From aa0726b20f398264f0a2abc60215be044b106f9c Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 17 May 2011 08:20:48 +0000 Subject: TQt4 port basket This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/basket@1232416 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/colorpicker.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/colorpicker.cpp') diff --git a/src/colorpicker.cpp b/src/colorpicker.cpp index 37049bb..52fe4c5 100644 --- a/src/colorpicker.cpp +++ b/src/colorpicker.cpp @@ -19,14 +19,14 @@ ***************************************************************************/ #include "colorpicker.h" -#include "qtimer.h" +#include "tqtimer.h" #include /// /// /** DektopColorPicker */ -/* From Qt documentation: +/* From TQt documentation: * " Note that only visible widgets can grab mouse input. * If isVisible() returns FALSE for a widget, that widget cannot call grabMouse(). " * So, we should use an always visible widget to be able to pick a color from screen, @@ -35,9 +35,9 @@ */ DesktopColorPicker::DesktopColorPicker() - : QDesktopWidget() + : TQDesktopWidget() { - setName("DesktopColorPicker"); + TQT_TQWIDGET(this)->setName("DesktopColorPicker"); m_gettingColorFromScreen = false; } @@ -49,14 +49,14 @@ void DesktopColorPicker::pickColor() { m_gettingColorFromScreen = true; // Global::mainContainer->setActive(false); - QTimer::singleShot( 50, this, SLOT(slotDelayedPick()) ); + TQTimer::singleShot( 50, this, TQT_SLOT(slotDelayedPick()) ); } /* When firered from basket context menu, and not from menu, grabMouse doesn't work! * It's perhapse because context menu call slotColorFromScreen() and then * ungrab the mouse (since menus grab the mouse). * But why isn't there such bug with normal menus?... - * By calling this method with a QTimer::singleShot, we are sure context menu code is + * By calling this method with a TQTimer::singleShot, we are sure context menu code is * finished and we can grab the mouse without loosing the grab: */ void DesktopColorPicker::slotDelayedPick() @@ -67,30 +67,30 @@ void DesktopColorPicker::slotDelayedPick() /* Validate the color */ -void DesktopColorPicker::mouseReleaseEvent(QMouseEvent *event) +void DesktopColorPicker::mouseReleaseEvent(TQMouseEvent *event) { if (m_gettingColorFromScreen) { m_gettingColorFromScreen = false; releaseMouse(); releaseKeyboard(); - QColor color = KColorDialog::grabColor(event->globalPos()); + TQColor color = KColorDialog::grabColor(event->globalPos()); emit pickedColor(color); } else - QDesktopWidget::mouseReleaseEvent(event); + TQDesktopWidget::mouseReleaseEvent(event); } /* Cancel the mode */ -void DesktopColorPicker::keyPressEvent(QKeyEvent *event) +void DesktopColorPicker::keyPressEvent(TQKeyEvent *event) { if (m_gettingColorFromScreen) - if (event->key() == Qt::Key_Escape) { + if (event->key() == TQt::Key_Escape) { m_gettingColorFromScreen = false; releaseMouse(); releaseKeyboard(); emit canceledPick(); } - QDesktopWidget::keyPressEvent(event); + TQDesktopWidget::keyPressEvent(event); } #include "colorpicker.moc" -- cgit v1.2.1