28 #include <QMainWindow>
49 if (c >=
'A' && c <=
'Z')
51 if (c >=
'a' && c <=
'z')
53 if (c >=
'A' && c <=
'Z')
54 return QKeySequence (keyMod | static_cast<int> (c));
57 return QKeySequence ();
70 return new Menu (go,
new QAction (qObj), parent_obj);
77 :
Object (go, action), m_parent (0), m_separator (0)
85 action->setCheckable (
true);
117 foreach (QAction* a,
m_parent->actions ())
118 if (! a->isSeparator () && a->objectName () !=
"builtinMenu")
121 (
octave_value (static_cast<double> (count)),
true,
false);
129 foreach (QAction* a,
m_parent->actions ())
130 if (! a->isSeparator () && a->objectName () !=
"builtinMenu")
142 m_parent->insertAction (before, action);
148 (
octave_value (static_cast<double> (count+1)),
true,
false);
152 connect (action, SIGNAL (triggered (
bool)), SLOT (
actionTriggered (
void)));
163 QAction* action = qWidget<QAction> ();
174 action->setCheckable (
true);
179 action->setChecked (
false);
180 action->setCheckable (
false);
189 if (! action->menu ())
233 foreach (QAction* a,
m_parent->actions ())
234 if (! a->isSeparator () && a->objectName () !=
"builtinMenu")
248 m_parent->insertAction (before, action);
263 QAction* action = qWidget<QAction> ();
264 QMenu* _menu = action->menu ();
268 _menu =
new QMenu (action->parentWidget ());
269 action->setMenu (_menu);
270 action->setShortcut (QKeySequence ());
271 connect (_menu, SIGNAL (aboutToShow (
void)),
281 QAction* action = qWidget<QAction> ();
283 if (action->isCheckable ())
284 action->setChecked (! action->isChecked ());
301 foreach (QAction* a,
m_parent->actions ())
303 if (! a->isSeparator () && a->objectName () !=
"builtinMenu")
313 if (go.
isa (
"uimenu"))
static void post_callback(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
bool is_visible(void) const
bool isa(const std::string &go_name) const
QString fromStdString(const std::string &s)
static Object * parentObject(const graphics_object &go)
static Menu * create(const graphics_object &go)
Menu(const graphics_object &go, QAction *action, Object *parent)
bool set(const octave_value &val, bool do_run=true, bool do_notify_toolkit=true)
static Object * fromQObject(QObject *obj)
void updateSiblingPositions(void)
virtual QObject * qObject(void)
graphics_object object(void) const
virtual void update(int pId)
void actionTriggered(void)
static QKeySequence accelSequence(const uimenu::properties &up)
virtual QWidget * menu(void)=0