}
-bool Menu::searchFunc(FuncRequest & func, stack<docstring> & names)
+bool Menu::searchFunc(FuncRequest & func, stack<docstring> & names) const
{
const_iterator m = begin();
const_iterator m_end = end();
// search for func in this menu iteratively, and put menu
// names in a stack.
- bool searchFunc(FuncRequest & func, std::stack<docstring> & names);
+ bool searchFunc(FuncRequest & func, std::stack<docstring> & names) const;
private:
friend class MenuBackend;
#include <QFileOpenEvent>
#include <QLocale>
#include <QLibraryInfo>
+#include <QMenuBar>
#include <QPixmapCache>
#include <QRegExp>
#include <QSessionManager>
<< fromqstr(language_name));
#ifdef Q_WS_MACX
+ // all windows in a Mac application share the same menu bar.
+ QMenuBar *menuBar = new QMenuBar(0);
// This allows to translate the strings that appear in the LyX menu.
addMenuTranslator();
#endif
}
-GuiMenubar::~GuiMenubar() {
-#ifdef Q_WS_MACX
- delete mac_menubar_;
-#endif
-}
+GuiMenubar::~GuiMenubar() {}
void GuiMenubar::openByName(QString const & name)
{
void GuiMenubar::macxMenuBarInit()
{
- mac_menubar_ = new QMenuBar;
-
/* Since Qt 4.2, the qt/mac menu code has special code for
specifying the role of a menu entry. However, it does not
work very well with our scheme of creating menus on demand,
/// name to menu for openByName
NameMap name_map_;
-
- /// MACOS X special menubar.
- QMenuBar * mac_menubar_;
};
} // namespace frontend