KVIrc  4.9.2
DeveloperAPIs
KviTalToolTip.h
Go to the documentation of this file.
1 #ifndef _KVI_TAL_TOOLTIP_H_
2 #define _KVI_TAL_TOOLTIP_H_
3 
4 //=============================================================================
5 //
6 // File : KviTalToolTip.h
7 // Creation date : Mon May 05 2008 11:25:08 by Alessandro Carbone
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2008 Alessandro Carbone (elfonol at gmail dot com)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 #include "kvi_settings.h"
29 
30 #include <QToolTip>
31 #include <QObject>
32 
33 class KviTalToolTip;
34 
35 // This is useful only with Qt4, but we put it here anyway
36 // to have both a consistent API and make moc happy
37 class KviTalToolTipHelper : public QObject
38 {
39  friend class KviTalToolTip;
40  Q_OBJECT
41 public:
42  KviTalToolTipHelper(KviTalToolTip * pToolTip, QWidget * pWidget);
44 
45 protected:
47 
48 protected:
49  virtual bool eventFilter(QObject * pObject, QEvent * pEvent);
50  void toolTipDying();
51 };
52 
54 {
55  friend class KviTalToolTipHelper;
56 
57 public:
58  KviTalToolTip(QWidget * pParent);
59  virtual ~KviTalToolTip();
60 
61 protected:
63  QWidget * m_pParent;
64 
65 public:
66  static void add(QWidget * widget, const QString & text);
67  static void remove(QWidget * widget);
68  virtual void tip(const QRect & rect, const QString & text);
69 
70 protected:
71  virtual void maybeTip(const QPoint & p);
72  void helperDying();
73 };
74 
75 #endif // _KVI_TAL_TOOLTIP_H_
~KviTalToolTipHelper()
Definition: KviTalToolTip.cpp:37
virtual bool eventFilter(QObject *pObject, QEvent *pEvent)
Definition: KviTalToolTip.cpp:51
KviTalToolTipHelper * m_pHelper
Definition: KviTalToolTip.h:62
friend class KviTalToolTip
Definition: KviTalToolTip.h:39
Definition: KviTalToolTip.h:53
QWidget * m_pParent
Definition: KviTalToolTip.h:63
void toolTipDying()
Definition: KviTalToolTip.cpp:46
KviTalToolTip * m_pToolTip
Definition: KviTalToolTip.h:46
Definition: KviTalToolTip.h:37
This file contains compile time settings.
#define p
Definition: detector.cpp:80
#define KVILIB_API
Definition: kvi_settings.h:125
KviTalToolTipHelper(KviTalToolTip *pToolTip, QWidget *pWidget)
Definition: KviTalToolTip.cpp:30