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/kbfxspinxmenu.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/kbfxspinxmenu.cpp')
-rw-r--r-- | src/kbfxspinxmenu.cpp | 270 |
1 files changed, 135 insertions, 135 deletions
diff --git a/src/kbfxspinxmenu.cpp b/src/kbfxspinxmenu.cpp index 0d016ac..6af42ef 100644 --- a/src/kbfxspinxmenu.cpp +++ b/src/kbfxspinxmenu.cpp @@ -21,13 +21,13 @@ #include "kbfxspinxmenu.h" -KbfxSpinxMenuWidget::KbfxSpinxMenuWidget ( QWidget * parent, const char *name, +KbfxSpinxMenuWidget::KbfxSpinxMenuWidget ( TQWidget * tqparent, const char *name, WFlags fl ) : - QWidget ( parent, "MenuWidget", - fl | Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop ) + TQWidget ( tqparent, "MenuWidget", + fl | TQt::WStyle_Customize | TQt::WStyle_NoBorder | TQt::WStyle_StaysOnTop ) { - m_parent = parent; - QString _name=name; + m_parent = tqparent; + TQString _name=name; init(); } @@ -45,7 +45,7 @@ KbfxSpinxMenuWidget::init() { createMask (); - QWidget *main = new QWidget ( this ); + TQWidget *main = new TQWidget ( this ); m_kbfxSpinxTop = new KbfxSpinxTop ( main ); m_toolBarBot = new KbfxSpinxToolBar ( main ); @@ -54,11 +54,11 @@ KbfxSpinxMenuWidget::init() m_kbfxSpinxTop->setMaximumHeight ( ConfigInit ().m_topBar_h ); m_kbfxSpinxTop->setMinimumHeight ( ConfigInit ().m_topBar_h ); - QWidget *middle = new QWidget ( main ); + TQWidget *middle = new TQWidget ( main ); - middle->setPalette ( QPalette ( QColor ( 24, 233, 233 ) ) ); + middle->setPalette ( TQPalette ( TQColor ( 24, 233, 233 ) ) ); -// m_middleFrame = new QHBoxLayout(middle); +// m_middleFrame = new TQHBoxLayout(middle); m_canvasView = new KbfxPlasmaCanvasView ( this ); m_indexView = new KbfxPlasmaIndexView ( this ); @@ -66,28 +66,28 @@ KbfxSpinxMenuWidget::init() /* Search Box */ m_searchTag = new KbfxPixmapLabel ( this, "Search:" ); - QToolTip::add( m_searchTag, tr2i18n( "Double click to clear..." ) ); + TQToolTip::add( m_searchTag, tr2i18n( "Double click to clear..." ) ); m_searchTag->normalize (); m_searchTag->move ( ConfigInit ().m_searchBox_x, ConfigInit ().m_searchBox_y ); - QPixmap m_searchPixmap = ( *KbfxPlasmaPixmapProvider::pixmap ( "find" ) ); + TQPixmap m_searchPixmap = ( *KbfxPlasmaPixmapProvider::pixmap ( "tqfind" ) ); m_searchTag->setPixmap ( m_searchPixmap ); m_searchTag->resize ( m_searchPixmap.width (), ConfigInit ().m_searchBox_h ); - m_search = new QLineEdit ( this, "Search BOX" ); - QToolTip::add( m_search, tr2i18n( "Type here to search..." ) ); - m_search->setFrameShape ( QFrame::NoFrame ); - m_search->setFocusPolicy ( QWidget::StrongFocus ); + m_search = new TQLineEdit ( this, "Search BOX" ); + TQToolTip::add( m_search, tr2i18n( "Type here to search..." ) ); + m_search->setFrameShape ( TQFrame::NoFrame ); + m_search->setFocusPolicy ( TQ_StrongFocus ); m_search->move ( ConfigInit ().m_searchBox_x + m_searchTag->width (), ConfigInit ().m_searchBox_y ); m_search->resize ( ConfigInit ().m_searchBox_w - m_searchTag->width (), ConfigInit ().m_searchBox_h ); - connect (m_searchTag, SIGNAL (mouseDoubleClicked ( const ButtonState & )), this, - SLOT (search_clear ( const ButtonState & ))); + connect (m_searchTag, TQT_SIGNAL (mouseDoubleClicked ( const ButtonState & )), this, + TQT_SLOT (search_clear ( const ButtonState & ))); int frameHeight = ConfigInit().m_listBox_h; @@ -101,7 +101,7 @@ KbfxSpinxMenuWidget::init() m_canvasView->setMinimumHeight ( ConfigInit().m_itemView_h ); m_canvasView->setMaximumWidth ( ConfigInit ().m_itemView_w ); m_canvasView->setMinimumWidth ( ConfigInit ().m_itemView_w ); - m_appCanvas = new QCanvas ( m_canvasView->width (), m_canvasView->height () ); + m_appCanvas = new TQCanvas ( m_canvasView->width (), m_canvasView->height () ); m_canvasView->setKbfxCanvas ( m_appCanvas ); m_appCanvas->setDoubleBuffering ( true ); @@ -109,7 +109,7 @@ KbfxSpinxMenuWidget::init() m_indexView->setMinimumHeight ( frameHeight ); m_indexView->setMaximumWidth ( ConfigInit ().m_listBox_w ); m_indexView->setMinimumWidth ( ConfigInit ().m_listBox_w ); - m_indexCanvas = new QCanvas ( m_indexView->width (), m_indexView->height () ); + m_indexCanvas = new TQCanvas ( m_indexView->width (), m_indexView->height () ); m_indexView->setKbfxCanvas ( m_indexCanvas ); m_indexCanvas->setDoubleBuffering ( true ); m_indexView->setView ( m_canvasView ); @@ -119,7 +119,7 @@ KbfxSpinxMenuWidget::init() m_indexLeftView->setMaximumWidth ( ConfigInit ().m_listBox_w ); m_indexLeftView->setMinimumWidth ( ConfigInit ().m_listBox_w ); m_indexLeftCanvas = - new QCanvas ( m_indexLeftView->width (), m_indexLeftView->height () ); + new TQCanvas ( m_indexLeftView->width (), m_indexLeftView->height () ); m_indexLeftView->setKbfxCanvas ( m_indexLeftCanvas ); m_indexLeftCanvas->setDoubleBuffering ( true ); m_indexLeftView->setView ( m_canvasView ); @@ -130,8 +130,8 @@ KbfxSpinxMenuWidget::init() m_indexLeftView->move ( ConfigInit ().m_listBox_w + ConfigInit ().m_itemView_w, ConfigInit ().m_listBox_y ); - m_fixedFrame = new QVBoxLayout ( main ); - m_fixedFrame->setResizeMode ( QLayout::Minimum ); + m_fixedFrame = new TQVBoxLayout ( main ); + m_fixedFrame->setResizeMode ( TQLayout::Minimum ); m_fixedFrame->addWidget ( m_kbfxSpinxTop ); m_fixedFrame->addWidget ( middle ); m_fixedFrame->addWidget ( m_toolBarBot ); @@ -143,37 +143,37 @@ KbfxSpinxMenuWidget::init() loadHistory (); - connect ( m_indexView, SIGNAL ( loadRequest ( KbfxSignal ) ), m_canvasView, - SLOT ( handleLoadRequest ( KbfxSignal ) ) ); + connect ( m_indexView, TQT_SIGNAL ( loadRequest ( KbfxSignal ) ), m_canvasView, + TQT_SLOT ( handleLoadRequest ( KbfxSignal ) ) ); - connect ( m_indexLeftView, SIGNAL ( loadRequest ( KbfxSignal ) ), m_canvasView, - SLOT ( handleLoadRequest ( KbfxSignal ) ) ); + connect ( m_indexLeftView, TQT_SIGNAL ( loadRequest ( KbfxSignal ) ), m_canvasView, + TQT_SLOT ( handleLoadRequest ( KbfxSignal ) ) ); - connect ( m_canvasView, SIGNAL ( clicked () ), this, SLOT ( hideMenu () ) ); + connect ( m_canvasView, TQT_SIGNAL ( clicked () ), this, TQT_SLOT ( hideMenu () ) ); - connect ( m_search, SIGNAL ( textChanged ( const QString & ) ), m_canvasView, - SLOT ( search ( const QString & ) ) ); + connect ( m_search, TQT_SIGNAL ( textChanged ( const TQString & ) ), m_canvasView, + TQT_SLOT ( search ( const TQString & ) ) ); connect ( m_indexView, - SIGNAL ( pluginRequest ( QString, KbfxPlasmaCanvasView * ) ), - m_indexView, SLOT ( loadPlugin ( QString, KbfxPlasmaCanvasView * ) ) ); + TQT_SIGNAL ( pluginRequest ( TQString, KbfxPlasmaCanvasView * ) ), + m_indexView, TQT_SLOT ( loadPlugin ( TQString, KbfxPlasmaCanvasView * ) ) ); connect ( m_indexLeftView, - SIGNAL ( pluginRequest ( QString, KbfxPlasmaCanvasView * ) ), + TQT_SIGNAL ( pluginRequest ( TQString, KbfxPlasmaCanvasView * ) ), m_indexLeftView, - SLOT ( loadPlugin ( QString, KbfxPlasmaCanvasView * ) ) ); + TQT_SLOT ( loadPlugin ( TQString, KbfxPlasmaCanvasView * ) ) ); connect ( m_indexView, - SIGNAL ( clearSelected() ), - m_indexLeftView, SLOT ( clearSelection() ) ); + TQT_SIGNAL ( clearSelected() ), + m_indexLeftView, TQT_SLOT ( clearSelection() ) ); connect ( m_indexLeftView, - SIGNAL ( clearSelected() ), + TQT_SIGNAL ( clearSelected() ), m_indexView, - SLOT ( clearSelection() ) ); + TQT_SLOT ( clearSelection() ) ); - connect (this,SIGNAL(refresh()),m_canvasView,SLOT(reload())); - connect (this,SIGNAL(runItem()),m_canvasView,SLOT(execFirst())); + connect (this,TQT_SIGNAL(refresh()),m_canvasView,TQT_SLOT(reload())); + connect (this,TQT_SIGNAL(runItem()),m_canvasView,TQT_SLOT(execFirst())); KbfxSpinxToolButton *logout = new KbfxSpinxToolButton ( m_toolBarBot ); KbfxSpinxToolButton *lock = new KbfxSpinxToolButton ( m_toolBarBot ); @@ -200,8 +200,8 @@ KbfxSpinxMenuWidget::init() m_toolBarBot->addButton ( logout ); m_toolBarBot->addButton ( lock ); - connect ( logout,SIGNAL ( clicked() ),this , SLOT ( hideMenu() ) ); - connect ( lock ,SIGNAL ( clicked() ),this , SLOT ( hideMenu() ) ); + connect ( logout,TQT_SIGNAL ( clicked() ),this , TQT_SLOT ( hideMenu() ) ); + connect ( lock ,TQT_SIGNAL ( clicked() ),this , TQT_SLOT ( hideMenu() ) ); } @@ -232,36 +232,36 @@ KbfxSpinxMenuWidget::changeHeight (int het) void KbfxSpinxMenuWidget::createMask () { - QPixmap maskpng = ( *KbfxPlasmaPixmapProvider::pixmap ( "mask" ) ); - QImage rawimg = maskpng.convertToImage (); + TQPixmap tqmaskpng = ( *KbfxPlasmaPixmapProvider::pixmap ( "tqmask" ) ); + TQImage rawimg = tqmaskpng.convertToImage (); rawimg = rawimg.smoothScale ( ConfigInit ().m_userMenuWidth, ConfigInit ().m_userMenuHeight, - QImage::ScaleFree ); + TQ_ScaleFree ); - maskpng.convertFromImage ( rawimg ); + tqmaskpng.convertFromImage ( rawimg ); - setMinimumWidth ( maskpng.width () ); - setMinimumHeight ( maskpng.height () ); -// setMaximumWidth ( maskpng.width () ); -// setMaximumHeight ( maskpng.height () ); - if ( !maskpng.mask () ) + setMinimumWidth ( tqmaskpng.width () ); + setMinimumHeight ( tqmaskpng.height () ); +// setMaximumWidth ( tqmaskpng.width () ); +// setMaximumHeight ( tqmaskpng.height () ); + if ( !tqmaskpng.tqmask () ) if ( rawimg.hasAlphaBuffer () ) { - QBitmap bm; - bm = rawimg.createAlphaMask (); - maskpng.setMask ( bm ); + TQBitmap bm; + bm.convertFromImage(rawimg.createAlphaMask ()); + tqmaskpng.setMask ( bm ); } else { - QBitmap bm; - bm = rawimg.createHeuristicMask (); - // maskpng.setMask ( bm ); + TQBitmap bm; + bm.convertFromImage(rawimg.createHeuristicMask ()); + // tqmaskpng.setMask ( bm ); } - if ( maskpng.mask () && m_parent ) - m_parent->setMask ( *maskpng.mask () ); + if ( tqmaskpng.tqmask () && m_parent ) + m_parent->setMask ( *tqmaskpng.tqmask () ); } void @@ -271,7 +271,7 @@ KbfxSpinxMenuWidget::resizeContent () void KbfxSpinxMenuWidget::loadHistory () { - QStringList::Iterator it; + TQStringList::Iterator it; for ( it = ConfigInit ().m_pluginsLeft.begin (); it != ConfigInit ().m_pluginsLeft.end (); ++it ) { @@ -294,7 +294,7 @@ KbfxSpinxMenuWidget::enterPressed () /* void -KbfxSpinxMenuWidget::propergateMove (QMouseEvent * me) +KbfxSpinxMenuWidget::propergateMove (TQMouseEvent * me) { } */ @@ -308,19 +308,19 @@ KbfxSpinxMenuWidget::hideMenu () /* void -KbfxSpinxMenuWidget::mouseMoveEvent (QMouseEvent * me) +KbfxSpinxMenuWidget::mouseMoveEvent (TQMouseEvent * me) { // m_listBox->setFocus(); } */ void -KbfxSpinxMenuWidget::loadPluginLeft ( QString name ) +KbfxSpinxMenuWidget::loadPluginLeft ( TQString name ) { if (name == NULL) { return; } - if ( m_loadedListLeft.contains ( name ) <= 0 ) + if ( m_loadedListLeft.tqcontains ( name ) <= 0 ) { m_loader = new KbfxPlasmaPluginLoader (); m_stack_R = m_loader->getView ( name ); @@ -342,9 +342,9 @@ KbfxSpinxMenuWidget::loadPluginLeft ( QString name ) } void -KbfxSpinxMenuWidget::loadPluginRight ( QString name ) +KbfxSpinxMenuWidget::loadPluginRight ( TQString name ) { -if ( m_loadedListRight.contains ( name ) <= 0 ) +if ( m_loadedListRight.tqcontains ( name ) <= 0 ) { m_loader = new KbfxPlasmaPluginLoader (); m_stack_R = m_loader->getView ( name ); @@ -367,28 +367,28 @@ if ( m_loadedListRight.contains ( name ) <= 0 ) /* void -KbfxSpinxMenuWidget::focusInEvent (QFocusEvent * te) +KbfxSpinxMenuWidget::focusInEvent (TQFocusEvent * te) { kdDebug() << "TODO: Handle Focus Event" << endl; } */ void -KbfxSpinxMenuWidget::keyPressEvent ( QKeyEvent * e ) +KbfxSpinxMenuWidget::keyPressEvent ( TQKeyEvent * e ) { - if ( e->key () == Qt::Key_Backspace ) + if ( e->key () == TQt::Key_Backspace ) { m_search->backspace (); return; } - else if ( e->key () == Qt::Key_Escape ) + else if ( e->key () == TQt::Key_Escape ) { hideMenu (); return; } - else if ( e->key() == Qt::Key_Return ) + else if ( e->key() == TQt::Key_Return ) { hideMenu (); m_canvasView->setFocus (); @@ -396,77 +396,77 @@ KbfxSpinxMenuWidget::keyPressEvent ( QKeyEvent * e ) return; } - else if ( e->key () == Qt::Key_Up ) + else if ( e->key () == TQt::Key_Up ) { m_search->setFocus (); return; } - else if ( e->key () == Qt::Key_Down ) + else if ( e->key () == TQt::Key_Down ) { m_canvasView->setFocus (); return; } - else if ( e->key () == Qt::Key_Control - || e->key () == Qt::Key_Alt - || e->key () == Qt::Key_Pause - || e->key () == Qt::Key_Print - || e->key () == Qt::Key_SysReq - || e->key () == Qt::Key_Meta - || e->key () == Qt::Key_CapsLock - || e->key () == Qt::Key_NumLock - || e->key () == Qt::Key_ScrollLock - || e->key () == Qt::Key_F1 - || e->key () == Qt::Key_F2 - || e->key () == Qt::Key_F3 - || e->key () == Qt::Key_F4 - || e->key () == Qt::Key_F5 - || e->key () == Qt::Key_F6 - || e->key () == Qt::Key_F7 - || e->key () == Qt::Key_F8 - || e->key () == Qt::Key_F9 - || e->key () == Qt::Key_F10 - || e->key () == Qt::Key_F11 - || e->key () == Qt::Key_F12 - || e->key () == Qt::Key_F13 - || e->key () == Qt::Key_F14 - || e->key () == Qt::Key_F15 - || e->key () == Qt::Key_F16 - || e->key () == Qt::Key_F17 - || e->key () == Qt::Key_F18 - || e->key () == Qt::Key_F19 - || e->key () == Qt::Key_F20 - || e->key () == Qt::Key_Super_L - || e->key () == Qt::Key_Super_R - || e->key () == Qt::Key_Menu - || e->key () == Qt::Key_Hyper_L - || e->key () == Qt::Key_Hyper_R - || e->key () == Qt::Key_Help - || e->key () == Qt::Key_Back - || e->key () == Qt::Key_Forward - || e->key () == Qt::Key_Stop - || e->key () == Qt::Key_Refresh - || e->key () == Qt::Key_VolumeDown - || e->key () == Qt::Key_VolumeMute - || e->key () == Qt::Key_VolumeUp - || e->key () == Qt::Key_BassBoost - || e->key () == Qt::Key_BassUp - || e->key () == Qt::Key_BassDown - || e->key () == Qt::Key_TrebleUp - || e->key () == Qt::Key_TrebleDown - || e->key () == Qt::Key_MediaPlay - || e->key () == Qt::Key_MediaStop - || e->key () == Qt::Key_MediaPrev - || e->key () == Qt::Key_MediaNext - || e->key () == Qt::Key_MediaRecord - || e->key () == Qt::Key_HomePage - || e->key () == Qt::Key_Favorites - || e->key () == Qt::Key_Search - || e->key () == Qt::Key_Standby - || e->key () == Qt::Key_OpenUrl - || e->key () == Qt::Key_LaunchMail - || e->key () == Qt::Key_LaunchMedia + else if ( e->key () == TQt::Key_Control + || e->key () == TQt::Key_Alt + || e->key () == TQt::Key_Pause + || e->key () == TQt::Key_Print + || e->key () == TQt::Key_SysReq + || e->key () == TQt::Key_Meta + || e->key () == TQt::Key_CapsLock + || e->key () == TQt::Key_NumLock + || e->key () == TQt::Key_ScrollLock + || e->key () == TQt::Key_F1 + || e->key () == TQt::Key_F2 + || e->key () == TQt::Key_F3 + || e->key () == TQt::Key_F4 + || e->key () == TQt::Key_F5 + || e->key () == TQt::Key_F6 + || e->key () == TQt::Key_F7 + || e->key () == TQt::Key_F8 + || e->key () == TQt::Key_F9 + || e->key () == TQt::Key_F10 + || e->key () == TQt::Key_F11 + || e->key () == TQt::Key_F12 + || e->key () == TQt::Key_F13 + || e->key () == TQt::Key_F14 + || e->key () == TQt::Key_F15 + || e->key () == TQt::Key_F16 + || e->key () == TQt::Key_F17 + || e->key () == TQt::Key_F18 + || e->key () == TQt::Key_F19 + || e->key () == TQt::Key_F20 + || e->key () == TQt::Key_Super_L + || e->key () == TQt::Key_Super_R + || e->key () == TQt::Key_Menu + || e->key () == TQt::Key_Hyper_L + || e->key () == TQt::Key_Hyper_R + || e->key () == TQt::Key_Help + || e->key () == TQt::Key_Back + || e->key () == TQt::Key_Forward + || e->key () == TQt::Key_Stop + || e->key () == TQt::Key_Refresh + || e->key () == TQt::Key_VolumeDown + || e->key () == TQt::Key_VolumeMute + || e->key () == TQt::Key_VolumeUp + || e->key () == TQt::Key_BassBoost + || e->key () == TQt::Key_BassUp + || e->key () == TQt::Key_BassDown + || e->key () == TQt::Key_TrebleUp + || e->key () == TQt::Key_TrebleDown + || e->key () == TQt::Key_MediaPlay + || e->key () == TQt::Key_MediaStop + || e->key () == TQt::Key_MediaPrev + || e->key () == TQt::Key_MediaNext + || e->key () == TQt::Key_MediaRecord + || e->key () == TQt::Key_HomePage + || e->key () == TQt::Key_Favorites + || e->key () == TQt::Key_Search + || e->key () == TQt::Key_Standby + || e->key () == TQt::Key_OpenUrl + || e->key () == TQt::Key_LaunchMail + || e->key () == TQt::Key_LaunchMedia ) { hideMenu (); @@ -475,7 +475,7 @@ KbfxSpinxMenuWidget::keyPressEvent ( QKeyEvent * e ) } /* - else if ( e->key() == Qt::Key_Alt ) + else if ( e->key() == TQt::Key_Alt ) { hideMenu (); m_canvasView->setFocus (); @@ -484,20 +484,20 @@ KbfxSpinxMenuWidget::keyPressEvent ( QKeyEvent * e ) } - else if ( e->key () == Qt::Key_Tab ) + else if ( e->key () == TQt::Key_Tab ) { // m_listBox->setFocus (); return; } - else if ( e->key () >= Qt::Key_0 && e->key () <= Qt::Key_9 ) + else if ( e->key () >= TQt::Key_0 && e->key () <= TQt::Key_9 ) { printf ( "%d \n", e->key () ); emit runItemAt ( e->key () ); return; } - else if ( e->key () == Qt::Key_Left ) + else if ( e->key () == TQt::Key_Left ) { m_canvasView->setFocus (); m_canvasView->emulatedKeyPress ( e ); |