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) (unidiff)
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) (ignore 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 @@
1
2
3/******
4 *
5 * rob's QToolTip class
6 *
7 * Apparently Sharp concluded that ToolTips were not useful on the Zaurus and
8 * left them out of their Qtopia. Unfortunately, QWhatsThis uses the
9 * QToolTips::palette(), that function returns all 0's, and that means that
10 * QWhatsThis windows come up with black background and black foreground. By
11 * re-implementing this class, QWhatsThis calls this QToolTip::palette(), and
12 * gets a useful result.
13 *
14 * Include this class in your own Zaurus application and QWhatsThis should work
15 * for you as well.
16 *
17 * The contents of this file are released without restriction to the public
18 * domain.
19 *
20 * Copyright (c) rob miller October, 2003
21 *
22 *****/
23#ifdef ADD_TOOLTIP
24
25#include "qtooltipcompat.h"
26QPalette QToolTip::palette() {
27 static bool init = false;
28 static QPalette pt;
29 if (! init) { // only initialise once
30 init=true;
31 //rDebug("initialising my qtt-palette()"); //rDebug() is just qDebug() with a compile switch
32 QColor fg = QColor(0x00,0x00,0x00);
33 QColor bg = QColor(0xff,0xff,0xdc);
34
35 pt.setColor(QColorGroup::Background,bg);
36 pt.setBrush(QColorGroup::Foreground,fg);
37 }
38
39 return pt;
40}
41#endif
42