28 #include <QActionEvent>
29 #include <QApplication>
32 #include <QMainWindow>
53 pix.fill (Qt::transparent);
58 QAction* a = bar->addAction (_empty,
"Empty Toolbar");
60 a->setEnabled (
false);
76 return new ToolBar (go,
new QToolBar (parentWidget));
83 :
Object (go, bar), m_empty (0), m_figure (0)
87 bar->setFloatable (
false);
88 bar->setMovable (
false);
99 bar->installEventFilter (
this);
110 QToolBar* bar = qWidget<QToolBar> ();
130 switch (xevent->type ())
132 case QEvent::ActionAdded:
133 case QEvent::ActionRemoved:
135 QActionEvent* ae =
dynamic_cast<QActionEvent*
> (xevent);
136 QToolBar* bar = qWidget<QToolBar> ();
140 if (xevent->type () == QEvent::ActionAdded)
142 if (bar->actions ().size () == 2)
143 QTimer::singleShot (0,
this, SLOT (
hideEmpty (
void)));
147 if (bar->actions ().size () == 1)
173 QToolBar* bar = qWidget<QToolBar> ();
bool is_visible(void) const
static Object * parentObject(const graphics_object &go)
static QAction * addEmptyAction(QToolBar *bar)
static Object * fromQObject(QObject *obj)
virtual QObject * qObject(void)
virtual void update(int pId)