diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-06-21 13:44:53 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-06-22 19:17:24 +0000 |
commit | ab3f016fb34b5ec0d62b8d3bf9bb6349eeea320d (patch) | |
tree | 8badb93af595c74dec1d494b1ecc2955d960fd9d /src/imports/platform/doc/src | |
parent | 373f30d86c4288e339f3bd8899061ec2f3eb269d (diff) |
Menu & MenuItem: use widgets as a fallback
This makes context menus available on Windows and KDE. One more reason
to keep the module experimental. In the long run, platforms should
implement QPA menus so that we can remove the undesired dependency.
Change-Id: Ifd2d1e92512a05a95d3e7e7e7c00d712e06ce0cb
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/imports/platform/doc/src')
-rw-r--r-- | src/imports/platform/doc/src/includes/widgets.qdocinc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/imports/platform/doc/src/includes/widgets.qdocinc b/src/imports/platform/doc/src/includes/widgets.qdocinc new file mode 100644 index 00000000..c89c3ca0 --- /dev/null +++ b/src/imports/platform/doc/src/includes/widgets.qdocinc @@ -0,0 +1,29 @@ +//! [1] +The Qt Labs Platform module uses Qt Widgets as a fallback on platforms that +do not have a native implementation available. Therefore, applications that +use types from the Qt Labs Platform module should link to QtWidgets and use +\l QApplication instead of \l QGuiApplication. + +To link against the QtWidgets library, add the following to your qmake project +file: + +\code +QT += widgets +\endcode + +Create an instance of \l QApplication in \c main(): + +\code +#include <QApplication> +#include <QQmlApplicationEngine> + +int main(int argc, char *argv[]) +{ + QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication app(argc, argv); + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); + return app.exec(); +} +\endcode +//! [1] |