summaryrefslogtreecommitdiffabout
path: root/qtcompat/qtooltipcompat.cpp
blob: a2de6088db0378d2bf0e678bd3ce8a7f380f4bb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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