diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-26 00:38:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-26 00:38:19 +0000 |
commit | f0296ef9e1f94e23c00d6f490e565d1dc768416d (patch) | |
tree | 7f3fd9f99621c111ff67f2d62feb5960a3371853 /src/part/radialMap/widgetEvents.cpp | |
parent | 3098eb909534268622ce776f9a7bb5310d31b3c1 (diff) | |
download | filelight-f0296ef9e1f94e23c00d6f490e565d1dc768416d.tar.gz filelight-f0296ef9e1f94e23c00d6f490e565d1dc768416d.zip |
TQt4 port Filelight
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/filelight@1233561 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/part/radialMap/widgetEvents.cpp')
-rw-r--r-- | src/part/radialMap/widgetEvents.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/src/part/radialMap/widgetEvents.cpp b/src/part/radialMap/widgetEvents.cpp index 71db1c0..1ad304e 100644 --- a/src/part/radialMap/widgetEvents.cpp +++ b/src/part/radialMap/widgetEvents.cpp @@ -15,15 +15,15 @@ #include <kpopupmenu.h> //::mousePressEvent() #include <krun.h> //::mousePressEvent() #include <kurldrag.h> -#include <qapplication.h>//QApplication::setOverrideCursor() -#include <qclipboard.h> -#include <qpainter.h> -#include <qtimer.h> //::resizeEvent() +#include <tqapplication.h>//TQApplication::setOverrideCursor() +#include <tqclipboard.h> +#include <tqpainter.h> +#include <tqtimer.h> //::resizeEvent() void -RadialMap::Widget::resizeEvent( QResizeEvent* ) +RadialMap::Widget::resizeEvent( TQResizeEvent* ) { if( m_map.resize( rect() ) ) m_timer.start( 500, true ); //will cause signature to rebuild for new size @@ -34,13 +34,13 @@ RadialMap::Widget::resizeEvent( QResizeEvent* ) } void -RadialMap::Widget::paintEvent( QPaintEvent* ) +RadialMap::Widget::paintEvent( TQPaintEvent* ) { - //bltBit for some Qt setups will bitBlt _after_ the labels are painted. Which buggers things up! - //shame as bitBlt is faster, possibly Qt bug? Should report the bug? - seems to be race condition + //bltBit for some TQt setups will bitBlt _after_ the labels are painted. Which buggers things up! + //shame as bitBlt is faster, possibly TQt bug? Should report the bug? - seems to be race condition //bitBlt( this, m_offset, &m_map ); - QPainter paint( this ); + TQPainter paint( this ); paint.drawPixmap( m_offset, m_map ); @@ -63,9 +63,9 @@ RadialMap::Widget::paintEvent( QPaintEvent* ) } const RadialMap::Segment* -RadialMap::Widget::segmentAt( QPoint &e ) const +RadialMap::Widget::segmentAt( TQPoint &e ) const { - //determine which segment QPoint e is above + //determine which segment TQPoint e is above e -= m_offset; @@ -110,12 +110,12 @@ RadialMap::Widget::segmentAt( QPoint &e ) const } void -RadialMap::Widget::mouseMoveEvent( QMouseEvent *e ) +RadialMap::Widget::mouseMoveEvent( TQMouseEvent *e ) { //set m_focus to what we hover over, update UI if it's a new segment Segment const * const oldFocus = m_focus; - QPoint p = e->pos(); + TQPoint p = e->pos(); m_focus = segmentAt( p ); //NOTE p is passed by non-const reference @@ -127,11 +127,11 @@ RadialMap::Widget::mouseMoveEvent( QMouseEvent *e ) m_tip->updateTip( m_focus->file(), m_tree ); emit mouseHover( m_focus->file()->fullPath() ); - //repaint required to update labels now before transparency is generated - repaint( false ); + //tqrepaint required to update labels now before transparency is generated + tqrepaint( false ); } - m_tip->moveTo( e->globalPos(), *this, ( p.y() < 0 ) ); //updates tooltip psuedo-tranparent background + m_tip->moveTo( e->globalPos(), *this, ( p.y() < 0 ) ); //updates tooltip psuedo-trantqparent background } else if( oldFocus && oldFocus->file() != m_tree ) { @@ -139,12 +139,12 @@ RadialMap::Widget::mouseMoveEvent( QMouseEvent *e ) m_tip->hide(); update(); - emit mouseHover( QString::null ); + emit mouseHover( TQString() ); } } void -RadialMap::Widget::mousePressEvent( QMouseEvent *e ) +RadialMap::Widget::mousePressEvent( TQMouseEvent *e ) { //m_tip is hidden already by event filter //m_focus is set correctly (I've been strict, I assure you it is correct!) @@ -184,12 +184,12 @@ RadialMap::Widget::mousePressEvent( QMouseEvent *e ) switch (popup.exec( e->globalPos(), 1 )) { case Konqueror: //KRun::runCommand will show an error message if there was trouble - KRun::runCommand( QString( "kfmclient openURL \"%1\"" ).arg( url.url() ) ); + KRun::runCommand( TQString( "kfmclient openURL \"%1\"" ).tqarg( url.url() ) ); break; case Konsole: // --workdir only works for local file paths - KRun::runCommand( QString( "konsole --workdir \"%1\"" ).arg( url.path() ) ); + KRun::runCommand( TQString( "konsole --workdir \"%1\"" ).tqarg( url.path() ) ); break; case Center: @@ -197,24 +197,24 @@ RadialMap::Widget::mousePressEvent( QMouseEvent *e ) goto section_two; case Copy: - QApplication::clipboard()->setData( new KURLDrag( KURL::List( url ) ) ); + TQApplication::tqclipboard()->setData( new KURLDrag( KURL::List( url ) ) ); break; case Delete: { const KURL url = Widget::url( m_focus->file() ); - const QString message = m_focus->file()->isDirectory() + const TQString message = m_focus->file()->isDirectory() ? i18n( "<qt>The directory at <i>'%1'</i> will be <b>recursively</b> and <b>permanently</b> deleted." ) : i18n( "<qt><i>'%1'</i> will be <b>permanently</b> deleted." ); const int userIntention = KMessageBox::warningContinueCancel( - this, message.arg( url.prettyURL() ), - QString::null, KGuiItem( i18n("&Delete"), "editdelete" ) ); + this, message.tqarg( url.prettyURL() ), + TQString(), KGuiItem( i18n("&Delete"), "editdelete" ) ); if (userIntention == KMessageBox::Continue) { KIO::Job *job = KIO::del( url ); job->setWindow( this ); - connect( job, SIGNAL(result( KIO::Job* )), SLOT(deleteJobFinished( KIO::Job* )) ); - QApplication::setOverrideCursor( KCursor::workingCursor() ); + connect( job, TQT_SIGNAL(result( KIO::Job* )), TQT_SLOT(deleteJobFinished( KIO::Job* )) ); + TQApplication::setOverrideCursor( KCursor::workingCursor() ); } } @@ -226,7 +226,7 @@ RadialMap::Widget::mousePressEvent( QMouseEvent *e ) else { // not right mouse button section_two: - const QRect rect( e->x() - 20, e->y() - 20, 40, 40 ); + const TQRect rect( e->x() - 20, e->y() - 20, 40, 40 ); m_tip->hide(); // user expects this @@ -248,16 +248,16 @@ RadialMap::Widget::mousePressEvent( QMouseEvent *e ) void RadialMap::Widget::deleteJobFinished( KIO::Job *job ) { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); if( !job->error() ) - invalidate(); + tqinvalidate(); else job->showErrorDialog( this ); } #include "debug.h" void -RadialMap::Widget::dropEvent( QDropEvent *e ) +RadialMap::Widget::dropEvent( TQDropEvent *e ) { DEBUG_ANNOUNCE @@ -267,7 +267,7 @@ RadialMap::Widget::dropEvent( QDropEvent *e ) } void -RadialMap::Widget::dragEnterEvent( QDragEnterEvent *e ) +RadialMap::Widget::dragEnterEvent( TQDragEnterEvent *e ) { DEBUG_ANNOUNCE |