Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
27688270
Commit
27688270
authored
May 18, 2010
by
Marco Bubke
Committed by
Kai Koehne
May 28, 2010
Browse files
Load plugins at the beginning of the meta info initializing
Reviewed-by: kkoehne
parent
3330d159
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/designercore/metainfo/metainfo.cpp
View file @
27688270
...
...
@@ -68,6 +68,7 @@ public:
void
clear
();
void
initialize
();
void
loadPlugins
(
QDeclarativeEngine
*
engine
);
void
parseQmlTypes
();
void
parseNonQmlTypes
();
void
parseValueTypes
();
...
...
@@ -112,6 +113,7 @@ void MetaInfoPrivate::initialize()
QDeclarativeEngine
engine
;
Q_UNUSED
(
engine
);
loadPlugins
(
&
engine
);
parseQmlTypes
();
parseNonQmlTypes
();
parseValueTypes
();
...
...
@@ -120,7 +122,25 @@ void MetaInfoPrivate::initialize()
m_isInitialized
=
true
;
}
void
MetaInfoPrivate
::
loadPlugins
(
QDeclarativeEngine
*
engine
)
{
// hack to load plugins
QDeclarativeComponent
pluginComponent
(
engine
);
QStringList
pluginList
;
pluginList
+=
"import Qt 4.7"
;
pluginList
+=
"import org.webkit 1.0"
;
// load maybe useful plugins
pluginList
+=
"import Qt.labs.folderlistmodel 1.0"
;
pluginList
+=
"import Qt.labs.gestures 1.0"
;
pluginList
+=
"import Qt.multimedia 4.7"
;
pluginList
+=
"import Qt.labs.particles 1.0"
;
QString
componentString
=
QString
(
"%1
\n
Item {}
\n
"
).
arg
(
pluginList
.
join
(
"
\n
"
));
pluginComponent
.
setData
(
componentString
.
toLatin1
(),
QUrl
());
}
void
MetaInfoPrivate
::
parseProperties
(
NodeMetaInfo
&
nodeMetaInfo
,
const
QMetaObject
*
qMetaObject
)
const
{
...
...
tests/auto/qml/qmldesigner/coretests/testcore.cpp
View file @
27688270
...
...
@@ -3606,6 +3606,12 @@ void TestCore::testMetaInfo()
{
QScopedPointer
<
Model
>
model
(
Model
::
create
(
"Qt/Item"
));
QVERIFY
(
model
.
data
());
// test whether default type is registered
QVERIFY
(
model
->
metaInfo
().
hasNodeMetaInfo
(
"Qt/Item"
,
4
,
7
));
// test whether types from plugins are loaded
QVERIFY
(
model
->
metaInfo
().
hasNodeMetaInfo
(
"org.webkit/WebView"
,
1
,
0
));
}
void
TestCore
::
testMetaInfoSimpleType
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment