KVIrc  4.9.2
DeveloperAPIs
KviTalListWidget.h
Go to the documentation of this file.
1 #ifndef _KVI_TAL_LISTWIDGET_H_
2 #define _KVI_TAL_LISTWIDGET_H_
3 
4 //=============================================================================
5 //
6 // File : KviTalListWidget.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"
30 
31 #include <QListWidget>
32 
34 
35 class KVILIB_API KviTalListWidget : public QListWidget
36 {
37  Q_OBJECT
38 public:
39  KviTalListWidget(QWidget * pParent, QString name, Qt::WindowType f = Qt::Widget);
40  KviTalListWidget(QWidget * pParent)
41  : QListWidget(pParent){};
42  virtual ~KviTalListWidget(){};
43 
44 protected:
45  virtual bool event(QEvent * e);
46  virtual bool eventFilter(QObject * o, QEvent * e);
47 signals:
48  void tipRequest(QListWidgetItem *, const QPoint &);
49 };
50 
51 class KVILIB_API KviTalListWidgetItem : public QListWidgetItem
52 {
53 public:
55  : QListWidgetItem(){};
57  : QListWidgetItem(pParent){};
58  KviTalListWidgetItem(KviTalListWidget * pParent, QString & label)
59  : QListWidgetItem(label, pParent){};
60  KviTalListWidget * listWidget() { return (KviTalListWidget *)QListWidgetItem::listWidget(); };
61  virtual ~KviTalListWidgetItem(){};
62 };
63 
65 {
66 public:
67  KviTalListWidgetText(KviTalListWidget * listbox, const QString & text = QString());
68  KviTalListWidgetText(const QString & text = QString());
70 
71  int height(const KviTalListWidget *) const;
72  int width(const KviTalListWidget *) const;
73 
74  int rtti() const;
75  enum
76  {
77  RTTI = 1
78  };
79 
80 protected:
81  virtual void paint(QPainter *);
82 
83 private:
84  Q_DISABLE_COPY(KviTalListWidgetText)
85 };
86 
88 {
89 public:
90  KviTalListWidgetPixmap(KviTalListWidget * listbox, const QPixmap &);
91  KviTalListWidgetPixmap(const QPixmap &);
92  KviTalListWidgetPixmap(KviTalListWidget * listbox, const QPixmap &, const QString &);
93  KviTalListWidgetPixmap(const QPixmap &, const QString &);
95 
96  const QPixmap * pixmap() const { return &pm; }
97 
98  int height(const KviTalListWidget *) const;
99  int width(const KviTalListWidget *) const;
100 
101  int rtti() const;
102  enum
103  {
104  RTTI = 2
105  };
106 
107 protected:
108  virtual void paint(QPainter *);
109 
110 private:
111  Q_DISABLE_COPY(KviTalListWidgetPixmap)
112  QPixmap pm;
113 };
114 
115 #endif // _KVI_TAL_LISTWIDGET_H_
Definition: KviTalListWidget.h:35
KviTalListWidget(QWidget *pParent)
Definition: KviTalListWidget.h:40
Definition: KviTalListWidget.h:87
#define f
Definition: detector.cpp:70
Definition: KviTalListWidget.h:64
KviTalListWidgetItem()
Definition: KviTalListWidget.h:54
const QPixmap * pixmap() const
Definition: KviTalListWidget.h:96
#define e
Definition: detector.cpp:69
virtual ~KviTalListWidgetItem()
Definition: KviTalListWidget.h:61
#define o
Definition: detector.cpp:79
Definition: KviTalListWidget.h:51
QString name()
Definition: KviRuntimeInfo.cpp:655
virtual ~KviTalListWidget()
Definition: KviTalListWidget.h:42
KviTalListWidget * listWidget()
Definition: KviTalListWidget.h:60
Class for item delegates.
KviTalListWidgetItem(KviTalListWidget *pParent, QString &label)
Definition: KviTalListWidget.h:58
This file contains compile time settings.
KviTalListWidgetItem(KviTalListWidget *pParent)
Definition: KviTalListWidget.h:56
#define KVILIB_API
Definition: kvi_settings.h:125