31 #if defined (HAVE_CONFIG_H)
35 #include <QDockWidget>
52 = add_action (
nullptr, rmgr.
icon (
"window-close",
false),
53 tr (
"&Close"), SLOT (request_close ()),
this);
56 = add_action (
nullptr, rmgr.
icon (
"window-close",
false),
57 tr (
"Close &All"), SLOT (request_close_all ()),
this);
60 = add_action (
nullptr, rmgr.
icon (
"window-close",
false),
61 tr (
"Close &Other"), SLOT (request_close_other ()),
this);
64 = add_action (
nullptr, QIcon (), tr (
"Switch to &Left Widget"),
65 SLOT (request_switch_left ()),
this);
68 = add_action (
nullptr, QIcon (), tr (
"Switch to &Right Widget"),
69 SLOT (request_switch_right ()),
this);
72 m_actions_list << m_close_action;
73 m_actions_list << m_close_others_action;
74 m_actions_list << m_close_all_action;
75 m_actions_list << m_switch_left_action;
76 m_actions_list << m_switch_right_action;
89 QMenu *menu = QMainWindow::createPopupMenu ();
92 if (actions.length () > 0)
94 QAction *sep = menu->insertSeparator (actions.at (0));
95 menu->insertActions (sep, new_actions);
98 menu->addActions (new_actions);
105 const QString& text,
const char *member,
111 if (receiver !=
nullptr)
115 a = menu->addAction (icon, text,
r, member);
118 a =
new QAction (icon, text,
this);
119 a->setEnabled (
true);
120 connect (a, SIGNAL (triggered ()),
r, member);
124 a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
147 for (
int i = 0; i <
m_dw_list.length (); i++)
162 for (
int i =
m_dw_list.length () - 1; i >= 0; i--)
172 for (
int i =
m_dw_list.length () - 1; i >= 0; i--)
191 int active = -1,
next;
193 for (
int i =
m_dw_list.length () - 1; i >= 0; i--)
205 if (direction == -1 && active == 0)
207 else if (direction == 1 && active ==
m_dw_list.length () - 1)
210 next = active + direction;
220 if (ev->type () == QEvent::ChildAdded
221 || ev->type () == QEvent::ChildRemoved)
226 m_dw_list = findChildren<QDockWidget *>();
229 if (ev->type () == QEvent::StyleChange)
233 for (
int i =
m_dw_list.length () - 1; i >= 0; i--)
245 return QMainWindow::event (ev);
Base class for Octave interfaces that use Qt.
shortcut_manager & get_shortcut_manager(void)
virtual QMenu * createPopupMenu()
void request_switch_left()
QAction * m_close_others_action
QAction * add_action(QMenu *menu, const QIcon &icon, const QString &text, const char *member, QWidget *receiver)
QAction * m_switch_left_action
QList< QDockWidget * > m_dw_list
QAction * m_close_all_action
void notice_settings(const gui_settings *)
base_qobject & m_octave_qobj
void request_switch_right()
QAction * m_switch_right_action
void request_switch(int direction)
virtual bool event(QEvent *ev)
QList< QAction * > m_actions_list
void request_close_other()
gui_settings * get_settings(void) const
QIcon icon(const QString &icon_name, bool octave_only=false, const QString &icon_alt_name=QString())
void set_shortcut(QAction *action, const sc_pref &scpref, bool enable=true)
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
const sc_pref sc_edit_file_close(sc_edit_file_cl, QKeySequence::Close)
const sc_pref sc_edit_file_close_other(sc_edit_file_cl+"_other", QKeySequence::UnknownKey)
const sc_pref sc_edit_file_close_all(sc_edit_file_cl+"_all", QKeySequence::UnknownKey)
const sc_pref sc_edit_tabs_switch_right_tab(sc_edit_tabs+":switch_right_tab", CTRL+Qt::Key_PageDown)
const sc_pref sc_edit_tabs_switch_left_tab(sc_edit_tabs+":switch_left_tab", CTRL+Qt::Key_PageUp)