23 #if defined (HAVE_CONFIG_H) 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 (nullptr), m_separator (nullptr)
85 action->setCheckable (
true);
86 action->setChecked (up.is_checked ());
89 action->setEnabled (up.is_enable ());
91 action->setVisible (up.is_visible ());
93 if (up.is_separator ())
107 int pos =
static_cast<int> (up.get_position ());
113 m_parent->insertAction (
nullptr, action);
117 foreach (QAction *
a,
m_parent->actions ())
118 if (!
a->isSeparator ())
122 (
octave_value (static_cast<double> (count)),
true,
false);
128 QAction *before =
nullptr;
130 foreach (QAction *
a,
m_parent->actions ())
132 if (!
a->isSeparator ())
145 m_parent->insertAction (before, action);
151 (
octave_value (static_cast<double> (count+1)),
true,
false);
155 connect (action, SIGNAL (triggered (
bool)), SLOT (
actionTriggered (
void)));
165 QAction *action = qWidget<QAction> ();
169 case uimenu::properties::ID_LABEL:
173 case uimenu::properties::ID_CHECKED:
174 if (up.is_checked ())
176 action->setCheckable (
true);
177 action->setChecked (up.is_checked ());
181 action->setChecked (
false);
182 action->setCheckable (
false);
186 case uimenu::properties::ID_ENABLE:
187 action->setEnabled (up.is_enable ());
190 case uimenu::properties::ID_ACCELERATOR:
191 if (! action->menu ())
195 case uimenu::properties::ID_SEPARATOR:
196 if (up.is_separator ())
215 case uimenu::properties::ID_VISIBLE:
216 action->setVisible (up.is_visible ());
221 case uimenu::properties::ID_POSITION:
228 int pos =
static_cast<int> (up.get_position ());
229 QAction *before =
nullptr;
235 foreach (QAction *
a,
m_parent->actions ())
237 if (!
a->isSeparator ())
252 m_parent->insertAction (before, action);
267 QAction *action = qWidget<QAction> ();
268 QMenu *_menu = action->menu ();
272 _menu =
new QMenu (action->parentWidget ());
273 action->setMenu (_menu);
274 action->setShortcut (QKeySequence ());
275 connect (_menu, SIGNAL (aboutToShow (
void)),
285 QAction *action = qWidget<QAction> ();
287 if (action->isCheckable ())
288 action->setChecked (! action->isChecked ());
305 foreach (QAction *
a,
m_parent->actions ())
307 if (!
a->isSeparator ())
317 if (go.
isa (
"uimenu"))
static void post_callback(const graphics_handle &h, const std::string &name, const octave_value &data=Matrix())
QString fromStdString(const std::string &s)
static Object * parentObject(const graphics_object &go)
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
bool isa(const std::string &go_name) const
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
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
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
virtual property get_property(const caseless_str &pname)