summaryrefslogtreecommitdiffabout
path: root/qtcompat/qtooltipcompat.cpp
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (side-by-side diff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /qtcompat/qtooltipcompat.cpp
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'qtcompat/qtooltipcompat.cpp') (more/less context) (show whitespace changes)
-rw-r--r--qtcompat/qtooltipcompat.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/qtcompat/qtooltipcompat.cpp b/qtcompat/qtooltipcompat.cpp
new file mode 100644
index 0000000..a2de608
--- a/dev/null
+++ b/qtcompat/qtooltipcompat.cpp
@@ -0,0 +1,42 @@
+
+
+/******
+ *
+ * rob's QToolTip class
+ *
+ * Apparently Sharp concluded that ToolTips were not useful on the Zaurus and
+ * left them out of their Qtopia. Unfortunately, QWhatsThis uses the
+ * QToolTips::palette(), that function returns all 0's, and that means that
+ * QWhatsThis windows come up with black background and black foreground. By
+ * re-implementing this class, QWhatsThis calls this QToolTip::palette(), and
+ * gets a useful result.
+ *
+ * Include this class in your own Zaurus application and QWhatsThis should work
+ * for you as well.
+ *
+ * The contents of this file are released without restriction to the public
+ * domain.
+ *
+ * Copyright (c) rob miller October, 2003
+ *
+ *****/
+#ifdef ADD_TOOLTIP
+
+#include "qtooltipcompat.h"
+QPalette QToolTip::palette() {
+ static bool init = false;
+ static QPalette pt;
+ if (! init) { // only initialise once
+ init=true;
+ //rDebug("initialising my qtt-palette()"); //rDebug() is just qDebug() with a compile switch
+ QColor fg = QColor(0x00,0x00,0x00);
+ QColor bg = QColor(0xff,0xff,0xdc);
+
+ pt.setColor(QColorGroup::Background,bg);
+ pt.setBrush(QColorGroup::Foreground,fg);
+ }
+
+ return pt;
+}
+#endif
+