Debian Codegraph @

examples/widgets/painting/pathstroke/main.cpp

raw
1 // Copyright (C) 2016 The Qt Company Ltd.
2 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4 #include "pathstroke.h"
5
6 #include <QApplication>
7
8 int main(int argc, char **argv)
9 {
10 QApplication app(argc, argv);
11
12 bool smallScreen = QApplication::arguments().contains("-small-screen");
13
14 PathStrokeWidget pathStrokeWidget(smallScreen);
15 QStyle *arthurStyle = new ArthurStyle();
16 pathStrokeWidget.setStyle(arthurStyle);
17 const QList<QWidget *> widgets = pathStrokeWidget.findChildren<QWidget *>();
18 for (QWidget *w : widgets) {
19 w->setStyle(arthurStyle);
20 w->setAttribute(Qt::WA_AcceptTouchEvents);
21 }
22
23 if (smallScreen)
24 pathStrokeWidget.showFullScreen();
25 else
26 pathStrokeWidget.show();
27
28 #ifdef QT_KEYPAD_NAVIGATION
29 QApplication::setNavigationMode(Qt::NavigationModeCursorAuto);
30 #endif
31 return app.exec();
32 }