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
Marco Bubke
flatpak-qt-creator
Commits
e45699d1
Commit
e45699d1
authored
Mar 30, 2010
by
Kai Koehne
Browse files
QmlDesigner: Fix compilation of core tests
Patch by Marco Bubke.
parent
387f906b
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/qmldesigner/core/include/nodeinstance.h
View file @
e45699d1
...
...
@@ -135,6 +135,9 @@ public:
static
void
registerDeclarativeTypes
();
#ifdef QT_BUILD_INTERNAL
QObject
*
testHandle
()
const
;
#endif
private:
// functions
NodeInstance
(
const
QSharedPointer
<
Internal
::
ObjectNodeInstance
>
&
abstractInstance
);
...
...
src/plugins/qmldesigner/core/instances/nodeinstance.cpp
View file @
e45699d1
...
...
@@ -622,4 +622,11 @@ void NodeInstance::registerDeclarativeTypes()
qmlRegisterType
<
QmlDesigner
::
Internal
::
QmlPropertyChangesObject
>
();
}
#ifdef QT_BUILD_INTERNAL
QObject
*
NodeInstance
::
testHandle
()
const
{
return
internalObject
();
}
#endif
}
// namespace QmlDesigner
tests/auto/qml/qmldesigner/coretests/testcore.cpp
View file @
e45699d1
...
...
@@ -3651,29 +3651,29 @@ void TestCore::testInstancesStates()
// base state
QVERIFY
(
textInstance
.
isValid
());
QCOMPARE
(
state1Instance
==
instanceView
->
s
tateInstance
(),
false
);
QCOMPARE
(
state2Instance
==
instanceView
->
s
tateInstance
(),
false
);
QCOMPARE
(
state1Instance
==
instanceView
->
activeS
tateInstance
(),
false
);
QCOMPARE
(
state2Instance
==
instanceView
->
activeS
tateInstance
(),
false
);
QCOMPARE
(
textInstance
.
property
(
"x"
).
toInt
(),
0
);
QCOMPARE
(
textInstance
.
property
(
"text"
).
toString
(),
QString
(
"base state"
));
// base state -> state
instanceView
->
activateState
(
state1Instance
);
QCOMPARE
(
state1Instance
==
instanceView
->
s
tateInstance
(),
true
);
QCOMPARE
(
state2Instance
==
instanceView
->
s
tateInstance
(),
false
);
QCOMPARE
(
state1Instance
==
instanceView
->
activeS
tateInstance
(),
true
);
QCOMPARE
(
state2Instance
==
instanceView
->
activeS
tateInstance
(),
false
);
QCOMPARE
(
textInstance
.
property
(
"x"
).
toInt
(),
10
);
QCOMPARE
(
textInstance
.
property
(
"text"
).
toString
(),
QString
(
"state1"
));
// state 1 -> state 2
instanceView
->
activateState
(
state2Instance
);
QCOMPARE
(
state1Instance
==
instanceView
->
s
tateInstance
(),
false
);
QCOMPARE
(
state2Instance
==
instanceView
->
s
tateInstance
(),
true
);
QCOMPARE
(
state1Instance
==
instanceView
->
activeS
tateInstance
(),
false
);
QCOMPARE
(
state2Instance
==
instanceView
->
activeS
tateInstance
(),
true
);
QCOMPARE
(
textInstance
.
property
(
"x"
).
toInt
(),
0
);
QCOMPARE
(
textInstance
.
property
(
"text"
).
toString
(),
QString
(
"state2"
));
// state 1 -> base state
instanceView
->
activateBaseState
();
QCOMPARE
(
state1Instance
==
instanceView
->
s
tateInstance
(),
false
);
QCOMPARE
(
state2Instance
==
instanceView
->
s
tateInstance
(),
false
);
QCOMPARE
(
state1Instance
==
instanceView
->
activeS
tateInstance
(),
false
);
QCOMPARE
(
state2Instance
==
instanceView
->
activeS
tateInstance
(),
false
);
QCOMPARE
(
textInstance
.
property
(
"x"
).
toInt
(),
0
);
QCOMPARE
(
textInstance
.
property
(
"text"
).
toString
(),
QString
(
"base state"
));
...
...
@@ -3844,14 +3844,14 @@ void TestCore::testStates()
NodeInstance
state1Instance
=
view
->
nodeInstanceView
()
->
instanceForNode
(
state1
);
QVERIFY
(
state1Instance
.
isValid
());
QCOMPARE
(
state1Instance
==
view
->
nodeInstanceView
()
->
s
tateInstance
(),
false
);
QCOMPARE
(
state1Instance
==
view
->
nodeInstanceView
()
->
activeS
tateInstance
(),
false
);
QCOMPARE
(
state1Instance
.
property
(
"name"
).
toString
(),
QString
(
"state 1"
));
view
->
setCurrentState
(
state1
);
//set currentState "state 1"
QCOMPARE
(
view
->
currentState
(),
state1
);
QCOMPARE
(
state1Instance
==
view
->
nodeInstanceView
()
->
s
tateInstance
(),
true
);
QCOMPARE
(
state1Instance
==
view
->
nodeInstanceView
()
->
activeS
tateInstance
(),
true
);
QVERIFY
(
!
textItem
.
propertyAffectedByCurrentState
(
"text"
));
...
...
@@ -3873,7 +3873,7 @@ void TestCore::testStates()
QCOMPARE
(
changes
.
modelNode
().
parentProperty
().
name
(),
QString
(
"changes"
));
QCOMPARE
(
changes
.
modelNode
().
parentProperty
().
parentModelNode
(),
state1
.
modelNode
());
QCOMPARE
(
state1Instance
==
view
->
nodeInstanceView
()
->
s
tateInstance
(),
true
);
QCOMPARE
(
state1Instance
==
view
->
nodeInstanceView
()
->
activeS
tateInstance
(),
true
);
QVERIFY
(
textItem
.
propertyAffectedByCurrentState
(
"text"
));
...
...
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