summaryrefslogtreecommitdiffstats
path: root/kspread/kspread_canvas.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kspread/kspread_canvas.cc')
-rw-r--r--kspread/kspread_canvas.cc130
1 files changed, 65 insertions, 65 deletions
diff --git a/kspread/kspread_canvas.cc b/kspread/kspread_canvas.cc
index 3f482e273..08ab33e07 100644
--- a/kspread/kspread_canvas.cc
+++ b/kspread/kspread_canvas.cc
@@ -47,7 +47,7 @@
#include <tqapplication.h>
#include <tqbuffer.h>
-#include <tqclipboard.h>
+#include <clipboard.h>
#include <tqdrawutil.h>
#include <tqlabel.h>
#include <tqpoint.h>
@@ -547,7 +547,7 @@ void Canvas::validateSelection()
ypos = sheet->dblRowPos( moveY );
}
//d->validationInfo->setGeometry( 3, y + 3, len + 2, hei + 2 );
- d->validationInfo->tqsetAlignment( TQt::AlignVCenter );
+ d->validationInfo->setAlignment( TQt::AlignVCenter );
TQPainter painter;
painter.begin( this );
int len = 0;
@@ -1011,7 +1011,7 @@ void Canvas::mouseMoveEvent( TQMouseEvent * _ev )
(int) _ev->y() );
if ( ( obj = getObject( p, activeSheet() ) ) && obj->isSelected() )
{
- KoRect const bound = obj->tqgeometry();
+ KoRect const bound = obj->geometry();
TQRect zoomedBound = doc()->zoomRect( KoRect(bound.left(), bound.top(),
bound.width(),
bound.height() ) );
@@ -1056,7 +1056,7 @@ void Canvas::mouseMoveEvent( TQMouseEvent * _ev )
}
//Check to see if the mouse is over a highlight range size grip and if it is, change the cursor
- //tqshape to a resize arrow
+ //shape to a resize arrow
if (highlightRangeSizeGripAt(ev_PosX,ev_PosY))
{
if ( sheet->layoutDirection()==Sheet::RightToLeft )
@@ -1177,7 +1177,7 @@ void Canvas::mouseReleaseEvent( TQMouseEvent* /*_ev*/)
doc()->addCommand( cmd );
} else
{
- tqrepaint();
+ repaint();
}
d->m_isMoving = false;
break;
@@ -1253,13 +1253,13 @@ void Canvas::processLeftClickAnchor()
if ( KRun::isExecutableFile( d->anchor , type ) )
{
- //TQString question = i18n("Do you want to open this link to '%1'?\n").tqarg(d->anchor);
+ //TQString question = i18n("Do you want to open this link to '%1'?\n").arg(d->anchor);
//question += i18n("Note that opening a link to a local file may "
// "compromise your system's security.");
TQString question = i18n("This link points to the program or script '%1'.\n"
- "Malicious programs can harm your computer. Are you sure that you want to run this program?").tqarg(d->anchor);
+ "Malicious programs can harm your computer. Are you sure that you want to run this program?").arg(d->anchor);
// this will also start local programs, so adding a "don't warn again"
// checkbox will probably be too dangerous
int choice = KMessageBox::warningYesNo(this, question, i18n("Open Link?"));
@@ -1352,9 +1352,9 @@ void Canvas::mousePressEvent( TQMouseEvent * _ev )
d->m_resizeObject = obj;
- d->m_ratio = static_cast<double>( obj->tqgeometry().width() ) /
- static_cast<double>( obj->tqgeometry().height() );
- d->m_rectBeforeResize = obj->tqgeometry();
+ d->m_ratio = static_cast<double>( obj->geometry().width() ) /
+ static_cast<double>( obj->geometry().height() );
+ d->m_rectBeforeResize = obj->geometry();
}
KoPoint docPoint ( doc()->unzoomPoint( _ev->pos() ) );
@@ -1816,7 +1816,7 @@ void Canvas::dropEvent( TQDropEvent * _ev )
}
- b = _ev->tqencodedData( TextDrag::selectionMimeType() );
+ b = _ev->encodedData( TextDrag::selectionMimeType() );
sheet->paste( b, TQRect( col, row, 1, 1 ), makeUndo );
if ( _ev->source() == this )
@@ -2150,13 +2150,13 @@ void Canvas::processEscapeKey(TQKeyEvent * event)
case MT_RESIZE_RU:
case MT_RESIZE_RD:
{
- TQRect oldBoundingRect = doc()->zoomRect( d->m_resizeObject->tqgeometry()/*getRepaintRect()*/);
+ TQRect oldBoundingRect = doc()->zoomRect( d->m_resizeObject->geometry()/*getRepaintRect()*/);
d->m_resizeObject->setGeometry( d->m_rectBeforeResize );
oldBoundingRect.moveBy( (int)( -xOffset()*doc()->zoomedResolutionX() ) ,
(int)( -yOffset() * doc()->zoomedResolutionY()) );
activeSheet()->setRegionPaintDirty( oldBoundingRect );
- tqrepaint( oldBoundingRect );
+ repaint( oldBoundingRect );
repaintObject( d->m_resizeObject );
d->m_ratio = 0.0;
d->m_resizeObject = 0;
@@ -3290,7 +3290,7 @@ KSpread::EmbeddedObject *Canvas::getObject( const TQPoint &pos, Sheet *_sheet )
{
if ( itObject.current()->sheet() == _sheet )
{
- KoRect const bound = ( itObject.current() )->tqgeometry();
+ KoRect const bound = ( itObject.current() )->geometry();
TQRect zoomedBound = doc()->zoomRect( KoRect(bound.left(), bound.top(),
bound.width(),
bound.height() ) );
@@ -3429,7 +3429,7 @@ void Canvas::resizeObject( ModifyType _modType, const KoPoint & point, bool keep
{
EmbeddedObject *obj = d->m_resizeObject;
- KoRect objRect = obj->tqgeometry();
+ KoRect objRect = obj->geometry();
objRect.moveBy( -xOffset(), -yOffset() );
TQRect oldBoundingRect( doc()->zoomRect( objRect ) );
@@ -3440,22 +3440,22 @@ void Canvas::resizeObject( ModifyType _modType, const KoPoint & point, bool keep
if ( _modType == MT_RESIZE_UP || _modType == MT_RESIZE_LU || _modType == MT_RESIZE_RU )
{
top = true;
-// snaptqStatus |= KoGuides::SNAP_HORIZ;
+// snapStatus |= KoGuides::SNAP_HORIZ;
}
if ( _modType == MT_RESIZE_DN || _modType == MT_RESIZE_LD || _modType == MT_RESIZE_RD )
{
bottom = true;
-// snaptqStatus |= KoGuides::SNAP_HORIZ;
+// snapStatus |= KoGuides::SNAP_HORIZ;
}
if ( _modType == MT_RESIZE_LF || _modType == MT_RESIZE_LU || _modType == MT_RESIZE_LD )
{
left = true;
-// snaptqStatus |= KoGuides::SNAP_VERT;
+// snapStatus |= KoGuides::SNAP_VERT;
}
if ( _modType == MT_RESIZE_RT || _modType == MT_RESIZE_RU || _modType == MT_RESIZE_RD )
{
right = true;
-// snaptqStatus |= KoGuides::SNAP_VERT;
+// snapStatus |= KoGuides::SNAP_VERT;
}
double newLeft = objRect.left();
@@ -3572,34 +3572,34 @@ void Canvas::resizeObject( ModifyType _modType, const KoPoint & point, bool keep
// {
// sp.setY( rect.bottom() );
// }
-// m_gl.repaintSnapping( sp, snaptqStatus );
+// m_gl.repaintSnapping( sp, snapStatus );
// }
- tqrepaint( oldBoundingRect );
+ repaint( oldBoundingRect );
repaintObject( obj );
emit objectSizeChanged();
}
}
-void Canvas::finishResizeObject( const TQString &/*name*/, bool /*tqlayout*/ )
+void Canvas::finishResizeObject( const TQString &/*name*/, bool /*layout*/ )
{
if ( d->m_resizeObject )
{
- KoPoint move = KoPoint( d->m_resizeObject->tqgeometry().x() - d->m_rectBeforeResize.x(),
- d->m_resizeObject->tqgeometry().y() - d->m_rectBeforeResize.y() );
- KoSize size = KoSize( d->m_resizeObject->tqgeometry().width() - d->m_rectBeforeResize.width(),
- d->m_resizeObject->tqgeometry().height() - d->m_rectBeforeResize.height() );
+ KoPoint move = KoPoint( d->m_resizeObject->geometry().x() - d->m_rectBeforeResize.x(),
+ d->m_resizeObject->geometry().y() - d->m_rectBeforeResize.y() );
+ KoSize size = KoSize( d->m_resizeObject->geometry().width() - d->m_rectBeforeResize.width(),
+ d->m_resizeObject->geometry().height() - d->m_rectBeforeResize.height() );
- if ( ( d->m_resizeObject->tqgeometry() ) != d->m_rectBeforeResize )
+ if ( ( d->m_resizeObject->geometry() ) != d->m_rectBeforeResize )
{
ChangeObjectGeometryCommand *resizeCmd = new ChangeObjectGeometryCommand( d->m_resizeObject, move, size );
// the command is not executed as the object is allready resized.
doc()->addCommand( resizeCmd );
}
-// if ( tqlayout )
-// doc()->tqlayout( m_resizeObject );
+// if ( layout )
+// doc()->layout( m_resizeObject );
d->m_ratio = 0.0;
d->m_isResizing = false;
@@ -3669,7 +3669,7 @@ void Canvas::deleteEditor (bool saveChanges, bool array)
TQString t = d->cellEditor->text();
// Delete the cell editor first and after that update the document.
- // That means we get a synchronous tqrepaint after the cell editor
+ // That means we get a synchronous repaint after the cell editor
// widget is gone. Otherwise we may get painting errors.
delete d->cellEditor;
d->cellEditor = 0;
@@ -3775,7 +3775,7 @@ bool Canvas::createEditor( EditorType ed, bool addFocus, bool captureArrowKeys )
TQColor color = cell->format()->textColor( markerColumn(), markerRow() );
if ( !color.isValid() )
- color = TQApplication::tqpalette().active().text();
+ color = TQApplication::palette().active().text();
g.setColor( TQColorGroup::Text, color);
color = cell->bgColor( markerColumn(), markerRow() );
@@ -3819,8 +3819,8 @@ bool Canvas::createEditor( EditorType ed, bool addFocus, bool captureArrowKeys )
void Canvas::repaintObject( EmbeddedObject *obj )
{
- //Calculate where the object appears on the canvas widget and then tqrepaint that part of the widget
- TQRect canvasRelativeGeometry = doc()->zoomRect( obj->tqgeometry() );
+ //Calculate where the object appears on the canvas widget and then repaint that part of the widget
+ TQRect canvasRelativeGeometry = doc()->zoomRect( obj->geometry() );
canvasRelativeGeometry.moveBy( (int)( -xOffset()*doc()->zoomedResolutionX() ) ,
(int)( -yOffset() * doc()->zoomedResolutionY()) );
@@ -3828,17 +3828,17 @@ void Canvas::repaintObject( EmbeddedObject *obj )
/* if ( !obj->isSelected() )
{
- KoRect g = obj->tqgeometry();
+ KoRect g = obj->geometry();
g.moveBy( -xOffset(), -yOffset() );
- TQRect tqgeometry( doc()->zoomRect( g ) );
+ TQRect geometry( doc()->zoomRect( g ) );
- update( tqgeometry );
+ update( geometry );
}
else
{
TQPainter p(this);
p.translate( -xOffset() * doc()->zoomedResolutionX() , -yOffset() * doc()->zoomedResolutionY() );
- obj->draw(&p); //this goes faster than calling tqrepaint
+ obj->draw(&p); //this goes faster than calling repaint
p.end();
}*/
}
@@ -3888,7 +3888,7 @@ void Canvas::copyOasisObjects()
for( ; itObject.current(); ++itObject )
{
if ( itObject.current()->isSelected() )
- p.drawPixmap( itObject.current()->tqgeometry().toTQRect().left() - r.left(), itObject.current()->tqgeometry().toTQRect().top() - r.top(), itObject.current()->toPixmap( 1.0 , 1.0 ) );
+ p.drawPixmap( itObject.current()->geometry().toTQRect().left() - r.left(), itObject.current()->geometry().toTQRect().top() - r.top(), itObject.current()->toPixmap( 1.0 , 1.0 ) );
}
p.end();
if (!pixmap.isNull())
@@ -3899,7 +3899,7 @@ void Canvas::copyOasisObjects()
}
TQDragObject *dragObject = multiDrag;
- TQApplication::tqclipboard()->setData( dragObject, TQClipboard::Clipboard );
+ TQApplication::clipboard()->setData( dragObject, TQClipboard::Clipboard );
}
void Canvas::closeEditor()
@@ -4064,7 +4064,7 @@ void Canvas::paintUpdates()
}
else
{
- matrix = painter.tqworldMatrix();
+ matrix = painter.worldMatrix();
}
@@ -4109,7 +4109,7 @@ void Canvas::paintUpdates()
{
cell = sheet->cellAt( x, y );
- // recalc and retqlayout only for non default cells
+ // recalc and relayout only for non default cells
if (!cell->isDefault())
{
if (cell->calcDirtyFlag()) cell->calc();
@@ -4202,7 +4202,7 @@ void Canvas::paintUpdates()
paintHighlightedRanges(painter, unzoomedRect);
paintNormalMarker(painter, unzoomedRect);
- //restore clip region with tqchildren area
+ //restore clip region with children area
painter.restore();
//painter.setClipRegion( rgnComplete );
}
@@ -4223,7 +4223,7 @@ void Canvas::clipoutChildren( TQPainter& painter ) const
{
if ( ( itObject.current() )->sheet() == activeSheet() )
{
- TQRect childGeometry = doc()->zoomRect( itObject.current()->tqgeometry());
+ TQRect childGeometry = doc()->zoomRect( itObject.current()->geometry());
//The clipping region is given in device coordinates
//so subtract the current offset (scroll position) of the canvas
@@ -4232,7 +4232,7 @@ void Canvas::clipoutChildren( TQPainter& painter ) const
if (painter.window().intersects(childGeometry))
rgn -= childGeometry;
- //painter.fillRect( doc()->zoomRect( itObject.current()->tqgeometry() ), TQColor("red" ) );
+ //painter.fillRect( doc()->zoomRect( itObject.current()->geometry() ), TQColor("red" ) );
}
}
@@ -4263,11 +4263,11 @@ void Canvas::paintChildren( TQPainter& painter, TQWMatrix& /*matrix*/ )
for( ; itObject.current(); ++itObject )
{
- TQRect const zoomedObjectGeometry = doc()->zoomRect( itObject.current()->tqgeometry() );
+ TQRect const zoomedObjectGeometry = doc()->zoomRect( itObject.current()->geometry() );
if ( ( itObject.current() )->sheet() == activeSheet() &&
zoomedWindowGeometry.intersects( zoomedObjectGeometry ) )
{
- //To prevent unnecessary redrawing of the embedded object, we only tqrepaint
+ //To prevent unnecessary redrawing of the embedded object, we only repaint
//if one or more of the cells underneath the object has been marked as 'dirty'.
TQRect canvasRelativeGeometry = zoomedObjectGeometry;
@@ -4656,7 +4656,7 @@ VBorder::~VBorder()
delete m_scrollTimer;
}
-TQSize VBorder::tqsizeHint() const
+TQSize VBorder::sizeHint() const
{
return TQSize( 40, 10 );
}
@@ -5036,9 +5036,9 @@ void VBorder::paintSizeIndicator( int mouseY, bool firstTime )
TQString tmpSize;
if ( m_iResizePos != y )
- tmpSize = i18n("Height: %1 %2").tqarg( KoUnit::toUserValue( m_pCanvas->doc()->unzoomItY( m_iResizePos - y ),
+ tmpSize = i18n("Height: %1 %2").arg( KoUnit::toUserValue( m_pCanvas->doc()->unzoomItY( m_iResizePos - y ),
m_pView->doc()->unit() ) )
- .tqarg( m_pView->doc()->unitName() );
+ .arg( m_pView->doc()->unitName() );
else
tmpSize = i18n( "Hide Row" );
@@ -5057,7 +5057,7 @@ void VBorder::paintSizeIndicator( int mouseY, bool firstTime )
else
m_lSize->setGeometry( 3, y + 3, len + 2,hei + 2 );
- m_lSize->tqsetAlignment( TQt::AlignVCenter );
+ m_lSize->setAlignment( TQt::AlignVCenter );
m_lSize->setText( tmpSize );
m_lSize->setPalette( TQToolTip::palette() );
m_lSize->show();
@@ -5095,7 +5095,7 @@ void VBorder::paintEvent( TQPaintEvent* _ev )
TQColor highlightColor = View::highlightColor();
TQPen pen( TQt::black, 1 );
painter.setPen( pen );
- // painter.setBackgroundColor( tqcolorGroup().base() );
+ // painter.setBackgroundColor( colorGroup().base() );
// painter.eraseRect( _ev->rect() );
@@ -5146,7 +5146,7 @@ void VBorder::paintEvent( TQPaintEvent* _ev )
}
else
{
- TQColor c = tqcolorGroup().background();
+ TQColor c = colorGroup().background();
TQBrush fill( c );
qDrawPlainRect ( &painter, 0, zoomedYPos, width, height+1, c.dark(150),
1, &fill );
@@ -5156,10 +5156,10 @@ void VBorder::paintEvent( TQPaintEvent* _ev )
// Reset painter
painter.setFont( normalFont );
- painter.setPen( tqcolorGroup().text() );
+ painter.setPen( colorGroup().text() );
if ( selected )
- painter.setPen( tqcolorGroup().highlightedText() );
+ painter.setPen( colorGroup().highlightedText() );
else if ( highlighted )
painter.setFont( boldFont );
@@ -5212,7 +5212,7 @@ HBorder::~HBorder()
delete m_scrollTimer;
}
-TQSize HBorder::tqsizeHint() const
+TQSize HBorder::sizeHint() const
{
return TQSize( 40, 10 );
}
@@ -5738,9 +5738,9 @@ void HBorder::paintSizeIndicator( int mouseX, bool firstTime )
TQString tmpSize;
if ( m_iResizePos != x )
tmpSize = i18n("Width: %1 %2")
- .tqarg( KGlobal::locale()->formatNumber( KoUnit::toUserValue( m_pCanvas->doc()->unzoomItX( (sheet->layoutDirection()==Sheet::RightToLeft) ? x - m_iResizePos : m_iResizePos - x ),
+ .arg( KGlobal::locale()->formatNumber( KoUnit::toUserValue( m_pCanvas->doc()->unzoomItX( (sheet->layoutDirection()==Sheet::RightToLeft) ? x - m_iResizePos : m_iResizePos - x ),
m_pView->doc()->unit() )))
- .tqarg( m_pView->doc()->unitName() );
+ .arg( m_pView->doc()->unitName() );
else
tmpSize = i18n( "Hide Column" );
@@ -5758,7 +5758,7 @@ void HBorder::paintSizeIndicator( int mouseX, bool firstTime )
else
m_lSize->setGeometry( x + 3, 3, len + 2, hei + 2 );
- m_lSize->tqsetAlignment( TQt::AlignVCenter );
+ m_lSize->setAlignment( TQt::AlignVCenter );
m_lSize->setText( tmpSize );
m_lSize->setPalette( TQToolTip::palette() );
m_lSize->show();
@@ -5866,7 +5866,7 @@ void HBorder::paintEvent( TQPaintEvent* _ev )
}
else
{
- TQColor c = tqcolorGroup().background();
+ TQColor c = colorGroup().background();
TQBrush fill( c );
qDrawPlainRect ( &painter, zoomedXPos, 0, width+1, height, c.dark(150),
1, &fill );
@@ -5874,10 +5874,10 @@ void HBorder::paintEvent( TQPaintEvent* _ev )
// Reset painter
painter.setFont( normalFont );
- painter.setPen( tqcolorGroup().text() );
+ painter.setPen( colorGroup().text() );
if ( selected )
- painter.setPen( tqcolorGroup().highlightedText() );
+ painter.setPen( colorGroup().highlightedText() );
else if ( highlighted )
painter.setFont( boldFont );
if ( !m_pView->activeSheet()->getShowColumnNumber() )
@@ -5929,7 +5929,7 @@ void HBorder::paintEvent( TQPaintEvent* _ev )
}
else
{
- TQColor c = tqcolorGroup().background();
+ TQColor c = colorGroup().background();
TQBrush fill( c );
qDrawPlainRect ( &painter, zoomedXPos, 0, width+1, height, c.dark(150),
1, &fill );
@@ -5937,10 +5937,10 @@ void HBorder::paintEvent( TQPaintEvent* _ev )
// Reset painter
painter.setFont( normalFont );
- painter.setPen( tqcolorGroup().text() );
+ painter.setPen( colorGroup().text() );
if ( selected )
- painter.setPen( tqcolorGroup().highlightedText() );
+ painter.setPen( colorGroup().highlightedText() );
else if ( highlighted )
painter.setFont( boldFont );
if ( !m_pView->activeSheet()->getShowColumnNumber() )
@@ -5991,7 +5991,7 @@ ToolTip::ToolTip( Canvas* canvas )
// this is a hack of course, because it's not available from TQToolTip
TQLabel *tip_findLabel()
{
- TQWidgetList *list = TQApplication::tqallWidgets();
+ TQWidgetList *list = TQApplication::allWidgets();
TQWidgetListIt it( *list );
TQWidget * w;
while ( (w=it.current()) != 0 )