31 #if defined (HAVE_CONFIG_H)
35 #include <QDockWidget>
65 =
add_action (
nullptr, QIcon (), tr (
"Switch to &Left Widget"),
69 =
add_action (
nullptr, QIcon (), tr (
"Switch to &Right Widget"),
91 QMenu *menu = QMainWindow::createPopupMenu ();
94 if (actions.length () > 0)
96 QAction *sep = menu->insertSeparator (actions.at (0));
97 menu->insertActions (sep, new_actions);
100 menu->addActions (new_actions);
108 const QString&
text,
const char *member,
114 if (receiver !=
nullptr)
118 a = menu->addAction (icon,
text,
r, member);
121 a =
new QAction (icon,
text,
this);
122 a->setEnabled (
true);
123 connect (a, SIGNAL (triggered ()),
r, member);
127 a->setShortcutContext (Qt::WidgetWithChildrenShortcut);
151 for (
int i = 0; i <
m_dw_list.length (); i++)
166 for (
int i =
m_dw_list.length () - 1; i >= 0; i--)
176 for (
int i =
m_dw_list.length () - 1; i >= 0; i--)
195 int active = -1,
next;
197 for (
int i =
m_dw_list.length () - 1; i >= 0; i--)
209 if (direction == -1 && active == 0)
211 else if (direction == 1 && active ==
m_dw_list.length () - 1)
214 next = active + direction;
225 if (ev->type () == QEvent::ChildAdded
226 || ev->type () == QEvent::ChildRemoved)
231 m_dw_list = findChildren<QDockWidget *>();
234 if (ev->type () == QEvent::StyleChange)
238 for (
int i =
m_dw_list.length () - 1; i >= 0; i--)
250 return QMainWindow::event (ev);
Base class for Octave interfaces that use Qt.
resource_manager & get_resource_manager(void)
shortcut_manager & get_shortcut_manager(void)
QAction * m_switch_left_action
QAction * m_close_all_action
QList< QAction * > m_actions_list
base_qobject & m_octave_qobj
QAction * add_action(QMenu *menu, const QIcon &icon, const QString &text, const char *member, QWidget *receiver)
void request_switch_left()
void request_switch(int direction)
virtual QMenu * createPopupMenu()
void request_close_other()
QAction * m_close_others_action
void request_switch_right()
dw_main_window(base_qobject &oct_qboj, QWidget *parent=nullptr)
QList< QDockWidget * > m_dw_list
void notice_settings(const gui_settings *)
virtual bool event(QEvent *ev)
QAction * m_switch_right_action
gui_settings * get_settings(void) const
QIcon icon(const QString &icon_name, bool fallback=true)
void set_shortcut(QAction *action, const sc_pref &scpref)
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)