diff options
author | Michele Calgaro <[email protected]> | 2023-07-22 23:33:11 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2023-07-22 23:33:11 +0900 |
commit | 7665c8d3f798aaf287ff14a35af74d9c303cb20c (patch) | |
tree | 00fd812583eed65f80d269255e8b662c90d1ddc7 /src/kommando.cpp | |
parent | 100a40e71a3f796a93675f9940c42ebe6429740e (diff) | |
download | kommando-7665c8d3f798aaf287ff14a35af74d9c303cb20c.tar.gz kommando-7665c8d3f798aaf287ff14a35af74d9c303cb20c.zip |
Raw Qt->TQt conversion using tde/scripts/conversions/qt3-tqt3/convert_existing_qt3_app_to_tq
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/kommando.cpp')
-rw-r--r-- | src/kommando.cpp | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/kommando.cpp b/src/kommando.cpp index e4abda2..2459af1 100644 --- a/src/kommando.cpp +++ b/src/kommando.cpp @@ -27,9 +27,9 @@ #include "configuration.h" Kommando::Kommando() - : QWidget( 0, "Kommando", Qt::WDestructiveClose | - Qt::WStyle_Customize | - Qt::WStyle_NoBorder), + : TQWidget( 0, "Kommando", TQt::WDestructiveClose | + TQt::WStyle_Customize | + TQt::WStyle_NoBorder), actMenu(0), navbutton(this), oldNavbuttonIconType(0) @@ -57,8 +57,8 @@ void Kommando::show( ) int rep_rootx, rep_rooty; unsigned int rep_mask; int mousex, mousey; - Display* dpy = qt_xdisplay(); - Window win = qt_xrootwin(); + Display* dpy = tqt_xdisplay(); + Window win = tqt_xrootwin(); XClassHint hint; hint.res_class = 0; @@ -84,16 +84,16 @@ void Kommando::show( ) move(mousex-config.menuRadius(),mousey-config.menuRadius()); //get the part of the screen the widget is drawn onto and apply a fade effect to it - mScreenshot = QPixmap::grabWindow( qt_xrootwin(), x(), y(), width(), height() ); + mScreenshot = TQPixmap::grabWindow( tqt_xrootwin(), x(), y(), width(), height() ); KPixmapEffect::fade( mScreenshot, config.opacity(), config.tintColor() ); - QWidget::show(); + TQWidget::show(); } void Kommando::hide( ) { selectButton(BUTTON_DESELECT); - QWidget::hide(); + TQWidget::hide(); } void Kommando::toggle( ) @@ -128,7 +128,7 @@ void Kommando::setActMenu( Menu * newMenu ) actMenu = newMenu; } -void Kommando::setActTopLevelMenu(const QString& appName ) +void Kommando::setActTopLevelMenu(const TQString& appName ) { Menu* menu = 0; for(Menu* it = mTopLevelMenus.first(); it != 0; it = mTopLevelMenus.next()){ @@ -136,15 +136,15 @@ void Kommando::setActTopLevelMenu(const QString& appName ) menu = it; break; } - //get a default menu, assume that a toplevel menu with QString::null or "default" as appname is one - if ((it->appName() == QString::null) || (it->appName() == "default")){ + //get a default menu, assume that a toplevel menu with TQString::null or "default" as appname is one + if ((it->appName() == TQString::null) || (it->appName() == "default")){ menu = it; } } setActMenu(menu); } -void Kommando::setTopLevelMenus( const QPtrList<Menu>& newmenus ) +void Kommando::setTopLevelMenus( const TQPtrList<Menu>& newmenus ) { setActMenu(0); //No need to clear the list, because autoDelete is turned on in @@ -160,13 +160,13 @@ void Kommando::windowActivationChange( bool oldActive ) } } -void Kommando::paintEvent( QPaintEvent * evt ) +void Kommando::paintEvent( TQPaintEvent * evt ) { - QPainter p(this); + TQPainter p(this); p.drawPixmap(evt->rect().topLeft(),mScreenshot,evt->rect()); } -void Kommando::wheelEvent( QWheelEvent * evt ) +void Kommando::wheelEvent( TQWheelEvent * evt ) { actMenu->selectButton(actMenu->selectedButtonNum()+evt->delta()/120); } @@ -223,36 +223,36 @@ void Kommando::slotButtonSelected( int type ) } } -void Kommando::keyPressEvent( QKeyEvent * evt ) +void Kommando::keyPressEvent( TQKeyEvent * evt ) { switch(evt->key()){ - case Qt::Key_Left: + case TQt::Key_Left: actMenu->selectButton(actMenu->selectedButtonNum()-1); break; - case Qt::Key_Right: + case TQt::Key_Right: actMenu->selectButton(actMenu->selectedButtonNum()+1); break; - case Qt::Key_Return: + case TQt::Key_Return: slotNavClick(); break; - case Qt::Key_Escape: + case TQt::Key_Escape: if(mTopLevelMenus.containsRef(actMenu)){ hide(); } else { setActMenu(actMenu->parentMenu()); } break; - case Qt::Key_1: - case Qt::Key_2: - case Qt::Key_3: - case Qt::Key_4: - case Qt::Key_5: - case Qt::Key_6: - case Qt::Key_7: - case Qt::Key_8: - case Qt::Key_9: + case TQt::Key_1: + case TQt::Key_2: + case TQt::Key_3: + case TQt::Key_4: + case TQt::Key_5: + case TQt::Key_6: + case TQt::Key_7: + case TQt::Key_8: + case TQt::Key_9: //We want to get the number of the button, so treat the enum as number (yes I know, but it works fine :->) - actMenu->selectButton(evt->key() - Qt::Key_1); + actMenu->selectButton(evt->key() - TQt::Key_1); break; } } @@ -269,7 +269,7 @@ void Kommando::resize( ) Config& config = Config::getSingleton(); setFixedSize(config.menuSize(),config.menuSize()); //apply a circular mask - QRegion mask(rect(),QRegion::Ellipse); + TQRegion mask(rect(),TQRegion::Ellipse); setMask(mask); } @@ -279,14 +279,14 @@ void Kommando::selectButton( int num ) actMenu->selectButton(num); } -void Kommando::mousePressEvent(QMouseEvent* evt) +void Kommando::mousePressEvent(TQMouseEvent* evt) { - middleMouseButtonState = (evt->button() == Qt::MidButton); + middleMouseButtonState = (evt->button() == TQt::MidButton); } -void Kommando::mouseReleaseEvent(QMouseEvent* evt) +void Kommando::mouseReleaseEvent(TQMouseEvent* evt) { - if(middleMouseButtonState && (evt->button() == Qt::MidButton)){ + if(middleMouseButtonState && (evt->button() == TQt::MidButton)){ middleMouseButtonState = false; slotNavClick(); } |