krita
squeezedcombobox.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00023 #ifndef SQUEEZEDCOMBOBOX_H
00024 #define SQUEEZEDCOMBOBOX_H
00025
00026 class QTimer;
00027
00028
00029
00030 #include <qcombobox.h>
00031 #include <qtooltip.h>
00032
00033 class SqueezedComboBox;
00034
00044 class SqueezedComboBoxTip : public QToolTip
00045 {
00046 public:
00057 SqueezedComboBoxTip( QWidget *parent, SqueezedComboBox *name );
00058
00059 protected:
00065 void maybeTip( const QPoint& pos );
00066
00067 private:
00068 SqueezedComboBox* m_originalWidget;
00069 };
00070
00082 class SqueezedComboBox : public QComboBox
00083 {
00084 Q_OBJECT
00085
00086 public:
00092 SqueezedComboBox(QWidget *parent = 0, const char *name = 0 );
00093
00097 virtual ~SqueezedComboBox();
00098
00099 bool contains(const QString & text) const;
00100
00109 void insertSqueezedItem(const QString& newItem, int index);
00110
00116 QString itemHighlighted( );
00117
00121 virtual QSize sizeHint() const;
00122
00123 private slots:
00124 void slotTimeOut();
00125 void slotUpdateToolTip( int index );
00126
00127 private:
00128 void resizeEvent ( QResizeEvent * );
00129 QString squeezeText( const QString& original);
00130
00131 QMap<int,QString> m_originalItems;
00132 QTimer* m_timer;
00133 SqueezedComboBoxTip* m_tooltip;
00134 };
00135
00136 #endif // SQUEEZEDCOMBOBOX_H
|