diff options
Diffstat (limited to 'src/part/radialMap/segmentTip.cpp')
-rw-r--r-- | src/part/radialMap/segmentTip.cpp | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/src/part/radialMap/segmentTip.cpp b/src/part/radialMap/segmentTip.cpp index f73e845..e677197 100644 --- a/src/part/radialMap/segmentTip.cpp +++ b/src/part/radialMap/segmentTip.cpp @@ -10,8 +10,8 @@ #include <kglobalsettings.h> #include <klocale.h> #include <kpixmapeffect.h> -#include <qpainter.h> -#include <qtooltip.h> //for its palette +#include <tqpainter.h> +#include <tqtooltip.h> //for its palette @@ -29,20 +29,20 @@ bool isBackingStoreActive() buffer[ N ] = '\0'; pclose( xdpyinfo ); - return QString::fromLocal8Bit( buffer ).contains( "backing-store YES" ); + return TQString(TQString::fromLocal8Bit( buffer )).tqcontains( "backing-store YES" ); } SegmentTip::SegmentTip( uint h ) - : QWidget( 0, 0, WNoAutoErase | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM ) + : TQWidget( 0, 0, WNoAutoErase | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM ) , m_cursorHeight( -h ) , m_backing_store( isBackingStoreActive() ) { - setBackgroundMode( Qt::NoBackground ); + setBackgroundMode( TQt::NoBackground ); } void -SegmentTip::moveTo( QPoint p, const QWidget &canvas, bool placeAbove ) +SegmentTip::moveTo( TQPoint p, const TQWidget &canvas, bool placeAbove ) { //**** this function is very slow and seems to be visibly influenced by operations like mapFromGlobal() (who knows why!) // ** so any improvements are much desired @@ -51,7 +51,7 @@ SegmentTip::moveTo( QPoint p, const QWidget &canvas, bool placeAbove ) p.rx() -= rect().center().x(); p.ry() -= (placeAbove ? 8 + height() : m_cursorHeight - 8); - const QRect screen = KGlobalSettings::desktopGeometry( parentWidget() ); + const TQRect screen = KGlobalSettings::desktopGeometry( tqparentWidget() ); const int x = p.x(); const int y = p.y(); @@ -66,25 +66,25 @@ SegmentTip::moveTo( QPoint p, const QWidget &canvas, bool placeAbove ) if( y2 > sh ) p.ry() -= y2 - sh; - //I'm using this QPoint to determine where to offset the bitBlt in m_pixmap - QPoint offset = canvas.mapToGlobal( QPoint() ) - p; + //I'm using this TQPoint to determine where to offset the bitBlt in m_pixmap + TQPoint offset = canvas.mapToGlobal( TQPoint() ) - p; if( offset.x() < 0 ) offset.setX( 0 ); if( offset.y() < 0 ) offset.setY( 0 ); - const QRect alphaMaskRect( canvas.mapFromGlobal( p ), size() ); - const QRect intersection( alphaMaskRect.intersect( canvas.rect() ) ); + const TQRect alphaMaskRect( canvas.mapFromGlobal( p ), size() ); + const TQRect intersection( alphaMaskRect.intersect( canvas.rect() ) ); m_pixmap.resize( size() ); //move to updateTip once you are sure it can never be null - bitBlt( &m_pixmap, offset, &canvas, intersection, Qt::CopyROP ); + bitBlt( &m_pixmap, offset, &canvas, intersection, TQt::CopyROP ); - QColor const c = QToolTip::palette().color( QPalette::Active, QColorGroup::Background ); + TQColor const c = TQToolTip::palette().color( TQPalette::Active, TQColorGroup::Background ); if (!m_backing_store) m_pixmap.fill( c ); - QPainter paint( &m_pixmap ); - paint.setPen( Qt::black ); - paint.setBrush( Qt::NoBrush ); + TQPainter paint( &m_pixmap ); + paint.setPen( TQt::black ); + paint.setBrush( TQt::NoBrush ); paint.drawRect( rect() ); paint.end(); @@ -105,15 +105,15 @@ SegmentTip::moveTo( QPoint p, const QWidget &canvas, bool placeAbove ) void SegmentTip::updateTip( const File* const file, const Directory* const root ) { - const QString s1 = file->fullPath( root ); - QString s2 = file->humanReadableSize(); + const TQString s1 = file->fullPath( root ); + TQString s2 = file->humanReadableSize(); KLocale *loc = KGlobal::locale(); const uint MARGIN = 3; const uint pc = 100 * file->size() / root->size(); uint maxw = 0; uint h = fontMetrics().height()*2 + 2*MARGIN; - if( pc > 0 ) s2 += QString( " (%1%)" ).arg( loc->formatNumber( pc, 0 ) ); + if( pc > 0 ) s2 += TQString( " (%1%)" ).tqarg( loc->formatNumber( pc, 0 ) ); m_text = s1; m_text += '\n'; @@ -121,11 +121,11 @@ SegmentTip::updateTip( const File* const file, const Directory* const root ) if( file->isDirectory() ) { - double files = static_cast<const Directory*>(file)->children(); - const uint pc = uint((100 * files) / (double)root->children()); - QString s3 = i18n( "Files: %1" ).arg( loc->formatNumber( files, 0 ) ); + double files = static_cast<const Directory*>(file)->tqchildren(); + const uint pc = uint((100 * files) / (double)root->tqchildren()); + TQString s3 = i18n( "Files: %1" ).tqarg( loc->formatNumber( files, 0 ) ); - if( pc > 0 ) s3 += QString( " (%1%)" ).arg( loc->formatNumber( pc, 0 ) ); + if( pc > 0 ) s3 += TQString( " (%1%)" ).tqarg( loc->formatNumber( pc, 0 ) ); maxw = fontMetrics().width( s3 ); h += fontMetrics().height(); @@ -141,19 +141,19 @@ SegmentTip::updateTip( const File* const file, const Directory* const root ) } bool -SegmentTip::event( QEvent *e ) +SegmentTip::event( TQEvent *e ) { switch( e->type() ) { - case QEvent::Show: + case TQEvent::Show: kapp->installEventFilter( this ); break; - case QEvent::Hide: + case TQEvent::Hide: kapp->removeEventFilter( this ); break; - case QEvent::Paint: + case TQEvent::Paint: { - //QPainter( this ).drawPixmap( 0, 0, m_pixmap ); + //TQPainter( this ).drawPixmap( 0, 0, m_pixmap ); bitBlt( this, 0, 0, &m_pixmap ); return true; } @@ -161,22 +161,22 @@ SegmentTip::event( QEvent *e ) ; } - return false/*QWidget::event( e )*/; + return false/*TQWidget::event( e )*/; } bool -SegmentTip::eventFilter( QObject*, QEvent *e ) +SegmentTip::eventFilter( TQObject*, TQEvent *e ) { switch ( e->type() ) { - case QEvent::Leave: -// case QEvent::MouseButtonPress: -// case QEvent::MouseButtonRelease: - case QEvent::KeyPress: - case QEvent::KeyRelease: - case QEvent::FocusIn: - case QEvent::FocusOut: - case QEvent::Wheel: + case TQEvent::Leave: +// case TQEvent::MouseButtonPress: +// case TQEvent::MouseButtonRelease: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::FocusIn: + case TQEvent::FocusOut: + case TQEvent::Wheel: hide(); //FALL THROUGH default: return false; //allow this event to passed to target |