Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/qquickwindowmodule.cpp |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | - | |||||||||||||||||||||||||
2 | - | |||||||||||||||||||||||||
3 | - | |||||||||||||||||||||||||
4 | - | |||||||||||||||||||||||||
5 | extern const QLoggingCategory &lcTransient(); | - | ||||||||||||||||||||||||
6 | - | |||||||||||||||||||||||||
7 | class QQuickWindowQmlImplPrivate : public QQuickWindowPrivate | - | ||||||||||||||||||||||||
8 | { | - | ||||||||||||||||||||||||
9 | public: | - | ||||||||||||||||||||||||
10 | QQuickWindowQmlImplPrivate() | - | ||||||||||||||||||||||||
11 | : complete(false) | - | ||||||||||||||||||||||||
12 | , visible(false) | - | ||||||||||||||||||||||||
13 | , visibility(QQuickWindow::AutomaticVisibility) | - | ||||||||||||||||||||||||
14 | { | - | ||||||||||||||||||||||||
15 | } executed 150 times by 8 tests: end of block Executed by:
| 150 | ||||||||||||||||||||||||
16 | - | |||||||||||||||||||||||||
17 | bool complete; | - | ||||||||||||||||||||||||
18 | bool visible; | - | ||||||||||||||||||||||||
19 | QQuickWindow::Visibility visibility; | - | ||||||||||||||||||||||||
20 | QV4::PersistentValue rootItemMarker; | - | ||||||||||||||||||||||||
21 | }; | - | ||||||||||||||||||||||||
22 | - | |||||||||||||||||||||||||
23 | QQuickWindowQmlImpl::QQuickWindowQmlImpl(QWindow *parent) | - | ||||||||||||||||||||||||
24 | : QQuickWindow(*(new QQuickWindowQmlImplPrivate), parent) | - | ||||||||||||||||||||||||
25 | { | - | ||||||||||||||||||||||||
26 | connect(this, &QWindow::visibleChanged, this, &QQuickWindowQmlImpl::visibleChanged); | - | ||||||||||||||||||||||||
27 | connect(this, &QWindow::visibilityChanged, this, &QQuickWindowQmlImpl::visibilityChanged); | - | ||||||||||||||||||||||||
28 | connect(this, &QWindow::screenChanged, this, &QQuickWindowQmlImpl::screenChanged); | - | ||||||||||||||||||||||||
29 | } executed 150 times by 8 tests: end of block Executed by:
| 150 | ||||||||||||||||||||||||
30 | - | |||||||||||||||||||||||||
31 | void QQuickWindowQmlImpl::setVisible(bool visible) | - | ||||||||||||||||||||||||
32 | { | - | ||||||||||||||||||||||||
33 | QQuickWindowQmlImplPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
34 | d->visible = visible; | - | ||||||||||||||||||||||||
35 | if (d->complete
| 0-148 | ||||||||||||||||||||||||
36 | QQuickWindow::setVisible(visible); executed 148 times by 8 tests: QQuickWindow::setVisible(visible); Executed by:
| 148 | ||||||||||||||||||||||||
37 | } executed 156 times by 8 tests: end of block Executed by:
| 156 | ||||||||||||||||||||||||
38 | - | |||||||||||||||||||||||||
39 | void QQuickWindowQmlImpl::setVisibility(Visibility visibility) | - | ||||||||||||||||||||||||
40 | { | - | ||||||||||||||||||||||||
41 | QQuickWindowQmlImplPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
42 | d->visibility = visibility; | - | ||||||||||||||||||||||||
43 | if (d->complete
| 0 | ||||||||||||||||||||||||
44 | QQuickWindow::setVisibility(visibility); never executed: QQuickWindow::setVisibility(visibility); | 0 | ||||||||||||||||||||||||
45 | } never executed: end of block | 0 | ||||||||||||||||||||||||
46 | - | |||||||||||||||||||||||||
47 | QQuickWindowAttached *QQuickWindowQmlImpl::qmlAttachedProperties(QObject *object) | - | ||||||||||||||||||||||||
48 | { | - | ||||||||||||||||||||||||
49 | return never executed: new QQuickWindowAttached(object);return new QQuickWindowAttached(object); never executed: return new QQuickWindowAttached(object); | 0 | ||||||||||||||||||||||||
50 | } | - | ||||||||||||||||||||||||
51 | - | |||||||||||||||||||||||||
52 | void QQuickWindowQmlImpl::classBegin() | - | ||||||||||||||||||||||||
53 | { | - | ||||||||||||||||||||||||
54 | QQuickWindowQmlImplPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
55 | QQmlEngine* e = qmlEngine(this); | - | ||||||||||||||||||||||||
56 | - | |||||||||||||||||||||||||
57 | QQmlEngine::setContextForObject(contentItem(), e->rootContext()); | - | ||||||||||||||||||||||||
58 | - | |||||||||||||||||||||||||
59 | - | |||||||||||||||||||||||||
60 | if (QCoreApplication::instance()->property("__qml_using_qqmlapplicationengine") == QVariant(true)
| 20-130 | ||||||||||||||||||||||||
61 | if (e
| 0-130 | ||||||||||||||||||||||||
62 | e->setIncubationController(incubationController()); executed 106 times by 1 test: e->setIncubationController(incubationController()); Executed by:
| 106 | ||||||||||||||||||||||||
63 | } executed 130 times by 1 test: end of block Executed by:
| 130 | ||||||||||||||||||||||||
64 | { | - | ||||||||||||||||||||||||
65 | - | |||||||||||||||||||||||||
66 | - | |||||||||||||||||||||||||
67 | QV4::ExecutionEngine *v4 = e->handle(); | - | ||||||||||||||||||||||||
68 | QV4::QObjectWrapper::wrap(v4, d->contentItem); | - | ||||||||||||||||||||||||
69 | } | - | ||||||||||||||||||||||||
70 | } executed 150 times by 8 tests: end of block Executed by:
| 150 | ||||||||||||||||||||||||
71 | - | |||||||||||||||||||||||||
72 | void QQuickWindowQmlImpl::componentComplete() | - | ||||||||||||||||||||||||
73 | { | - | ||||||||||||||||||||||||
74 | QQuickWindowQmlImplPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
75 | d->complete = true; | - | ||||||||||||||||||||||||
76 | QQuickItem *itemParent = qmlobject_cast<QQuickItem *>(QObject::parent()); | - | ||||||||||||||||||||||||
77 | if (itemParent
| 2-144 | ||||||||||||||||||||||||
78 | for (bool qt_category_enabled = lcTransient().isDebugEnabled(); qt_category_enabled
never executed: QMessageLogger(__FILE__, 128, __PRETTY_FUNCTION__, lcTransient().categoryName()).debug() << "window" << title() << "has invisible Item parent" << itemParent << "transientParent" << transientParent() << "declared visibility" << d->visibility << "; delaying show"; | 0-4 | ||||||||||||||||||||||||
79 | << transientParent() << "declared visibility" << d->visibility << "; delaying show"; never executed: QMessageLogger(__FILE__, 128, __PRETTY_FUNCTION__, lcTransient().categoryName()).debug() << "window" << title() << "has invisible Item parent" << itemParent << "transientParent" << transientParent() << "declared visibility" << d->visibility << "; delaying show"; | 0 | ||||||||||||||||||||||||
80 | connect(itemParent, &QQuickItem::windowChanged, this, | - | ||||||||||||||||||||||||
81 | &QQuickWindowQmlImpl::setWindowVisibility, Qt::QueuedConnection); | - | ||||||||||||||||||||||||
82 | } executed 4 times by 1 test: else if (transientParent()end of block Executed by:
| 0-144 | ||||||||||||||||||||||||
83 | connect(transientParent(), &QQuickWindow::visibleChanged, this, | - | ||||||||||||||||||||||||
84 | &QQuickWindowQmlImpl::setWindowVisibility, Qt::QueuedConnection); | - | ||||||||||||||||||||||||
85 | } executed 2 times by 1 test: else {end of block Executed by:
| 2 | ||||||||||||||||||||||||
86 | setWindowVisibility(); | - | ||||||||||||||||||||||||
87 | } executed 144 times by 7 tests: end of block Executed by:
| 144 | ||||||||||||||||||||||||
88 | } | - | ||||||||||||||||||||||||
89 | - | |||||||||||||||||||||||||
90 | void QQuickWindowQmlImpl::setWindowVisibility() | - | ||||||||||||||||||||||||
91 | { | - | ||||||||||||||||||||||||
92 | QQuickWindowQmlImplPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
93 | if (transientParent()
| 0-144 | ||||||||||||||||||||||||
94 | return; never executed: return; | 0 | ||||||||||||||||||||||||
95 | - | |||||||||||||||||||||||||
96 | if (QQuickItem *senderItem = qmlobject_cast<QQuickItem *>(sender())
| 4-144 | ||||||||||||||||||||||||
97 | disconnect(senderItem, &QQuickItem::windowChanged, this, &QQuickWindowQmlImpl::setWindowVisibility); | - | ||||||||||||||||||||||||
98 | } executed 4 times by 1 test: else if (sender()end of block Executed by:
| 0-144 | ||||||||||||||||||||||||
99 | disconnect(transientParent(), &QWindow::visibleChanged, this, &QQuickWindowQmlImpl::setWindowVisibility); | - | ||||||||||||||||||||||||
100 | } never executed: end of block | 0 | ||||||||||||||||||||||||
101 | - | |||||||||||||||||||||||||
102 | - | |||||||||||||||||||||||||
103 | - | |||||||||||||||||||||||||
104 | - | |||||||||||||||||||||||||
105 | if ((d->visibility == Hidden
| 0-148 | ||||||||||||||||||||||||
106 | QQmlData *data = QQmlData::get(this); | - | ||||||||||||||||||||||||
107 | ((data && data->context) ? static_cast<void>(0) : qt_assert("data && data->context", __FILE__, 157)); | - | ||||||||||||||||||||||||
108 | - | |||||||||||||||||||||||||
109 | QQmlError error; | - | ||||||||||||||||||||||||
110 | error.setObject(this); | - | ||||||||||||||||||||||||
111 | - | |||||||||||||||||||||||||
112 | const QQmlContextData* urlContext = data->context; | - | ||||||||||||||||||||||||
113 | while (urlContext
| 0 | ||||||||||||||||||||||||
114 | urlContext = urlContext->parent; never executed: urlContext = urlContext->parent; | 0 | ||||||||||||||||||||||||
115 | error.setUrl(urlContext ? urlContext->url() : QUrl()); | - | ||||||||||||||||||||||||
116 | - | |||||||||||||||||||||||||
117 | QString objectId = data->context->findObjectId(this); | - | ||||||||||||||||||||||||
118 | if (!objectId.isEmpty()
| 0 | ||||||||||||||||||||||||
119 | error.setDescription(QCoreApplication::translate("QQuickWindowQmlImpl", never executed: error.setDescription(QCoreApplication::translate("QQuickWindowQmlImpl", "Conflicting properties 'visible' and 'visibility' for Window '%1'").arg(objectId)); | 0 | ||||||||||||||||||||||||
120 | "Conflicting properties 'visible' and 'visibility' for Window '%1'").arg(objectId)); never executed: error.setDescription(QCoreApplication::translate("QQuickWindowQmlImpl", "Conflicting properties 'visible' and 'visibility' for Window '%1'").arg(objectId)); | 0 | ||||||||||||||||||||||||
121 | else | - | ||||||||||||||||||||||||
122 | error.setDescription(QCoreApplication::translate("QQuickWindowQmlImpl", never executed: error.setDescription(QCoreApplication::translate("QQuickWindowQmlImpl", "Conflicting properties 'visible' and 'visibility'")); | 0 | ||||||||||||||||||||||||
123 | "Conflicting properties 'visible' and 'visibility'")); never executed: error.setDescription(QCoreApplication::translate("QQuickWindowQmlImpl", "Conflicting properties 'visible' and 'visibility'")); | 0 | ||||||||||||||||||||||||
124 | - | |||||||||||||||||||||||||
125 | QQmlEnginePrivate::get(data->context->engine)->warning(error); | - | ||||||||||||||||||||||||
126 | } never executed: end of block | 0 | ||||||||||||||||||||||||
127 | - | |||||||||||||||||||||||||
128 | if (d->visibility == AutomaticVisibility
| 0-148 | ||||||||||||||||||||||||
129 | setWindowState(QGuiApplicationPrivate::platformIntegration()->defaultWindowState(flags())); | - | ||||||||||||||||||||||||
130 | setVisible(d->visible); | - | ||||||||||||||||||||||||
131 | } executed 148 times by 8 tests: else {end of block Executed by:
| 148 | ||||||||||||||||||||||||
132 | setVisibility(d->visibility); | - | ||||||||||||||||||||||||
133 | } never executed: end of block | 0 | ||||||||||||||||||||||||
134 | } | - | ||||||||||||||||||||||||
135 | - | |||||||||||||||||||||||||
136 | QObject *QQuickWindowQmlImpl::screen() const | - | ||||||||||||||||||||||||
137 | { | - | ||||||||||||||||||||||||
138 | return never executed: new QQuickScreenInfo(const_cast<QQuickWindowQmlImpl *>(this), QWindow::screen());return new QQuickScreenInfo(const_cast<QQuickWindowQmlImpl *>(this), QWindow::screen()); never executed: return new QQuickScreenInfo(const_cast<QQuickWindowQmlImpl *>(this), QWindow::screen()); | 0 | ||||||||||||||||||||||||
139 | } | - | ||||||||||||||||||||||||
140 | - | |||||||||||||||||||||||||
141 | void QQuickWindowQmlImpl::setScreen(QObject *screen) | - | ||||||||||||||||||||||||
142 | { | - | ||||||||||||||||||||||||
143 | QQuickScreenInfo *screenWrapper = qobject_cast<QQuickScreenInfo *>(screen); | - | ||||||||||||||||||||||||
144 | QWindow::setScreen(screenWrapper ? screenWrapper->wrappedScreen() : nullptr); | - | ||||||||||||||||||||||||
145 | } never executed: end of block | 0 | ||||||||||||||||||||||||
146 | - | |||||||||||||||||||||||||
147 | void QQuickWindowModule::defineModule() | - | ||||||||||||||||||||||||
148 | { | - | ||||||||||||||||||||||||
149 | const char uri[] = "QtQuick.Window"; | - | ||||||||||||||||||||||||
150 | - | |||||||||||||||||||||||||
151 | qmlRegisterType<QQuickWindow>(uri, 2, 0, "Window"); | - | ||||||||||||||||||||||||
152 | qmlRegisterRevision<QWindow,1>(uri, 2, 1); | - | ||||||||||||||||||||||||
153 | qmlRegisterRevision<QWindow,2>(uri, 2, 2); | - | ||||||||||||||||||||||||
154 | qmlRegisterRevision<QQuickWindow,1>(uri, 2, 1); | - | ||||||||||||||||||||||||
155 | qmlRegisterRevision<QQuickWindow,2>(uri, 2, 2); | - | ||||||||||||||||||||||||
156 | qmlRegisterType<QQuickWindowQmlImpl>(uri, 2, 1, "Window"); | - | ||||||||||||||||||||||||
157 | qmlRegisterType<QQuickWindowQmlImpl,1>(uri, 2, 2, "Window"); | - | ||||||||||||||||||||||||
158 | qmlRegisterType<QQuickWindowQmlImpl,2>(uri, 2, 3, "Window"); | - | ||||||||||||||||||||||||
159 | qmlRegisterUncreatableType<QQuickScreen>(uri, 2, 0, "Screen", ([]() noexcept -> QString { enum { Size = sizeof(u"" "Screen can only be used via the attached property.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Screen can only be used via the attached property." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 54 times by 20 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 54 times by 20 tests: }()));return qstring_literal_temp; Executed by:
| 54 | ||||||||||||||||||||||||
160 | qmlRegisterUncreatableType<QQuickScreen,1>(uri, 2, 3, "Screen", ([]() noexcept -> QString { enum { Size = sizeof(u"" "Screen can only be used via the attached property.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Screen can only be used via the attached property." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 54 times by 20 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 54 times by 20 tests: }()));return qstring_literal_temp; Executed by:
| 54 | ||||||||||||||||||||||||
161 | qmlRegisterUncreatableType<QQuickScreenInfo,2>(uri, 2, 3, "ScreenInfo", ([]() noexcept -> QString { enum { Size = sizeof(u"" "ScreenInfo can only be used via the attached property.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ScreenInfo can only be used via the attached property." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 54 times by 20 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 54 times by 20 tests: }()));return qstring_literal_temp; Executed by:
| 54 | ||||||||||||||||||||||||
162 | qmlRegisterUncreatableType<QQuickScreenInfo,10>(uri, 2, 10, "ScreenInfo", ([]() noexcept -> QString { enum { Size = sizeof(u"" "ScreenInfo can only be used via the attached property.")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "ScreenInfo can only be used via the attached property." }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 54 times by 20 tests: qstring_literal_temp;return qstring_literal_temp; Executed by:
executed 54 times by 20 tests: }()));return qstring_literal_temp; Executed by:
| 54 | ||||||||||||||||||||||||
163 | } executed 54 times by 20 tests: end of block Executed by:
| 54 | ||||||||||||||||||||||||
164 | - | |||||||||||||||||||||||||
165 | - | |||||||||||||||||||||||||
166 | - | |||||||||||||||||||||||||
Switch to Source code | Preprocessed file |