summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets/styles/main.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-06-20 14:50:48 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-12-12 23:24:29 +0100
commit072ca960f517f0cdfcb768dcbeebba2212a6c21e (patch)
tree53a55ceb2be475dd5a7b1a0830b7d9b79b79a5a9 /examples/widgets/widgets/styles/main.cpp
parentda0e7457523a5c6867c2d9b9f0346167738f0323 (diff)
styles example: Set default style up front, and react to style changes
Allows running the example with -style foo or QT_STYLE_OVERRIDE. No changes to documentation needed. Change-Id: Id7cef450f13faabd118badde51afb7273439c9fc Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'examples/widgets/widgets/styles/main.cpp')
-rw-r--r--examples/widgets/widgets/styles/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/widgets/widgets/styles/main.cpp b/examples/widgets/widgets/styles/main.cpp
index d340719984..471589d3ad 100644
--- a/examples/widgets/widgets/styles/main.cpp
+++ b/examples/widgets/widgets/styles/main.cpp
@@ -50,12 +50,15 @@
#include <QApplication>
+#include "norwegianwoodstyle.h"
#include "widgetgallery.h"
int main(int argc, char *argv[])
{
Q_INIT_RESOURCE(styles);
+ QApplication::setStyle(new NorwegianWoodStyle);
+
QApplication app(argc, argv);
WidgetGallery gallery;
gallery.show();