| 1 | /* |
| 2 | * Copyright 2014-2016 Canonical Ltd. |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU Lesser General Public License as published by |
| 6 | * the Free Software Foundation; version 3. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU Lesser General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU Lesser General Public License |
| 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 15 | */ |
| 16 | |
| 17 | // Dedicated QML launcher with the ability to setup QQuickView/QQmlEngine |
| 18 | // differently and with various extensions. Used internally to write Autopilot |
| 19 | // test cases that exhibit specific behavior. |
| 20 | |
| 21 | #include <iostream> |
| 22 | #include <QtCore/qdebug.h> |
| 23 | #include <QtQuick/QQuickItem> |
| 24 | #include <QtQuick/QQuickView> |
| 25 | #include <QtGui/QGuiApplication> |
| 26 | #include <QtQml/QQmlEngine> |
| 27 | #include <QtQml/QQmlContext> |
| 28 | #include <QtQml/QQmlComponent> |
| 29 | #include <QtCore/QFileInfo> |
| 30 | #include <QLibrary> |
| 31 | #include <QOpenGLContext> |
| 32 | #include <QtGui/private/qopenglcontext_p.h> |
| 33 | #include <QtQuick/private/qsgcontext_p.h> |
| 34 | #include <QtCore/QCommandLineParser> |
| 35 | #include <QtCore/QCommandLineOption> |
| 36 | #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= QT_VERSION_CHECKcxx . . $ `<external>/15045578679651060896/qglobal.h:61:9`!(6, 0, 0) |
| 37 | #include <LomiriToolkit-Qt6/private/mousetouchadaptor_p.h> |
| 38 | #else |
| 39 | #include <LomiriToolkit/private/mousetouchadaptor_p.h>cxx . . $ `<file>/include/LomiriToolkit/5.5.0/LomiriToolkit/private/mousetouchadaptor_p.h`/ |
| 40 | #endif |
| 41 | #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= QT_VERSION_CHECKcxx . . $ `<external>/15045578679651060896/qglobal.h:61:9`!(6, 0, 0) |
| 42 | #include <LomiriMetrics-Qt6/applicationmonitor.h> |
| 43 | #else |
| 44 | #include <LomiriMetrics/applicationmonitor.h>cxx . . $ `<file>/include/LomiriMetrics/applicationmonitor.h`/ |
| 45 | #endif |
| 46 | #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= QT_VERSION_CHECKcxx . . $ `<external>/15045578679651060896/qglobal.h:61:9`!(6, 0, 0) |
| 47 | #include <QtGui/QInputDevice> |
| 48 | #else |
| 49 | #include <QtGui/QTouchDevice> |
| 50 | #endif |
| 51 | #include <QtQml/qqml.h> |
| 52 | |
| 53 | static QObjectcxx . . $ QObject# *s_testRootObjectcxx . . $ s_testRootObject. = 0; |
| 54 | static QObjectcxx . . $ QObject# *testRootObjectcxx . . $ testRootObject(bb5c9267d46df6de).(QQmlEnginecxx . . $ QQmlEngine# *engine, QJSEnginecxx . . $ QJSEngine# *jsEngine) |
| 55 | { |
| 56 | Q_UNUSEDcxx . . $ `<external>/15045578679651060896/qglobal.h:117:9`!(jsEngine); |
| 57 | if (!s_testRootObjectcxx . . $ s_testRootObject.) { |
| 58 | s_testRootObjectcxx . . $ s_testRootObject. = new QObjectcxx . . $ QObject#QObject(749de1b6ae65bddd).(engine); |
| 59 | } |
| 60 | return s_testRootObjectcxx . . $ s_testRootObject.; |
| 61 | } |
| 62 | |
| 63 | int maincxx . . $ main(d8e43b79a186046c).(int argc, const char *argv[]) |
| 64 | { |
| 65 | // QPlatformIntegration::ThreadedOpenGL |
| 66 | setenv("QML_FORCE_THREADED_RENDERER", "1", 1); |
| 67 | // QPlatformIntegration::BufferQueueingOpenGL |
| 68 | setenv("QML_FIXED_ANIMATION_STEP", "1", 1); |
| 69 | // Oxide and QWebEngine need a shared context |
| 70 | QScopedPointercxx . . $ QScopedPointer#<QOpenGLContextcxx . . $ QOpenGLContext#> shareContextcxx . . $ QScopedPointer#QScopedPointer(6f97683fca3ece44).; |
| 71 | shareContext.resetcxx . . $ QScopedPointer#reset(b1f27668ced7db9d).(new QOpenGLContextcxx . . $ QOpenGLContext#QOpenGLContext(749de1b6ae65bddd).); |
| 72 | #if QT_VERSIONcxx . . $ `<external>/15045578679651060896/qglobal.h:57:9`! >= QT_VERSION_CHECKcxx . . $ `<external>/15045578679651060896/qglobal.h:61:9`!(5, 4, 0) |
| 73 | qt_gl_set_global_share_contextcxx . . $ qt_gl_set_global_share_context(af0faf9796a78f62).(shareContext.datacxx . . $ QScopedPointer#data(34d6acfd341ba7ab).()); |
| 74 | #elif QT_VERSION >= QT_VERSION_CHECK(5, 3, 0) |
| 75 | QOpenGLContextPrivate::setGlobalShareContext(shareContext.data()); |
| 76 | #else |
| 77 | QSGContext::setSharedOpenGLContext(shareContext.data()); |
| 78 | #endif |
| 79 | QGuiApplicationcxx . . $ QGuiApplication#::setApplicationNamecxx . . $ QCoreApplication#setApplicationName(3520e46b33348bf6).("UITK Launcher"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 80 | QGuiApplicationcxx . . $ QGuiApplication# applicationcxx . . $ QGuiApplication#QGuiApplication(6e9b1c7df49e191d).(argc, (char**)argv); |
| 81 | |
| 82 | QCommandLineParsercxx . . $ QCommandLineParser# argscxx . . $ QCommandLineParser#QCommandLineParser(49f6e7a06ebc5aa8).; |
| 83 | QCommandLineOptioncxx . . $ QCommandLineOption# _importcxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).("I"cxx . . $ QString#QString(85c52e162fed56f9)., "Add <path> to the list of import paths"cxx . . $ QString#QString(85c52e162fed56f9)., "path"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 84 | QCommandLineOptioncxx . . $ QCommandLineOption# _enableTouchcxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).("touch"cxx . . $ QString#QString(85c52e162fed56f9)., "Enables mouse to touch conversion on desktop"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 85 | QCommandLineOptioncxx . . $ QCommandLineOption# _testabilitycxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).("testability"cxx . . $ QString#QString(85c52e162fed56f9)., "Loads the testability driver"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 86 | QCommandLineOptioncxx . . $ QCommandLineOption# _framelesscxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).("frameless"cxx . . $ QString#QString(85c52e162fed56f9)., "Run without borders"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 87 | QCommandLineOptioncxx . . $ QCommandLineOption# _enginecxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).("engine"cxx . . $ QString#QString(85c52e162fed56f9)., "Use quick engine from quick view"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 88 | QCommandLineOptioncxx . . $ QCommandLineOption# _desktop_file_hintcxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).("desktop_file_hint"cxx . . $ QString#QString(85c52e162fed56f9)., "Desktop file - ignored"cxx . . $ QString#QString(85c52e162fed56f9)., "desktop_file"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 89 | QCommandLineOptioncxx . . $ QCommandLineOption# _metricsOverlaycxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).("metrics-overlay"cxx . . $ QString#QString(85c52e162fed56f9)., "Enable the metrics overlay"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 90 | QCommandLineOptioncxx . . $ QCommandLineOption# _metricsLoggingcxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).( |
| 91 | "metrics-logging"cxx . . $ QString#QString(85c52e162fed56f9)., "Enable metrics logging, <device> can be 'stdout', 'lttng' (Linux "cxx . . $ QString#QString(85c52e162fed56f9). |
| 92 | "only), a local or absolute filename", "device"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 93 | QCommandLineOptioncxx . . $ QCommandLineOption# _metricsLoggingFiltercxx . . $ QCommandLineOption#QCommandLineOption(6d8ce341bc76c5ea).( |
| 94 | "metrics-logging-filter"cxx . . $ QString#QString(85c52e162fed56f9)., "Filter metrics logging, <filter> is a list of events separated "cxx . . $ QString#QString(85c52e162fed56f9). |
| 95 | "by a comma ('window', 'process', 'frame' or '*'), events not filtered are discarded", |
| 96 | "filter"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 97 | |
| 98 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_import); |
| 99 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_enableTouch); |
| 100 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_testability); |
| 101 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_frameless); |
| 102 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_engine); |
| 103 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_desktop_file_hint); |
| 104 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_metricsOverlay); |
| 105 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_metricsLogging); |
| 106 | args.addOptioncxx . . $ QCommandLineParser#addOption(785b7e1f8b52cda9).(_metricsLoggingFilter); |
| 107 | args.addPositionalArgumentcxx . . $ QCommandLineParser#addPositionalArgument(9f9ceb6f9de3a67b).("filename"cxx . . $ QString#QString(85c52e162fed56f9)., "Document to be viewed"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 108 | args.setSingleDashWordOptionModecxx . . $ QCommandLineParser#setSingleDashWordOptionMode(6a29231968589d8).(QCommandLineParsercxx . . $ QCommandLineParser#::ParseAsLongOptionscxx . . $ QCommandLineParser#ParseAsLongOptions.); |
| 109 | args.addHelpOptioncxx . . $ QCommandLineParser#addHelpOption(cd8590dcf46f7865).(); |
| 110 | if (!args.parsecxx . . $ QCommandLineParser#parse(6ea41922f5835cfb).(application.argumentscxx . . $ QCoreApplication#arguments(669a05bc42dd57cc).())) { |
| 111 | qWarningcxx . . $ `<external>/10450329605257866924/qlogging.h:166:9`!() <<cxx . . $ QDebug#`operator<<`(4cf17434affdd8). args.errorTextcxx . . $ QCommandLineParser#errorText(6ef7b6c27b00b43d).(); |
| 112 | args.showHelpcxx . . $ QCommandLineParser#showHelp(3ca292c338df9bb3).(1); |
| 113 | } |
| 114 | |
| 115 | QStringcxx . . $ QString# filenamecxx . . $ QString#QString(ced63f7c635d850d).; |
| 116 | if (args.positionalArgumentscxx . . $ QCommandLineParser#positionalArguments(e1dbd5c4feadc8f5).().countcxx . . $ QList#count(455f465bc33b4cdf).() > 0) { |
| 117 | filename =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). args.positionalArgumentscxx . . $ QCommandLineParser#positionalArguments(e1dbd5c4feadc8f5).()[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0]; |
| 118 | } |
| 119 | if (filename.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) { |
| 120 | // show usage and exit |
| 121 | args.showHelpcxx . . $ QCommandLineParser#showHelp(3ca292c338df9bb3).(1); |
| 122 | } |
| 123 | |
| 124 | // Testability is only supported out of the box by QApplication not QGuiApplication |
| 125 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_testability) || getenv("QT_LOAD_TESTABILITY")) { |
| 126 | QLibrarycxx . . $ QLibrary# testLibcxx . . $ QLibrary#QLibrary(6b24f83d17022bd9).(QLatin1Stringcxx . . $ QString#QString(4641beeb24e75d60).("qttestability")); |
| 127 | if (testLib.loadcxx . . $ QLibrary#load(c9857a73d68e59ba).()) { |
| 128 | typedef void (*TasInitializecxx . . $ main(d8e43b79a186046c).TasInitialize#)(void); |
| 129 | TasInitializecxx . . $ main(d8e43b79a186046c).TasInitialize# initFunction = (TasInitializecxx . . $ main(d8e43b79a186046c).TasInitialize#)testLib.resolvecxx . . $ QLibrary#resolve(3efb40c7f910a1d9).("qt_testability_init"); |
| 130 | if (initFunction) { |
| 131 | initFunction(); |
| 132 | } else { |
| 133 | qCriticalcxx . . $ `<external>/10450329605257866924/qlogging.h:167:9`!("Library qttestability resolve failed!"); |
| 134 | return 1; |
| 135 | } |
| 136 | } else { |
| 137 | qCriticalcxx . . $ `<external>/10450329605257866924/qlogging.h:167:9`!("Library qttestability load failed!"); |
| 138 | return 1; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // Allow manual execution of unit tests using Qt.Test |
| 143 | qmlRegisterSingletonTypecxx . . $ qmlRegisterSingletonType(191e4453460aa164).<QObjectcxx . . $ QObject#>("Qt.test.qtestroot", 1, 0, "QTestRootObject", testRootObjectcxx . . $ testRootObject(bb5c9267d46df6de).); |
| 144 | |
| 145 | QPointercxx . . $ QPointer#<QQmlEnginecxx . . $ QQmlEngine#> enginecxx . . $ QPointer#QPointer(49f6e7a06ebc5aa8).; |
| 146 | QScopedPointercxx . . $ QScopedPointer#<QQuickWindowcxx . . $ QQuickWindow#> windowcxx . . $ QScopedPointer#QScopedPointer(6f97683fca3ece44).; |
| 147 | QStringcxx . . $ QString# testCaseImportcxx . . $ QString#QString(ced63f7c635d850d).; |
| 148 | // Let's see if the source file exists |
| 149 | QFilecxx . . $ QFile# sourceCodecxx . . $ QFile#QFile(3520e46b33348bf6).(filename); |
| 150 | if (!sourceCode.opencxx . . $ QFile#open(dca164408be960c8).(QIODevicecxx . . $ QFlags#QFlags(93d577a3e9528307).::ReadOnlycxx . . $ QIODevice#ReadOnly.)) { |
| 151 | qCriticalcxx . . $ `<external>/10450329605257866924/qlogging.h:167:9`!("%s", qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(sourceCode.errorString())); |
| 152 | return 1; |
| 153 | } |
| 154 | while (!sourceCode.atEndcxx . . $ QFileDevice#atEnd(50ce9a9e25b4a850).()) { |
| 155 | QByteArraycxx . . $ QByteArray# line(sourceCode.readLinecxx . . $ QIODevice#readLine(1117a85f2fd4e5c8).()); |
| 156 | if (line.containscxx . . $ QByteArray#contains(7d4bdb1abc417636).("{")) |
| 157 | break; |
| 158 | // Hack to avoid assertion if QtTest or Lomiri.Test is used: |
| 159 | // ASSERT: "QTest::TestLoggers::loggerCount() != 0" in file qtestlog.cpp, line 278 |
| 160 | if ((line.startsWithcxx . . $ QByteArray#startsWith(7d4bdb1abc417636).("import ") && QStringcxx . . $ QString#QString(45672f3c6961a244).(line).splitcxx . . $ QString#split(c8b44a97dcb6200d).("//"cxx . . $ QString#QString(85c52e162fed56f9).)[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0].splitcxx . . $ QString#split(c8b44a97dcb6200d).("/*"cxx . . $ QString#QString(85c52e162fed56f9).)[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).0].containscxx . . $ QString#contains(8cce4688c16f48f3).("Test"cxx . . $ QString#QString(85c52e162fed56f9).))) { |
| 161 | testCaseImport =cxx . . $ QString#`operator=`(49ea8750b4987a17). line; |
| 162 | break; |
| 163 | } |
| 164 | } |
| 165 | QUrlcxx . . $ QUrl# source(QUrlcxx . . $ QUrl#::fromLocalFilecxx . . $ QUrl#fromLocalFile(daf4b0201622af21).(filename)); |
| 166 | |
| 167 | // The default constructor affects the components tree (autopilot vis) |
| 168 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_engine) || !testCaseImport.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) { |
| 169 | QQuickViewcxx . . $ QQuickView# *view(new QQuickViewcxx . . $ QQuickView#()); |
| 170 | engine =cxx . . $ QPointer#`operator=`(500fb76d9e491ab0). view->enginecxx . . $ QQuickView#engine(a2abd829983e1876).(); |
| 171 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_import)) { |
| 172 | QStringListcxx . . $ QStringList# paths = args.valuescxx . . $ QCommandLineParser#values(c7805b5741ed236c).(_import); |
| 173 | Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(const QString &path, paths) { |
| 174 | engine->cxx . . $ QPointer#`operator->`(5a2a78a048fb49a8).addImportPathcxx . . $ QQmlEngine#addImportPath(3520e46b33348bf6).(path); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | view->setSourcecxx . . $ QQuickView#setSource(37355d2f77053a23).(source); |
| 179 | while (view->statuscxx . . $ QQuickView#status(ab0b79d79d9c6f7d).() == QQuickViewcxx . . $ QQuickView#::Loadingcxx . . $ QQuickView#Loading.) |
| 180 | QCoreApplicationcxx . . $ QCoreApplication#::processEventscxx . . $ QCoreApplication#processEvents(5ce75b802d22674c).(); |
| 181 | if (view->errorscxx . . $ QQuickView#errors(a7eaa256e9a94d).().countcxx . . $ QList#count(455f465bc33b4cdf).() > 0) { |
| 182 | args.showHelpcxx . . $ QCommandLineParser#showHelp(3ca292c338df9bb3).(3); |
| 183 | } |
| 184 | // An unsupported root object is not technically an error |
| 185 | if (!view->rootObjectcxx . . $ QQuickView#rootObject(e7eee0192cff5fb0).()) { |
| 186 | if (!testCaseImport.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 187 | qCriticalcxx . . $ `<external>/10450329605257866924/qlogging.h:167:9`!("Note: QtTest or Lomiri.Test was detected here: %s", qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(testCaseImport)); |
| 188 | return 1; |
| 189 | } |
| 190 | |
| 191 | window.resetcxx . . $ QScopedPointer#reset(b1f27668ced7db9d).(view); |
| 192 | } else { |
| 193 | engine =cxx . . $ QPointer#`operator=`(500fb76d9e491ab0). new QQmlEnginecxx . . $ QQmlEngine#QQmlEngine(749de1b6ae65bddd).(); |
| 194 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_import)) { |
| 195 | QStringListcxx . . $ QStringList# paths = args.valuescxx . . $ QCommandLineParser#values(c7805b5741ed236c).(_import); |
| 196 | Q_FOREACHcxx . . $ `<external>/15045578679651060896/qglobal.h:1137:9`!(const QString &path, paths) { |
| 197 | engine->cxx . . $ QPointer#`operator->`(5a2a78a048fb49a8).addImportPathcxx . . $ QQmlEngine#addImportPath(3520e46b33348bf6).(path); |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | QObjectcxx . . $ QObject#::connectcxx . . $ QObject#connect(158df1d9a01a3410).(engine, SIGNALcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:271:10`!(quit()), QCoreApplicationcxx . . $ QCoreApplication#::instancecxx . . $ QCoreApplication#instance(d43115d48568c255).(), SLOTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:270:10`!(quit())); |
| 202 | QPointercxx . . $ QPointer#<QQmlComponentcxx . . $ QQmlComponent#> componentcxx . . $ QPointer#QPointer(ebd0a1552f8ce24f).(new QQmlComponentcxx . . $ QQmlComponent#QQmlComponent(1ee7362edd1472d8).(engine)); |
| 203 | component->cxx . . $ QPointer#`operator->`(5a2a78a048fb49a8).loadUrlcxx . . $ QQmlComponent#loadUrl(5eaf494bc5e3bf3b).(source, QQmlComponentcxx . . $ QQmlComponent#::Asynchronouscxx . . $ QQmlComponent#Asynchronous.); |
| 204 | while (component->cxx . . $ QPointer#`operator->`(5a2a78a048fb49a8).isLoadingcxx . . $ QQmlComponent#isLoading(50ce9a9e25b4a850).()) |
| 205 | QCoreApplicationcxx . . $ QCoreApplication#::processEventscxx . . $ QCoreApplication#processEvents(5ce75b802d22674c).(); |
| 206 | QObjectcxx . . $ QObject# *toplevel(component->cxx . . $ QPointer#`operator->`(5a2a78a048fb49a8).createcxx . . $ QQmlComponent#create(1adc5df52fdd8588).()); |
| 207 | if (!toplevel && component->cxx . . $ QPointer#`operator->`(5a2a78a048fb49a8).isErrorcxx . . $ QQmlComponent#isError(50ce9a9e25b4a850).()) { |
| 208 | qCriticalcxx . . $ `<external>/10450329605257866924/qlogging.h:167:9`!("%s", qPrintablecxx . . $ `<external>/15045578679651060896/qglobal.h:831:11`!(component->errorString())); |
| 209 | return 1; |
| 210 | } |
| 211 | |
| 212 | window.resetcxx . . $ QScopedPointer#reset(b1f27668ced7db9d).(qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<QQuickWindowcxx . . $ QQuickWindow# *>(toplevel)); |
| 213 | if (window) |
| 214 | engine->cxx . . $ QPointer#`operator->`(5a2a78a048fb49a8).setIncubationControllercxx . . $ QQmlEngine#setIncubationController(b6e6629b777f2f6e).(window->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).incubationControllercxx . . $ QQuickWindow#incubationController(cfa4b6bbff47324e).()); |
| 215 | else { |
| 216 | QQuickItemcxx . . $ QQuickItem# *rootItem = qobject_castcxx . . $ qobject_cast(c988cfc0ca08742e).<QQuickItemcxx . . $ QQuickItem# *>(toplevel); |
| 217 | if (rootItem) { |
| 218 | QQuickViewcxx . . $ QQuickView# *view(new QQuickViewcxx . . $ QQuickView#(engine, 0)); |
| 219 | window.resetcxx . . $ QScopedPointer#reset(b1f27668ced7db9d).(view); |
| 220 | view->setResizeModecxx . . $ QQuickView#setResizeMode(a59df3724df848c).(QQuickViewcxx . . $ QQuickView#::SizeRootObjectToViewcxx . . $ QQuickView#SizeRootObjectToView.); |
| 221 | view->setContentcxx . . $ QQuickView#setContent(b2b0d00c31b32b08).(source, component, rootItem); |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | // Application monitoring. |
| 227 | UMApplicationMonitorcxx . . $ UMApplicationMonitor#* applicationMonitor = UMApplicationMonitorcxx . . $ UMApplicationMonitor#::instancecxx . . $ UMApplicationMonitor#instance(8318bce5f57494).(); |
| 228 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_metricsLoggingFilter)) { |
| 229 | QStringListcxx . . $ QStringList# filterList = QStringcxx . . $ QString#(args.valuecxx . . $ QCommandLineParser#value(aa213ac3e429ad86).(_metricsLoggingFilter)).splitcxx . . $ QString#split(92030b8bf74e4227).( |
| 230 | QCharcxx . . $ QChar#(','), Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::SkipEmptyPartscxx . . $ Qt/SkipEmptyParts.); |
| 231 | UMApplicationMonitorcxx . . $ UMApplicationMonitor#::LoggingFilterscxx . . $ UMApplicationMonitor#LoggingFilters# filtercxx . . $ QFlags#QFlags(ced63f7c635d850d).; |
| 232 | const int size = filterList.sizecxx . . $ QList#size(ea6fe5115c70a13f).(); |
| 233 | for (int i = 0; i < size; ++i) { |
| 234 | if (filterList[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "*") { |
| 235 | filter |=cxx . . $ QFlags#`operator|=`(fd64b2b07d6098e0). UMApplicationMonitorcxx . . $ UMApplicationMonitor#::AllEventscxx . . $ UMApplicationMonitor#AllEvents.; |
| 236 | break; |
| 237 | } else if (filterList[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "window") { |
| 238 | filter |=cxx . . $ QFlags#`operator|=`(fd64b2b07d6098e0). UMApplicationMonitorcxx . . $ UMApplicationMonitor#::WindowEventcxx . . $ UMApplicationMonitor#WindowEvent.; |
| 239 | } else if (filterList[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "process") { |
| 240 | filter |=cxx . . $ QFlags#`operator|=`(fd64b2b07d6098e0). UMApplicationMonitorcxx . . $ UMApplicationMonitor#::ProcessEventcxx . . $ UMApplicationMonitor#ProcessEvent.; |
| 241 | } else if (filterList[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "frame") { |
| 242 | filter |=cxx . . $ QFlags#`operator|=`(fd64b2b07d6098e0). UMApplicationMonitorcxx . . $ UMApplicationMonitor#::FrameEventcxx . . $ UMApplicationMonitor#FrameEvent.; |
| 243 | } else if (filterList[cxx . . $ QList#`operator[]`(7a0ef1c7079e8533).i] ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "generic") { |
| 244 | filter |=cxx . . $ QFlags#`operator|=`(fd64b2b07d6098e0). UMApplicationMonitorcxx . . $ UMApplicationMonitor#::GenericEventcxx . . $ UMApplicationMonitor#GenericEvent.; |
| 245 | } |
| 246 | } |
| 247 | applicationMonitor->setLoggingFiltercxx . . $ UMApplicationMonitor#setLoggingFilter(316e99312c36147b).(filter); |
| 248 | } |
| 249 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_metricsLogging)) { |
| 250 | UMLoggercxx . . $ UMLogger#* logger; |
| 251 | QStringcxx . . $ QString# device = args.valuecxx . . $ QCommandLineParser#value(aa213ac3e429ad86).(_metricsLogging); |
| 252 | if (device.isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).() || device ==cxx . . $ QString#`operator==`(7d4bdb1abc417636). "stdout") { |
| 253 | logger = new UMFileLoggercxx . . $ UMFileLogger#(stdoutcxx . . $ `<external>/232824719582829767/stdio.h:154:9`!); |
| 254 | #if defined(Q_OS_LINUXcxx . . $ `<external>/5130987379601705141/qsystemdetection.h:150:11`!) && defined(LTTNG_PLUGIN_BUILD_PATH) |
| 255 | } else if (device == "lttng") { |
| 256 | logger = new UMLTTNGLogger(); |
| 257 | #endif // defined(Q_OS_LINUX) && defined(LTTNG_PLUGIN_BUILD_PATH) |
| 258 | } else { |
| 259 | logger = new UMFileLoggercxx . . $ UMFileLogger#(device); |
| 260 | } |
| 261 | if (logger->isOpencxx . . $ UMLogger#isOpen(c9857a73d68e59ba).()) { |
| 262 | applicationMonitor->installLoggercxx . . $ UMApplicationMonitor#installLogger(64677de7f1da7520).(logger); |
| 263 | applicationMonitor->setLoggingcxx . . $ UMApplicationMonitor#setLogging(b45ddcbc8423892c).(true); |
| 264 | } else { |
| 265 | delete logger; |
| 266 | } |
| 267 | } |
| 268 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_metricsOverlay)) { |
| 269 | applicationMonitor->setOverlaycxx . . $ UMApplicationMonitor#setOverlay(b45ddcbc8423892c).(true); |
| 270 | } |
| 271 | |
| 272 | if (window->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).titlecxx . . $ QWindow#title(6ef7b6c27b00b43d).().isEmptycxx . . $ QString#isEmpty(50ce9a9e25b4a850).()) |
| 273 | window->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).setTitlecxx . . $ QWindow#setTitle(3520e46b33348bf6).("UI Toolkit QQuickView"cxx . . $ QString#QString(85c52e162fed56f9).); |
| 274 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_frameless)) { |
| 275 | window->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).setFlagscxx . . $ QWindow#setFlags(f800b5e9bc59e42e).(Qtcxx . . $ QFlags#QFlags(93d577a3e9528307).::FramelessWindowHintcxx . . $ Qt/FramelessWindowHint.); |
| 276 | } |
| 277 | window->cxx . . $ QScopedPointer#`operator->`(34d6acfd341ba7ab).showcxx . . $ QWindow#show(49f6e7a06ebc5aa8).(); |
| 278 | |
| 279 | if (args.isSetcxx . . $ QCommandLineParser#isSet(77a06b70c81738c8).(_enableTouch)) { |
| 280 | // has no effect if we have touch screen |
| 281 | new UT_PREPEND_NAMESPACEcxx . . $ `src/LomiriToolkit/lomiritoolkitglobal.h:54:9`!(MouseTouchAdaptor)(&application); |
| 282 | } |
| 283 | |
| 284 | return application.execcxx . . $ QGuiApplication#exec(b126dc7c1de90089).(); |
| 285 | } |