summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-12-22 00:05:06 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-12-22 22:54:56 (GMT)
commitf360cc9b521e5e3e7d4b896627b3257365c6ad3c (patch)
tree1082b32b852cd82c0d46b55445232b7deafa8cbd
parentb461c315547b42293968219583187d83b2b25e0f (diff)
downloadQt-f360cc9b521e5e3e7d4b896627b3257365c6ad3c.zip
Qt-f360cc9b521e5e3e7d4b896627b3257365c6ad3c.tar.gz
Qt-f360cc9b521e5e3e7d4b896627b3257365c6ad3c.tar.bz2
Improve QDeclarativeComponent test coverage.
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp11
-rw-r--r--src/declarative/qml/qdeclarativecomponent_p.h1
-rw-r--r--tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp15
3 files changed, 15 insertions, 12 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 77fc925..ecb3bc5 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -699,17 +699,6 @@ QObject *QDeclarativeComponent::create(QDeclarativeContext *context)
return rv;
}
-QObject *QDeclarativeComponentPrivate::create(QDeclarativeContextData *context,
- const QBitField &bindings)
-{
- if (!context)
- context = QDeclarativeContextData::get(engine->rootContext());
-
- QObject *rv = beginCreate(context, bindings);
- completeCreate();
- return rv;
-}
-
/*!
This method provides more advanced control over component instance creation.
In general, programmers should use QDeclarativeComponent::create() to create a
diff --git a/src/declarative/qml/qdeclarativecomponent_p.h b/src/declarative/qml/qdeclarativecomponent_p.h
index 7b30bad..daf1dcb 100644
--- a/src/declarative/qml/qdeclarativecomponent_p.h
+++ b/src/declarative/qml/qdeclarativecomponent_p.h
@@ -81,7 +81,6 @@ class Q_AUTOTEST_EXPORT QDeclarativeComponentPrivate : public QObjectPrivate, pu
public:
QDeclarativeComponentPrivate() : typeData(0), progress(0.), start(-1), count(-1), cc(0), engine(0), creationContext(0) {}
- QObject *create(QDeclarativeContextData *, const QBitField &);
QObject *beginCreate(QDeclarativeContextData *, const QBitField &);
void completeCreate();
diff --git a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
index 8a19b8b..60ce46d 100644
--- a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
+++ b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp
@@ -57,6 +57,7 @@ public:
tst_qdeclarativecomponent() { }
private slots:
+ void null();
void loadEmptyUrl();
void qmlCreateObject();
@@ -64,6 +65,20 @@ private:
QDeclarativeEngine engine;
};
+void tst_qdeclarativecomponent::null()
+{
+ {
+ QDeclarativeComponent c;
+ QVERIFY(c.isNull());
+ }
+
+ {
+ QDeclarativeComponent c(&engine);
+ QVERIFY(c.isNull());
+ }
+}
+
+
void tst_qdeclarativecomponent::loadEmptyUrl()
{
QDeclarativeComponent c(&engine);