Menus.cpp: QProxyStyle was introduced in Qt 4.6.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@37694 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2011-02-16 16:00:42 +00:00
parent cc07aa98fb
commit 92f86af54d

View File

@ -65,7 +65,9 @@
#include <QHash> #include <QHash>
#include <QList> #include <QList>
#include <QMenuBar> #include <QMenuBar>
#if QT_VERSION >= 0x040600
#include <QProxyStyle> #include <QProxyStyle>
#endif
#include <QString> #include <QString>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
@ -1225,7 +1227,7 @@ void Menu::Impl::populate(QMenu & qMenu, MenuDefinition const & menu)
} }
#ifdef Q_WS_WIN #if defined(Q_WS_WIN) && (QT_VERSION >= 0x040600)
class AlwaysMnemonicStyle : public QProxyStyle { class AlwaysMnemonicStyle : public QProxyStyle {
public: public:
int styleHint(StyleHint hint, const QStyleOption *opt = 0, const QWidget *widget = 0, int styleHint(StyleHint hint, const QStyleOption *opt = 0, const QWidget *widget = 0,
@ -1246,12 +1248,12 @@ Menu::Menu(GuiView * gv, QString const & name, bool top_level,
bool keyboard) bool keyboard)
: QMenu(gv), d(new Menu::Impl) : QMenu(gv), d(new Menu::Impl)
{ {
#ifdef Q_WS_WIN #if defined(Q_WS_WIN) && (QT_VERSION >= 0x040600)
if (keyboard) if (keyboard)
setStyle(new AlwaysMnemonicStyle); setStyle(new AlwaysMnemonicStyle);
#else #else
(void) keyboard; (void) keyboard;
#endif #endif
d->top_level_menu = top_level? new MenuDefinition : 0; d->top_level_menu = top_level? new MenuDefinition : 0;
d->view = gv; d->view = gv;