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 <QList>
#include <QMenuBar>
#if QT_VERSION >= 0x040600
#include <QProxyStyle>
#endif
#include <QString>
#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 {
public:
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)
: QMenu(gv), d(new Menu::Impl)
{
#ifdef Q_WS_WIN
#if defined(Q_WS_WIN) && (QT_VERSION >= 0x040600)
if (keyboard)
setStyle(new AlwaysMnemonicStyle);
#else
#else
(void) keyboard;
#endif
#endif
d->top_level_menu = top_level? new MenuDefinition : 0;
d->view = gv;