Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmlvme.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qqmlvme_p.h"
5
6#include <private/qmetaobjectbuilder_p.h>
7#include "qqmlengine.h"
8#include <private/qfinitestack_p.h>
9#include <QtQml/private/qqmlcomponent_p.h>
10
11#include <QStack>
12#include <QPointF>
13#include <QSizeF>
14#include <QRectF>
15#include <QtCore/qdebug.h>
16#include <QtCore/qvarlengtharray.h>
17#include <QtCore/qcoreapplication.h>
18#include <QtCore/qdatetime.h>
19#include <QtCore/qvarlengtharray.h>
20#include <QtQml/qjsvalue.h>
21
23
24bool QQmlVME::s_enableComponentComplete = true;
25
27{
28 s_enableComponentComplete = true;
29}
30
32{
33 s_enableComponentComplete = false;
34}
35
37{
38 return s_enableComponentComplete;
39}
40
42: m_objectCount(0), m_objects(nullptr), m_contextCount(0), m_contexts(nullptr)
43{
44}
45
50
52{
53 clear();
54
55 QFiniteStack<QQmlGuard<QObject> > &objects = creator->allCreatedObjects();
56 m_objectCount = objects.count();
57 m_objects = new QQmlGuard<QObject>[m_objectCount];
58 for (int ii = 0; ii < m_objectCount; ++ii)
59 m_objects[ii] = objects[ii];
60
61 m_contextCount = 1;
62 m_contexts = new QQmlGuardedContextData[m_contextCount];
63 m_contexts[0] = creator->parentContextData();
64}
65
67{
68 delete [] m_objects;
69 delete [] m_contexts;
70
71 m_objectCount = 0;
72 m_objects = nullptr;
73 m_contextCount = 0;
74 m_contexts = nullptr;
75}
76
78{
79 for (int ii = 0; ii < m_objectCount; ++ii)
80 if (m_objects[ii].isNull())
81 return false;
82
83 for (int ii = 0; ii < m_contextCount; ++ii)
84 if (m_contexts[ii].isNull() || !m_contexts[ii]->engine())
85 return false;
86
87 return true;
88}
89
bool isOK() const
Definition qqmlvme.cpp:77
void guard(QQmlObjectCreator *)
Definition qqmlvme.cpp:51
void clear()
Definition qqmlvme.cpp:66
static void disableComponentComplete()
Definition qqmlvme.cpp:31
static bool componentCompleteEnabled()
Definition qqmlvme.cpp:36
static void enableComponentComplete()
Definition qqmlvme.cpp:26
Combined button and popup list for selecting options.
QObject::connect nullptr
QItemEditorCreatorBase * creator
QJSEngine engine
[0]