diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2014-04-11 14:20:48 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-04-11 16:15:01 +0300 |
commit | 89ce36fca455bf2babf3eae772ca21ce140cf16d (patch) | |
tree | 27b30b37643ebfe4615d7eb645b72cd42a4316cb | |
parent | a7353367b7d29eacc70ea960409e8eb682fe4e9c (diff) |
Fix PieMenu not showing in enterprise-gallery launcher demo.
The problem is that the root item doesn't get the correct size - or
any size for that matter - so it is never visible.
The fix for this is already in Qt 5.3 (see QTBUG-36938), but we can
still work around it for earlier versions with this fix.
Task-number: QTRD-3040
Change-Id: I38a5f793cf1cc07a758d9118c31bc3177a75da54
Reviewed-by: Samuli Piippo <samuli.piippo@digia.com>
Reviewed-by: Kalle Viironen <kalle.viironen@digia.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
-rw-r--r-- | basicsuite/shared/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/basicsuite/shared/main.cpp b/basicsuite/shared/main.cpp index 25c3cb4..d33b09c 100644 --- a/basicsuite/shared/main.cpp +++ b/basicsuite/shared/main.cpp @@ -25,6 +25,9 @@ #include <QtGui/QPalette> #include <QtCore/QRegExp> +#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0)) +#include <QtQuick/QQuickItem> +#endif #include <QtQuick/QQuickView> #include <QtQml/QQmlEngine> @@ -70,6 +73,11 @@ int main(int argc, char **argv) } QQuickView view; +#if (QT_VERSION < QT_VERSION_CHECK(5, 3, 0)) + // Ensure the width and height are valid because of QTBUG-36938. + QObject::connect(&view, SIGNAL(widthChanged(int)), view.contentItem(), SLOT(setWidth(int))); + QObject::connect(&view, SIGNAL(heightChanged(int)), view.contentItem(), SLOT(setHeight(int))); +#endif DummyEngine engine; view.rootContext()->setContextProperty("engine", &engine); |