diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-04 19:54:24 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-04 19:54:24 +0000 |
commit | d7633c195a464e4d344ada9eea61afd10110598a (patch) | |
tree | 1f2da0b135f3ed84955e340cae823f00c4ce7284 /src/svnfrontend/svnfiletip.cpp | |
parent | 3fa7eb804f67b2789f128075cc2522f398640250 (diff) | |
download | tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.tar.gz tdesvn-d7633c195a464e4d344ada9eea61afd10110598a.zip |
Port kdesvn to TQt4
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kdesvn@1230412 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/svnfrontend/svnfiletip.cpp')
-rw-r--r-- | src/svnfrontend/svnfiletip.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/src/svnfrontend/svnfiletip.cpp b/src/svnfrontend/svnfiletip.cpp index 2021169..c7388d3 100644 --- a/src/svnfrontend/svnfiletip.cpp +++ b/src/svnfrontend/svnfiletip.cpp @@ -26,38 +26,38 @@ #include <kapplication.h> #include <kdebug.h> -#include <qlabel.h> -#include <qtooltip.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qscrollview.h> -#include <qtimer.h> - -SvnFileTip::SvnFileTip(QScrollView*parent) - : QFrame( 0, 0, WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM ), +#include <tqlabel.h> +#include <tqtooltip.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqscrollview.h> +#include <tqtimer.h> + +SvnFileTip::SvnFileTip(TQScrollView*tqparent) + : TQFrame( 0, 0, WStyle_Customize | WStyle_NoBorder | WStyle_Tool | WStyle_StaysOnTop | WX11BypassWM ), m_on( false ), m_preview( false ), m_filter( false ), m_corner( 0 ), m_num( 0 ), - m_view( parent ), + m_view( tqparent ), m_svnitem( 0 ), m_previewJob( 0 ) { - m_iconLabel = new QLabel(this); - m_textLabel = new QLabel(this); - m_textLabel->setAlignment(Qt::AlignAuto | Qt::AlignTop); + m_iconLabel = new TQLabel(this); + m_textLabel = new TQLabel(this); + m_textLabel->tqsetAlignment(TQt::AlignAuto | TQt::AlignTop); - QGridLayout* layout = new QGridLayout(this, 1, 2, 8, 0); - layout->addWidget(m_iconLabel, 0, 0); - layout->addWidget(m_textLabel, 0, 1); - layout->setResizeMode(QLayout::Fixed); + TQGridLayout* tqlayout = new TQGridLayout(this, 1, 2, 8, 0); + tqlayout->addWidget(m_iconLabel, 0, 0); + tqlayout->addWidget(m_textLabel, 0, 1); + tqlayout->setResizeMode(TQLayout::Fixed); - setPalette( QToolTip::palette() ); + setPalette( TQToolTip::palette() ); setMargin( 1 ); - setFrameStyle( QFrame::Plain | QFrame::Box ); + setFrameStyle( TQFrame::Plain | TQFrame::Box ); - m_timer = new QTimer(this); + m_timer = new TQTimer(this); hide(); } @@ -87,7 +87,7 @@ void SvnFileTip::setOptions( bool on, bool preview, int num ) m_num = num; } -void SvnFileTip::setItem(SvnItem*item, const QRect &rect, const QPixmap *pixmap ) +void SvnFileTip::setItem(SvnItem*item, const TQRect &rect, const TQPixmap *pixmap ) { hideTip(); @@ -107,13 +107,13 @@ void SvnFileTip::setItem(SvnItem*item, const QRect &rect, const QPixmap *pixmap if ( pixmap ) m_iconLabel->setPixmap( *pixmap ); else - m_iconLabel->setPixmap( QPixmap() ); + m_iconLabel->setPixmap( TQPixmap() ); } // Don't start immediately, because the user could move the mouse over another item // This avoids a quick sequence of started preview-jobs m_timer->disconnect( this ); - connect(m_timer, SIGNAL(timeout()), this, SLOT(startDelayed())); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(startDelayed())); m_timer->start( 300, true ); } else { m_timer->stop(); @@ -124,11 +124,11 @@ void SvnFileTip::reposition() { if ( m_rect.isEmpty() || !m_view || !m_view->viewport() ) return; - QRect rect = m_rect; - QPoint off = m_view->viewport()->mapToGlobal( m_view->contentsToViewport( rect.topRight() ) ); + TQRect rect = m_rect; + TQPoint off = m_view->viewport()->mapToGlobal( m_view->contentsToViewport( rect.topRight() ) ); rect.moveTopRight( off ); - QPoint pos = rect.center(); + TQPoint pos = rect.center(); // m_corner: // 0: upperleft // 1: upperright @@ -137,7 +137,7 @@ void SvnFileTip::reposition() // 4+: none m_corner = 0; // should the tooltip be shown to the left or to the right of the ivi ? - QRect desk = KGlobalSettings::desktopGeometry(rect.center()); + TQRect desk = KGlobalSettings::desktopGeometry(rect.center()); if (rect.center().x() + width() > desk.right()) { // to the left @@ -162,7 +162,7 @@ void SvnFileTip::reposition() update(); } -void SvnFileTip::gotPreview( const KFileItem* item, const QPixmap& pixmap ) +void SvnFileTip::gotPreview( const KFileItem* item, const TQPixmap& pixmap ) { m_previewJob = 0; if (!m_svnitem || item != m_svnitem->fileItem()) return; @@ -175,7 +175,7 @@ void SvnFileTip::gotPreviewResult() m_previewJob = 0; } -void SvnFileTip::drawContents( QPainter *p ) +void SvnFileTip::drawContents( TQPainter *p ) { static const char * const names[] = { "arrow_topleft", @@ -185,14 +185,14 @@ void SvnFileTip::drawContents( QPainter *p ) }; if (m_corner >= 4) { // 4 is empty, so don't draw anything - QFrame::drawContents( p ); + TQFrame::drawContents( p ); return; } if ( m_corners[m_corner].isNull()) - m_corners[m_corner].load( locate( "data", QString::fromLatin1( "konqueror/pics/%1.png" ).arg( names[m_corner] ) ) ); + m_corners[m_corner].load( locate( "data", TQString::tqfromLatin1( "konqueror/pics/%1.png" ).tqarg( names[m_corner] ) ) ); - QPixmap &pix = m_corners[m_corner]; + TQPixmap &pix = m_corners[m_corner]; switch ( m_corner ) { @@ -210,7 +210,7 @@ void SvnFileTip::drawContents( QPainter *p ) break; } - QFrame::drawContents( p ); + TQFrame::drawContents( p ); } void SvnFileTip::setFilter( bool enable ) @@ -219,10 +219,10 @@ void SvnFileTip::setFilter( bool enable ) if ( enable ) { kapp->installEventFilter( this ); - QApplication::setGlobalMouseTracking( true ); + TQApplication::setGlobalMouseTracking( true ); } else { - QApplication::setGlobalMouseTracking( false ); + TQApplication::setGlobalMouseTracking( false ); kapp->removeEventFilter( this ); } m_filter = enable; @@ -234,12 +234,12 @@ void SvnFileTip::showTip() hide(); return; } - QString text = m_svnitem->getToolTipText(); + TQString text = m_svnitem->getToolTipText(); if ( text.isEmpty() ) return; m_timer->disconnect( this ); - connect(m_timer, SIGNAL(timeout()), this, SLOT(hideTip())); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(hideTip())); m_timer->start( 15000, true ); m_textLabel->setText( text ); @@ -269,35 +269,35 @@ void SvnFileTip::startDelayed() oneItem.append( m_svnitem->fileItem() ); m_previewJob = KIO::filePreview( oneItem, 256, 256, 64, 70, true, true, 0); - connect( m_previewJob, SIGNAL( gotPreview( const KFileItem *, const QPixmap & ) ), - this, SLOT( gotPreview( const KFileItem *, const QPixmap & ) ) ); - connect( m_previewJob, SIGNAL( result( KIO::Job * ) ), - this, SLOT( gotPreviewResult() ) ); + connect( m_previewJob, TQT_SIGNAL( gotPreview( const KFileItem *, const TQPixmap & ) ), + this, TQT_SLOT( gotPreview( const KFileItem *, const TQPixmap & ) ) ); + connect( m_previewJob, TQT_SIGNAL( result( KIO::Job * ) ), + this, TQT_SLOT( gotPreviewResult() ) ); } m_timer->disconnect( this ); - connect(m_timer, SIGNAL(timeout()), this, SLOT(showTip())); + connect(m_timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(showTip())); m_timer->start( 400, true ); } -void SvnFileTip::resizeEvent( QResizeEvent* event ) +void SvnFileTip::resizeEvent( TQResizeEvent* event ) { - QFrame::resizeEvent(event); + TQFrame::resizeEvent(event); reposition(); } -bool SvnFileTip::eventFilter( QObject *, QEvent *e ) +bool SvnFileTip::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: hideTip(); default: break; } |