summaryrefslogtreecommitdiffstats
path: root/krecipes/src/widgets/kreruler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'krecipes/src/widgets/kreruler.cpp')
-rw-r--r--krecipes/src/widgets/kreruler.cpp236
1 files changed, 118 insertions, 118 deletions
diff --git a/krecipes/src/widgets/kreruler.cpp b/krecipes/src/widgets/kreruler.cpp
index 69c63a6..3ac9a19 100644
--- a/krecipes/src/widgets/kreruler.cpp
+++ b/krecipes/src/widgets/kreruler.cpp
@@ -28,10 +28,10 @@
#include <kglobalsettings.h>
#include <kdebug.h>
#include <kiconloader.h>
-#include <qcursor.h>
-#include <qpainter.h>
-#include <qpopupmenu.h>
-#include <qtooltip.h>
+#include <ntqcursor.h>
+#include <ntqpainter.h>
+#include <ntqpopupmenu.h>
+#include <ntqtooltip.h>
#include "krepagelayout.h"
@@ -41,12 +41,12 @@ public:
}
~KoRulerPrivate() {}
- QWidget *canvas;
+ TQWidget *canvas;
int flags;
int oldMx, oldMy;
bool whileMovingBorderLeft, whileMovingBorderRight;
bool whileMovingBorderTop, whileMovingBorderBottom;
- QPixmap pmFirst, pmLeft;
+ TQPixmap pmFirst, pmLeft;
KoPageLayout layout;
KoTabulatorList tabList;
// Do we have to remove a certain tab in the DC Event?
@@ -55,7 +55,7 @@ public:
KoTabulator currTab;
// The action we're currently doing - basically only valid between press and release time
KoRuler::Action action;
- QPopupMenu *rb_menu;
+ TQPopupMenu *rb_menu;
int mRemoveTab, mPageLayout; // menu item ids
int frameEnd;
double i_right;
@@ -81,9 +81,9 @@ const int KoRuler::F_HELPLINES = 4;
const int KoRuler::F_NORESIZE = 8;
/*================================================================*/
-KoRuler::KoRuler( QWidget *_parent, QWidget *_canvas, Orientation _orientation,
+KoRuler::KoRuler( TQWidget *_parent, TQWidget *_canvas, Orientation _orientation,
const KoPageLayout& _layout, int _flags, KoUnit::Unit _unit )
- : QFrame( _parent ), buffer( width(), height() ), m_zoom(1.0), m_1_zoom(1.0),
+ : TQFrame( _parent ), buffer( width(), height() ), m_zoom(1.0), m_1_zoom(1.0),
m_unit( _unit )
{
setWFlags( WResizeNoErase | WRepaintNoErase );
@@ -124,12 +124,12 @@ KoRuler::KoRuler( QWidget *_parent, QWidget *_canvas, Orientation _orientation,
d->currTab.type = T_INVALID;
d->removeTab.type = T_INVALID;
- if ( orientation == Qt::Horizontal ) {
- frameStart = qRound( zoomIt(d->layout.ptLeft) );
- d->frameEnd = qRound( zoomIt(d->layout.ptWidth - d->layout.ptRight) );
+ if ( orientation == TQt::Horizontal ) {
+ frameStart = tqRound( zoomIt(d->layout.ptLeft) );
+ d->frameEnd = tqRound( zoomIt(d->layout.ptWidth - d->layout.ptRight) );
} else {
- frameStart = qRound( zoomIt(d->layout.ptTop) );
- d->frameEnd = qRound( zoomIt(d->layout.ptHeight - d->layout.ptBottom) );
+ frameStart = tqRound( zoomIt(d->layout.ptTop) );
+ d->frameEnd = tqRound( zoomIt(d->layout.ptHeight - d->layout.ptBottom) );
}
m_bFrameStartSet = false;
@@ -156,10 +156,10 @@ void KoRuler::setMousePos( int mx, int my )
{
if ( !showMPos || ( mx == mposX && my == mposY ) ) return;
- QPainter p( this );
- p.setRasterOp( Qt::NotROP );
+ TQPainter p( this );
+ p.setRasterOp( TQt::NotROP );
- if ( orientation == Qt::Horizontal ) {
+ if ( orientation == TQt::Horizontal ) {
if ( hasToDelete )
p.drawLine( mposX, 1, mposX, height() - 1 );
p.drawLine( mx, 1, mx, height() - 1 );
@@ -201,23 +201,23 @@ double KoRuler::lineDistance() const
}
/*================================================================*/
-void KoRuler::drawHorizontal( QPainter *_painter )
+void KoRuler::drawHorizontal( TQPainter *_painter )
{
- QFont font = KGlobalSettings::toolBarFont();
- QFontMetrics fm( font );
- resize( width(), QMAX( fm.height() + 4, 20 ) );
+ TQFont font = KGlobalSettings::toolBarFont();
+ TQFontMetrics fm( font );
+ resize( width(), TQMAX( fm.height() + 4, 20 ) );
// Use a double-buffer pixmap
- QPainter p( &buffer );
- p.fillRect( 0, 0, width(), height(), QBrush( colorGroup().brush( QColorGroup::Background ) ) );
+ TQPainter p( &buffer );
+ p.fillRect( 0, 0, width(), height(), TQBrush( colorGroup().brush( TQColorGroup::Background ) ) );
- int totalw = qRound( zoomIt(d->layout.ptWidth) );
- QString str;
+ int totalw = tqRound( zoomIt(d->layout.ptWidth) );
+ TQString str;
- p.setBrush( colorGroup().brush( QColorGroup::Base ) );
+ p.setBrush( colorGroup().brush( TQColorGroup::Base ) );
// Draw white rect
- QRect r;
+ TQRect r;
if ( !d->whileMovingBorderLeft )
r.setLeft( -diffx + frameStart );
else
@@ -237,9 +237,9 @@ void KoRuler::drawHorizontal( QPainter *_painter )
int maxwidth = 0;
for ( double i = 0.0;i <= (double)totalw;i += dist ) {
- str = QString::number( KoUnit::toUserValue( i / m_zoom, m_unit ) );
+ str = TQString::number( KoUnit::toUserValue( i / m_zoom, m_unit ) );
int textwidth = fm.width( str );
- maxwidth = QMAX( maxwidth, textwidth );
+ maxwidth = TQMAX( maxwidth, textwidth );
}
// Make sure that the ruler stays readable at lower zoom levels
@@ -248,11 +248,11 @@ void KoRuler::drawHorizontal( QPainter *_painter )
}
for ( double i = 0.0;i <= (double)totalw;i += dist ) {
- str = QString::number( KoUnit::toUserValue( i / m_zoom, m_unit ) );
+ str = TQString::number( KoUnit::toUserValue( i / m_zoom, m_unit ) );
int textwidth = fm.width( str );
- maxwidth = QMAX( maxwidth, textwidth );
- p.drawText( qRound(i) - diffx - qRound(textwidth * 0.5),
- qRound(( height() - fm.height() ) * 0.5),
+ maxwidth = TQMAX( maxwidth, textwidth );
+ p.drawText( tqRound(i) - diffx - tqRound(textwidth * 0.5),
+ tqRound(( height() - fm.height() ) * 0.5),
textwidth, height(), AlignLeft | AlignTop, str );
}
@@ -261,7 +261,7 @@ void KoRuler::drawHorizontal( QPainter *_painter )
if ( dist > maxwidth + 2 )
{
for ( double i = dist * 0.5;i <= (double)totalw;i += dist ) {
- int ii=qRound(i);
+ int ii=tqRound(i);
p.drawLine( ii - diffx, 7, ii - diffx, height() - 7 );
}
}
@@ -271,7 +271,7 @@ void KoRuler::drawHorizontal( QPainter *_painter )
if ( dist * 0.5 > maxwidth + 2 )
{
for ( double i = dist * 0.25;i <= (double)totalw;i += dist * 0.5 ) {
- int ii=qRound(i);
+ int ii=tqRound(i);
p.drawLine( ii - diffx, 9, ii - diffx, height() - 9 );
}
}
@@ -279,18 +279,18 @@ void KoRuler::drawHorizontal( QPainter *_painter )
// Draw ending bar (at page width)
//int constant=zoomIt(1);
//p.drawLine( totalw - diffx + constant, 1, totalw - diffx + constant, height() - 1 );
- //p.setPen( colorGroup().color( QColorGroup::Base ) );
+ //p.setPen( colorGroup().color( TQColorGroup::Base ) );
//p.drawLine( totalw - diffx, 1, totalw - diffx, height() - 1 );
// Draw starting bar (at 0)
- //p.setPen( colorGroup().color( QColorGroup::Text ) );
+ //p.setPen( colorGroup().color( TQColorGroup::Text ) );
//p.drawLine( -diffx, 1, -diffx, height() - 1 );
- //p.setPen( colorGroup().color( QColorGroup::Base ) );
+ //p.setPen( colorGroup().color( TQColorGroup::Base ) );
//p.drawLine( -diffx - constant, 1, -diffx - constant, height() - 1 );
// Show the mouse position
if ( d->action == A_NONE && showMPos ) {
- p.setPen( colorGroup().color( QColorGroup::Text ) );
+ p.setPen( colorGroup().color( TQColorGroup::Text ) );
p.drawLine( mposX, 1, mposX, height() - 1 );
}
hasToDelete = false;
@@ -301,28 +301,28 @@ void KoRuler::drawHorizontal( QPainter *_painter )
/*================================================================*/
-void KoRuler::drawVertical( QPainter *_painter )
+void KoRuler::drawVertical( TQPainter *_painter )
{
- QFont font = KGlobalSettings::toolBarFont();
- QFontMetrics fm( font );
- resize( QMAX( fm.height() + 4, 20 ), height() );
+ TQFont font = KGlobalSettings::toolBarFont();
+ TQFontMetrics fm( font );
+ resize( TQMAX( fm.height() + 4, 20 ), height() );
- QPainter p( &buffer );
- p.fillRect( 0, 0, width(), height(), QBrush( colorGroup().brush( QColorGroup::Background ) ) );
+ TQPainter p( &buffer );
+ p.fillRect( 0, 0, width(), height(), TQBrush( colorGroup().brush( TQColorGroup::Background ) ) );
- int totalh = qRound( zoomIt(d->layout.ptHeight) );
+ int totalh = tqRound( zoomIt(d->layout.ptHeight) );
// Clip rect - this gives basically always a rect like (2,2,width-2,height-2)
- QRect paintRect = _painter->clipRegion( QPainter::CoordPainter ).boundingRect();
+ TQRect paintRect = _painter->clipRegion( TQPainter::CoordPainter ).boundingRect();
// Ruler rect
- QRect rulerRect( 0, -diffy, width(), totalh );
+ TQRect rulerRect( 0, -diffy, width(), totalh );
if ( paintRect.intersects( rulerRect ) ) {
- QString str;
+ TQString str;
- p.setBrush( colorGroup().brush( QColorGroup::Base ) );
+ p.setBrush( colorGroup().brush( TQColorGroup::Base ) );
// Draw white rect
- QRect r;
+ TQRect r;
if ( !d->whileMovingBorderTop )
r.setTop( -diffy + frameStart );
else
@@ -342,9 +342,9 @@ void KoRuler::drawVertical( QPainter *_painter )
int maxheight = 0;
for ( double i = 0.0;i <= (double)totalh;i += dist ) {
- str = QString::number( KoUnit::toUserValue( i / m_zoom, m_unit ) );
+ str = TQString::number( KoUnit::toUserValue( i / m_zoom, m_unit ) );
int textwidth = fm.width( str );
- maxheight = QMAX( maxheight, textwidth );
+ maxheight = TQMAX( maxheight, textwidth );
}
// Make sure that the ruler stays readable at lower zoom levels
@@ -353,13 +353,13 @@ void KoRuler::drawVertical( QPainter *_painter )
}
for ( double i = 0.0;i <= (double)totalh;i += dist ) {
- str = QString::number( KoUnit::toUserValue( i / m_zoom, m_unit ) );
+ str = TQString::number( KoUnit::toUserValue( i / m_zoom, m_unit ) );
int textheight = fm.height();
int textwidth = fm.width( str );
- maxheight = QMAX( maxheight, textwidth );
+ maxheight = TQMAX( maxheight, textwidth );
p.save();
- p.translate( qRound(( width() - textheight ) * 0.5),
- qRound(i) - diffy + qRound(textwidth * 0.5) );
+ p.translate( tqRound(( width() - textheight ) * 0.5),
+ tqRound(i) - diffy + tqRound(textwidth * 0.5) );
p.rotate( -90 );
p.drawText( 0, 0, textwidth + 1, textheight, AlignLeft | AlignTop, str );
p.restore();
@@ -369,7 +369,7 @@ void KoRuler::drawVertical( QPainter *_painter )
if ( dist > maxheight + 2 )
{
for ( double i = dist * 0.5;i <= (double)totalh;i += dist ) {
- int ii=qRound(i);
+ int ii=tqRound(i);
p.drawLine( 7, ii - diffy, width() - 7, ii - diffy );
}
}
@@ -378,26 +378,26 @@ void KoRuler::drawVertical( QPainter *_painter )
if ( dist * 0.5 > maxheight + 2 )
{
for ( double i = dist * 0.25;i <=(double)totalh;i += dist *0.5 ) {
- int ii=qRound(i);
+ int ii=tqRound(i);
p.drawLine( 9, ii - diffy, width() - 9, ii - diffy );
}
}
// Draw ending bar (at page height)
//p.drawLine( 1, totalh - diffy + 1, width() - 1, totalh - diffy + 1 );
- //p.setPen( colorGroup().color( QColorGroup::Base ) );
+ //p.setPen( colorGroup().color( TQColorGroup::Base ) );
//p.drawLine( 1, totalh - diffy, width() - 1, totalh - diffy );
// Draw starting bar (at 0)
- //p.setPen( colorGroup().color( QColorGroup::Text ) );
+ //p.setPen( colorGroup().color( TQColorGroup::Text ) );
//p.drawLine( 1, -diffy, width() - 1, -diffy );
- //p.setPen( colorGroup().color( QColorGroup::Base ) );
+ //p.setPen( colorGroup().color( TQColorGroup::Base ) );
//p.drawLine( 1, -diffy - 1, width() - 1, -diffy - 1 );
}
// Show the mouse position
if ( d->action == A_NONE && showMPos ) {
- p.setPen( colorGroup().color( QColorGroup::Text ) );
+ p.setPen( colorGroup().color( TQColorGroup::Text ) );
p.drawLine( 1, mposY, width() - 1, mposY );
}
hasToDelete = false;
@@ -406,7 +406,7 @@ void KoRuler::drawVertical( QPainter *_painter )
_painter->drawPixmap( 0, 0, buffer );
}
-void KoRuler::mousePressEvent( QMouseEvent *e )
+void KoRuler::mousePressEvent( TQMouseEvent *e )
{
if( !d->m_bReadWrite)
return;
@@ -422,7 +422,7 @@ void KoRuler::mousePressEvent( QMouseEvent *e )
d->rb_menu->setItemEnabled(d->mRemoveTab, false);
else
d->rb_menu->setItemEnabled(d->mRemoveTab, true);
- d->rb_menu->popup( QCursor::pos() );
+ d->rb_menu->popup( TQCursor::pos() );
d->action = A_NONE;
d->mousePressed = false;
return;
@@ -447,8 +447,8 @@ void KoRuler::mousePressEvent( QMouseEvent *e )
d->whileMovingBorderBottom = true;
if ( d->canvas ) {
- QPainter p( d->canvas );
- p.setRasterOp( Qt::NotROP );
+ TQPainter p( d->canvas );
+ p.setRasterOp( TQt::NotROP );
p.drawLine( 0, d->oldMy, d->canvas->width(), d->oldMy );
p.end();
}
@@ -458,13 +458,13 @@ void KoRuler::mousePressEvent( QMouseEvent *e )
drawLine(d->oldMx, -1);
} else if ( d->action == A_TAB ) {
if ( d->canvas && d->currTab.type != T_INVALID ) {
- drawLine( qRound( applyRtlAndZoom(d->currTab.ptPos) ) + frameStart - diffx, -1 );
+ drawLine( tqRound( applyRtlAndZoom(d->currTab.ptPos) ) + frameStart - diffx, -1 );
}
}
else if ( d->flags & F_HELPLINES )
{
- setCursor( orientation == Qt::Horizontal ?
- Qt::sizeVerCursor : Qt::sizeHorCursor );
+ setCursor( orientation == TQt::Horizontal ?
+ TQt::sizeVerCursor : TQt::sizeHorCursor );
d->action = A_HELPLINES;
}
default:
@@ -472,7 +472,7 @@ void KoRuler::mousePressEvent( QMouseEvent *e )
}
}
-void KoRuler::mouseReleaseEvent( QMouseEvent *e )
+void KoRuler::mouseReleaseEvent( TQMouseEvent *e )
{
d->mousePressed = false;
@@ -496,8 +496,8 @@ void KoRuler::mouseReleaseEvent( QMouseEvent *e )
d->whileMovingBorderBottom = false;
if ( d->canvas ) {
- QPainter p( d->canvas );
- p.setRasterOp( Qt::NotROP );
+ TQPainter p( d->canvas );
+ p.setRasterOp( TQt::NotROP );
p.drawLine( 0, d->oldMy, d->canvas->width(), d->oldMy );
p.end();
}
@@ -520,7 +520,7 @@ void KoRuler::mouseReleaseEvent( QMouseEvent *e )
emit newRightIndent( d->i_right );
} else if ( d->action == A_TAB ) {
if ( d->canvas && !fakeMovement ) {
- drawLine( qRound( applyRtlAndZoom( d->currTab.ptPos ) ) + frameStart - diffx, -1);
+ drawLine( tqRound( applyRtlAndZoom( d->currTab.ptPos ) ) + frameStart - diffx, -1);
}
if ( willRemoveTab( e->y() ) )
{
@@ -547,37 +547,37 @@ void KoRuler::mouseReleaseEvent( QMouseEvent *e )
}
else if( d->action == A_HELPLINES )
{
- emit addHelpline( e->pos(), orientation == Qt::Horizontal);
+ emit addHelpline( e->pos(), orientation == TQt::Horizontal);
setCursor( ArrowCursor );
}
d->currTab.type = T_INVALID; // added (DF)
}
-void KoRuler::mouseMoveEvent( QMouseEvent *e )
+void KoRuler::mouseMoveEvent( TQMouseEvent *e )
{
hasToDelete = false;
int pw = d->frameEnd - frameStart;
- int ph = qRound(zoomIt(d->layout.ptHeight));
+ int ph = tqRound(zoomIt(d->layout.ptHeight));
int left = frameStart - diffx;
- int top = qRound(zoomIt(d->layout.ptTop));
+ int top = tqRound(zoomIt(d->layout.ptTop));
top -= diffy;
int right = d->frameEnd - diffx;
- int bottom = qRound(zoomIt(d->layout.ptBottom));
+ int bottom = tqRound(zoomIt(d->layout.ptBottom));
bottom = ph - bottom - diffy;
// Cumulate first-line-indent
- int ip_first = qRound( zoomIt( i_first + ( d->rtl ? d->i_right : i_left) ) );
- int ip_left = qRound(zoomIt(i_left));
- int ip_right = qRound(zoomIt(d->i_right));
+ int ip_first = tqRound( zoomIt( i_first + ( d->rtl ? d->i_right : i_left) ) );
+ int ip_left = tqRound(zoomIt(i_left));
+ int ip_right = tqRound(zoomIt(d->i_right));
int mx = e->x();
mx = mx+diffx < 0 ? 0 : mx;
int my = e->y();
my = my+diffy < 0 ? 0 : my;
- QToolTip::remove( this);
+ TQToolTip::remove( this);
switch ( orientation ) {
- case Qt::Horizontal: {
+ case TQt::Horizontal: {
if ( !d->mousePressed ) {
setCursor( ArrowCursor );
d->action = A_NONE;
@@ -595,10 +595,10 @@ void KoRuler::mouseMoveEvent( QMouseEvent *e )
if ( !m_bFrameStartSet )
{
if ( mx > left - 5 && mx < left + 5 ) {
- setCursor( Qt::sizeHorCursor );
+ setCursor( TQt::sizeHorCursor );
d->action = A_BR_LEFT;
} else if ( mx > right - 5 && mx < right + 5 ) {
- setCursor( Qt::sizeHorCursor );
+ setCursor( TQt::sizeHorCursor );
d->action = A_BR_RIGHT;
}
}
@@ -609,7 +609,7 @@ void KoRuler::mouseMoveEvent( QMouseEvent *e )
int newPos=mx;
if( newPos!=right && gridSize!=0.0 && (e->state() & ShiftButton)==0) { // apply grid.
double grid=zoomIt(gridSize * 16);
- newPos=qRound( ((newPos * 16 / grid) * grid) / 16 );
+ newPos=tqRound( ((newPos * 16 / grid) * grid) / 16 );
}
if(newPos-left < 0) newPos=left;
else if (right-newPos < 0) newPos=right;
@@ -702,8 +702,8 @@ void KoRuler::mouseMoveEvent( QMouseEvent *e )
if ( d->canvas) {
if (d->rtl) newValue = unZoomIt(pw) - newValue;
if(newValue == d->currTab.ptPos) break; // no change
- QPainter p( d->canvas );
- p.setRasterOp( Qt::NotROP );
+ TQPainter p( d->canvas );
+ p.setRasterOp( TQt::NotROP );
// prevent 1st drawLine when we just created a new tab
// (it's a NOT line)
double pt;
@@ -711,7 +711,7 @@ void KoRuler::mouseMoveEvent( QMouseEvent *e )
if( d->currTab != d->removeTab )
{
pt = applyRtlAndZoom(d->currTab.ptPos);
- pt_fr = qRound(pt) + frameStart - diffx;
+ pt_fr = tqRound(pt) + frameStart - diffx;
p.drawLine( pt_fr, 0, pt_fr, d->canvas->height() );
}
@@ -722,7 +722,7 @@ void KoRuler::mouseMoveEvent( QMouseEvent *e )
d->currTab.ptPos = newValue;
pt = applyRtlAndZoom( newValue );
- pt_fr = qRound(pt) + frameStart - diffx;
+ pt_fr = tqRound(pt) + frameStart - diffx;
p.drawLine( pt_fr, 0, pt_fr, d->canvas->height() );
p.end();
@@ -737,32 +737,32 @@ void KoRuler::mouseMoveEvent( QMouseEvent *e )
}
if( d->action == A_HELPLINES )
{
- emit moveHelpLines( e->pos(), orientation == Qt::Horizontal);
+ emit moveHelpLines( e->pos(), orientation == TQt::Horizontal);
}
return;
} break;
- case Qt::Vertical: {
+ case TQt::Vertical: {
if ( !d->mousePressed ) {
setCursor( ArrowCursor );
d->action = A_NONE;
if ( d->flags & F_NORESIZE )
break;
if ( my > top - 5 && my < top + 5 ) {
- QToolTip::add( this, i18n("Top margin") );
- setCursor( Qt::sizeVerCursor );
+ TQToolTip::add( this, i18n("Top margin") );
+ setCursor( TQt::sizeVerCursor );
d->action = A_BR_TOP;
} else if ( my > bottom - 5 && my < bottom + 5 ) {
- QToolTip::add( this, i18n("Bottom margin") );
- setCursor( Qt::sizeVerCursor );
+ TQToolTip::add( this, i18n("Bottom margin") );
+ setCursor( TQt::sizeVerCursor );
d->action = A_BR_BOTTOM;
}
} else {
switch ( d->action ) {
case A_BR_TOP: {
if ( d->canvas && my < bottom-20 && my+diffy-2 > 0) {
- QPainter p( d->canvas );
- p.setRasterOp( Qt::NotROP );
+ TQPainter p( d->canvas );
+ p.setRasterOp( TQt::NotROP );
p.drawLine( 0, d->oldMy, d->canvas->width(), d->oldMy );
p.drawLine( 0, my, d->canvas->width(), my );
p.end();
@@ -776,8 +776,8 @@ void KoRuler::mouseMoveEvent( QMouseEvent *e )
} break;
case A_BR_BOTTOM: {
if ( d->canvas && my > top+20 && my+diffy < ph-2) {
- QPainter p( d->canvas );
- p.setRasterOp( Qt::NotROP );
+ TQPainter p( d->canvas );
+ p.setRasterOp( TQt::NotROP );
p.drawLine( 0, d->oldMy, d->canvas->width(), d->oldMy );
p.drawLine( 0, my, d->canvas->width(), my );
p.end();
@@ -796,20 +796,20 @@ void KoRuler::mouseMoveEvent( QMouseEvent *e )
}
if( d->action == A_HELPLINES )
{
- emit moveHelpLines( e->pos(), orientation == Qt::Horizontal);
+ emit moveHelpLines( e->pos(), orientation == TQt::Horizontal);
}
d->oldMx = mx;
d->oldMy = my;
}
-void KoRuler::resizeEvent( QResizeEvent *e )
+void KoRuler::resizeEvent( TQResizeEvent *e )
{
- QFrame::resizeEvent( e );
+ TQFrame::resizeEvent( e );
buffer.resize( size() );
}
-void KoRuler::mouseDoubleClickEvent( QMouseEvent* )
+void KoRuler::mouseDoubleClickEvent( TQMouseEvent* )
{
handleDoubleClick();
}
@@ -855,8 +855,8 @@ double KoRuler::makeIntern( double _v )
void KoRuler::setupMenu()
{
- d->rb_menu = new QPopupMenu();
- Q_CHECK_PTR( d->rb_menu );
+ d->rb_menu = new TQPopupMenu();
+ TQ_CHECK_PTR( d->rb_menu );
for ( uint i = 0 ; i <= KoUnit::U_LASTUNIT ; ++i )
{
KoUnit::Unit unit = static_cast<KoUnit::Unit>( i );
@@ -924,9 +924,9 @@ void KoRuler::searchTab(int mx) {
d->currTab.type = T_INVALID;
KoTabulatorList::ConstIterator it = d->tabList.begin();
for ( ; it != d->tabList.end() ; ++it ) {
- pos = qRound(applyRtlAndZoom((*it).ptPos)) - diffx + frameStart;
+ pos = tqRound(applyRtlAndZoom((*it).ptPos)) - diffx + frameStart;
if ( mx > pos - 5 && mx < pos + 5 ) {
- setCursor( Qt::sizeHorCursor );
+ setCursor( TQt::sizeHorCursor );
d->action = A_TAB;
d->currTab = *it;
break;
@@ -936,8 +936,8 @@ void KoRuler::searchTab(int mx) {
void KoRuler::drawLine(int oldX, int newX) {
- QPainter p( d->canvas );
- p.setRasterOp( Qt::NotROP );
+ TQPainter p( d->canvas );
+ p.setRasterOp( TQt::NotROP );
p.drawLine( oldX, 0, oldX, d->canvas->height() );
if(newX!=-1)
p.drawLine( newX, 0, newX, d->canvas->height() );
@@ -1023,19 +1023,19 @@ void KoRuler::slotMenuActivated( int i )
}
}
-QSize KoRuler::minimumSizeHint() const
+TQSize KoRuler::minimumSizeHint() const
{
- QSize size;
- QFont font = KGlobalSettings::toolBarFont();
- QFontMetrics fm( font );
+ TQSize size;
+ TQFont font = KGlobalSettings::toolBarFont();
+ TQFontMetrics fm( font );
- size.setWidth( QMAX( fm.height() + 4, 20 ) );
- size.setHeight( QMAX( fm.height() + 4, 20 ) );
+ size.setWidth( TQMAX( fm.height() + 4, 20 ) );
+ size.setHeight( TQMAX( fm.height() + 4, 20 ) );
return size;
}
-QSize KoRuler::sizeHint() const
+TQSize KoRuler::sizeHint() const
{
return minimumSizeHint();
}