Fix compilation of Menubar for Windows CE.
Use QApplicationPrivate::getHWNDForWidget for getting the HWND for Widgets. The Menubar needs refactoring, but the API for native Menubars is not in place yet, so fix it temporarily. Change-Id: I090cca99d19aa881c2f41b54005a65f3ae67ae68 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>bb10
parent
c85eeaec7c
commit
22e0948bc3
|
|
@ -377,7 +377,8 @@ void QMenuBarPrivate::wceCreateMenuBar(QWidget *parent)
|
|||
Q_Q(QMenuBar);
|
||||
wce_menubar = new QWceMenuBarPrivate(this);
|
||||
|
||||
wce_menubar->parentWindowHandle = parent ? parent->winId() : q->winId();
|
||||
wce_menubar->parentWindowHandle = parent ? QApplicationPrivate::getHWNDForWidget(parent) :
|
||||
QApplicationPrivate::getHWNDForWidget(q);
|
||||
wce_menubar->leftButtonAction = defaultAction;
|
||||
|
||||
wce_menubar->menubarHandle = qt_wce_create_menubar(wce_menubar->parentWindowHandle, (HINSTANCE)qWinAppInst(), 0, SHCMBF_EMPTYBAR);
|
||||
|
|
@ -547,7 +548,8 @@ void QMenuBarPrivate::_q_updateDefaultAction()
|
|||
void QMenuBarPrivate::QWceMenuBarPrivate::rebuild()
|
||||
{
|
||||
d->q_func()->resize(0,0);
|
||||
parentWindowHandle = d->q_func()->parentWidget() ? d->q_func()->parentWidget()->winId() : d->q_func()->winId();
|
||||
parentWindowHandle = d->q_func()->parentWidget() ? QApplicationPrivate::getHWNDForWidget(d->q_func()->parentWidget()) :
|
||||
QApplicationPrivate::getHWNDForWidget(d->q_func());
|
||||
if (d->wceClassicMenu) {
|
||||
QList<QAction*> actions = d->actions;
|
||||
int maxEntries;
|
||||
|
|
|
|||
|
|
@ -784,7 +784,6 @@ QMenuBar::~QMenuBar()
|
|||
d->platformMenuBar = 0;
|
||||
|
||||
#ifdef Q_OS_WINCE
|
||||
Q_D(QMenuBar);
|
||||
if (qt_wince_is_mobile())
|
||||
d->wceDestroyMenuBar();
|
||||
#endif
|
||||
|
|
@ -1244,8 +1243,9 @@ void QMenuBar::actionEvent(QActionEvent *e)
|
|||
d->itemsDirty = true;
|
||||
|
||||
if (d->platformMenuBar) {
|
||||
#if !defined(Q_OS_WINCE)
|
||||
QPlatformMenuBar *nativeMenuBar = d->platformMenuBar;
|
||||
#if defined(Q_OS_WINCE)
|
||||
#else
|
||||
QMenuBarPrivate::QWceMenuBarPrivate *nativeMenuBar = d->wce_menubar;
|
||||
#endif
|
||||
if (!nativeMenuBar)
|
||||
|
|
|
|||
|
|
@ -168,6 +168,7 @@ public:
|
|||
|
||||
QWceMenuBarPrivate(QMenuBarPrivate *menubar);
|
||||
~QWceMenuBarPrivate();
|
||||
void addAction(QAction *, QAction *);
|
||||
void addAction(QAction *, QWceMenuAction* =0);
|
||||
void addAction(QWceMenuAction *, QWceMenuAction* =0);
|
||||
void syncAction(QWceMenuAction *);
|
||||
|
|
|
|||
Loading…
Reference in New Issue