26 #if defined (HAVE_CONFIG_H)
31 #include <QActionEvent>
32 #include <QApplication>
35 #include <QMainWindow>
53 pix.fill (Qt::transparent);
63 QAction *a = bar->addAction (empty_icon,
"Empty Toolbar");
65 a->setEnabled (
false);
82 return new ToolBar (oct_qobj, interp, go,
83 new QToolBar (parentWidget));
91 :
Object (oct_qobj, interp, go, bar), m_empty (nullptr), m_figure (nullptr)
95 bar->setFloatable (
false);
96 bar->setMovable (
false);
97 bar->setVisible (tp.is_visible ());
108 tp.get_tag () ==
"__default_toolbar__");
110 bar->installEventFilter (
this);
120 QToolBar *bar = qWidget<QToolBar> ();
124 case base_properties::ID_VISIBLE:
140 switch (xevent->type ())
142 case QEvent::ActionAdded:
143 case QEvent::ActionRemoved:
145 QActionEvent *ae =
dynamic_cast<QActionEvent *
> (xevent);
146 QToolBar *bar = qWidget<QToolBar> ();
150 if (xevent->type () == QEvent::ActionAdded)
152 if (bar->actions ().size () == 2)
153 QTimer::singleShot (0,
this, SLOT (
hideEmpty (
void)));
157 if (bar->actions ().size () == 1)
183 QToolBar *bar = qWidget<QToolBar> ();
static Object * parentObject(octave::interpreter &interp, const graphics_object &go)
static Object * fromQObject(QObject *obj)
virtual void update(int pId)
virtual QObject * qObject(void)
Base class for Octave interfaces that use Qt.
const QString global_toolbar_style("QToolBar {" "spacing-top: 0px;" "spacing-bottom: 0px;" "margin-top: 0px;" "margin-bottom: 0px;" "padding-top: 0px;" "padding-bottom: 0px;" "border-top: 0px;" "border-bottom: 0px;" "}")
static QIcon makeEmptyIcon(void)
static QAction * addEmptyAction(QToolBar *bar)