diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-05 22:07:15 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-05 22:07:15 +0000 |
commit | 421b60af92c83b889f8903c2898f2bd07186fcd8 (patch) | |
tree | ad873a24c9438baed4942fda795430a4c3dc9a9a /src/kbfxplasmaindexview.cpp | |
parent | 39e896bddf25bf34cbf8be814d959181e2c1d1dd (diff) | |
download | kbfx-421b60af92c83b889f8903c2898f2bd07186fcd8.tar.gz kbfx-421b60af92c83b889f8903c2898f2bd07186fcd8.zip |
TQt4 port kbfx
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbfx@1230544 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/kbfxplasmaindexview.cpp')
-rw-r--r-- | src/kbfxplasmaindexview.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/src/kbfxplasmaindexview.cpp b/src/kbfxplasmaindexview.cpp index ee50c9e..d7e80e1 100644 --- a/src/kbfxplasmaindexview.cpp +++ b/src/kbfxplasmaindexview.cpp @@ -21,9 +21,9 @@ #include "kbfxplasmaindexview.h" -KbfxPlasmaIndexView::KbfxPlasmaIndexView ( QWidget * parent, const char *name, +KbfxPlasmaIndexView::KbfxPlasmaIndexView ( TQWidget * tqparent, const char *name, WFlags l ) : - QCanvasView ( parent, name, l ) + TQCanvasView ( tqparent, name, l ) { m_itemGroup = new KbfxPlasmaCanvasGroup (); m_itemGroupList = new KbfxPlasmaCanvasGroupView (); @@ -32,19 +32,19 @@ KbfxPlasmaIndexView::KbfxPlasmaIndexView ( QWidget * parent, const char *name, m_itemStack->addGroup ( m_itemGroupList ); viewport ()->setMouseTracking ( TRUE ); - m_currentPos = QPoint ( 0, 0 ); - m_mousePollTimer = new QTimer ( this ); + m_currentPos = TQPoint ( 0, 0 ); + m_mousePollTimer = new TQTimer ( this ); m_pluginList = KbfxPlasmaPluginLoader::scanPlugins (); viewport ()->setAcceptDrops ( true ); - this->setVScrollBarMode ( QScrollView::AlwaysOff ); - this->setHScrollBarMode ( QScrollView::AlwaysOff ); - setFrameShape ( QFrame::NoFrame ); + this->setVScrollBarMode ( TQScrollView::AlwaysOff ); + this->setHScrollBarMode ( TQScrollView::AlwaysOff ); + setFrameShape ( TQFrame::NoFrame ); m_currentItem = 0L; m_selectedItem = 0L; // m_pluginList = ""; - connect ( this, SIGNAL ( clicked ( KbfxPlasmaIndexItem * ) ), this, - SLOT ( slotClicked ( KbfxPlasmaIndexItem * ) ) ); + connect ( this, TQT_SIGNAL ( clicked ( KbfxPlasmaIndexItem * ) ), this, + TQT_SLOT ( slotClicked ( KbfxPlasmaIndexItem * ) ) ); m_currentView = 0; setDragAutoScroll ( true ); } @@ -58,16 +58,16 @@ void KbfxPlasmaIndexView::checkMousePos () { KbfxPlasmaCanvasGroup *tmp = 0; - if ( QCursor::pos () == mapToGlobal ( contentsToViewport ( m_currentPos ) ) ) + if ( TQCursor::pos () == mapToGlobal ( contentsToViewport ( m_currentPos ) ) ) { - QMouseEvent me ( QEvent::MouseButtonPress, + TQMouseEvent me ( TQEvent::MouseButtonPress, this->mapToGlobal ( m_currentPos ), Qt::LeftButton, Qt::LeftButton ); clearAll (); - QCanvasItemList l = canvas ()->collisions ( m_currentPos ); - for ( QCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it ) + TQCanvasItemList l = canvas ()->collisions ( m_currentPos ); + for ( TQCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it ) { if ( ( *it )->rtti () == CANVASITEM ) { @@ -107,9 +107,9 @@ KbfxPlasmaIndexView::clearAllButOne ( KbfxPlasmaIndexItem * i ) { i = i; - QCanvasItemList list = canvas ()->allItems (); + TQCanvasItemList list = canvas ()->allItems (); - QCanvasItemList::Iterator it = list.begin (); + TQCanvasItemList::Iterator it = list.begin (); for ( ; it != list.end (); ++it ) { if ( *it ) @@ -127,9 +127,9 @@ KbfxPlasmaIndexView::clearAllButOne ( KbfxPlasmaIndexItem * i ) void KbfxPlasmaIndexView::clearSelection () { - QCanvasItemList list = canvas ()->allItems (); + TQCanvasItemList list = canvas ()->allItems (); - QCanvasItemList::Iterator it = list.begin (); + TQCanvasItemList::Iterator it = list.begin (); for ( ; it != list.end (); ++it ) { if ( *it ) @@ -143,7 +143,7 @@ KbfxPlasmaIndexView::clearSelection () } void -KbfxPlasmaIndexView::leaveEvent ( QEvent * e ) +KbfxPlasmaIndexView::leaveEvent ( TQEvent * e ) { e = e; clearAllButOne ( m_currentItem ); @@ -162,18 +162,18 @@ KbfxPlasmaIndexView::contextMenuSlot ( int id ) } void -KbfxPlasmaIndexView::contentsContextMenuEvent ( QContextMenuEvent * event ) +KbfxPlasmaIndexView::contentsContextMenuEvent ( TQContextMenuEvent * event ) { event = event; /* m_pluginMenu = new KPopupMenu ( this );; - connect ( m_pluginMenu, SIGNAL ( activated ( int ) ), this, - SLOT ( contextMenuSlot ( int ) ) ); + connect ( m_pluginMenu, TQT_SIGNAL ( activated ( int ) ), this, + TQT_SLOT ( contextMenuSlot ( int ) ) ); m_pluginMenu->insertTitle ( "Insert Plugin", 0, 0 ); int _index = 1; - for ( QStringList::Iterator it = m_pluginList.begin (); + for ( TQStringList::Iterator it = m_pluginList.begin (); it != m_pluginList.end (); ++it ) { @@ -246,7 +246,7 @@ KbfxPlasmaIndexView::loadList ( KbfxDataStack * stkPtr ) m_itemStack->raise ( 0 ); - for ( QStringList::Iterator it = m_pluginList.begin (); + for ( TQStringList::Iterator it = m_pluginList.begin (); it != m_pluginList.end (); ++it ) { if ( *it == stkPtr->name() ) @@ -258,20 +258,20 @@ KbfxPlasmaIndexView::loadList ( KbfxDataStack * stkPtr ) } void -KbfxPlasmaIndexView::setKbfxCanvas ( QCanvas * cnv ) +KbfxPlasmaIndexView::setKbfxCanvas ( TQCanvas * cnv ) { setCanvas ( cnv ); - canvas ()->setBackgroundPixmap ( ( *KbfxPlasmaPixmapProvider::pixmap ( "listboxbg" )) ); + canvas ()->tqsetBackgroundPixmap ( ( *KbfxPlasmaPixmapProvider::pixmap ( "listboxbg" )) ); canvas ()->update (); } void -KbfxPlasmaIndexView::loadPlugin ( QString name, KbfxPlasmaCanvasView * view ) +KbfxPlasmaIndexView::loadPlugin ( TQString name, KbfxPlasmaCanvasView * view ) { - if ( m_pluginList.contains ( name ) <= 0 ) + if ( m_pluginList.tqcontains ( name ) <= 0 ) { KbfxPlasmaPluginLoader *m_loader = new KbfxPlasmaPluginLoader (); KbfxDataStack *m_stack_R = m_loader->getView ( name ); @@ -298,7 +298,7 @@ KbfxPlasmaIndexView::loadPlugin ( QString name, KbfxPlasmaCanvasView * view ) void -KbfxPlasmaIndexView::mouseMoveEvent ( QMouseEvent * me ) +KbfxPlasmaIndexView::mouseMoveEvent ( TQMouseEvent * me ) { me = me; } @@ -306,7 +306,7 @@ KbfxPlasmaIndexView::mouseMoveEvent ( QMouseEvent * me ) void -KbfxPlasmaIndexView::contentsMouseMoveEvent ( QMouseEvent * me ) +KbfxPlasmaIndexView::contentsMouseMoveEvent ( TQMouseEvent * me ) { if ( canvas () == NULL ) return; @@ -315,9 +315,9 @@ KbfxPlasmaIndexView::contentsMouseMoveEvent ( QMouseEvent * me ) // TODO: Get wait time from config - this->setCursor ( QCursor ( Qt::PointingHandCursor ) ); + this->setCursor ( TQCursor ( TQt::PointingHandCursor ) ); - QTimer::singleShot ( 800, this, SLOT ( checkMousePos () ) ); + TQTimer::singleShot ( 800, this, TQT_SLOT ( checkMousePos () ) ); if ( contentsToViewport ( me->pos () ).y () < this->height () / 5 ) { @@ -328,16 +328,16 @@ KbfxPlasmaIndexView::contentsMouseMoveEvent ( QMouseEvent * me ) scrollBy ( 10, 10 ); } - QScrollView::contentsMouseMoveEvent ( me ); + TQScrollView::contentsMouseMoveEvent ( me ); // KbfxPlasmaCanvasGroup *tmp = 0; - QCanvasItemList l = canvas ()->collisions ( me->pos () ); + TQCanvasItemList l = canvas ()->collisions ( me->pos () ); if ( l.count () <= 0 ) return; - for ( QCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it ) + for ( TQCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it ) { if ( *it == 0 ) return; @@ -358,18 +358,18 @@ KbfxPlasmaIndexView::contentsMouseMoveEvent ( QMouseEvent * me ) } void -KbfxPlasmaIndexView::contentsMousePressEvent ( QMouseEvent * me ) +KbfxPlasmaIndexView::contentsMousePressEvent ( TQMouseEvent * me ) { - if ( me->button () == RightButton ) + if ( me->button () == Qt::RightButton ) return; clearAll (); - this->setCursor ( QCursor ( Qt::WaitCursor ) ); + this->setCursor ( TQCursor ( TQt::WaitCursor ) ); KbfxPlasmaCanvasGroup *tmp = 0; - QCanvasItemList l = canvas ()->collisions ( me->pos () ); - for ( QCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it ) + TQCanvasItemList l = canvas ()->collisions ( me->pos () ); + for ( TQCanvasItemList::Iterator it = l.begin (); it != l.end (); ++it ) { if ( ( *it )->rtti () == CANVASITEM ) { @@ -393,10 +393,10 @@ KbfxPlasmaIndexView::contentsMousePressEvent ( QMouseEvent * me ) // m_clickPos = me->pos (); - QScrollView::contentsMousePressEvent ( me ); + TQScrollView::contentsMousePressEvent ( me ); canvas ()->update (); - this->setCursor ( QCursor ( Qt::PointingHandCursor ) ); + this->setCursor ( TQCursor ( TQt::PointingHandCursor ) ); } void @@ -409,17 +409,17 @@ KbfxPlasmaIndexView::slotClicked ( KbfxPlasmaIndexItem * it ) KbfxSignal signal ( _it->belongsTo (), _it->Id () ); - this->setCursor ( QCursor ( Qt::WaitCursor ) ); + this->setCursor ( TQCursor ( TQt::WaitCursor ) ); emit loadRequest ( signal ); - this->setCursor ( QCursor ( Qt::PointingHandCursor ) ); + this->setCursor ( TQCursor ( TQt::PointingHandCursor ) ); } void KbfxPlasmaIndexView::clearAll () { - QCanvasItemList list = canvas ()->allItems (); + TQCanvasItemList list = canvas ()->allItems (); - QCanvasItemList::Iterator it = list.begin (); + TQCanvasItemList::Iterator it = list.begin (); for ( ; it != list.end (); ++it ) { if ( *it ) |