4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
20 // FIXME: this can go when we move to Qt 4.3
21 #define QT_VERSION_CHECK(major, minor, patch) ((major<<16)|(minor<<8)|(patch))
23 #if QT_VERSION >= QT_VERSION_CHECK(4, 2, 0)
24 #include <QWidgetAction>
31 * For holding an arbitrary set of icons.
33 #if QT_VERSION >= QT_VERSION_CHECK(4, 2, 0)
35 class IconPalette : public QWidgetAction {
38 IconPalette(QWidget * parent);
39 void addButton(QAction *);
40 QWidget * createWidget(QWidget * parent);
43 void setIconSize(const QSize &);
46 void iconSizeChanged(const QSize &);
48 QList<QAction *> actions_;
54 class IconPalette : public QWidget {
57 IconPalette(QWidget * parent);
58 void addButton(QAction *);
64 void triggered(QAction *);
68 void showEvent(QShowEvent * event);
69 void hideEvent(QHideEvent * event);
70 void paintEvent(QPaintEvent * event);
73 virtual void clicked(QAction *);
76 QGridLayout * layout_;
77 QList<QAction *> actions_;
80 #endif // QT_VERSION >= QT_VERSION_CHECK(4, 2, 0)
83 * Popup menu for a toolbutton.
84 * We need this to keep track whether
85 * it is necessary to enable/disable
88 class ButtonMenu : public QMenu {
91 ButtonMenu(const QString & title, QWidget * parent = 0 );
98 QList<QAction *> actions_;
102 } // namespace frontend
105 #endif // ICONPALETTE_H