Skip to content
GitLab
Menu
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
34d3b5d8
Commit
34d3b5d8
authored
Apr 28, 2010
by
Kai Koehne
Browse files
QuickDesigner: Remove dependency of autotests to tests/manual/qml
Copy over used files to tests/auto/qml/qmldesigner/data directory.
parent
3828d6b2
Changes
5
Hide whitespace changes
Inline
Side-by-side
tests/auto/qml/qmldesigner/coretests/testcore.cpp
View file @
34d3b5d8
...
...
@@ -6090,10 +6090,8 @@ void TestCore::changePropertyBinding()
void
TestCore
::
loadTestFiles
()
{
const
QString
manualTestPath
=
QLatin1String
(
QTCREATORDIR
)
+
"/tests/manual/qml/testfiles"
;
qDebug
()
<<
manualTestPath
;
{
//empty.qml
QFile
file
(
manualTestPath
+
"
/empty.qml"
);
QFile
file
(
":/fx
/empty.qml"
);
QVERIFY
(
file
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
));
QPlainTextEdit
textEdit
;
...
...
@@ -6111,12 +6109,12 @@ void TestCore::loadTestFiles()
QVERIFY
(
model
.
data
());
ModelNode
rootModelNode
(
testRewriterView
->
rootModelNode
());
QVERIFY
(
rootModelNode
.
isValid
());
QCOMPARE
(
rootModelNode
.
type
(),
QLatin1String
(
"Qt/
Rectangle
"
));
QCOMPARE
(
rootModelNode
.
type
(),
QLatin1String
(
"Qt/
Item
"
));
QVERIFY
(
rootModelNode
.
allDirectSubModelNodes
().
isEmpty
());
}
{
//helloworld.qml
QFile
file
(
manualTestPath
+
"
/helloworld.qml"
);
QFile
file
(
":/fx
/helloworld.qml"
);
QVERIFY
(
file
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
));
QPlainTextEdit
textEdit
;
...
...
@@ -6146,7 +6144,7 @@ void TestCore::loadTestFiles()
QCOMPARE
(
textNode
.
variantProperty
(
"y"
).
value
().
toInt
(),
93
);
}
{
//states.qml
QFile
file
(
manualTestPath
+
"
/states.qml"
);
QFile
file
(
":/fx
/states.qml"
);
QVERIFY
(
file
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
));
QPlainTextEdit
textEdit
;
...
...
@@ -6195,7 +6193,7 @@ void TestCore::loadTestFiles()
QSKIP
(
"Fails because the text editor model doesn't know about components"
,
SkipAll
);
{
//usingbutton.qml
QFile
file
(
manualTestPath
+
"
/usingbutton.qml"
);
QFile
file
(
":/fx
/usingbutton.qml"
);
QVERIFY
(
file
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
));
QPlainTextEdit
textEdit
;
...
...
@@ -6209,7 +6207,6 @@ void TestCore::loadTestFiles()
testRewriterView
->
setTextModifier
(
&
textModifier
);
model
->
attachView
(
testRewriterView
.
data
());
qDebug
()
<<
testRewriterView
->
errors
().
first
().
toString
();
QVERIFY
(
testRewriterView
->
errors
().
isEmpty
());
QVERIFY
(
model
.
data
());
...
...
tests/auto/qml/qmldesigner/data/fx/helloworld.qml
View file @
34d3b5d8
import
Qt
4.7
Rectangle
{
width
:
300
height
:
300
id
:
page
color
:
"
#ffff00
"
Rectangle
{
width
:
183
x
:
31
objectName
:
"
Rectangle_1
"
y
:
76
rotation
:
-
20
height
:
193
color
:
"
#ffaa00
"
gradient
:
Gradient
{
GradientStop
{
position
:
0.0
;
color
:
"
#ffaa00
"
}
GradientStop
{
position
:
1.0
;
color
:
"
#ffaa7f
"
}
}
Text
{
width
:
78
x
:
11
y
:
10
height
:
20
id
:
helloText2
text
:
"
Hello QmlGraphics!
"
}
Text
{
width
:
85
x
:
11
objectName
:
"
xt5
"
y
:
165
height
:
18
id
:
helloText5
text
:
"
blah!!!!!
"
}
Image
{
width
:
422
x
:
47
objectName
:
"
Image_1
"
opacity
:
0.6
y
:
45.2
rotation
:
0
scale
:
0.2
height
:
498
source
:
"
http://farm4.static.flickr.com/3002/2722850010_02b62a030f_m.jpg
"
smooth
:
true
fillMode
:
"
Tile
"
}
Text
{
width
:
100
x
:
178
y
:
11.64
rotation
:
90
height
:
20
id
:
helloText11
text
:
"
Hello QmlGraphics!
"
}
}
Text
{
width
:
100
x
:
10
y
:
13
height
:
20
id
:
helloText3
text
:
"
Hello QmlGraphics!
"
}
width
:
200
height
:
200
Text
{
width
:
127
x
:
163
y
:
184
height
:
106
id
:
helloText4
text
:
"
Hello QmlGraphics!
"
x
:
66
y
:
93
text
:
"
Hello World
"
}
}
tests/auto/qml/qmldesigner/data/fx/states.qml
View file @
34d3b5d8
import
Qt
4.7
Item
{
id
:
theRootItem
;
width
:
400
;
height
:
400
;
Rectangle
{
width
:
157
;
height
:
120
;
x
:
145
;
y
:
157
;
id
:
rectangle_1
;
Rectangle
{
id
:
rect
width
:
200
height
:
200
Text
{
id
:
text
x
:
66
y
:
93
text
:
"
Base State
"
}
Rectangle
{
x
:
49
;
y
:
6
;
width
:
100
;
id
:
rectangle_2
;
color
:
"
#009920
"
;
height
:
100
;
}
states
:
[
State
{
name
:
"
State1
"
;
when
:
destination
===
"
one
"
;
name
:
"
State1
"
PropertyChanges
{
target
:
rectangle_2
;
height
:
200
width
:
300
target
:
rect
color
:
"
blue
"
}
PropertyChanges
{
target
:
text
text
:
"
State1
"
}
},
State
{
name
:
"
State2
"
;
when
:
false
==
true
;
},
State
{
name
:
"
State3
"
;
name
:
"
State2
"
PropertyChanges
{
target
:
rectangle_2
;
x
:
200
y
:
300
target
:
rect
color
:
"
gray
"
}
}
]
transitions
:
[
Transition
{
NumberAnimation
{
properties
:
"
width, height
"
easing
:
"
OutQuad
"
duration
:
500
PropertyChanges
{
target
:
text
text
:
"
State2
"
}
}
]
}
Image
{
id
:
image1
x
:
41
y
:
46
source
:
"
images/qtcreator.png
"
}
}
tests/auto/qml/qmldesigner/data/fx/usingbutton.qml
0 → 100644
View file @
34d3b5d8
import
Qt
4.7
import
"
components
"
as
X
Rectangle
{
width
:
640
height
:
480
X.MyButton
{
}
}
tests/auto/qml/qmldesigner/data/testfiles.qrc
View file @
34d3b5d8
<RCC>
<qresource prefix="/"
>
<qresource prefix="/">
<file>fx/attributes.qml</file>
<file>fx/empty.qml</file>
<file>fx/helloworld.qml</file>
...
...
@@ -7,5 +7,6 @@
<file>qwidget/test.qml</file>
<file>fx/topitem.qml</file>
<file>fx/subitems/SubItem.qml</file>
<file>fx/states.qml</file>
</qresource>
</RCC>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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