diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-27 19:21:21 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-27 19:21:21 +0000 |
commit | d8cc8bdfa7fa624a526d5aa1626974e1444cb799 (patch) | |
tree | f295f1c545b319963d5357af79fe08991d8141d9 /src/k3btooltip.cpp | |
parent | 2a39a080579fb52a2599c02b2939795385b89093 (diff) | |
download | k3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.tar.gz k3b-d8cc8bdfa7fa624a526d5aa1626974e1444cb799.zip |
TQt4 port k3b
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/k3b@1233803 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/k3btooltip.cpp')
-rw-r--r-- | src/k3btooltip.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/src/k3btooltip.cpp b/src/k3btooltip.cpp index 570c23b..63ea037 100644 --- a/src/k3btooltip.cpp +++ b/src/k3btooltip.cpp @@ -19,24 +19,24 @@ #include <k3bthememanager.h> #include <k3bapplication.h> -#include <qtimer.h> -#include <qapplication.h> -#include <qlabel.h> +#include <tqtimer.h> +#include <tqapplication.h> +#include <tqlabel.h> #include <kdebug.h> #include <fixx11h.h> -K3bToolTip::K3bToolTip( QWidget* widget ) - : QObject( widget ), +K3bToolTip::K3bToolTip( TQWidget* widget ) + : TQObject( widget ), m_parentWidget( widget ), m_currentTip( 0 ), - m_tipTimer( new QTimer( this ) ), + m_tipTimer( new TQTimer( this ) ), m_tipTimeout( 700 ) { m_parentWidget->installEventFilter( this ); - connect( m_tipTimer, SIGNAL(timeout()), - this, SLOT(slotCheckShowTip()) ); + connect( m_tipTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(slotCheckShowTip()) ); } @@ -45,9 +45,9 @@ K3bToolTip::~K3bToolTip() } -void K3bToolTip::tip( const QRect& rect, const QString& text, int effect ) +void K3bToolTip::tip( const TQRect& rect, const TQString& text, int effect ) { - QLabel* label = new QLabel( text, parentWidget() ); + TQLabel* label = new TQLabel( text, tqparentWidget() ); label->setMargin( 6 ); if( K3bTheme* theme = k3bappcore->themeManager()->currentTheme() ) { label->setPaletteBackgroundColor( theme->backgroundColor() ); @@ -57,9 +57,9 @@ void K3bToolTip::tip( const QRect& rect, const QString& text, int effect ) } -void K3bToolTip::tip( const QRect& rect, const QPixmap& pix, int effect ) +void K3bToolTip::tip( const TQRect& rect, const TQPixmap& pix, int effect ) { - QLabel* label = new QLabel( parentWidget() ); + TQLabel* label = new TQLabel( tqparentWidget() ); label->setMargin( 6 ); if( K3bTheme* theme = k3bappcore->themeManager()->currentTheme() ) { label->setPaletteBackgroundColor( theme->backgroundColor() ); @@ -70,7 +70,7 @@ void K3bToolTip::tip( const QRect& rect, const QPixmap& pix, int effect ) } -void K3bToolTip::tip( const QRect& rect, QWidget* w, int effect ) +void K3bToolTip::tip( const TQRect& rect, TQWidget* w, int effect ) { // stop the timer m_tipTimer->stop(); @@ -80,24 +80,24 @@ void K3bToolTip::tip( const QRect& rect, QWidget* w, int effect ) // which screen are we on? int scr; - if( QApplication::desktop()->isVirtualDesktop() ) - scr = QApplication::desktop()->screenNumber( m_parentWidget->mapToGlobal( m_lastMousePos ) ); + if( TQApplication::desktop()->isVirtualDesktop() ) + scr = TQApplication::desktop()->screenNumber( m_parentWidget->mapToGlobal( m_lastMousePos ) ); else - scr = QApplication::desktop()->screenNumber( m_parentWidget ); + scr = TQApplication::desktop()->screenNumber( m_parentWidget ); // make sure the widget is displayed correcly - w->reparent( QApplication::desktop()->screen( scr ), + w->reparent( TQApplication::desktop()->screen( scr ), WStyle_StaysOnTop | WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WX11BypassWM, - QPoint( 0, 0 ), false ); + TQPoint( 0, 0 ), false ); w->polish(); w->adjustSize(); // positioning code from qtooltip.cpp - QRect screen = QApplication::desktop()->screenGeometry( scr ); + TQRect screen = TQApplication::desktop()->screenGeometry( scr ); // FIXME: why (2,16) and (4,24) below? Why not use the cursors' size? - QPoint p = m_parentWidget->mapToGlobal( m_lastMousePos ) + QPoint( 2, 16 ); + TQPoint p = m_parentWidget->mapToGlobal( m_lastMousePos ) + TQPoint( 2, 16 ); if( p.x() + w->width() > screen.x() + screen.width() ) p.rx() -= 4 + w->width(); @@ -132,28 +132,28 @@ void K3bToolTip::hideTip() } -bool K3bToolTip::eventFilter( QObject* o, QEvent* e ) +bool K3bToolTip::eventFilter( TQObject* o, TQEvent* e ) { - if( o == parentWidget() ) { + if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(tqparentWidget()) ) { switch( e->type() ) { - case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - case QEvent::MouseButtonDblClick: - case QEvent::KeyPress: - case QEvent::KeyRelease: + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + case TQEvent::MouseButtonDblClick: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: // input - turn off tool tip mode hideTip(); m_tipTimer->stop(); break; - case QEvent::MouseMove: { - QMouseEvent* m = (QMouseEvent*)e; + case TQEvent::MouseMove: { + TQMouseEvent* m = (TQMouseEvent*)e; m_lastMousePos = m_parentWidget->mapFromGlobal( m->globalPos() ); m_tipTimer->stop(); if( m_currentTip ) { // see if we have to hide it - if( !m_currentTipRect.contains( m_lastMousePos ) ) { + if( !m_currentTipRect.tqcontains( m_lastMousePos ) ) { hideTip(); // in case we moved the mouse from one tip area to the next without leaving @@ -169,10 +169,10 @@ bool K3bToolTip::eventFilter( QObject* o, QEvent* e ) break; } - case QEvent::Leave: - case QEvent::Hide: - case QEvent::Destroy: - case QEvent::FocusOut: + case TQEvent::Leave: + case TQEvent::Hide: + case TQEvent::Destroy: + case TQEvent::FocusOut: hideTip(); m_tipTimer->stop(); break; |