summaryrefslogtreecommitdiffstats
path: root/src/colorpicker.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-17 08:20:48 +0000
commitaa0726b20f398264f0a2abc60215be044b106f9c (patch)
tree070fdbc19a1106cfdd7f651a8ce76bb1b89a513d /src/colorpicker.cpp
parentd3cf5b3e75aadc3b02d0b56f030d4c3f8c2c749d (diff)
downloadbasket-aa0726b20f398264f0a2abc60215be044b106f9c.tar.gz
basket-aa0726b20f398264f0a2abc60215be044b106f9c.zip
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
Diffstat (limited to 'src/colorpicker.cpp')
-rw-r--r--src/colorpicker.cpp24
1 files changed, 12 insertions, 12 deletions
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 <kcolordialog.h>
/// ///
/** 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"