aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js38
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js31
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js22
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js3
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js3
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js10
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js16
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js18
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js50
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js5
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js10
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js8
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js2
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js2
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js72
-rw-r--r--tests/auto/qml/qjsengine/tst_qjsengine.cpp9
-rw-r--r--tests/auto/qml/qml.pro8
-rw-r--r--tests/auto/qml/qmlmin/tst_qmlmin.cpp8
-rw-r--r--tests/auto/qml/qqmlchangeset/qqmlchangeset.pro10
-rw-r--r--tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp (renamed from tests/auto/qml/qquickchangeset/tst_qquickchangeset.cpp)106
-rw-r--r--tests/auto/qml/qqmlecmascript/data/getSet.qml14
-rw-r--r--tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon1.qml47
-rw-r--r--tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon2.qml19
-rw-r--r--tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml19
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml9
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp65
-rw-r--r--tests/auto/qml/qqmllanguage/data/CompositeType5.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/data/CompositeType6.qml2
-rw-r--r--tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml8
-rw-r--r--tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.errors.txt2
-rw-r--r--tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/data/literals.qml4
-rw-r--r--tests/auto/qml/qqmllanguage/data/registeredCompositeType.qml3
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp25
-rw-r--r--tests/auto/qml/qqmllistcompositor/qqmllistcompositor.pro (renamed from tests/auto/qml/qquickchangeset/qquickchangeset.pro)4
-rw-r--r--tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp (renamed from tests/auto/qml/qquicklistcompositor/tst_qquicklistcompositor.cpp)106
-rw-r--r--tests/auto/qml/qqmllistmodel/data/enumerate.qml (renamed from tests/auto/qml/qquicklistmodel/data/enumerate.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodel/data/multipleroles.qml (renamed from tests/auto/qml/qquicklistmodel/data/multipleroles.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodel/data/setmodelcachelist.qml (renamed from tests/auto/qml/qquicklistmodel/data/setmodelcachelist.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodel/data/signalhandlers.qml (renamed from tests/auto/qml/qquicklistmodel/data/signalhandlers.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodel/qqmllistmodel.pro (renamed from tests/auto/qml/qquicklistmodel/qquicklistmodel.pro)4
-rw-r--r--tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp (renamed from tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp)110
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/model.qml (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/model.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/script.js (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/script.js)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.js (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.js)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.qml (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.js (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.js)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.qml (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workersync.js (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workersync.js)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml (renamed from tests/auto/qml/qquicklistmodelworkerscript/data/workersync.qml)0
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/qqmllistmodelworkerscript.pro (renamed from tests/auto/qml/qquicklistmodelworkerscript/qquicklistmodelworkerscript.pro)4
-rw-r--r--tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp (renamed from tests/auto/qml/qquicklistmodelworkerscript/tst_qquicklistmodelworkerscript.cpp)82
-rw-r--r--tests/auto/qml/qqmlmetatype/data/CompositeType.qml5
-rw-r--r--tests/auto/qml/qqmlmetatype/data/ImplicitType.qml5
-rw-r--r--tests/auto/qml/qqmlmetatype/data/testImplicitComposite.qml3
-rw-r--r--tests/auto/qml/qqmlmetatype/qqmlmetatype.pro3
-rw-r--r--tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp58
-rw-r--r--tests/auto/qml/qqmlmoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir1
-rw-r--r--tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp2
-rw-r--r--tests/auto/quick/examples/tst_examples.cpp36
-rw-r--r--tests/auto/quick/qquickanimations/qquickanimations.pro1
-rw-r--r--tests/auto/quick/qquickflickable/qquickflickable.pro1
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp181
-rw-r--r--tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp1
-rw-r--r--tests/auto/quick/qquickgridview/tst_qquickgridview.cpp8
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp8
-rw-r--r--tests/auto/quick/qquicklistview/tst_qquicklistview.cpp12
-rw-r--r--tests/auto/quick/qquickpathview/tst_qquickpathview.cpp152
-rw-r--r--tests/auto/quick/qquickpositioners/data/gridtest.qml6
-rw-r--r--tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp243
-rw-r--r--tests/auto/quick/qquicktextdocument/data/text.qml6
-rw-r--r--tests/auto/quick/qquicktextdocument/qquicktextdocument.pro (renamed from tests/auto/qml/qquicklistcompositor/qquicklistcompositor.pro)9
-rw-r--r--tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp87
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp2
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp4
-rw-r--r--tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp264
-rw-r--r--tests/auto/quick/qquickwindow/data/focus.qml4
-rw-r--r--tests/auto/quick/qquickwindow/data/ownershipRootItem.qml2
-rw-r--r--tests/auto/quick/qquickwindow/data/showHideAnimate.qml5
-rw-r--r--tests/auto/quick/qquickwindow/qquickwindow.pro3
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp192
-rw-r--r--tests/auto/quick/quick.pro1
98 files changed, 1440 insertions, 1014 deletions
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
index a4bf1c7de6..87cba8cd2f 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
@@ -252,44 +252,6 @@ for ( HEX_STRING = "-0x0", HEX_VALUE = 0, POWER = 0; POWER < 15; POWER++, HEX_ST
HEX_VALUE -= Math.pow(16,POWER)*15;
}
-// let us do some octal tests. numbers that start with 0 and do not provid a radix should
-// default to using "0" as a radix.
-
-var OCT_STRING = "0";
-var OCT_VALUE = 0;
-
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+")", OCT_VALUE, parseInt(OCT_STRING) );
- OCT_VALUE += Math.pow(8,POWER)*7;
-}
-
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+")", OCT_VALUE, parseInt(OCT_STRING) );
- OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
-// should get the same results as above if we provid the radix of 8 (or 010)
-
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+",8)", OCT_VALUE, parseInt(OCT_STRING,8) );
- OCT_VALUE += Math.pow(8,POWER)*7;
-}
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+",010)", OCT_VALUE, parseInt(OCT_STRING,010) );
- OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
-// we shall stop parsing digits when we get one that isn't a numeric literal of the type we think
-// it should be.
-for ( OCT_STRING = "0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+"8,8)", OCT_VALUE, parseInt(OCT_STRING+"8",8) );
- OCT_VALUE += Math.pow(8,POWER)*7;
-}
-for ( OCT_STRING = "-0", OCT_VALUE = 0, POWER = 0; POWER < 15; POWER++, OCT_STRING = OCT_STRING +"7" ) {
- new TestCase( SECTION, "parseInt("+OCT_STRING+"8,010)", OCT_VALUE, parseInt(OCT_STRING+"8",010) );
- OCT_VALUE -= Math.pow(8,POWER)*7;
-}
-
new TestCase( SECTION,
"parseInt( '0x' )",
NaN,
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
index 56bf83adcc..a89154e597 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
@@ -384,43 +384,12 @@ new TestCase( SECTION, "parseFloat(0XE)", 14, parseFloat(0XE));
new TestCase( SECTION, "parseFloat(0XF)", 15, parseFloat(0XF));
-// A StringNumericLiteral may not use octal notation
-
-new TestCase( SECTION, "parseFloat('00')", 0, parseFloat("00"));
-new TestCase( SECTION, "parseFloat('01')", 1, parseFloat("01"));
-new TestCase( SECTION, "parseFloat('02')", 2, parseFloat("02"));
-new TestCase( SECTION, "parseFloat('03')", 3, parseFloat("03"));
-new TestCase( SECTION, "parseFloat('04')", 4, parseFloat("04"));
-new TestCase( SECTION, "parseFloat('05')", 5, parseFloat("05"));
-new TestCase( SECTION, "parseFloat('06')", 6, parseFloat("06"));
-new TestCase( SECTION, "parseFloat('07')", 7, parseFloat("07"));
-new TestCase( SECTION, "parseFloat('010')", 10, parseFloat("010"));
-new TestCase( SECTION, "parseFloat('011')", 11, parseFloat("011"));
-
// A StringNumericLIteral may have any number of leading 0 digits
new TestCase( SECTION, "parseFloat('001')", 1, parseFloat("001"));
new TestCase( SECTION, "parseFloat('0001')", 1, parseFloat("0001"));
new TestCase( SECTION, "parseFloat(' 0001 ')", 1, parseFloat(" 0001 "));
-// an octal numeric literal should be treated as an octal
-
-new TestCase( SECTION, "parseFloat(00)", 0, parseFloat(00));
-new TestCase( SECTION, "parseFloat(01)", 1, parseFloat(01));
-new TestCase( SECTION, "parseFloat(02)", 2, parseFloat(02));
-new TestCase( SECTION, "parseFloat(03)", 3, parseFloat(03));
-new TestCase( SECTION, "parseFloat(04)", 4, parseFloat(04));
-new TestCase( SECTION, "parseFloat(05)", 5, parseFloat(05));
-new TestCase( SECTION, "parseFloat(06)", 6, parseFloat(06));
-new TestCase( SECTION, "parseFloat(07)", 7, parseFloat(07));
-new TestCase( SECTION, "parseFloat(010)", 8, parseFloat(010));
-new TestCase( SECTION, "parseFloat(011)", 9, parseFloat(011));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION, "parseFloat(001)", 1, parseFloat(001));
-new TestCase( SECTION, "parseFloat(0001)", 1, parseFloat(0001));
-
// make sure it's reflexive
new TestCase( SECTION, "parseFloat(Math.PI)", Math.PI, parseFloat(Math.PI));
new TestCase( SECTION, "parseFloat(Math.LN2)", Math.LN2, parseFloat(Math.LN2));
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
index 557b93f637..1167b73ee1 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
@@ -256,28 +256,6 @@ new TestCase( SECTION, "parseFloat(' 0XD')", 0, parseFl
new TestCase( SECTION, "parseFloat(' 0XE')", 0, parseFloat(" 0XE"));
new TestCase( SECTION, "parseFloat(' 0XF')", 0, parseFloat(" 0XF"));
-// A StringNumericLiteral may not use octal notation
-
-new TestCase( SECTION, "parseFloat(' 00')", 0, parseFloat(" 00"));
-new TestCase( SECTION, "parseFloat(' 01')", 1, parseFloat(" 01"));
-new TestCase( SECTION, "parseFloat(' 02')", 2, parseFloat(" 02"));
-new TestCase( SECTION, "parseFloat(' 03')", 3, parseFloat(" 03"));
-new TestCase( SECTION, "parseFloat(' 04')", 4, parseFloat(" 04"));
-new TestCase( SECTION, "parseFloat(' 05')", 5, parseFloat(" 05"));
-new TestCase( SECTION, "parseFloat(' 06')", 6, parseFloat(" 06"));
-new TestCase( SECTION, "parseFloat(' 07')", 7, parseFloat(" 07"));
-new TestCase( SECTION, "parseFloat(' 010')", 10, parseFloat(" 010"));
-new TestCase( SECTION, "parseFloat(' 011')", 11, parseFloat(" 011"));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION, "parseFloat(' 001')", 1, parseFloat(" 001"));
-new TestCase( SECTION, "parseFloat(' 0001')", 1, parseFloat(" 0001"));
-
-// A StringNumericLIteral may have any number of leading 0 digits
-
-new TestCase( SECTION, "parseFloat(001)", 1, parseFloat(001));
-new TestCase( SECTION, "parseFloat(0001)", 1, parseFloat(0001));
// make sure it' s reflexive
new TestCase( SECTION, "parseFloat( ' ' +Math.PI+' ')", Math.PI, parseFloat( ' ' +Math.PI+' '));
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
index faeeb9e0b0..18f1986d7e 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
@@ -106,9 +106,6 @@ new TestCase( SECTION, "isNaN( '0xaa' )", false, isNaN( "0xaa" )
new TestCase( SECTION, "isNaN( '0x0A' )", false, isNaN( "0x0A" ) );
new TestCase( SECTION, "isNaN( '0xAA' )", false, isNaN( "0xAA" ) );
-new TestCase( SECTION, "isNaN( 077 )", false, isNaN( 077 ) );
-new TestCase( SECTION, "isNaN( '077' )", false, isNaN( "077" ) );
-
new TestCase( SECTION, "isNaN( Number.NaN )", true, isNaN(Number.NaN) );
new TestCase( SECTION, "isNaN( Number.POSITIVE_INFINITY )", false, isNaN(Number.POSITIVE_INFINITY) );
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
index e3db5e7931..9eb52a8ff1 100644
--- a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
@@ -107,9 +107,6 @@ new TestCase( SECTION, "isFinite( '0xaa' )", true, isFinite( "0
new TestCase( SECTION, "isFinite( '0x0A' )", true, isFinite( "0x0A" ) );
new TestCase( SECTION, "isFinite( '0xAA' )", true, isFinite( "0xAA" ) );
-new TestCase( SECTION, "isFinite( 077 )", true, isFinite( 077 ) );
-new TestCase( SECTION, "isFinite( '077' )", true, isFinite( "077" ) );
-
new TestCase( SECTION, "isFinite( new String('Infinity') )", false, isFinite(new String("Infinity")) );
new TestCase( SECTION, "isFinite( new String('-Infinity') )", false, isFinite(new String("-Infinity")) );
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
index fb13b24e07..3eacb2990f 100644
--- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
@@ -85,16 +85,6 @@ new TestCase( SECTION,
0x100000000 );
new TestCase( SECTION,
- "077777777777777777",
- 2251799813685247,
- 077777777777777777 );
-
-new TestCase( SECTION,
- "077777777777777776",
- 2251799813685246,
- 077777777777777776 );
-
-new TestCase( SECTION,
"0x1fffffffffffff",
9007199254740991,
0x1fffffffffffff );
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
index 8fbe16cb8f..6121cd54fd 100644
--- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
@@ -74,20 +74,4 @@ new TestCase( SECTION,
9,
9 );
-new TestCase( SECTION,
- "09",
- 9,
- 09 );
-
-new TestCase( SECTION,
- "099",
- 99,
- 099 );
-
-
-new TestCase( SECTION,
- "077",
- 63,
- 077 );
-
test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
index 9ccb912752..29635596e1 100644
--- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
@@ -215,24 +215,6 @@ new TestCase( SECTION, "0XE", 14, 0XE );
new TestCase( SECTION, "0XF", 15, 0XF );
-new TestCase( SECTION, "00", 0, 00 );
-new TestCase( SECTION, "01", 1, 01 );
-new TestCase( SECTION, "02", 2, 02 );
-new TestCase( SECTION, "03", 3, 03 );
-new TestCase( SECTION, "04", 4, 04 );
-new TestCase( SECTION, "05", 5, 05 );
-new TestCase( SECTION, "06", 6, 06 );
-new TestCase( SECTION, "07", 7, 07 );
-
-new TestCase( SECTION, "000", 0, 000 );
-new TestCase( SECTION, "011", 9, 011 );
-new TestCase( SECTION, "022", 18, 022 );
-new TestCase( SECTION, "033", 27, 033 );
-new TestCase( SECTION, "044", 36, 044 );
-new TestCase( SECTION, "055", 45, 055 );
-new TestCase( SECTION, "066", 54, 066 );
-new TestCase( SECTION, "077", 63, 077 );
-
new TestCase( SECTION, "0.00000000001", 0.00000000001, 0.00000000001 );
new TestCase( SECTION, "0.00000000001e-2", 0.0000000000001, 0.00000000001e-2 );
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
index 015a385220..4a3173db6c 100644
--- a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
@@ -76,53 +76,6 @@ new TestCase( SECTION, "\\v", String.fromCharCode(0x000B), "\v" );
// DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::OctalEscapeSequence
-new TestCase( SECTION, "\\00", String.fromCharCode(0x0000), "\00" );
-new TestCase( SECTION, "\\01", String.fromCharCode(0x0001), "\01" );
-new TestCase( SECTION, "\\02", String.fromCharCode(0x0002), "\02" );
-new TestCase( SECTION, "\\03", String.fromCharCode(0x0003), "\03" );
-new TestCase( SECTION, "\\04", String.fromCharCode(0x0004), "\04" );
-new TestCase( SECTION, "\\05", String.fromCharCode(0x0005), "\05" );
-new TestCase( SECTION, "\\06", String.fromCharCode(0x0006), "\06" );
-new TestCase( SECTION, "\\07", String.fromCharCode(0x0007), "\07" );
-
-new TestCase( SECTION, "\\010", String.fromCharCode(0x0008), "\010" );
-new TestCase( SECTION, "\\011", String.fromCharCode(0x0009), "\011" );
-new TestCase( SECTION, "\\012", String.fromCharCode(0x000A), "\012" );
-new TestCase( SECTION, "\\013", String.fromCharCode(0x000B), "\013" );
-new TestCase( SECTION, "\\014", String.fromCharCode(0x000C), "\014" );
-new TestCase( SECTION, "\\015", String.fromCharCode(0x000D), "\015" );
-new TestCase( SECTION, "\\016", String.fromCharCode(0x000E), "\016" );
-new TestCase( SECTION, "\\017", String.fromCharCode(0x000F), "\017" );
-new TestCase( SECTION, "\\020", String.fromCharCode(0x0010), "\020" );
-new TestCase( SECTION, "\\042", String.fromCharCode(0x0022), "\042" );
-
-new TestCase( SECTION, "\\0", String.fromCharCode(0x0000), "\0" );
-new TestCase( SECTION, "\\1", String.fromCharCode(0x0001), "\1" );
-new TestCase( SECTION, "\\2", String.fromCharCode(0x0002), "\2" );
-new TestCase( SECTION, "\\3", String.fromCharCode(0x0003), "\3" );
-new TestCase( SECTION, "\\4", String.fromCharCode(0x0004), "\4" );
-new TestCase( SECTION, "\\5", String.fromCharCode(0x0005), "\5" );
-new TestCase( SECTION, "\\6", String.fromCharCode(0x0006), "\6" );
-new TestCase( SECTION, "\\7", String.fromCharCode(0x0007), "\7" );
-
-new TestCase( SECTION, "\\10", String.fromCharCode(0x0008), "\10" );
-new TestCase( SECTION, "\\11", String.fromCharCode(0x0009), "\11" );
-new TestCase( SECTION, "\\12", String.fromCharCode(0x000A), "\12" );
-new TestCase( SECTION, "\\13", String.fromCharCode(0x000B), "\13" );
-new TestCase( SECTION, "\\14", String.fromCharCode(0x000C), "\14" );
-new TestCase( SECTION, "\\15", String.fromCharCode(0x000D), "\15" );
-new TestCase( SECTION, "\\16", String.fromCharCode(0x000E), "\16" );
-new TestCase( SECTION, "\\17", String.fromCharCode(0x000F), "\17" );
-new TestCase( SECTION, "\\20", String.fromCharCode(0x0010), "\20" );
-new TestCase( SECTION, "\\42", String.fromCharCode(0x0022), "\42" );
-
-new TestCase( SECTION, "\\000", String.fromCharCode(0), "\000" );
-new TestCase( SECTION, "\\111", String.fromCharCode(73), "\111" );
-new TestCase( SECTION, "\\222", String.fromCharCode(146), "\222" );
-new TestCase( SECTION, "\\333", String.fromCharCode(219), "\333" );
-
-// following line commented out as it causes a compile time error
-// new TestCase( SECTION, "\\444", "444", "\444" );
// DoubleStringCharacters:DoubleStringCharacter::EscapeSequence::HexEscapeSequence
/*
@@ -202,13 +155,10 @@ new TestCase( SECTION, "\\o", "o", "\o" );
new TestCase( SECTION, "\\p", "p", "\p" );
new TestCase( SECTION, "\\q", "q", "\q" );
new TestCase( SECTION, "\\s", "s", "\s" );
-new TestCase( SECTION, "\\u", "u", "\u" );
new TestCase( SECTION, "\\w", "w", "\w" );
-new TestCase( SECTION, "\\x", "x", "\x" );
new TestCase( SECTION, "\\y", "y", "\y" );
new TestCase( SECTION, "\\z", "z", "\z" );
-new TestCase( SECTION, "\\9", "9", "\9" );
new TestCase( SECTION, "\\A", "A", "\A" );
new TestCase( SECTION, "\\B", "B", "\B" );
diff --git a/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
index 0412742767..abe1095d40 100644
--- a/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
@@ -194,11 +194,6 @@ new TestCase( SECTION,
Math.abs( -0xfff ) );
new TestCase( SECTION,
- "Math.abs( -0777 )",
- 511,
- Math.abs(-0777 ) );
-
-new TestCase( SECTION,
"Math.abs('-1e-1')",
0.1,
Math.abs('-1e-1') );
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
index dc56427395..3141906d5d 100644
--- a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
@@ -296,16 +296,6 @@ new TestCase( SECTION,
0x100000000 );
new TestCase( SECTION,
- "077777777777777777",
- 2251799813685247,
- 077777777777777777 );
-
-new TestCase( SECTION,
- "077777777777777776",
- 2251799813685246,
- 077777777777777776 );
-
-new TestCase( SECTION,
"0x1fffffffffffff",
9007199254740991,
0x1fffffffffffff );
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
index 401ad43c11..053720d7e9 100644
--- a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
@@ -125,70 +125,6 @@ expectedmatch = Array(string);
addThis();
-/*
- * This one should produce a match. The two-character string
- * 'a' + '\011' is duplicated in the pattern and test string:
- */
-status = inSection(4);
-pattern = /.\011/;
-string = 'a\011';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now, for the second character of the string,
- * use the Unicode escape '\u0009' instead of the octal escape '\011'
- */
-status = inSection(5);
-pattern = /.\011/;
-string = 'a\u0009';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now for the second character of the string,
- * use the hex escape '\x09' instead of the octal escape '\011'
- */
-status = inSection(6);
-pattern = /.\011/;
-string = 'a\x09';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Same as above, only now for the second character of the string,
- * use the escape '\t' instead of the octal escape '\011'
- */
-status = inSection(7);
-pattern = /.\011/;
-string = 'a\t';
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
-/*
- * Return to the string from Section 1.
- *
- * Unlike Section 1, use the RegExp() function to create the
- * regexp pattern: null character followed by the string '11'.
- *
- * Since this is exactly what the string is, we should get a match -
- */
-status = inSection(8);
-string = 'a' + String.fromCharCode(0) + '11';
-pattern = RegExp(string);
-actualmatch = string.match(pattern);
-expectedmatch = Array(string);
-addThis();
-
-
//-------------------------------------------------------------------------------------------------
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
index bca1a15e19..7b811abc31 100644
--- a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
@@ -111,11 +111,11 @@ testRegExp([status], [re], [str], [result], [expect]);
//# Some things for avoiding backslashitis later on.
$esc = '\\\\';
$Period = '\.';
-$space = '\040'; $tab = '\t';
+$space = '\x20'; $tab = '\t';
$OpenBR = '\\['; $CloseBR = '\\]';
$OpenParen = '\\('; $CloseParen = '\\)';
-$NonASCII = '\x80-\xff'; $ctrl = '\000-\037';
-$CRlist = '\n\015'; //# note: this should really be only \015.
+$NonASCII = '\x80-\xff'; $ctrl = '\0-\x1f';
+$CRlist = '\n\x0d'; //# note: this should really be only \015.
// Items 19, 20, 21
$qtext = '[^' + $esc + $NonASCII + $CRlist + '\"]'; // # for within "..."
$dtext = '[^' + $esc + $NonASCII + $CRlist + $OpenBR + $CloseBR + ']'; // # for within [...]
@@ -226,7 +226,7 @@ $route_addr =
'>'; // # >
//# Item 3: phrase........
-$phrase_ctrl = '\000-\010\012-\037'; // # like ctrl, but without tab
+$phrase_ctrl = '\0-\x08\x0a-\x1f'; // # like ctrl, but without tab
//# Like atom-char, but without listing space, and uses phrase_ctrl.
//# Since the class is negated, this matches the same as atom-char plus space and tab
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
index 1be199743d..27ddfab51d 100755
--- a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
@@ -37,7 +37,7 @@
var gTestfile = 'regress-441477-01.js';
//-----------------------------------------------------------------------------
-var BUGNUMBER = 441477-01;
+var BUGNUMBER = 441477.01;
var summary = '';
var actual = 'No Exception';
var expect = 'No Exception';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
index 368fde1278..59564b272e 100755
--- a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
@@ -55,7 +55,7 @@ function test()
expect = ["", undefined, ""] + '';
actual = "y".split(/(x)?\1y/) + '';
- reportCompare(expect, actual, summary + ': "y".split(/(x)?\1y/)');
+ reportCompare(expect, actual, summary + ': "y".split(/(x)?\\1y/)');
expect = ["", undefined, ""] + '';
actual = "y".split(/(x)?y/) + '';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js
deleted file mode 100755
index 0e3c4b0189..0000000000
--- a/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is JavaScript Engine testing utilities.
- *
- * The Initial Developer of the Original Code is
- * Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2007
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s): Martin Honnen
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-var gTestfile = 'regress-352044-02-n.js';
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 352044;
-var summary = 'issues with Unicode escape sequences in JavaScript source code';
-var actual = 'No Error';
-var expect = 'SyntaxError';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
- enterFunc ('test');
- printBugNumber(BUGNUMBER);
- printStatus (summary);
-
- print('This test case is expected to throw an uncaught SyntaxError');
-
- try
- {
- var i = 1;
- i \u002b= 1;
- print(i);
- }
- catch(ex)
- {
- actual = ex + '';
- }
-
- reportCompare(expect, actual, summary);
-
- exitFunc ('test');
-}
diff --git a/tests/auto/qml/qjsengine/tst_qjsengine.cpp b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
index 55c3fc800a..70b718c4d8 100644
--- a/tests/auto/qml/qjsengine/tst_qjsengine.cpp
+++ b/tests/auto/qml/qjsengine/tst_qjsengine.cpp
@@ -2226,15 +2226,10 @@ void tst_QJSEngine::jsContinueInSwitch()
void tst_QJSEngine::jsShadowReadOnlyPrototypeProperty()
{
- // SpiderMonkey has different behavior than JSC and V8; it disallows
- // creating a property on the instance if there's a property with the
- // same name in the prototype, and that property is read-only. We
- // adopted that behavior in the old (4.5) QtScript back-end, but it
- // just seems weird -- and non-compliant. Adopt the JSC behavior instead.
QJSEngine eng;
QVERIFY(eng.evaluate("o = {}; o.__proto__ = parseInt; o.length").isNumber());
- QCOMPARE(eng.evaluate("o.length = 123; o.length").toInt(), 123);
- QVERIFY(eng.evaluate("o.hasOwnProperty('length')").toBool());
+ QVERIFY(eng.evaluate("o.length = 123; o.length").toInt() != 123);
+ QVERIFY(!eng.evaluate("o.hasOwnProperty('length')").toBool());
}
void tst_QJSEngine::jsReservedWords_data()
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
index b77effe3e5..da705cefdb 100644
--- a/tests/auto/qml/qml.pro
+++ b/tests/auto/qml/qml.pro
@@ -42,11 +42,11 @@ PRIVATETESTS += \
qqmlvaluetypes \
qqmlvaluetypeproviders \
qqmlbinding \
- qquickchangeset \
+ qqmlchangeset \
qqmlconnections \
- qquicklistcompositor \
- qquicklistmodel \
- qquicklistmodelworkerscript \
+ qqmllistcompositor \
+ qqmllistmodel \
+ qqmllistmodelworkerscript \
qquickworkerscript \
qqmlbundle \
qrcqml \
diff --git a/tests/auto/qml/qmlmin/tst_qmlmin.cpp b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
index a2ac6949ee..2957a70d04 100644
--- a/tests/auto/qml/qmlmin/tst_qmlmin.cpp
+++ b/tests/auto/qml/qmlmin/tst_qmlmin.cpp
@@ -112,6 +112,7 @@ void tst_qmlmin::initTestCase()
invalidFiles << "tests/auto/qml/qqmlecmascript/data/qtbug_22843.library.js";
invalidFiles << "tests/auto/qml/qquickworkerscript/data/script_error_onLoad.js";
invalidFiles << "tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedFileQualifier.js";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedImport.js";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/malformedModule.js";
@@ -120,6 +121,13 @@ void tst_qmlmin::initTestCase()
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingFileQualifier.js";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingModuleQualifier.js";
invalidFiles << "tests/auto/qml/qqmlecmascript/data/jsimportfail/missingModuleVersion.js";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml";
+ invalidFiles << "tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml";
}
QStringList tst_qmlmin::findFiles(const QDir &d)
diff --git a/tests/auto/qml/qqmlchangeset/qqmlchangeset.pro b/tests/auto/qml/qqmlchangeset/qqmlchangeset.pro
new file mode 100644
index 0000000000..b65e58c0b3
--- /dev/null
+++ b/tests/auto/qml/qqmlchangeset/qqmlchangeset.pro
@@ -0,0 +1,10 @@
+CONFIG += testcase
+TARGET = tst_qqmlhangeset
+macx:CONFIG -= app_bundle
+
+SOURCES += tst_qqmlchangeset.cpp
+
+CONFIG += parallel_test
+
+QT += core-private gui-private qml-private testlib
+DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qquickchangeset/tst_qquickchangeset.cpp b/tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp
index 77286b04b4..0f09de26d3 100644
--- a/tests/auto/qml/qquickchangeset/tst_qquickchangeset.cpp
+++ b/tests/auto/qml/qqmlchangeset/tst_qqmlchangeset.cpp
@@ -39,9 +39,9 @@
**
****************************************************************************/
#include <qtest.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmlchangeset_p.h>
-class tst_qquickchangeset : public QObject
+class tst_qqmlchangeset : public QObject
{
Q_OBJECT
private slots:
@@ -140,7 +140,7 @@ public:
bool applyChanges(QVector<int> &list, const QVector<Signal> &changes)
{
- QHash<QQuickChangeSet::MoveKey, int> removedValues;
+ QHash<QQmlChangeSet::MoveKey, int> removedValues;
foreach (const Signal &signal, changes) {
if (signal.isInsert()) {
if (signal.index < 0 || signal.index > list.count()) {
@@ -148,7 +148,7 @@ public:
return false;
}
if (signal.moveId != -1) {
- QQuickChangeSet::Insert insert(signal.index, signal.count, signal.moveId, signal.offset);
+ QQmlChangeSet::Insert insert(signal.index, signal.count, signal.moveId, signal.offset);
for (int i = insert.start(); i < insert.end(); ++i)
list.insert(i, removedValues.take(insert.moveKey(i)));
} else {
@@ -160,7 +160,7 @@ public:
return false;
}
if (signal.moveId != -1) {
- QQuickChangeSet::Remove remove(signal.index, signal.count, signal.moveId, signal.offset);
+ QQmlChangeSet::Remove remove(signal.index, signal.count, signal.moveId, signal.offset);
for (int i = remove.start(); i < remove.end(); ++i)
removedValues.insert(remove.moveKey(i), list.at(i));
}
@@ -184,7 +184,7 @@ public:
};
-bool operator ==(const tst_qquickchangeset::Signal &left, const tst_qquickchangeset::Signal &right)
+bool operator ==(const tst_qqmlchangeset::Signal &left, const tst_qqmlchangeset::Signal &right)
{
return left.index == right.index
&& left.count == right.count
@@ -194,13 +194,13 @@ bool operator ==(const tst_qquickchangeset::Signal &left, const tst_qquickchange
}
QT_BEGIN_NAMESPACE
-bool operator ==(const QQuickChangeSet::Change &left, const QQuickChangeSet::Change &right)
+bool operator ==(const QQmlChangeSet::Change &left, const QQmlChangeSet::Change &right)
{
return left.index == right.index && left.count == right.count && left.moveId == right.moveId;
}
QT_END_NAMESPACE
-QDebug operator <<(QDebug debug, const tst_qquickchangeset::Signal &signal)
+QDebug operator <<(QDebug debug, const tst_qqmlchangeset::Signal &signal)
{
if (signal.isInsert() && signal.moveId == -1)
debug.nospace() << "Insert(" << signal.index << "," << signal.count << ")";
@@ -217,8 +217,8 @@ QDebug operator <<(QDebug debug, const tst_qquickchangeset::Signal &signal)
return debug;
}
-Q_DECLARE_METATYPE(tst_qquickchangeset::SignalList)
-Q_DECLARE_METATYPE(tst_qquickchangeset::SignalListList)
+Q_DECLARE_METATYPE(tst_qqmlchangeset::SignalList)
+Q_DECLARE_METATYPE(tst_qqmlchangeset::SignalListList)
#if 0
# define VERIFY_EXPECTED_OUTPUT \
@@ -256,7 +256,7 @@ Q_DECLARE_METATYPE(tst_qquickchangeset::SignalListList)
}
#endif
-void tst_qquickchangeset::sequence_data()
+void tst_qqmlchangeset::sequence_data()
{
QTest::addColumn<SignalList>("input");
QTest::addColumn<SignalList>("output");
@@ -1163,12 +1163,12 @@ void tst_qquickchangeset::sequence_data()
<< Insert(24,1,5,9) << Insert(25,2) << Insert(27,2));
}
-void tst_qquickchangeset::sequence()
+void tst_qqmlchangeset::sequence()
{
QFETCH(SignalList, input);
QFETCH(SignalList, output);
- QQuickChangeSet set;
+ QQmlChangeSet set;
foreach (const Signal &signal, input) {
if (signal.isRemove())
@@ -1182,18 +1182,18 @@ void tst_qquickchangeset::sequence()
}
SignalList changes;
- foreach (const QQuickChangeSet::Remove &remove, set.removes())
+ foreach (const QQmlChangeSet::Remove &remove, set.removes())
changes << Remove(remove.index, remove.count, remove.moveId, remove.offset);
- foreach (const QQuickChangeSet::Insert &insert, set.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, set.inserts())
changes << Insert(insert.index, insert.count, insert.moveId, insert.offset);
- foreach (const QQuickChangeSet::Change &change, set.changes())
+ foreach (const QQmlChangeSet::Change &change, set.changes())
changes << Change(change.index, change.count);
VERIFY_EXPECTED_OUTPUT
QCOMPARE(changes, output);
}
-void tst_qquickchangeset::apply_data()
+void tst_qqmlchangeset::apply_data()
{
QTest::addColumn<SignalListList>("input");
@@ -1297,15 +1297,15 @@ void tst_qquickchangeset::apply_data()
<< (SignalList() << Move(38,23,1,3) << Move(38,31,0,4) << Remove(26,11) << Move(5,7,18,5) << Move(19,0,8,6)));
}
-void tst_qquickchangeset::apply()
+void tst_qqmlchangeset::apply()
{
QFETCH(SignalListList, input);
- QQuickChangeSet set;
- QQuickChangeSet linearSet;
+ QQmlChangeSet set;
+ QQmlChangeSet linearSet;
foreach (const SignalList &list, input) {
- QQuickChangeSet intermediateSet;
+ QQmlChangeSet intermediateSet;
foreach (const Signal &signal, list) {
if (signal.isRemove()) {
intermediateSet.remove(signal.index, signal.count);
@@ -1322,15 +1322,15 @@ void tst_qquickchangeset::apply()
}
SignalList changes;
- foreach (const QQuickChangeSet::Remove &remove, set.removes())
+ foreach (const QQmlChangeSet::Remove &remove, set.removes())
changes << Remove(remove.index, remove.count, remove.moveId, remove.offset);
- foreach (const QQuickChangeSet::Insert &insert, set.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, set.inserts())
changes << Insert(insert.index, insert.count, insert.moveId, insert.offset);
SignalList linearChanges;
- foreach (const QQuickChangeSet::Remove &remove, linearSet.removes())
+ foreach (const QQmlChangeSet::Remove &remove, linearSet.removes())
linearChanges << Remove(remove.index, remove.count, remove.moveId, remove.offset);
- foreach (const QQuickChangeSet::Insert &insert, linearSet.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, linearSet.inserts())
linearChanges << Insert(insert.index, insert.count, insert.moveId, insert.offset);
// The output in the failing tests isn't incorrect, merely sub-optimal.
@@ -1343,7 +1343,7 @@ void tst_qquickchangeset::apply()
QCOMPARE(changes, linearChanges);
}
-void tst_qquickchangeset::removeConsecutive_data()
+void tst_qqmlchangeset::removeConsecutive_data()
{
QTest::addColumn<SignalList>("input");
QTest::addColumn<SignalList>("output");
@@ -1359,22 +1359,22 @@ void tst_qquickchangeset::removeConsecutive_data()
<< (SignalList() << Remove(0,2) << Remove(0,1,0,0) << Remove(0,5));
}
-void tst_qquickchangeset::removeConsecutive()
+void tst_qqmlchangeset::removeConsecutive()
{
QFETCH(SignalList, input);
QFETCH(SignalList, output);
- QVector<QQuickChangeSet::Remove> removes;
+ QVector<QQmlChangeSet::Remove> removes;
foreach (const Signal &signal, input) {
QVERIFY(signal.isRemove());
- removes.append(QQuickChangeSet::Remove(signal.index, signal.count, signal.moveId, signal.offset));
+ removes.append(QQmlChangeSet::Remove(signal.index, signal.count, signal.moveId, signal.offset));
}
- QQuickChangeSet set;
+ QQmlChangeSet set;
set.remove(removes);
SignalList changes;
- foreach (const QQuickChangeSet::Remove &remove, set.removes())
+ foreach (const QQmlChangeSet::Remove &remove, set.removes())
changes << Remove(remove.index, remove.count, remove.moveId, remove.offset);
QVERIFY(set.inserts().isEmpty());
QVERIFY(set.changes().isEmpty());
@@ -1383,7 +1383,7 @@ void tst_qquickchangeset::removeConsecutive()
QCOMPARE(changes, output);
}
-void tst_qquickchangeset::insertConsecutive_data()
+void tst_qqmlchangeset::insertConsecutive_data()
{
QTest::addColumn<SignalList>("input");
QTest::addColumn<SignalList>("output");
@@ -1399,22 +1399,22 @@ void tst_qquickchangeset::insertConsecutive_data()
<< (SignalList() << Insert(0,2) << Insert(2,1,0,0) << Insert(3,5));
}
-void tst_qquickchangeset::insertConsecutive()
+void tst_qqmlchangeset::insertConsecutive()
{
QFETCH(SignalList, input);
QFETCH(SignalList, output);
- QVector<QQuickChangeSet::Insert> inserts;
+ QVector<QQmlChangeSet::Insert> inserts;
foreach (const Signal &signal, input) {
QVERIFY(signal.isInsert());
- inserts.append(QQuickChangeSet::Insert(signal.index, signal.count, signal.moveId, signal.offset));
+ inserts.append(QQmlChangeSet::Insert(signal.index, signal.count, signal.moveId, signal.offset));
}
- QQuickChangeSet set;
+ QQmlChangeSet set;
set.insert(inserts);
SignalList changes;
- foreach (const QQuickChangeSet::Insert &insert, set.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, set.inserts())
changes << Insert(insert.index, insert.count, insert.moveId, insert.offset);
QVERIFY(set.removes().isEmpty());
QVERIFY(set.changes().isEmpty());
@@ -1423,9 +1423,9 @@ void tst_qquickchangeset::insertConsecutive()
QCOMPARE(changes, output);
}
-void tst_qquickchangeset::copy()
+void tst_qqmlchangeset::copy()
{
- QQuickChangeSet changeSet;
+ QQmlChangeSet changeSet;
changeSet.remove(0, 12);
changeSet.remove(5, 4);
changeSet.insert(3, 9);
@@ -1433,9 +1433,9 @@ void tst_qquickchangeset::copy()
changeSet.change(24, 8);
changeSet.move(3, 5, 9, 0);
- QQuickChangeSet copy(changeSet);
+ QQmlChangeSet copy(changeSet);
- QQuickChangeSet assign;
+ QQmlChangeSet assign;
assign = changeSet;
copy.move(4, 2, 5, 1);
@@ -1453,27 +1453,27 @@ void tst_qquickchangeset::copy()
QCOMPARE(assign.difference(), changeSet.difference());
}
-void tst_qquickchangeset::debug()
+void tst_qqmlchangeset::debug()
{
- QQuickChangeSet changeSet;
+ QQmlChangeSet changeSet;
changeSet.remove(0, 12);
changeSet.remove(5, 4);
changeSet.insert(3, 9);
changeSet.insert(15, 2);
changeSet.change(24, 8);
- QTest::ignoreMessage(QtDebugMsg, "QQuickChangeSet(Remove(0,12) Remove(5,4) Insert(3,9) Insert(15,2) Change(24,8) )");
+ QTest::ignoreMessage(QtDebugMsg, "QQmlChangeSet(Remove(0,12) Remove(5,4) Insert(3,9) Insert(15,2) Change(24,8) )");
qDebug() << changeSet;
changeSet.clear();
- QTest::ignoreMessage(QtDebugMsg, "QQuickChangeSet(Remove(12,4,0,0) Insert(5,4,0,0) )");
+ QTest::ignoreMessage(QtDebugMsg, "QQmlChangeSet(Remove(12,4,0,0) Insert(5,4,0,0) )");
changeSet.move(12, 5, 4, 0);
qDebug() << changeSet;
}
-void tst_qquickchangeset::random_data()
+void tst_qqmlchangeset::random_data()
{
QTest::addColumn<int>("seed");
QTest::addColumn<int>("combinations");
@@ -1484,7 +1484,7 @@ void tst_qquickchangeset::random_data()
QTest::newRow("3*5") << 32 << 3 << 5;
}
-void tst_qquickchangeset::random()
+void tst_qqmlchangeset::random()
{
QFETCH(int, seed);
QFETCH(int, combinations);
@@ -1494,14 +1494,14 @@ void tst_qquickchangeset::random()
int failures = 0;
for (int i = 0; i < 20000; ++i) {
- QQuickChangeSet accumulatedSet;
+ QQmlChangeSet accumulatedSet;
SignalList input;
int modelCount = 40;
int moveCount = 0;
for (int j = 0; j < combinations; ++j) {
- QQuickChangeSet set;
+ QQmlChangeSet set;
for (int k = 0; k < depth; ++k) {
switch (-(qrand() % 3)) {
case InsertOp: {
@@ -1537,9 +1537,9 @@ void tst_qquickchangeset::random()
}
SignalList output;
- foreach (const QQuickChangeSet::Remove &remove, accumulatedSet.removes())
+ foreach (const QQmlChangeSet::Remove &remove, accumulatedSet.removes())
output << Remove(remove.index, remove.count, remove.moveId, remove.offset);
- foreach (const QQuickChangeSet::Insert &insert, accumulatedSet.inserts())
+ foreach (const QQmlChangeSet::Insert &insert, accumulatedSet.inserts())
output << Insert(insert.index, insert.count, insert.moveId, insert.offset);
QVector<int> inputList;
@@ -1569,6 +1569,6 @@ void tst_qquickchangeset::random()
QCOMPARE(failures, 0);
}
-QTEST_MAIN(tst_qquickchangeset)
+QTEST_MAIN(tst_qqmlchangeset)
-#include "tst_qquickchangeset.moc"
+#include "tst_qqmlchangeset.moc"
diff --git a/tests/auto/qml/qqmlecmascript/data/getSet.qml b/tests/auto/qml/qqmlecmascript/data/getSet.qml
new file mode 100644
index 0000000000..2987986b38
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/getSet.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+
+QtObject {
+ function get(x) { return 1; }
+ function set(x) { return 1; }
+ function code() {
+ var get = 0;
+ var set = 1;
+ var o = {
+ get foo() { return 2; },
+ set foo(x) { 1; }
+ }
+ }
+}
diff --git a/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon1.qml b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon1.qml
new file mode 100644
index 0000000000..b9a30ef8b5
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon1.qml
@@ -0,0 +1,47 @@
+import QtQuick 2.0
+
+QtObject {
+
+ // PLEASE NOTE: the function below is whitespace and newline sensitive,
+ // because that is what the test is all about.
+ //
+ // So: DO NOT REFORMAT THE CODE BELOW!
+
+ function code() {
+var x=0, y=0;
+var z=
+x
++
+++
+y
+
+//////////////////////////////////////////////////////////////////////////////
+if (false) {
+ ;
+}
+//////////////////////////////////////////////////////////////////////////////
+
+z=
+x
++ ++
+y
+
+//////////////////////////////////////////////////////////////////////////////
+if (false) {
+ ;
+}
+//////////////////////////////////////////////////////////////////////////////
+
+z=
+x
++ ++
+y
+
+//////////////////////////////////////////////////////////////////////////////
+if (false) {
+ ;
+}
+
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon2.qml b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon2.qml
new file mode 100644
index 0000000000..717cdb5715
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon2.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+
+QtObject {
+
+ // PLEASE NOTE: the function below is whitespace and newline sensitive,
+ // because that is what the test is all about.
+ //
+ // So: DO NOT REFORMAT THE CODE BELOW!
+
+ function code() {
+var a, b, c;
+a=b
+++c
+
+if (a === b) {
+}
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml
new file mode 100644
index 0000000000..710729cbfe
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/incrDecrSemicolon_error1.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+
+QtObject {
+
+ // PLEASE NOTE: the function below is whitespace and newline sensitive,
+ // because that is what the test is all about.
+ //
+ // So: DO NOT REFORMAT THE CODE BELOW!
+
+ function code() {
+var x=0, y=0;
+var z=
+x
+++
+++
+y
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml
new file mode 100644
index 0000000000..1b83a1be0b
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.1.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml
new file mode 100644
index 0000000000..77f13178c3
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.2.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 1.01;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml
new file mode 100644
index 0000000000..f20baf305a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.3.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 1e-10;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml
new file mode 100644
index 0000000000..e115dbbbb1
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.4.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = -1.2;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml
new file mode 100644
index 0000000000..c3db17602a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.5.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = .4e-5;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml
new file mode 100644
index 0000000000..471db8708a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.6.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0x1;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml
new file mode 100644
index 0000000000..f8f8e1aae8
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing.7.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0Xa;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml
new file mode 100644
index 0000000000..61233cbd5b
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing_error.1.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0x;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml b/tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml
new file mode 100644
index 0000000000..45195452ca
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/numberParsing_error.2.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = 0X;
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml
new file mode 100644
index 0000000000..71b82b956d
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.1.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\01";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml
new file mode 100644
index 0000000000..787f1d86c7
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.2.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\1a";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml
new file mode 100644
index 0000000000..9954617b6b
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.3.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\012";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml
new file mode 100644
index 0000000000..5bf41f0c1a
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.4.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\00a";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml
new file mode 100644
index 0000000000..563e01a995
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/stringParsing_error.5.qml
@@ -0,0 +1,9 @@
+
+import QtQuick 2.0
+
+QtObject {
+ function code() {
+ var x = "\u000G";
+ }
+}
+
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index fee66695fc..93f3b66504 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -266,6 +266,9 @@ private slots:
void deleteLaterObjectMethodCall();
void automaticSemicolon();
void compatibilitySemicolon();
+ void incrDecrSemicolon1();
+ void incrDecrSemicolon2();
+ void incrDecrSemicolon_error1();
void unaryExpression();
void switchStatement();
void withStatement();
@@ -285,6 +288,8 @@ private slots:
void propertyOverride();
void concatenatedStringPropertyAccess();
void jsOwnedObjectsDeletedOnEngineDestroy();
+ void numberParsing();
+ void stringParsing();
private:
static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter);
@@ -1792,10 +1797,7 @@ void tst_qqmlecmascript::functionErrors()
object = componentTwo.create();
QVERIFY(object != 0);
- QString srpname = object->property("srp_name").toString();
-
- warning = url + QLatin1String(":16: TypeError: Property 'scarceResource' of object ") + srpname
- + QLatin1String(" is not a function");
+ warning = url + QLatin1String(":16: TypeError: Property 'scarceResource' of object [object Object] is not a function");
QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
delete object;
@@ -4111,8 +4113,7 @@ void tst_qqmlecmascript::scarceResources_other()
QVERIFY(!object->property("scarceResourceCopy").isValid()); // not yet assigned, so should not be valid
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
- srp_name = object->property("srp_name").toString();
- expectedWarning = varComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object ") + srp_name + QLatin1String(" is not a function");
+ expectedWarning = varComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object [object Object] is not a function");
QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
@@ -4184,8 +4185,7 @@ void tst_qqmlecmascript::scarceResources_other()
QVERIFY(!object->property("scarceResourceCopy").isValid()); // not yet assigned, so should not be valid
eo = qobject_cast<ScarceResourceObject*>(QQmlProperty::read(object, "a").value<QObject*>());
QVERIFY(eo->scarceResourceIsDetached()); // should be no other copies of it at this stage.
- srp_name = object->property("srp_name").toString();
- expectedWarning = variantComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object ") + srp_name + QLatin1String(" is not a function");
+ expectedWarning = variantComponentTwelve.url().toString() + QLatin1String(":16: TypeError: Property 'scarceResource' of object [object Object] is not a function");
QTest::ignoreMessage(QtWarningMsg, qPrintable(expectedWarning)); // we expect a meaningful warning to be printed.
QMetaObject::invokeMethod(object, "retrieveScarceResource");
QVERIFY(!object->property("scarceResourceCopy").isValid()); // due to exception, assignment will NOT have occurred.
@@ -6625,6 +6625,27 @@ void tst_qqmlecmascript::compatibilitySemicolon()
QVERIFY(object != 0);
}
+void tst_qqmlecmascript::incrDecrSemicolon1()
+{
+ QQmlComponent component(&engine, testFileUrl("incrDecrSemicolon1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+void tst_qqmlecmascript::incrDecrSemicolon2()
+{
+ QQmlComponent component(&engine, testFileUrl("incrDecrSemicolon2.qml"));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+}
+
+void tst_qqmlecmascript::incrDecrSemicolon_error1()
+{
+ QQmlComponent component(&engine, testFileUrl("incrDecrSemicolon_error1.qml"));
+ QObject *object = component.create();
+ QVERIFY(object == 0);
+}
+
void tst_qqmlecmascript::unaryExpression()
{
QQmlComponent component(&engine, testFileUrl("unaryExpression.qml"));
@@ -7343,6 +7364,34 @@ void tst_qqmlecmascript::jsOwnedObjectsDeletedOnEngineDestroy()
delete object;
}
+void tst_qqmlecmascript::numberParsing()
+{
+ for (int i = 1; i < 8; ++i) {
+ QString file("numberParsing.%1.qml");
+ file = file.arg(i);
+ QQmlComponent component(&engine, testFileUrl(file));
+ QObject *object = component.create();
+ QVERIFY(object != 0);
+ }
+ for (int i = 1; i < 3; ++i) {
+ QString file("numberParsing_error.%1.qml");
+ file = file.arg(i);
+ QQmlComponent component(&engine, testFileUrl(file));
+ QVERIFY(!component.errors().isEmpty());
+ }
+}
+
+void tst_qqmlecmascript::stringParsing()
+{
+ for (int i = 1; i < 6; ++i) {
+ QString file("stringParsing_error.%1.qml");
+ file = file.arg(i);
+ QQmlComponent component(&engine, testFileUrl(file));
+ QObject *object = component.create();
+ QVERIFY(object == 0);
+ }
+}
+
QTEST_MAIN(tst_qqmlecmascript)
#include "tst_qqmlecmascript.moc"
diff --git a/tests/auto/qml/qqmllanguage/data/CompositeType5.qml b/tests/auto/qml/qqmllanguage/data/CompositeType5.qml
new file mode 100644
index 0000000000..564468ce90
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/CompositeType5.qml
@@ -0,0 +1,2 @@
+CompositeType {
+}
diff --git a/tests/auto/qml/qqmllanguage/data/CompositeType6.qml b/tests/auto/qml/qqmllanguage/data/CompositeType6.qml
new file mode 100644
index 0000000000..a8a2af9318
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/CompositeType6.qml
@@ -0,0 +1,2 @@
+CompositeType2 {
+}
diff --git a/tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml b/tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml
index 717cd84536..4034849df8 100644
--- a/tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml
+++ b/tests/auto/qml/qqmllanguage/data/assignCompositeToType.qml
@@ -8,6 +8,10 @@ QtObject {
property QtObject myProperty4
property MyQmlObject myProperty5
property MyQmlObject myProperty6
+ property CompositeType myProperty7
+ property CompositeType myProperty8
+ property CompositeType2 myProperty9
+ property CompositeType2 myPropertyA
myProperty: CompositeType {}
myProperty2: CompositeType2 {}
@@ -15,4 +19,8 @@ QtObject {
myProperty4: CompositeType4 {}
myProperty5: CompositeType2 {}
myProperty6: CompositeType4 {}
+ myProperty7: CompositeType {}
+ myProperty8: CompositeType5 {}
+ myProperty9: CompositeType2 {}
+ myPropertyA: CompositeType6 {}
}
diff --git a/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.errors.txt b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.errors.txt
new file mode 100644
index 0000000000..7a75447a62
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.errors.txt
@@ -0,0 +1,2 @@
+3:1:Type RegisteredCompositeType2 unavailable
+-1:-1:File not found
diff --git a/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.qml b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.qml
new file mode 100644
index 0000000000..915a6138d9
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.1.qml
@@ -0,0 +1,3 @@
+import Test 1.0
+
+RegisteredCompositeType2 {}
diff --git a/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.errors.txt b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.errors.txt
new file mode 100644
index 0000000000..0272619404
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.errors.txt
@@ -0,0 +1,2 @@
+3:1:Type RegisteredCompositeType3 unavailable
+1:1:Expected a qualified name id
diff --git a/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.qml b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.qml
new file mode 100644
index 0000000000..43d7f3ee95
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/badCompositeRegistration.2.qml
@@ -0,0 +1,3 @@
+import Test 1.0
+
+RegisteredCompositeType3 {}
diff --git a/tests/auto/qml/qqmllanguage/data/literals.qml b/tests/auto/qml/qqmllanguage/data/literals.qml
index ffef050438..564b389760 100644
--- a/tests/auto/qml/qqmllanguage/data/literals.qml
+++ b/tests/auto/qml/qqmllanguage/data/literals.qml
@@ -2,12 +2,14 @@ import QtQuick 2.0
QtObject {
property variant n1: 0xFe32 // hex
- property variant n2: 015 // octal
+ property variant n2: 015
property variant n3: -4.2E11 // floating-point literals
property variant n4: .1e9
property variant n5: 3e-12
property variant n6: 3e+12
property variant n7: 0.1e9
+ property variant n8: 1152921504606846976
+ property variant n9: 100000000000000000000
property variant c1: "\b" // special characters
property variant c2: "\f"
diff --git a/tests/auto/qml/qqmllanguage/data/registeredCompositeType.qml b/tests/auto/qml/qqmllanguage/data/registeredCompositeType.qml
new file mode 100644
index 0000000000..f633a14fa7
--- /dev/null
+++ b/tests/auto/qml/qqmllanguage/data/registeredCompositeType.qml
@@ -0,0 +1,3 @@
+import Test 1.0
+
+RegisteredCompositeType {}
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index 0f9e328bd9..3121d10265 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -139,6 +139,7 @@ private slots:
void registrationOrder();
void readonly();
void receivers();
+ void registeredCompositeType();
void basicRemote_data();
void basicRemote();
@@ -467,6 +468,9 @@ void tst_qqmllanguage::errors_data()
QTest::newRow("invalidTypeName.4") << "invalidTypeName.4.qml" << "invalidTypeName.4.errors.txt" << false;
QTest::newRow("Major version isolation") << "majorVersionIsolation.qml" << "majorVersionIsolation.errors.txt" << false;
+
+ QTest::newRow("badCompositeRegistration.1") << "badCompositeRegistration.1.qml" << "badCompositeRegistration.1.errors.txt" << false;
+ QTest::newRow("badCompositeRegistration.2") << "badCompositeRegistration.2.qml" << "badCompositeRegistration.2.errors.txt" << false;
}
@@ -2771,6 +2775,10 @@ void tst_qqmllanguage::initTestCase()
QQmlMetaType::registerCustomStringConverter(qMetaTypeId<MyCustomVariantType>(), myCustomVariantTypeConverter);
registerTypes();
+ // Registered here because it uses testFileUrl
+ qmlRegisterType(testFileUrl("CompositeType.qml"), "Test", 1, 0, "RegisteredCompositeType");
+ qmlRegisterType(testFileUrl("CompositeType.DoesNotExist.qml"), "Test", 1, 0, "RegisteredCompositeType2");
+ qmlRegisterType(testFileUrl("invalidRoot.1.qml"), "Test", 1, 0, "RegisteredCompositeType3");
// Registering the TestType class in other modules should have no adverse effects
qmlRegisterType<TestType>("org.qtproject.TestPre", 1, 0, "Test");
@@ -2915,6 +2923,17 @@ void tst_qqmllanguage::receivers()
delete o;
}
+void tst_qqmllanguage::registeredCompositeType()
+{
+ QQmlComponent component(&engine, testFileUrl("registeredCompositeType.qml"));
+
+ VERIFY_ERRORS(0);
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+
+ delete o;
+}
+
// QTBUG-18268
void tst_qqmllanguage::remoteLoadCrash()
{
@@ -3053,6 +3072,8 @@ void tst_qqmllanguage::literals_data()
QTest::newRow("fp3") << "n5" << QVariant(3e-12);
QTest::newRow("fp4") << "n6" << QVariant(3e+12);
QTest::newRow("fp5") << "n7" << QVariant(0.1e9);
+ QTest::newRow("large-int1") << "n8" << QVariant((double) 1152921504606846976);
+ QTest::newRow("large-int2") << "n9" << QVariant(100000000000000000000.);
QTest::newRow("special1") << "c1" << QVariant(QString("\b"));
QTest::newRow("special2") << "c2" << QVariant(QString("\f"));
@@ -3064,8 +3085,8 @@ void tst_qqmllanguage::literals_data()
QTest::newRow("special8") << "c8" << QVariant(QString("\""));
QTest::newRow("special9") << "c9" << QVariant(QString("\\"));
// We don't handle octal escape sequences
- QTest::newRow("special11") << "c10" << QVariant(QString(1, QChar(0xa9)));
- QTest::newRow("special12") << "c11" << QVariant(QString(1, QChar(0x00A9)));
+ QTest::newRow("special10") << "c10" << QVariant(QString(1, QChar(0xa9)));
+ QTest::newRow("special11") << "c11" << QVariant(QString(1, QChar(0x00A9)));
}
void tst_qqmllanguage::literals()
diff --git a/tests/auto/qml/qquickchangeset/qquickchangeset.pro b/tests/auto/qml/qqmllistcompositor/qqmllistcompositor.pro
index fd8c87baa4..e6c9dc3a29 100644
--- a/tests/auto/qml/qquickchangeset/qquickchangeset.pro
+++ b/tests/auto/qml/qqmllistcompositor/qqmllistcompositor.pro
@@ -1,8 +1,8 @@
CONFIG += testcase
-TARGET = tst_qquickchangeset
+TARGET = tst_qqmllistcompositor
macx:CONFIG -= app_bundle
-SOURCES += tst_qquickchangeset.cpp
+SOURCES += tst_qqmllistcompositor.cpp
CONFIG += parallel_test
diff --git a/tests/auto/qml/qquicklistcompositor/tst_qquicklistcompositor.cpp b/tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp
index 5be501c94e..d5e85f478d 100644
--- a/tests/auto/qml/qquicklistcompositor/tst_qquicklistcompositor.cpp
+++ b/tests/auto/qml/qqmllistcompositor/tst_qqmllistcompositor.cpp
@@ -39,11 +39,11 @@
**
****************************************************************************/
#include <qtest.h>
-#include <private/qquicklistcompositor_p.h>
+#include <private/qqmllistcompositor_p.h>
template<typename T, int N> int lengthOf(const T (&)[N]) { return N; }
-typedef QQuickListCompositor C;
+typedef QQmlListCompositor C;
struct Range
{
@@ -70,9 +70,9 @@ template <typename T> struct Array
typedef Array<int> IndexArray;
typedef Array<const void *> ListArray;
-typedef QVector<QQuickListCompositor::Remove> RemoveList;
-typedef QVector<QQuickListCompositor::Insert> InsertList;
-typedef QVector<QQuickListCompositor::Change> ChangeList;
+typedef QVector<QQmlListCompositor::Remove> RemoveList;
+typedef QVector<QQmlListCompositor::Insert> InsertList;
+typedef QVector<QQmlListCompositor::Change> ChangeList;
typedef QVector<Range> RangeList;
@@ -102,7 +102,7 @@ QT_END_NAMESPACE
static const C::Group Visible = C::Group(2);
static const C::Group Selection = C::Group(3);
-class tst_qquicklistcompositor : public QObject
+class tst_qqmllistcompositor : public QObject
{
Q_OBJECT
@@ -174,7 +174,7 @@ private slots:
void groupDebug();
};
-void tst_qquicklistcompositor::find_data()
+void tst_qqmllistcompositor::find_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("startGroup");
@@ -201,7 +201,7 @@ void tst_qquicklistcompositor::find_data()
<< uint(C::PrependFlag | SelectionFlag | C::DefaultFlag | C::CacheFlag) << 0;
}
-void tst_qquicklistcompositor::find()
+void tst_qqmllistcompositor::find()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, startGroup);
@@ -215,7 +215,7 @@ void tst_qquicklistcompositor::find()
QFETCH(uint, rangeFlags);
QFETCH(int, rangeIndex);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -224,7 +224,7 @@ void tst_qquicklistcompositor::find()
compositor.find(startGroup, startIndex);
- QQuickListCompositor::iterator it = compositor.find(group, index);
+ QQmlListCompositor::iterator it = compositor.find(group, index);
QCOMPARE(it.index[C::Cache], cacheIndex);
QCOMPARE(it.index[C::Default], defaultIndex);
QCOMPARE(it.index[Visible], visibleIndex);
@@ -233,7 +233,7 @@ void tst_qquicklistcompositor::find()
QCOMPARE(it->index, rangeIndex);
}
-void tst_qquicklistcompositor::findInsertPosition_data()
+void tst_qqmllistcompositor::findInsertPosition_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("group");
@@ -265,7 +265,7 @@ void tst_qquicklistcompositor::findInsertPosition_data()
<< uint(0) << 0;
}
-void tst_qquicklistcompositor::findInsertPosition()
+void tst_qqmllistcompositor::findInsertPosition()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, group);
@@ -277,14 +277,14 @@ void tst_qquicklistcompositor::findInsertPosition()
QFETCH(uint, rangeFlags);
QFETCH(int, rangeIndex);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
foreach (const Range &range, ranges)
compositor.append(range.list, range.index, range.count, range.flags);
- QQuickListCompositor::insert_iterator it = compositor.findInsertPosition(group, index);
+ QQmlListCompositor::insert_iterator it = compositor.findInsertPosition(group, index);
QCOMPARE(it.index[C::Cache], cacheIndex);
QCOMPARE(it.index[C::Default], defaultIndex);
@@ -294,9 +294,9 @@ void tst_qquicklistcompositor::findInsertPosition()
QCOMPARE(it->index, rangeIndex);
}
-void tst_qquicklistcompositor::insert()
+void tst_qqmllistcompositor::insert()
{
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -383,7 +383,7 @@ void tst_qquicklistcompositor::insert()
}
}
-void tst_qquicklistcompositor::clearFlags_data()
+void tst_qqmllistcompositor::clearFlags_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("group");
@@ -518,7 +518,7 @@ void tst_qquicklistcompositor::clearFlags_data()
}
}
-void tst_qquicklistcompositor::clearFlags()
+void tst_qqmllistcompositor::clearFlags()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, group);
@@ -535,7 +535,7 @@ void tst_qquicklistcompositor::clearFlags()
QFETCH(IndexArray, selectionIndexes);
QFETCH(ListArray, selectionLists);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -577,7 +577,7 @@ void tst_qquicklistcompositor::clearFlags()
}
}
-void tst_qquicklistcompositor::setFlags_data()
+void tst_qqmllistcompositor::setFlags_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("group");
@@ -700,7 +700,7 @@ void tst_qquicklistcompositor::setFlags_data()
}
}
-void tst_qquicklistcompositor::setFlags()
+void tst_qqmllistcompositor::setFlags()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, group);
@@ -717,7 +717,7 @@ void tst_qquicklistcompositor::setFlags()
QFETCH(IndexArray, selectionIndexes);
QFETCH(ListArray, selectionLists);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -759,7 +759,7 @@ void tst_qquicklistcompositor::setFlags()
}
}
-void tst_qquicklistcompositor::move_data()
+void tst_qqmllistcompositor::move_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<C::Group>("fromGroup");
@@ -985,7 +985,7 @@ void tst_qquicklistcompositor::move_data()
}
}
-void tst_qquicklistcompositor::move()
+void tst_qqmllistcompositor::move()
{
QFETCH(RangeList, ranges);
QFETCH(C::Group, fromGroup);
@@ -1004,7 +1004,7 @@ void tst_qquicklistcompositor::move()
QFETCH(IndexArray, selectionIndexes);
QFETCH(ListArray, selectionLists);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1048,11 +1048,11 @@ void tst_qquicklistcompositor::move()
}
}
-void tst_qquicklistcompositor::moveFromEnd()
+void tst_qqmllistcompositor::moveFromEnd()
{
int listA; void *a = &listA;
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.append(a, 0, 1, C::AppendFlag | C::PrependFlag | C::DefaultFlag);
// Moving an item anchors it to that position.
@@ -1074,9 +1074,9 @@ void tst_qquicklistcompositor::moveFromEnd()
QCOMPARE(it.modelIndex(), 0);
}
-void tst_qquicklistcompositor::clear()
+void tst_qqmllistcompositor::clear()
{
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1097,7 +1097,7 @@ void tst_qquicklistcompositor::clear()
QCOMPARE(compositor.count(C::Cache), 0);
}
-void tst_qquicklistcompositor::listItemsInserted_data()
+void tst_qqmllistcompositor::listItemsInserted_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<void *>("list");
@@ -1226,7 +1226,7 @@ void tst_qquicklistcompositor::listItemsInserted_data()
}
}
-void tst_qquicklistcompositor::listItemsInserted()
+void tst_qqmllistcompositor::listItemsInserted()
{
QFETCH(RangeList, ranges);
QFETCH(void *, list);
@@ -1238,7 +1238,7 @@ void tst_qquicklistcompositor::listItemsInserted()
QFETCH(IndexArray, visibleIndexes);
QFETCH(IndexArray, selectionIndexes);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1276,7 +1276,7 @@ void tst_qquicklistcompositor::listItemsInserted()
}
}
-void tst_qquicklistcompositor::listItemsRemoved_data()
+void tst_qqmllistcompositor::listItemsRemoved_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<void *>("list");
@@ -1362,7 +1362,7 @@ void tst_qquicklistcompositor::listItemsRemoved_data()
}
}
-void tst_qquicklistcompositor::listItemsRemoved()
+void tst_qqmllistcompositor::listItemsRemoved()
{
QFETCH(RangeList, ranges);
QFETCH(void *, list);
@@ -1374,7 +1374,7 @@ void tst_qquicklistcompositor::listItemsRemoved()
QFETCH(IndexArray, visibleIndexes);
QFETCH(IndexArray, selectionIndexes);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1412,7 +1412,7 @@ void tst_qquicklistcompositor::listItemsRemoved()
}
}
-void tst_qquicklistcompositor::listItemsMoved_data()
+void tst_qqmllistcompositor::listItemsMoved_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<void *>("list");
@@ -1554,7 +1554,7 @@ void tst_qquicklistcompositor::listItemsMoved_data()
}
}
-void tst_qquicklistcompositor::listItemsMoved()
+void tst_qqmllistcompositor::listItemsMoved()
{
QFETCH(RangeList, ranges);
QFETCH(void *, list);
@@ -1568,7 +1568,7 @@ void tst_qquicklistcompositor::listItemsMoved()
QFETCH(IndexArray, visibleIndexes);
QFETCH(IndexArray, selectionIndexes);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1608,7 +1608,7 @@ void tst_qquicklistcompositor::listItemsMoved()
}
}
-void tst_qquicklistcompositor::listItemsChanged_data()
+void tst_qqmllistcompositor::listItemsChanged_data()
{
QTest::addColumn<RangeList>("ranges");
QTest::addColumn<void *>("list");
@@ -1640,7 +1640,7 @@ void tst_qquicklistcompositor::listItemsChanged_data()
<< Change(0, 0, 3, 6, 2, C::DefaultFlag | C::CacheFlag));
}
-void tst_qquicklistcompositor::listItemsChanged()
+void tst_qqmllistcompositor::listItemsChanged()
{
QFETCH(RangeList, ranges);
QFETCH(void *, list);
@@ -1648,7 +1648,7 @@ void tst_qquicklistcompositor::listItemsChanged()
QFETCH(int, count);
QFETCH(ChangeList, expectedChanges);
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
@@ -1661,12 +1661,12 @@ void tst_qquicklistcompositor::listItemsChanged()
QCOMPARE(changes, expectedChanges);
}
-void tst_qquicklistcompositor::compositorDebug()
+void tst_qqmllistcompositor::compositorDebug()
{
void *a = (void *)0xa0;
void *b = (void *)0xb0;
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
compositor.append(a, 0, 2, C::PrependFlag | C::DefaultFlag);
@@ -1676,7 +1676,7 @@ void tst_qquicklistcompositor::compositorDebug()
compositor.append(a, 2, 3, C::DefaultFlag);
QTest::ignoreMessage(QtDebugMsg,
- "QQuickListCompositor(00110\n"
+ "QQmlListCompositor(00110\n"
" 0 0 0 0 Range(0xa0 0 2 00P000000000D0\n"
" 0 0 2 0 Range(0xa0 2 3 00P00000000000\n"
" 0 0 2 0 Range(0xa0 5 2 0AP000000000D0\n"
@@ -1687,7 +1687,7 @@ void tst_qquicklistcompositor::compositorDebug()
compositor.setFlags(C::Default, 5, 2, SelectionFlag);
QTest::ignoreMessage(QtDebugMsg,
- "QQuickListCompositor(20110\n"
+ "QQmlListCompositor(20110\n"
" 0 0 0 0 Range(0xa0 0 2 00P000000000D0\n"
" 0 0 2 0 Range(0xa0 2 3 00P00000000000\n"
" 0 0 2 0 Range(0xa0 5 2 0AP000000000D0\n"
@@ -1698,12 +1698,12 @@ void tst_qquicklistcompositor::compositorDebug()
qDebug() << compositor;
}
-void tst_qquicklistcompositor::changeDebug()
+void tst_qqmllistcompositor::changeDebug()
{
void *a = (void *)0xa0;
void *b = (void *)0xb0;
- QQuickListCompositor compositor;
+ QQmlListCompositor compositor;
compositor.setGroupCount(4);
compositor.setDefaultGroups(VisibleFlag | C::DefaultFlag);
compositor.append(a, 0, 2, C::PrependFlag | C::DefaultFlag);
@@ -1716,14 +1716,14 @@ void tst_qquicklistcompositor::changeDebug()
QTest::ignoreMessage(QtDebugMsg, "Change(-1 2 000000010D0 2 0 7 0)");
- qDebug() << QQuickListCompositor::Change(compositor.find(C::Default, 7), 2, SelectionFlag | C::DefaultFlag);
+ qDebug() << QQmlListCompositor::Change(compositor.find(C::Default, 7), 2, SelectionFlag | C::DefaultFlag);
QTest::ignoreMessage(QtDebugMsg, "Remove(9 4 000000000D0 10 0)");
- qDebug() << QQuickListCompositor::Remove(compositor.find(C::Default, 10), 4, C::DefaultFlag, 9);
+ qDebug() << QQmlListCompositor::Remove(compositor.find(C::Default, 10), 4, C::DefaultFlag, 9);
QTest::ignoreMessage(QtDebugMsg, "Insert(9 4 000000000D0 3 0)");
- qDebug() << QQuickListCompositor::Insert(compositor.find(C::Default, 3), 4, C::DefaultFlag, 9);
+ qDebug() << QQmlListCompositor::Insert(compositor.find(C::Default, 3), 4, C::DefaultFlag, 9);
}
-void tst_qquicklistcompositor::groupDebug()
+void tst_qqmllistcompositor::groupDebug()
{
QTest::ignoreMessage(QtDebugMsg, "Default ");
qDebug() << C::Default;
@@ -1733,8 +1733,8 @@ void tst_qquicklistcompositor::groupDebug()
qDebug() << Selection;
}
-QTEST_MAIN(tst_qquicklistcompositor)
+QTEST_MAIN(tst_qqmllistcompositor)
-#include "tst_qquicklistcompositor.moc"
+#include "tst_qqmllistcompositor.moc"
diff --git a/tests/auto/qml/qquicklistmodel/data/enumerate.qml b/tests/auto/qml/qqmllistmodel/data/enumerate.qml
index f73d66b318..f73d66b318 100644
--- a/tests/auto/qml/qquicklistmodel/data/enumerate.qml
+++ b/tests/auto/qml/qqmllistmodel/data/enumerate.qml
diff --git a/tests/auto/qml/qquicklistmodel/data/multipleroles.qml b/tests/auto/qml/qqmllistmodel/data/multipleroles.qml
index 4a331e2b3e..4a331e2b3e 100644
--- a/tests/auto/qml/qquicklistmodel/data/multipleroles.qml
+++ b/tests/auto/qml/qqmllistmodel/data/multipleroles.qml
diff --git a/tests/auto/qml/qquicklistmodel/data/setmodelcachelist.qml b/tests/auto/qml/qqmllistmodel/data/setmodelcachelist.qml
index 58bf1ccd04..58bf1ccd04 100644
--- a/tests/auto/qml/qquicklistmodel/data/setmodelcachelist.qml
+++ b/tests/auto/qml/qqmllistmodel/data/setmodelcachelist.qml
diff --git a/tests/auto/qml/qquicklistmodel/data/signalhandlers.qml b/tests/auto/qml/qqmllistmodel/data/signalhandlers.qml
index 750d99c5a3..750d99c5a3 100644
--- a/tests/auto/qml/qquicklistmodel/data/signalhandlers.qml
+++ b/tests/auto/qml/qqmllistmodel/data/signalhandlers.qml
diff --git a/tests/auto/qml/qquicklistmodel/qquicklistmodel.pro b/tests/auto/qml/qqmllistmodel/qqmllistmodel.pro
index e2b88ccec6..ef044f1663 100644
--- a/tests/auto/qml/qquicklistmodel/qquicklistmodel.pro
+++ b/tests/auto/qml/qqmllistmodel/qqmllistmodel.pro
@@ -1,8 +1,8 @@
CONFIG += testcase
-TARGET = tst_qquicklistmodel
+TARGET = tst_qqmllistmodel
macx:CONFIG -= app_bundle
-SOURCES += tst_qquicklistmodel.cpp
+SOURCES += tst_qqmllistmodel.cpp
include (../../shared/util.pri)
diff --git a/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
index 8deaae9902..22229febf3 100644
--- a/tests/auto/qml/qquicklistmodel/tst_qquicklistmodel.cpp
+++ b/tests/auto/qml/qqmllistmodel/tst_qqmllistmodel.cpp
@@ -43,7 +43,7 @@
#include <QtQuick/private/qquicktext_p.h>
#include <QtQuick/private/qquickanimation_p.h>
#include <QtQml/private/qqmlengine_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include <QtQml/private/qqmlexpression_p.h>
#include <QQmlComponent>
@@ -82,17 +82,17 @@ static bool isValidErrorMessage(const QString &msg, bool dynamicRoleTest)
return valid;
}
-class tst_qquicklistmodel : public QQmlDataTest
+class tst_qqmllistmodel : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquicklistmodel()
+ tst_qqmllistmodel()
{
qRegisterMetaType<QVector<int> >();
}
private:
- int roleFromName(const QQuickListModel *model, const QString &roleName);
+ int roleFromName(const QQmlListModel *model, const QString &roleName);
static bool compareVariantList(const QVariantList &testList, QVariant object);
@@ -132,11 +132,11 @@ private slots:
void datetime_data();
};
-bool tst_qquicklistmodel::compareVariantList(const QVariantList &testList, QVariant object)
+bool tst_qqmllistmodel::compareVariantList(const QVariantList &testList, QVariant object)
{
bool allOk = true;
- QQuickListModel *model = qobject_cast<QQuickListModel *>(object.value<QObject *>());
+ QQmlListModel *model = qobject_cast<QQmlListModel *>(object.value<QObject *>());
if (model == 0)
return false;
@@ -178,12 +178,12 @@ bool tst_qquicklistmodel::compareVariantList(const QVariantList &testList, QVari
return allOk;
}
-int tst_qquicklistmodel::roleFromName(const QQuickListModel *model, const QString &roleName)
+int tst_qqmllistmodel::roleFromName(const QQmlListModel *model, const QString &roleName)
{
return model->roleNames().key(roleName.toUtf8(), -1);
}
-void tst_qquicklistmodel::static_types_data()
+void tst_qqmllistmodel::static_types_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QVariant>("value");
@@ -240,7 +240,7 @@ void tst_qquicklistmodel::static_types_data()
<< QString("<Unknown File>: Can't assign to existing role 'foo' of different type [List -> Number]");
}
-void tst_qquicklistmodel::static_types()
+void tst_qqmllistmodel::static_types()
{
QFETCH(QString, qml);
QFETCH(QVariant, value);
@@ -272,7 +272,7 @@ void tst_qquicklistmodel::static_types()
delete obj;
}
-void tst_qquicklistmodel::static_i18n_data()
+void tst_qqmllistmodel::static_i18n_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QVariant>("value");
@@ -309,7 +309,7 @@ void tst_qquicklistmodel::static_i18n_data()
<< QString("ListElement: improperly specified QT_TRID_NOOP");
}
-void tst_qquicklistmodel::static_i18n()
+void tst_qqmllistmodel::static_i18n()
{
QFETCH(QString, qml);
QFETCH(QVariant, value);
@@ -341,7 +341,7 @@ void tst_qquicklistmodel::static_i18n()
delete obj;
}
-void tst_qquicklistmodel::static_nestedElements()
+void tst_qqmllistmodel::static_nestedElements()
{
QFETCH(int, elementCount);
@@ -379,7 +379,7 @@ void tst_qquicklistmodel::static_nestedElements()
delete obj;
}
-void tst_qquicklistmodel::static_nestedElements_data()
+void tst_qqmllistmodel::static_nestedElements_data()
{
QTest::addColumn<int>("elementCount");
@@ -389,7 +389,7 @@ void tst_qquicklistmodel::static_nestedElements_data()
QTest::newRow("many items") << 5;
}
-void tst_qquicklistmodel::dynamic_data()
+void tst_qqmllistmodel::dynamic_data()
{
QTest::addColumn<QString>("script");
QTest::addColumn<int>("result");
@@ -530,7 +530,7 @@ void tst_qquicklistmodel::dynamic_data()
}
}
-void tst_qquicklistmodel::dynamic()
+void tst_qqmllistmodel::dynamic()
{
QFETCH(QString, script);
QFETCH(int, result);
@@ -539,7 +539,7 @@ void tst_qquicklistmodel::dynamic()
QQuickItem dummyItem0, dummyItem1;
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine::setContextForObject(&model,engine.rootContext());
engine.rootContext()->setContextObject(&model);
@@ -561,7 +561,7 @@ void tst_qquicklistmodel::dynamic()
QVERIFY(spyCount.count() > 0);
}
-void tst_qquicklistmodel::enumerate()
+void tst_qqmllistmodel::enumerate()
{
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("enumerate.qml"));
@@ -602,7 +602,7 @@ void tst_qquicklistmodel::enumerate()
delete item;
}
-void tst_qquicklistmodel::error_data()
+void tst_qqmllistmodel::error_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QString>("error");
@@ -652,7 +652,7 @@ void tst_qquicklistmodel::error_data()
<< "Foo.ListElement - Foo is not a namespace";
}
-void tst_qquicklistmodel::error()
+void tst_qqmllistmodel::error()
{
QFETCH(QString, qml);
QFETCH(QString, error);
@@ -671,7 +671,7 @@ void tst_qquicklistmodel::error()
}
}
-void tst_qquicklistmodel::syncError()
+void tst_qqmllistmodel::syncError()
{
QString qml = "import QtQuick 2.0\nListModel { id: lm; Component.onCompleted: lm.sync() }";
QString error = "file:dummy.qml:2:1: QML ListModel: List sync() can only be called from a WorkerScript";
@@ -689,7 +689,7 @@ void tst_qquicklistmodel::syncError()
/*
Test model changes from set() are available to the view
*/
-void tst_qquicklistmodel::set_data()
+void tst_qqmllistmodel::set_data()
{
QTest::addColumn<bool>("dynamicRoles");
@@ -697,12 +697,12 @@ void tst_qquicklistmodel::set_data()
QTest::newRow("dynamicRoles") << true;
}
-void tst_qquicklistmodel::set()
+void tst_qqmllistmodel::set()
{
QFETCH(bool, dynamicRoles);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine::setContextForObject(&model,engine.rootContext());
engine.rootContext()->setContextProperty("model", &model);
@@ -727,7 +727,7 @@ void tst_qquicklistmodel::set()
/*
Test model changes on values returned by get() are available to the view
*/
-void tst_qquicklistmodel::get()
+void tst_qqmllistmodel::get()
{
QFETCH(QString, expression);
QFETCH(int, index);
@@ -740,7 +740,7 @@ void tst_qquicklistmodel::get()
component.setData(
"import QtQuick 2.0\n"
"ListModel {}\n", QUrl());
- QQuickListModel *model = qobject_cast<QQuickListModel*>(component.create());
+ QQmlListModel *model = qobject_cast<QQmlListModel*>(component.create());
model->setDynamicRoles(dynamicRoles);
engine.rootContext()->setContextProperty("model", model);
@@ -775,7 +775,7 @@ void tst_qquicklistmodel::get()
delete model;
}
-void tst_qquicklistmodel::get_data()
+void tst_qqmllistmodel::get_data()
{
QTest::addColumn<QString>("expression");
QTest::addColumn<int>("index");
@@ -802,7 +802,7 @@ void tst_qquicklistmodel::get_data()
/*
Test that the tests run in get() also work for nested list data
*/
-void tst_qquicklistmodel::get_nested()
+void tst_qqmllistmodel::get_nested()
{
QFETCH(QString, expression);
QFETCH(int, index);
@@ -818,10 +818,10 @@ void tst_qquicklistmodel::get_nested()
component.setData(
"import QtQuick 2.0\n"
"ListModel {}", QUrl());
- QQuickListModel *model = qobject_cast<QQuickListModel*>(component.create());
+ QQmlListModel *model = qobject_cast<QQmlListModel*>(component.create());
model->setDynamicRoles(dynamicRoles);
QVERIFY(component.errorString().isEmpty());
- QQuickListModel *childModel;
+ QQmlListModel *childModel;
engine.rootContext()->setContextProperty("model", model);
RUNEXPR("model.append({ listRoleA: [\n"
@@ -872,7 +872,7 @@ void tst_qquicklistmodel::get_nested()
int outerListRole = roleFromName(model, outerListRoleName);
QVERIFY(outerListRole >= 0);
- childModel = qobject_cast<QQuickListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
+ childModel = qobject_cast<QQmlListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
QVERIFY(childModel);
QString extendedExpression = QString("get(%1).%2.%3").arg(outerListIndex).arg(outerListRoleName).arg(expression);
@@ -900,20 +900,20 @@ void tst_qquicklistmodel::get_nested()
delete model;
}
-void tst_qquicklistmodel::get_nested_data()
+void tst_qqmllistmodel::get_nested_data()
{
get_data();
}
//QTBUG-13754
-void tst_qquicklistmodel::crash_model_with_multiple_roles()
+void tst_qqmllistmodel::crash_model_with_multiple_roles()
{
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("multipleroles.qml"));
QObject *rootItem = component.create();
QVERIFY(component.errorString().isEmpty());
QVERIFY(rootItem != 0);
- QQuickListModel *model = rootItem->findChild<QQuickListModel*>("listModel");
+ QQmlListModel *model = rootItem->findChild<QQmlListModel*>("listModel");
QVERIFY(model != 0);
// used to cause a crash
@@ -923,7 +923,7 @@ void tst_qquicklistmodel::crash_model_with_multiple_roles()
}
//QTBUG-15190
-void tst_qquicklistmodel::set_model_cache()
+void tst_qqmllistmodel::set_model_cache()
{
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("setmodelcachelist.qml"));
@@ -935,7 +935,7 @@ void tst_qquicklistmodel::set_model_cache()
delete model;
}
-void tst_qquicklistmodel::property_changes()
+void tst_qqmllistmodel::property_changes()
{
QFETCH(QString, script_setup);
QFETCH(QString, script_change);
@@ -946,7 +946,7 @@ void tst_qquicklistmodel::property_changes()
QFETCH(bool, dynamicRoles);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine::setContextForObject(&model, engine.rootContext());
engine.rootContext()->setContextObject(&model);
@@ -993,7 +993,7 @@ void tst_qquicklistmodel::property_changes()
delete connectionsObject;
}
-void tst_qquicklistmodel::property_changes_data()
+void tst_qqmllistmodel::property_changes_data()
{
QTest::addColumn<QString>("script_setup");
QTest::addColumn<QString>("script_change");
@@ -1066,7 +1066,7 @@ void tst_qquicklistmodel::property_changes_data()
}
}
-void tst_qquicklistmodel::clear_data()
+void tst_qqmllistmodel::clear_data()
{
QTest::addColumn<bool>("dynamicRoles");
@@ -1074,12 +1074,12 @@ void tst_qquicklistmodel::clear_data()
QTest::newRow("dynamicRoles") << true;
}
-void tst_qquicklistmodel::clear()
+void tst_qqmllistmodel::clear()
{
QFETCH(bool, dynamicRoles);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine::setContextForObject(&model, engine.rootContext());
engine.rootContext()->setContextProperty("model", &model);
@@ -1111,7 +1111,7 @@ void tst_qquicklistmodel::clear()
QCOMPARE(roleNames[2], QByteArray("propertyC"));
}
-void tst_qquicklistmodel::signal_handlers_data()
+void tst_qqmllistmodel::signal_handlers_data()
{
QTest::addColumn<bool>("dynamicRoles");
@@ -1119,14 +1119,14 @@ void tst_qquicklistmodel::signal_handlers_data()
QTest::newRow("dynamicRoles") << true;
}
-void tst_qquicklistmodel::signal_handlers()
+void tst_qqmllistmodel::signal_handlers()
{
QFETCH(bool, dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("signalhandlers.qml"));
QObject *model = component.create();
- QQuickListModel *lm = qobject_cast<QQuickListModel *>(model);
+ QQmlListModel *lm = qobject_cast<QQmlListModel *>(model);
QVERIFY(lm != 0);
lm->setDynamicRoles(dynamicRoles);
QVERIFY2(component.errorString().isEmpty(), QTest::toString(component.errorString()));
@@ -1136,7 +1136,7 @@ void tst_qquicklistmodel::signal_handlers()
delete model;
}
-void tst_qquicklistmodel::role_mode_data()
+void tst_qqmllistmodel::role_mode_data()
{
QTest::addColumn<QString>("script");
QTest::addColumn<int>("result");
@@ -1150,14 +1150,14 @@ void tst_qquicklistmodel::role_mode_data()
QTest::newRow("enableDynamic2") << "{dynamicRoles=true;append({'a':1});dynamicRoles=false;dynamicRoles}" << 1 << "<Unknown File>: QML ListModel: unable to enable static roles as this model is not empty!";
}
-void tst_qquicklistmodel::role_mode()
+void tst_qqmllistmodel::role_mode()
{
QFETCH(QString, script);
QFETCH(int, result);
QFETCH(QString, warning);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
QQmlEngine::setContextForObject(&model,engine.rootContext());
engine.rootContext()->setContextObject(&model);
QQmlExpression e(engine.rootContext(), &model, script);
@@ -1171,10 +1171,10 @@ void tst_qquicklistmodel::role_mode()
QCOMPARE(actual,result);
}
-void tst_qquicklistmodel::string_to_list_crash()
+void tst_qqmllistmodel::string_to_list_crash()
{
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
QQmlEngine::setContextForObject(&model,engine.rootContext());
engine.rootContext()->setContextObject(&model);
QString script = QLatin1String("{append({'a':'data'});get(0).a = [{'x':123}]}");
@@ -1184,7 +1184,7 @@ void tst_qquicklistmodel::string_to_list_crash()
e.evaluate();
}
-void tst_qquicklistmodel::empty_element_warning_data()
+void tst_qqmllistmodel::empty_element_warning_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<bool>("warning");
@@ -1198,7 +1198,7 @@ void tst_qquicklistmodel::empty_element_warning_data()
QTest::newRow("role3") << "import QtQuick 2.0\nListModel { ListElement {} ListElement {a:1} ListElement {b:2} }" << false;
}
-void tst_qquicklistmodel::empty_element_warning()
+void tst_qqmllistmodel::empty_element_warning()
{
QFETCH(QString, qml);
QFETCH(bool, warning);
@@ -1219,7 +1219,7 @@ void tst_qquicklistmodel::empty_element_warning()
delete obj;
}
-void tst_qquicklistmodel::datetime_data()
+void tst_qqmllistmodel::datetime_data()
{
QTest::addColumn<QString>("qml");
QTest::addColumn<QDateTime>("expected");
@@ -1234,13 +1234,13 @@ void tst_qquicklistmodel::datetime_data()
QTest::newRow("dt3") << "{append({'date':dt0});get(0).date=undefined;get(0).date}" << dt;
}
-void tst_qquicklistmodel::datetime()
+void tst_qqmllistmodel::datetime()
{
QFETCH(QString, qml);
QFETCH(QDateTime, expected);
QQmlEngine engine;
- QQuickListModel model;
+ QQmlListModel model;
QQmlEngine::setContextForObject(&model,engine.rootContext());
QDateTime dt0(QDate(1900, 1, 2), QTime( 8, 14));
QDateTime dt1(QDate(2000, 11, 22), QTime(10, 45));
@@ -1253,6 +1253,6 @@ void tst_qquicklistmodel::datetime()
QVERIFY(expected == dtResult);
}
-QTEST_MAIN(tst_qquicklistmodel)
+QTEST_MAIN(tst_qqmllistmodel)
-#include "tst_qquicklistmodel.moc"
+#include "tst_qqmllistmodel.moc"
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/model.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/model.qml
index 5973ea8adf..5973ea8adf 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/model.qml
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/model.qml
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/script.js b/tests/auto/qml/qqmllistmodelworkerscript/data/script.js
index 66a4acb8a8..66a4acb8a8 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/script.js
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/script.js
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.js b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.js
index cb9dfa66aa..cb9dfa66aa 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.js
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.js
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.qml
index e2361acf6b..e2361acf6b 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremoveelement.qml
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremoveelement.qml
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.js b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.js
index f63dd68839..f63dd68839 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.js
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.js
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.qml
index bdb5e024d8..bdb5e024d8 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workerremovelist.qml
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workerremovelist.qml
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workersync.js b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.js
index 9b8d8fa7f3..9b8d8fa7f3 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workersync.js
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.js
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/data/workersync.qml b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml
index c21cd43e7e..c21cd43e7e 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/data/workersync.qml
+++ b/tests/auto/qml/qqmllistmodelworkerscript/data/workersync.qml
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/qquicklistmodelworkerscript.pro b/tests/auto/qml/qqmllistmodelworkerscript/qqmllistmodelworkerscript.pro
index 07875722f1..14f0604a9b 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/qquicklistmodelworkerscript.pro
+++ b/tests/auto/qml/qqmllistmodelworkerscript/qqmllistmodelworkerscript.pro
@@ -1,8 +1,8 @@
CONFIG += testcase
-TARGET = tst_qquicklistmodelworkerscript
+TARGET = tst_qqmllistmodelworkerscript
macx:CONFIG -= app_bundle
-SOURCES += tst_qquicklistmodelworkerscript.cpp
+SOURCES += tst_qqmllistmodelworkerscript.cpp
include (../../shared/util.pri)
diff --git a/tests/auto/qml/qquicklistmodelworkerscript/tst_qquicklistmodelworkerscript.cpp b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
index 8d5f34c010..a0edfb6891 100644
--- a/tests/auto/qml/qquicklistmodelworkerscript/tst_qquicklistmodelworkerscript.cpp
+++ b/tests/auto/qml/qqmllistmodelworkerscript/tst_qqmllistmodelworkerscript.cpp
@@ -42,7 +42,7 @@
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquicktext_p.h>
#include <QtQml/private/qqmlengine_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include <QtQml/private/qqmlexpression_p.h>
#include <QQmlComponent>
@@ -81,18 +81,18 @@ static bool isValidErrorMessage(const QString &msg, bool dynamicRoleTest)
return valid;
}
-class tst_qquicklistmodelworkerscript : public QQmlDataTest
+class tst_qqmllistmodelworkerscript : public QQmlDataTest
{
Q_OBJECT
public:
- tst_qquicklistmodelworkerscript()
+ tst_qqmllistmodelworkerscript()
{
qRegisterMetaType<QVector<int> >();
}
private:
- int roleFromName(const QQuickListModel *model, const QString &roleName);
- QQuickItem *createWorkerTest(QQmlEngine *eng, QQmlComponent *component, QQuickListModel *model);
+ int roleFromName(const QQmlListModel *model, const QString &roleName);
+ QQuickItem *createWorkerTest(QQmlEngine *eng, QQmlComponent *component, QQmlListModel *model);
void waitForWorker(QQuickItem *item);
static bool compareVariantList(const QVariantList &testList, QVariant object);
@@ -119,11 +119,11 @@ private slots:
void dynamic_role();
};
-bool tst_qquicklistmodelworkerscript::compareVariantList(const QVariantList &testList, QVariant object)
+bool tst_qqmllistmodelworkerscript::compareVariantList(const QVariantList &testList, QVariant object)
{
bool allOk = true;
- QQuickListModel *model = qobject_cast<QQuickListModel *>(object.value<QObject *>());
+ QQmlListModel *model = qobject_cast<QQmlListModel *>(object.value<QObject *>());
if (model == 0)
return false;
@@ -165,12 +165,12 @@ bool tst_qquicklistmodelworkerscript::compareVariantList(const QVariantList &tes
return allOk;
}
-int tst_qquicklistmodelworkerscript::roleFromName(const QQuickListModel *model, const QString &roleName)
+int tst_qqmllistmodelworkerscript::roleFromName(const QQmlListModel *model, const QString &roleName)
{
return model->roleNames().key(roleName.toUtf8(), -1);
}
-QQuickItem *tst_qquicklistmodelworkerscript::createWorkerTest(QQmlEngine *eng, QQmlComponent *component, QQuickListModel *model)
+QQuickItem *tst_qqmllistmodelworkerscript::createWorkerTest(QQmlEngine *eng, QQmlComponent *component, QQmlListModel *model)
{
QQuickItem *item = qobject_cast<QQuickItem*>(component->create());
QQmlEngine::setContextForObject(model, eng->rootContext());
@@ -179,7 +179,7 @@ QQuickItem *tst_qquicklistmodelworkerscript::createWorkerTest(QQmlEngine *eng, Q
return item;
}
-void tst_qquicklistmodelworkerscript::waitForWorker(QQuickItem *item)
+void tst_qqmllistmodelworkerscript::waitForWorker(QQuickItem *item)
{
QQmlProperty prop(item, "done");
QVERIFY(prop.isValid());
@@ -198,7 +198,7 @@ void tst_qquicklistmodelworkerscript::waitForWorker(QQuickItem *item)
QVERIFY(prop.read().toBool());
}
-void tst_qquicklistmodelworkerscript::dynamic_data()
+void tst_qqmllistmodelworkerscript::dynamic_data()
{
QTest::addColumn<QString>("script");
QTest::addColumn<int>("result");
@@ -339,12 +339,12 @@ void tst_qquicklistmodelworkerscript::dynamic_data()
}
}
-void tst_qquicklistmodelworkerscript::dynamic_worker_data()
+void tst_qqmllistmodelworkerscript::dynamic_worker_data()
{
dynamic_data();
}
-void tst_qquicklistmodelworkerscript::dynamic_worker()
+void tst_qqmllistmodelworkerscript::dynamic_worker()
{
QFETCH(QString, script);
QFETCH(int, result);
@@ -357,7 +357,7 @@ void tst_qquicklistmodelworkerscript::dynamic_worker()
// This is same as dynamic() except it applies the test to a ListModel called
// from a WorkerScript.
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("model.qml"));
@@ -389,12 +389,12 @@ void tst_qquicklistmodelworkerscript::dynamic_worker()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::dynamic_worker_sync_data()
+void tst_qqmllistmodelworkerscript::dynamic_worker_sync_data()
{
dynamic_data();
}
-void tst_qquicklistmodelworkerscript::dynamic_worker_sync()
+void tst_qqmllistmodelworkerscript::dynamic_worker_sync()
{
QFETCH(QString, script);
QFETCH(int, result);
@@ -408,7 +408,7 @@ void tst_qquicklistmodelworkerscript::dynamic_worker_sync()
// from the worker script, calls sync(), and tests the changes are reflected in the
// list in the main thread
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("model.qml"));
@@ -439,7 +439,7 @@ void tst_qquicklistmodelworkerscript::dynamic_worker_sync()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::get_data()
+void tst_qqmllistmodelworkerscript::get_data()
{
QTest::addColumn<QString>("expression");
QTest::addColumn<int>("index");
@@ -463,7 +463,7 @@ void tst_qquicklistmodelworkerscript::get_data()
}
}
-void tst_qquicklistmodelworkerscript::get_worker()
+void tst_qqmllistmodelworkerscript::get_worker()
{
QFETCH(QString, expression);
QFETCH(int, index);
@@ -471,7 +471,7 @@ void tst_qquicklistmodelworkerscript::get_worker()
QFETCH(QVariant, roleValue);
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("model.qml"));
@@ -513,12 +513,12 @@ void tst_qquicklistmodelworkerscript::get_worker()
delete item;
}
-void tst_qquicklistmodelworkerscript::get_worker_data()
+void tst_qqmllistmodelworkerscript::get_worker_data()
{
get_data();
}
-void tst_qquicklistmodelworkerscript::property_changes_data()
+void tst_qqmllistmodelworkerscript::property_changes_data()
{
QTest::addColumn<QString>("script_setup");
QTest::addColumn<QString>("script_change");
@@ -591,7 +591,7 @@ void tst_qquicklistmodelworkerscript::property_changes_data()
}
}
-void tst_qquicklistmodelworkerscript::property_changes_worker()
+void tst_qqmllistmodelworkerscript::property_changes_worker()
{
QFETCH(QString, script_setup);
QFETCH(QString, script_change);
@@ -600,7 +600,7 @@ void tst_qquicklistmodelworkerscript::property_changes_worker()
QFETCH(bool, itemsChanged);
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("model.qml"));
@@ -631,12 +631,12 @@ void tst_qquicklistmodelworkerscript::property_changes_worker()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::property_changes_worker_data()
+void tst_qqmllistmodelworkerscript::property_changes_worker_data()
{
property_changes_data();
}
-void tst_qquicklistmodelworkerscript::worker_sync_data()
+void tst_qqmllistmodelworkerscript::worker_sync_data()
{
QTest::addColumn<bool>("dynamicRoles");
@@ -644,11 +644,11 @@ void tst_qquicklistmodelworkerscript::worker_sync_data()
QTest::newRow("dynamicRoles") << true;
}
-void tst_qquicklistmodelworkerscript::worker_sync()
+void tst_qqmllistmodelworkerscript::worker_sync()
{
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("workersync.qml"));
@@ -661,7 +661,7 @@ void tst_qquicklistmodelworkerscript::worker_sync()
QVERIFY(model.count() == 2);
QVariant childData = model.data(0, 0);
- QQuickListModel *childModel = qobject_cast<QQuickListModel *>(childData.value<QObject *>());
+ QQmlListModel *childModel = qobject_cast<QQmlListModel *>(childData.value<QObject *>());
QVERIFY(childModel);
QVERIFY(childModel->count() == 1);
@@ -704,16 +704,16 @@ void tst_qquicklistmodelworkerscript::worker_sync()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::worker_remove_element_data()
+void tst_qqmllistmodelworkerscript::worker_remove_element_data()
{
worker_sync_data();
}
-void tst_qquicklistmodelworkerscript::worker_remove_element()
+void tst_qqmllistmodelworkerscript::worker_remove_element()
{
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("workerremoveelement.qml"));
@@ -746,7 +746,7 @@ void tst_qquicklistmodelworkerscript::worker_remove_element()
{
//don't crash if model was deleted earlier
- QQuickListModel* model = new QQuickListModel;
+ QQmlListModel* model = new QQmlListModel;
model->setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("workerremoveelement.qml"));
@@ -767,16 +767,16 @@ void tst_qquicklistmodelworkerscript::worker_remove_element()
}
}
-void tst_qquicklistmodelworkerscript::worker_remove_list_data()
+void tst_qqmllistmodelworkerscript::worker_remove_list_data()
{
worker_sync_data();
}
-void tst_qquicklistmodelworkerscript::worker_remove_list()
+void tst_qqmllistmodelworkerscript::worker_remove_list()
{
QFETCH(bool, dynamicRoles);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(dynamicRoles);
QQmlEngine eng;
QQmlComponent component(&eng, testFileUrl("workerremovelist.qml"));
@@ -808,7 +808,7 @@ void tst_qquicklistmodelworkerscript::worker_remove_list()
qApp->processEvents();
}
-void tst_qquicklistmodelworkerscript::dynamic_role_data()
+void tst_qqmllistmodelworkerscript::dynamic_role_data()
{
QTest::addColumn<QString>("preamble");
QTest::addColumn<QString>("script");
@@ -817,13 +817,13 @@ void tst_qquicklistmodelworkerscript::dynamic_role_data()
QTest::newRow("sync1") << "{append({'a':[{'b':1},{'b':2}]})}" << "{get(0).a = 'string';count}" << 1;
}
-void tst_qquicklistmodelworkerscript::dynamic_role()
+void tst_qqmllistmodelworkerscript::dynamic_role()
{
QFETCH(QString, preamble);
QFETCH(QString, script);
QFETCH(int, result);
- QQuickListModel model;
+ QQmlListModel model;
model.setDynamicRoles(true);
QQmlEngine engine;
QQmlComponent component(&engine, testFileUrl("model.qml"));
@@ -854,6 +854,6 @@ void tst_qquicklistmodelworkerscript::dynamic_role()
qApp->processEvents();
}
-QTEST_MAIN(tst_qquicklistmodelworkerscript)
+QTEST_MAIN(tst_qqmllistmodelworkerscript)
-#include "tst_qquicklistmodelworkerscript.moc"
+#include "tst_qqmllistmodelworkerscript.moc"
diff --git a/tests/auto/qml/qqmlmetatype/data/CompositeType.qml b/tests/auto/qml/qqmlmetatype/data/CompositeType.qml
new file mode 100644
index 0000000000..bc2abca42b
--- /dev/null
+++ b/tests/auto/qml/qqmlmetatype/data/CompositeType.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property int foo
+}
diff --git a/tests/auto/qml/qqmlmetatype/data/ImplicitType.qml b/tests/auto/qml/qqmlmetatype/data/ImplicitType.qml
new file mode 100644
index 0000000000..ca2bcef5bf
--- /dev/null
+++ b/tests/auto/qml/qqmlmetatype/data/ImplicitType.qml
@@ -0,0 +1,5 @@
+import QtQml 2.0
+
+QtObject {
+ property int bar
+}
diff --git a/tests/auto/qml/qqmlmetatype/data/testImplicitComposite.qml b/tests/auto/qml/qqmlmetatype/data/testImplicitComposite.qml
new file mode 100644
index 0000000000..f838c6995f
--- /dev/null
+++ b/tests/auto/qml/qqmlmetatype/data/testImplicitComposite.qml
@@ -0,0 +1,3 @@
+import "."
+
+ImplicitType{}
diff --git a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
index b24f006bad..a9a6a32a2b 100644
--- a/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
+++ b/tests/auto/qml/qqmlmetatype/qqmlmetatype.pro
@@ -3,6 +3,9 @@ TARGET = tst_qqmlmetatype
SOURCES += tst_qqmlmetatype.cpp
macx:CONFIG -= app_bundle
+TESTDATA = data/*
+include (../../shared/util.pri)
+
CONFIG += parallel_test
QT += core-private gui-private qml-private testlib v8-private
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
index d5dd364e25..90023222d3 100644
--- a/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
+++ b/tests/auto/qml/qqmlmetatype/tst_qqmlmetatype.cpp
@@ -41,12 +41,16 @@
#include <qtest.h>
#include <qqml.h>
+#include <qqmlprivate.h>
+#include <qqmlengine.h>
+#include <qqmlcomponent.h>
#include <private/qqmlmetatype_p.h>
#include <private/qqmlpropertyvalueinterceptor_p.h>
#include <private/qhashedstring_p.h>
+#include "../../shared/util.h"
-class tst_qqmlmetatype : public QObject
+class tst_qqmlmetatype : public QQmlDataTest
{
Q_OBJECT
public:
@@ -60,6 +64,8 @@ private slots:
void qmlPropertyValueInterceptorCast();
void qmlType();
void invalidQmlTypeName();
+ void registrationType();
+ void compositeType();
void isList();
@@ -77,6 +83,13 @@ public:
};
QML_DECLARE_TYPE(TestType);
+QObject *testTypeProvider(QQmlEngine *engine, QJSEngine *scriptEngine)
+{
+ Q_UNUSED(engine);
+ Q_UNUSED(scriptEngine);
+ return new TestType();
+}
+
class ParserStatusTestType : public QObject, public QQmlParserStatus
{
Q_OBJECT
@@ -108,10 +121,15 @@ QML_DECLARE_TYPE(ValueInterceptorTestType);
void tst_qqmlmetatype::initTestCase()
{
+ QQmlDataTest::initTestCase();
qmlRegisterType<TestType>("Test", 1, 0, "TestType");
+ qmlRegisterSingletonType<TestType>("Test", 1, 0, "TestTypeSingleton", testTypeProvider);
qmlRegisterType<ParserStatusTestType>("Test", 1, 0, "ParserStatusTestType");
qmlRegisterType<ValueSourceTestType>("Test", 1, 0, "ValueSourceTestType");
qmlRegisterType<ValueInterceptorTestType>("Test", 1, 0, "ValueInterceptorTestType");
+
+ QUrl testTypeUrl(testFileUrl("CompositeType.qml"));
+ qmlRegisterType(testTypeUrl, "Test", 1, 0, "TestTypeComposite");
}
void tst_qqmlmetatype::qmlParserStatusCast()
@@ -228,6 +246,44 @@ void tst_qqmlmetatype::defaultObject()
QCOMPARE(QString(QQmlMetaType::defaultProperty(&t).name()), QString("foo"));
}
+void tst_qqmlmetatype::registrationType()
+{
+ QQmlType *type = QQmlMetaType::qmlType(QString("TestType"), QString("Test"), 1, 0);
+ QVERIFY(type);
+ QVERIFY(!type->isInterface());
+ QVERIFY(!type->isSingleton());
+ QVERIFY(!type->isComposite());
+
+ type = QQmlMetaType::qmlType(QString("TestTypeSingleton"), QString("Test"), 1, 0);
+ QVERIFY(type);
+ QVERIFY(!type->isInterface());
+ QVERIFY(type->isSingleton());
+ QVERIFY(!type->isComposite());
+
+ type = QQmlMetaType::qmlType(QString("TestTypeComposite"), QString("Test"), 1, 0);
+ QVERIFY(type);
+ QVERIFY(!type->isInterface());
+ QVERIFY(!type->isSingleton());
+ QVERIFY(type->isComposite());
+}
+
+void tst_qqmlmetatype::compositeType()
+{
+ QQmlEngine engine;
+
+ //Loading the test file also loads all composite types it imports
+ QQmlComponent c(&engine, testFileUrl("testImplicitComposite.qml"));
+ QObject* obj = c.create();
+ QVERIFY(obj);
+
+ QQmlType *type = QQmlMetaType::qmlType(QString("ImplicitType"), QString(""), 1, 0);
+ QVERIFY(type);
+ QVERIFY(type->module() == QLatin1String(""));
+ QVERIFY(type->elementName() == QLatin1String("ImplicitType"));
+ QCOMPARE(type->qmlTypeName(), QLatin1String("ImplicitType"));
+ QCOMPARE(type->sourceUrl(), testFileUrl("ImplicitType.qml"));
+}
+
QTEST_MAIN(tst_qqmlmetatype)
#include "tst_qqmlmetatype.moc"
diff --git a/tests/auto/qml/qqmlmoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir b/tests/auto/qml/qqmlmoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir
deleted file mode 100644
index 0a8b5d46eb..0000000000
--- a/tests/auto/qml/qqmlmoduleplugin/imports/com/nokia/AutoTestQmlPluginType/qmldir
+++ /dev/null
@@ -1 +0,0 @@
-plugin plugin
diff --git a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
index 46e0c9e436..a2bf06c2ba 100644
--- a/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
+++ b/tests/auto/qml/qquickworkerscript/tst_qquickworkerscript.cpp
@@ -145,7 +145,7 @@ void tst_QQuickWorkerScript::messaging_data()
void tst_QQuickWorkerScript::messaging_sendQObjectList()
{
- // Not allowed to send QObjects other than QQuickListModelWorkerAgent
+ // Not allowed to send QObjects other than QQmlListModelWorkerAgent
// instances. If objects are sent in a list, they will be sent as 'undefined'
// js values.
diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp
index 7055fb6e03..9c5fb88af2 100644
--- a/tests/auto/quick/examples/tst_examples.cpp
+++ b/tests/auto/quick/examples/tst_examples.cpp
@@ -82,11 +82,9 @@ private:
QStringList findQmlFiles(const QDir &);
QQmlEngine engine;
-
- QQuickWindow *window;
};
-tst_examples::tst_examples() : window(0)
+tst_examples::tst_examples()
{
// Add files to exclude here
excludedFiles << "examples/quick/canvas/tiger/tiger.qml"; // QTBUG-26528
@@ -94,7 +92,7 @@ tst_examples::tst_examples() : window(0)
// Add directories you want excluded here (don't add examples/, because they install to examples/qtdeclarative/)
excludedDirs << "shared"; //Not an example
- excludedDirs << "qtquick/text/fonts"; // QTBUG-21415
+ excludedDirs << "quick/text/fonts"; // QTBUG-29004
excludedDirs << "snippets/qml/path"; //No root QQuickItem
excludedDirs << "tutorials/gettingStartedQml"; //C++ example, but no cpp files in root dir
@@ -120,7 +118,6 @@ tst_examples::tst_examples() : window(0)
tst_examples::~tst_examples()
{
- delete window;
}
void tst_examples::init()
@@ -260,6 +257,9 @@ void tst_examples::sgexamples_data()
void tst_examples::sgexamples()
{
QFETCH(QString, file);
+ QQuickWindow window;
+ window.setPersistentOpenGLContext(true);
+ window.setPersistentSceneGraph(true);
QQmlComponent component(&engine, QUrl::fromLocalFile(file));
if (component.status() == QQmlComponent::Error)
@@ -272,13 +272,11 @@ void tst_examples::sgexamples()
component.completeCreate();
QVERIFY(root);
- if (!window) {
- window = new QQuickWindow();
- window->resize(240, 320);
- window->show();
- QVERIFY(QTest::qWaitForWindowExposed(window));
- }
- root->setParentItem(window->contentItem());
+ window.resize(240, 320);
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+
+ root->setParentItem(window.contentItem());
component.completeCreate();
qApp->processEvents();
@@ -303,6 +301,8 @@ void tst_examples::sgsnippets_data()
void tst_examples::sgsnippets()
{
+ QQuickWindow window;
+
QFETCH(QString, file);
QQmlComponent component(&engine, QUrl::fromLocalFile(file));
@@ -316,13 +316,11 @@ void tst_examples::sgsnippets()
component.completeCreate();
QVERIFY(root);
- if (!window) {
- window = new QQuickWindow();
- window->resize(240, 320);
- window->show();
- QVERIFY(QTest::qWaitForWindowExposed(window));
- }
- root->setParentItem(window->contentItem());
+ window.resize(240, 320);
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+
+ root->setParentItem(window.contentItem());
component.completeCreate();
qApp->processEvents();
diff --git a/tests/auto/quick/qquickanimations/qquickanimations.pro b/tests/auto/quick/qquickanimations/qquickanimations.pro
index f3cf4832e5..747a2afdff 100644
--- a/tests/auto/quick/qquickanimations/qquickanimations.pro
+++ b/tests/auto/quick/qquickanimations/qquickanimations.pro
@@ -1,4 +1,5 @@
CONFIG += testcase
+mac:CONFIG+=insignificant_test # QTBUG-29062
TARGET = tst_qquickanimations
SOURCES += tst_qquickanimations.cpp
diff --git a/tests/auto/quick/qquickflickable/qquickflickable.pro b/tests/auto/quick/qquickflickable/qquickflickable.pro
index 95c703befe..67d5fc12f0 100644
--- a/tests/auto/quick/qquickflickable/qquickflickable.pro
+++ b/tests/auto/quick/qquickflickable/qquickflickable.pro
@@ -11,3 +11,4 @@ TESTDATA = data/*
QT += core-private gui-private v8-private qml-private quick-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+CONFIG+=insignificant_test
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 57c4c12264..875ade45b8 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -210,10 +210,12 @@ void tst_qquickflickable::boundsBehavior()
void tst_qquickflickable::rebound()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("rebound.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -229,7 +231,7 @@ void tst_qquickflickable::rebound()
QSignalSpy hMoveSpy(flickable, SIGNAL(movingHorizontallyChanged()));
// flick and test the transition is run
- flick(window, QPoint(20,20), QPoint(120,120), 200);
+ flick(window.data(), QPoint(20,20), QPoint(120,120), 200);
QTRY_COMPARE(window->rootObject()->property("transitionsStarted").toInt(), 2);
QCOMPARE(hMoveSpy.count(), 1);
@@ -259,14 +261,13 @@ void tst_qquickflickable::rebound()
#ifdef Q_OS_MAC
QSKIP("QTBUG-26696 - sometimes fails on Mac");
- delete window;
return;
#endif
// flick and trigger the transition multiple times
// (moving signals are emitted as soon as the first transition starts)
- flick(window, QPoint(20,20), QPoint(120,120), 200); // both x and y will bounce back
- flick(window, QPoint(20,120), QPoint(120,20), 200); // only x will bounce back
+ flick(window.data(), QPoint(20,20), QPoint(120,120), 200); // both x and y will bounce back
+ flick(window.data(), QPoint(20,120), QPoint(120,20), 200); // only x will bounce back
QVERIFY(flickable->isMoving());
QVERIFY(window->rootObject()->property("transitionsStarted").toInt() >= 1);
@@ -295,7 +296,7 @@ void tst_qquickflickable::rebound()
// (i.e. moving but transition->running = false)
window->rootObject()->setProperty("transitionEnabled", false);
- flick(window, QPoint(20,20), QPoint(120,120), 200);
+ flick(window.data(), QPoint(20,20), QPoint(120,120), 200);
QCOMPARE(window->rootObject()->property("transitionsStarted").toInt(), 0);
QCOMPARE(hMoveSpy.count(), 1);
QCOMPARE(vMoveSpy.count(), 1);
@@ -308,8 +309,6 @@ void tst_qquickflickable::rebound()
QCOMPARE(movementStartedSpy.count(), 1);
QCOMPARE(movementEndedSpy.count(), 1);
QCOMPARE(window->rootObject()->property("transitionsStarted").toInt(), 0);
-
- delete window;
}
void tst_qquickflickable::maximumFlickVelocity()
@@ -355,7 +354,9 @@ void tst_qquickflickable::pressDelay()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("pressDelay.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -394,7 +395,9 @@ void tst_qquickflickable::nestedPressDelay()
QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("nestedPressDelay.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *outer = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -503,7 +506,8 @@ void tst_qquickflickable::returnToBounds()
{
QFETCH(bool, setRebound);
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
+
window->rootContext()->setContextProperty("setRebound", setRebound);
window->setSource(testFileUrl("resize.qml"));
QVERIFY(window->rootObject() != 0);
@@ -534,8 +538,6 @@ void tst_qquickflickable::returnToBounds()
QVERIFY(!rebound->running());
QCOMPARE(reboundSpy.count(), setRebound ? 2 : 0);
-
- delete window;
}
void tst_qquickflickable::returnToBounds_data()
@@ -548,10 +550,12 @@ void tst_qquickflickable::returnToBounds_data()
void tst_qquickflickable::wheel()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("wheel.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flick = window->rootObject()->findChild<QQuickFlickable*>("flick");
@@ -561,7 +565,7 @@ void tst_qquickflickable::wheel()
QPoint pos(200, 200);
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(0,-120), -120, Qt::Vertical, Qt::NoButton, Qt::NoModifier);
event.setAccepted(false);
- QGuiApplication::sendEvent(window, &event);
+ QGuiApplication::sendEvent(window.data(), &event);
}
QTRY_VERIFY(flick->contentY() > 0);
@@ -575,13 +579,11 @@ void tst_qquickflickable::wheel()
QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(-120,0), -120, Qt::Horizontal, Qt::NoButton, Qt::NoModifier);
event.setAccepted(false);
- QGuiApplication::sendEvent(window, &event);
+ QGuiApplication::sendEvent(window.data(), &event);
}
QTRY_VERIFY(flick->contentX() > 0);
QVERIFY(flick->contentY() == 0);
-
- delete window;
}
void tst_qquickflickable::movingAndFlicking_data()
@@ -616,11 +618,12 @@ void tst_qquickflickable::movingAndFlicking()
const QPoint flickFrom(50, 200); // centre
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -639,7 +642,7 @@ void tst_qquickflickable::movingAndFlicking()
QSignalSpy flickEndSpy(flickable, SIGNAL(flickEnded()));
// do a flick that keeps the view within the bounds
- flick(window, flickFrom, flickToWithoutSnapBack, 200);
+ flick(window.data(), flickFrom, flickToWithoutSnapBack, 200);
QTRY_VERIFY(flickable->isMoving());
QCOMPARE(flickable->isMovingHorizontally(), horizontalEnabled);
@@ -695,7 +698,7 @@ void tst_qquickflickable::movingAndFlicking()
flickable->setContentX(0);
flickable->setContentY(0);
QTRY_VERIFY(!flickable->isMoving());
- flick(window, flickFrom, flickToWithSnapBack, 200);
+ flick(window.data(), flickFrom, flickToWithSnapBack, 10);
QTRY_VERIFY(flickable->isMoving());
QCOMPARE(flickable->isMovingHorizontally(), horizontalEnabled);
@@ -739,8 +742,6 @@ void tst_qquickflickable::movingAndFlicking()
QCOMPARE(flickable->contentX(), 0.0);
QCOMPARE(flickable->contentY(), 0.0);
-
- delete window;
}
@@ -776,11 +777,12 @@ void tst_qquickflickable::movingAndDragging()
const QPoint moveFrom(50, 200); // centre
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowExposed(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -799,10 +801,10 @@ void tst_qquickflickable::movingAndDragging()
QSignalSpy moveEndSpy(flickable, SIGNAL(movementEnded()));
// start the drag
- QTest::mousePress(window, Qt::LeftButton, 0, moveFrom);
- QTest::mouseMove(window, moveFrom + moveByWithoutSnapBack);
- QTest::mouseMove(window, moveFrom + moveByWithoutSnapBack*2);
- QTest::mouseMove(window, moveFrom + moveByWithoutSnapBack*3);
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, moveFrom);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithoutSnapBack);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithoutSnapBack*2);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithoutSnapBack*3);
QTRY_VERIFY(flickable->isMoving());
QCOMPARE(flickable->isMovingHorizontally(), horizontalEnabled);
@@ -821,7 +823,7 @@ void tst_qquickflickable::movingAndDragging()
QCOMPARE(moveStartSpy.count(), 1);
QCOMPARE(dragStartSpy.count(), 1);
- QTest::mouseRelease(window, Qt::LeftButton, 0, moveFrom + moveByWithoutSnapBack*3);
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, moveFrom + moveByWithoutSnapBack*3);
QVERIFY(!flickable->isDragging());
QVERIFY(!flickable->isDraggingHorizontally());
@@ -870,10 +872,10 @@ void tst_qquickflickable::movingAndDragging()
flickable->setContentX(0);
flickable->setContentY(0);
QTRY_VERIFY(!flickable->isMoving());
- QTest::mousePress(window, Qt::LeftButton, 0, moveFrom);
- QTest::mouseMove(window, moveFrom + moveByWithSnapBack);
- QTest::mouseMove(window, moveFrom + moveByWithSnapBack*2);
- QTest::mouseMove(window, moveFrom + moveByWithSnapBack*3);
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, moveFrom);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithSnapBack);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithSnapBack*2);
+ QTest::mouseMove(window.data(), moveFrom + moveByWithSnapBack*3);
QVERIFY(flickable->isMoving());
QCOMPARE(flickable->isMovingHorizontally(), horizontalEnabled);
@@ -894,7 +896,7 @@ void tst_qquickflickable::movingAndDragging()
QCOMPARE(dragStartSpy.count(), 1);
QCOMPARE(dragEndSpy.count(), 0);
- QTest::mouseRelease(window, Qt::LeftButton, 0, moveFrom + moveByWithSnapBack*3);
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, moveFrom + moveByWithSnapBack*3);
// should now start snapping back to bounds (moving but not dragging)
QVERIFY(flickable->isMoving());
@@ -937,17 +939,16 @@ void tst_qquickflickable::movingAndDragging()
QCOMPARE(flickable->contentX(), 0.0);
QCOMPARE(flickable->contentY(), 0.0);
-
- delete window;
}
void tst_qquickflickable::flickOnRelease()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowExposed(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -960,9 +961,9 @@ void tst_qquickflickable::flickOnRelease()
// underlying drivers will hopefully provide a pre-calculated velocity
// (based on more data than what the UI gets), thus making this use case
// working even with small movements.
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50, 300));
- QTest::mouseMove(window, QPoint(50, 10), 10);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 10), 10);
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(50, 300));
+ QTest::mouseMove(window.data(), QPoint(50, 10), 10);
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 10), 10);
QCOMPARE(vFlickSpy.count(), 1);
@@ -974,17 +975,16 @@ void tst_qquickflickable::flickOnRelease()
#endif
// Stop on a full pixel after user interaction
QCOMPARE(flickable->contentY(), (qreal)qRound(flickable->contentY()));
-
- delete window;
}
void tst_qquickflickable::pressWhileFlicking()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowExposed(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
@@ -999,7 +999,7 @@ void tst_qquickflickable::pressWhileFlicking()
// flick then press while it is still moving
// flicking == false, moving == true;
- flick(window, QPoint(20,190), QPoint(20, 50), 200);
+ flick(window.data(), QPoint(20,190), QPoint(20, 50), 200);
QVERIFY(flickable->verticalVelocity() > 0.0);
QTRY_VERIFY(flickable->isFlicking());
QVERIFY(flickable->isFlickingVertically());
@@ -1014,77 +1014,76 @@ void tst_qquickflickable::pressWhileFlicking()
QCOMPARE(hFlickSpy.count(), 0);
QCOMPARE(flickSpy.count(), 1);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(20, 50));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(20, 50));
QTRY_VERIFY(!flickable->isFlicking());
QVERIFY(!flickable->isFlickingVertically());
QVERIFY(flickable->isMoving());
QVERIFY(flickable->isMovingVertically());
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(20,50));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(20,50));
QVERIFY(!flickable->isFlicking());
QVERIFY(!flickable->isFlickingVertically());
QTRY_VERIFY(!flickable->isMoving());
QVERIFY(!flickable->isMovingVertically());
// Stop on a full pixel after user interaction
QCOMPARE(flickable->contentX(), (qreal)qRound(flickable->contentX()));
-
- delete window;
}
void tst_qquickflickable::disabled()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("disabled.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flick = window->rootObject()->findChild<QQuickFlickable*>("flickable");
QVERIFY(flick != 0);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50, 90));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(50, 90));
- QTest::mouseMove(window, QPoint(50, 80));
- QTest::mouseMove(window, QPoint(50, 70));
- QTest::mouseMove(window, QPoint(50, 60));
+ QTest::mouseMove(window.data(), QPoint(50, 80));
+ QTest::mouseMove(window.data(), QPoint(50, 70));
+ QTest::mouseMove(window.data(), QPoint(50, 60));
QVERIFY(flick->isMoving() == false);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 60));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 60));
// verify that mouse clicks on other elements still work (QTBUG-20584)
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(50, 10));
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 10));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(50, 10));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 10));
QTRY_VERIFY(window->rootObject()->property("clicked").toBool() == true);
-
- delete window;
}
void tst_qquickflickable::flickVelocity()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("flickable03.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
QVERIFY(flickable != 0);
// flick up
- flick(window, QPoint(20,190), QPoint(20, 50), 200);
+ flick(window.data(), QPoint(20,190), QPoint(20, 50), 200);
QVERIFY(flickable->verticalVelocity() > 0.0);
QTRY_VERIFY(flickable->verticalVelocity() == 0.0);
// flick down
- flick(window, QPoint(20,10), QPoint(20, 140), 200);
- QVERIFY(flickable->verticalVelocity() < 0.0);
+ flick(window.data(), QPoint(20,10), QPoint(20, 140), 200);
+ QTRY_VERIFY(flickable->verticalVelocity() < 0.0);
QTRY_VERIFY(flickable->verticalVelocity() == 0.0);
#ifdef Q_OS_MAC
QSKIP("boost doesn't work on OS X");
- delete window;
return;
#endif
@@ -1092,17 +1091,15 @@ void tst_qquickflickable::flickVelocity()
QQuickFlickablePrivate *fp = QQuickFlickablePrivate::get(flickable);
bool boosted = false;
for (int i = 0; i < 6; ++i) {
- flick(window, QPoint(20,390), QPoint(20, 50), 100);
+ flick(window.data(), QPoint(20,390), QPoint(20, 50), 100);
boosted |= fp->flickBoost > 1.0;
}
QVERIFY(boosted);
// Flick in opposite direction -> boost cancelled.
- flick(window, QPoint(20,10), QPoint(20, 340), 200);
+ flick(window.data(), QPoint(20,10), QPoint(20, 340), 200);
QTRY_VERIFY(flickable->verticalVelocity() < 0.0);
QVERIFY(fp->flickBoost == 1.0);
-
- delete window;
}
void tst_qquickflickable::margins()
@@ -1166,20 +1163,22 @@ void tst_qquickflickable::margins()
void tst_qquickflickable::cancelOnMouseGrab()
{
- QQuickView *window = new QQuickView;
+ QScopedPointer<QQuickView> window(new QQuickView);
window->setSource(testFileUrl("cancel.qml"));
window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window.data()));
window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
QVERIFY(flickable != 0);
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(10, 10));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(10, 10));
// drag out of bounds
- QTest::mouseMove(window, QPoint(50, 50));
- QTest::mouseMove(window, QPoint(100, 100));
- QTest::mouseMove(window, QPoint(150, 150));
+ QTest::mouseMove(window.data(), QPoint(50, 50));
+ QTest::mouseMove(window.data(), QPoint(100, 100));
+ QTest::mouseMove(window.data(), QPoint(150, 150));
QVERIFY(flickable->contentX() != 0);
QVERIFY(flickable->contentY() != 0);
@@ -1195,56 +1194,54 @@ void tst_qquickflickable::cancelOnMouseGrab()
QTRY_VERIFY(!flickable->isMoving());
QTRY_VERIFY(!flickable->isDragging());
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(50, 10));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 10));
- delete window;
}
void tst_qquickflickable::clickAndDragWhenTransformed()
{
- QQuickView *view = new QQuickView;
+ QScopedPointer<QQuickView> view(new QQuickView);
view->setSource(testFileUrl("transformedFlickable.qml"));
view->show();
+ QVERIFY(QTest::qWaitForWindowExposed(view.data()));
view->requestActivate();
- QVERIFY(QTest::qWaitForWindowExposed(view));
+ QVERIFY(QTest::qWaitForWindowActive(view.data()));
QVERIFY(view->rootObject() != 0);
QQuickFlickable *flickable = view->rootObject()->findChild<QQuickFlickable*>("flickable");
QVERIFY(flickable != 0);
// click outside child rect
- QTest::mousePress(view, Qt::LeftButton, 0, QPoint(190, 190));
+ QTest::mousePress(view.data(), Qt::LeftButton, 0, QPoint(190, 190));
QTest::qWait(10);
QCOMPARE(flickable->property("itemPressed").toBool(), false);
- QTest::mouseRelease(view, Qt::LeftButton, 0, QPoint(190, 190));
+ QTest::mouseRelease(view.data(), Qt::LeftButton, 0, QPoint(190, 190));
// click inside child rect
- QTest::mousePress(view, Qt::LeftButton, 0, QPoint(200, 200));
+ QTest::mousePress(view.data(), Qt::LeftButton, 0, QPoint(200, 200));
QTest::qWait(10);
QCOMPARE(flickable->property("itemPressed").toBool(), true);
- QTest::mouseRelease(view, Qt::LeftButton, 0, QPoint(200, 200));
+ QTest::mouseRelease(view.data(), Qt::LeftButton, 0, QPoint(200, 200));
const int threshold = qApp->styleHints()->startDragDistance();
// drag outside bounds
- QTest::mousePress(view, Qt::LeftButton, 0, QPoint(160, 160));
+ QTest::mousePress(view.data(), Qt::LeftButton, 0, QPoint(160, 160));
QTest::qWait(10);
- QTest::mouseMove(view, QPoint(160 + threshold * 2, 160));
- QTest::mouseMove(view, QPoint(160 + threshold * 3, 160));
+ QTest::mouseMove(view.data(), QPoint(160 + threshold * 2, 160));
+ QTest::mouseMove(view.data(), QPoint(160 + threshold * 3, 160));
QCOMPARE(flickable->isDragging(), false);
QCOMPARE(flickable->property("itemPressed").toBool(), false);
- QTest::mouseRelease(view, Qt::LeftButton, 0, QPoint(180, 160));
+ QTest::mouseRelease(view.data(), Qt::LeftButton, 0, QPoint(180, 160));
// drag inside bounds
- QTest::mousePress(view, Qt::LeftButton, 0, QPoint(200, 140));
+ QTest::mousePress(view.data(), Qt::LeftButton, 0, QPoint(200, 140));
QTest::qWait(10);
- QTest::mouseMove(view, QPoint(200 + threshold * 2, 140));
- QTest::mouseMove(view, QPoint(200 + threshold * 3, 140));
+ QTest::mouseMove(view.data(), QPoint(200 + threshold * 2, 140));
+ QTest::mouseMove(view.data(), QPoint(200 + threshold * 3, 140));
QCOMPARE(flickable->isDragging(), true);
QCOMPARE(flickable->property("itemPressed").toBool(), false);
- QTest::mouseRelease(view, Qt::LeftButton, 0, QPoint(220, 140));
-
- delete view;
+ QTest::mouseRelease(view.data(), Qt::LeftButton, 0, QPoint(220, 140));
}
void tst_qquickflickable::flickTwiceUsingTouches()
diff --git a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
index 19059c55df..b350abe953 100644
--- a/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
+++ b/tests/auto/quick/qquickfocusscope/tst_qquickfocusscope.cpp
@@ -525,7 +525,6 @@ void tst_qquickfocusscope::canvasFocus()
QSignalSpy scope2ActiveFocusSpy(scope2, SIGNAL(activeFocusChanged(bool)));
QSignalSpy item2ActiveFocusSpy(item2, SIGNAL(activeFocusChanged(bool)));
- QEXPECT_FAIL("", "QTBUG-22415", Abort);
QCOMPARE(rootItem->hasFocus(), false);
QCOMPARE(rootItem->hasActiveFocus(), false);
QCOMPARE(scope1->hasFocus(), true);
diff --git a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
index 3c30f9e887..0c9788ab8e 100644
--- a/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
+++ b/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp
@@ -51,8 +51,7 @@
#include <QtQuick/private/qquickitem_p.h>
#include <QtQuick/private/qquickgridview_p.h>
#include <QtQuick/private/qquicktext_p.h>
-#include <QtQuick/private/qquickvisualitemmodel_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include "../../shared/util.h"
#include "../shared/viewtestutil.h"
#include "../shared/visualtestutil.h"
@@ -2435,7 +2434,7 @@ void tst_QQuickGridView::modelChanges()
QQuickGridView *gridView = window->rootObject()->findChild<QQuickGridView*>("gridView");
QTRY_VERIFY(gridView);
- QQuickListModel *alternateModel = window->rootObject()->findChild<QQuickListModel*>("alternateModel");
+ QQmlListModel *alternateModel = window->rootObject()->findChild<QQmlListModel*>("alternateModel");
QTRY_VERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue<QObject *>(alternateModel);
QSignalSpy modelSpy(gridView, SIGNAL(modelChanged()));
@@ -2871,7 +2870,8 @@ void tst_QQuickGridView::enforceRange_rightToLeft()
ctxt->setContextProperty("testTopToBottom", QVariant(true));
window->setSource(testFileUrl("gridview-enforcerange.qml"));
- qApp->processEvents();
+ window->show();
+ QTRY_VERIFY(window->isExposed());
QVERIFY(window->rootObject() != 0);
QQuickGridView *gridview = findItem<QQuickGridView>(window->rootObject(), "grid");
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index e237174eb1..a7343f686f 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -175,6 +175,8 @@ private:
};
void ensureFocus(QWindow *w) {
+ if (w->width() <=0 || w->height() <= 0)
+ w->setGeometry(100, 100, 400, 300);
w->show();
w->requestActivate();
QTest::qWaitForWindowActive(w);
@@ -270,10 +272,6 @@ void tst_qquickitem::simpleFocus()
QQuickWindow window;
ensureFocus(&window);
-#ifdef Q_OS_MAC
- QSKIP("QTBUG-24094: fails on Mac OS X 10.7");
-#endif
-
QTRY_VERIFY(QGuiApplication::focusWindow() == &window);
QQuickItem *l1c1 = new TestItem(window.contentItem());
@@ -732,7 +730,7 @@ void tst_qquickitem::focusSubItemInNonFocusScope()
QQuickView *view = new QQuickView;
view->setSource(testFileUrl("focusSubItemInNonFocusScope.qml"));
view->show();
- qApp->processEvents();
+ QTest::qWaitForWindowActive(view);
QQuickItem *dummyItem = view->rootObject()->findChild<QQuickItem *>("dummyItem");
QVERIFY(dummyItem);
diff --git a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
index c034fe83c8..65892ddd9b 100644
--- a/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
+++ b/tests/auto/quick/qquicklistview/tst_qquicklistview.cpp
@@ -48,8 +48,8 @@
#include <QtQml/qqmlincubator.h>
#include <QtQuick/private/qquicklistview_p.h>
#include <QtQuick/private/qquicktext_p.h>
-#include <QtQuick/private/qquickvisualitemmodel_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmlobjectmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include "../../shared/util.h"
#include "../shared/viewtestutil.h"
#include "../shared/visualtestutil.h"
@@ -2768,7 +2768,7 @@ void tst_QQuickListView::itemList()
QQuickItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QQuickVisualItemModel *model = window->rootObject()->findChild<QQuickVisualItemModel*>("itemModel");
+ QQmlObjectModel *model = window->rootObject()->findChild<QQmlObjectModel*>("itemModel");
QTRY_VERIFY(model != 0);
QTRY_VERIFY(model->count() == 3);
@@ -2809,7 +2809,7 @@ void tst_QQuickListView::itemListFlicker()
QQuickItem *contentItem = listview->contentItem();
QTRY_VERIFY(contentItem != 0);
- QQuickVisualItemModel *model = window->rootObject()->findChild<QQuickVisualItemModel*>("itemModel");
+ QQmlObjectModel *model = window->rootObject()->findChild<QQmlObjectModel*>("itemModel");
QTRY_VERIFY(model != 0);
QTRY_VERIFY(model->count() == 3);
@@ -3258,7 +3258,7 @@ void tst_QQuickListView::modelChanges()
QQuickListView *listView = window->rootObject()->findChild<QQuickListView*>("listView");
QTRY_VERIFY(listView);
- QQuickListModel *alternateModel = window->rootObject()->findChild<QQuickListModel*>("alternateModel");
+ QQmlListModel *alternateModel = window->rootObject()->findChild<QQmlListModel*>("alternateModel");
QTRY_VERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue<QObject *>(alternateModel);
QSignalSpy modelSpy(listView, SIGNAL(modelChanged()));
@@ -4606,7 +4606,7 @@ void tst_QQuickListView::rightToLeft()
QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
- QQuickVisualItemModel *model = window->rootObject()->findChild<QQuickVisualItemModel*>("itemModel");
+ QQmlObjectModel *model = window->rootObject()->findChild<QQmlObjectModel*>("itemModel");
QTRY_VERIFY(model != 0);
QTRY_VERIFY(model->count() == 3);
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
index 8821203902..f52939e628 100644
--- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
+++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp
@@ -50,7 +50,7 @@
#include <QtQuick/private/qquickpath_p.h>
#include <QtQuick/private/qquicktext_p.h>
#include <QtQuick/private/qquickrectangle_p.h>
-#include <QtQml/private/qquicklistmodel_p.h>
+#include <QtQml/private/qqmllistmodel_p.h>
#include <QtQml/private/qqmlvaluetype_p.h>
#include <QtGui/qstandarditemmodel.h>
#include <QStringListModel>
@@ -199,7 +199,7 @@ void tst_QQuickPathView::initValues()
void tst_QQuickPathView::items()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QaimModel model;
model.addItem("Fred", "12345");
@@ -238,8 +238,6 @@ void tst_QQuickPathView::items()
offset.setX(pathview->highlightItem()->width()/2);
offset.setY(pathview->highlightItem()->height()/2);
QCOMPARE(pathview->highlightItem()->position() + offset, start);
-
- delete window;
}
void tst_QQuickPathView::pathview2()
@@ -350,7 +348,7 @@ void tst_QQuickPathView::insertModel()
QFETCH(qreal, offset);
QFETCH(int, currentIndex);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -388,8 +386,6 @@ void tst_QQuickPathView::insertModel()
QTRY_COMPARE(pathview->offset(), offset);
QCOMPARE(pathview->currentIndex(), currentIndex);
-
- delete window;
}
void tst_QQuickPathView::removeModel_data()
@@ -444,7 +440,8 @@ void tst_QQuickPathView::removeModel()
QFETCH(qreal, offset);
QFETCH(int, currentIndex);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
+
window->show();
QaimModel model;
@@ -478,8 +475,6 @@ void tst_QQuickPathView::removeModel()
QTRY_COMPARE(pathview->offset(), offset);
QCOMPARE(pathview->currentIndex(), currentIndex);
-
- delete window;
}
@@ -539,7 +534,7 @@ void tst_QQuickPathView::moveModel()
QFETCH(qreal, offset);
QFETCH(int, currentIndex);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -573,8 +568,6 @@ void tst_QQuickPathView::moveModel()
QTRY_COMPARE(pathview->offset(), offset);
QCOMPARE(pathview->currentIndex(), currentIndex);
-
- delete window;
}
void tst_QQuickPathView::consecutiveModelChanges_data()
@@ -640,7 +633,7 @@ void tst_QQuickPathView::consecutiveModelChanges()
QFETCH(qreal, offset);
QFETCH(int, currentIndex);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -704,7 +697,6 @@ void tst_QQuickPathView::consecutiveModelChanges()
QCOMPARE(pathview->currentIndex(), currentIndex);
- delete window;
}
void tst_QQuickPathView::path()
@@ -756,7 +748,7 @@ void tst_QQuickPathView::path()
void tst_QQuickPathView::dataModel()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QQmlContext *ctxt = window->rootContext();
@@ -865,13 +857,12 @@ void tst_QQuickPathView::dataModel()
model.removeItem(model.count()-1);
QCOMPARE(pathview->currentIndex(), model.count()-1);
- delete window;
delete testObject;
}
void tst_QQuickPathView::pathMoved()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -926,7 +917,6 @@ void tst_QQuickPathView::pathMoved()
window->rootObject()->setProperty("delegateScale", 1.2);
QTRY_COMPARE(firstItem->position() + offset, start);
- delete window;
}
void tst_QQuickPathView::offset_data()
@@ -960,7 +950,7 @@ void tst_QQuickPathView::offset()
void tst_QQuickPathView::setCurrentIndex()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -1103,12 +1093,11 @@ void tst_QQuickPathView::setCurrentIndex()
QCOMPARE(pathview->currentItem(), firstItem);
QCOMPARE(firstItem->property("onPath"), QVariant(true));
- delete window;
}
void tst_QQuickPathView::resetModel()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QStringList strings;
strings << "one" << "two" << "three";
@@ -1143,12 +1132,11 @@ void tst_QQuickPathView::resetModel()
QCOMPARE(display->text(), strings.at(i));
}
- delete window;
}
void tst_QQuickPathView::propertyChanges()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("propertychanges.qml"));
@@ -1185,12 +1173,11 @@ void tst_QQuickPathView::propertyChanges()
pathView->setMaximumFlickVelocity(1000);
QCOMPARE(maximumFlickVelocitySpy.count(), 1);
- delete window;
}
void tst_QQuickPathView::pathChanges()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("propertychanges.qml"));
@@ -1247,12 +1234,11 @@ void tst_QQuickPathView::pathChanges()
pathAttribute->setName("scale");
QCOMPARE(nameSpy.count(),1);
- delete window;
}
void tst_QQuickPathView::componentChanges()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("propertychanges.qml"));
@@ -1270,12 +1256,11 @@ void tst_QQuickPathView::componentChanges()
pathView->setDelegate(&delegateComponent);
QCOMPARE(delegateSpy.count(),1);
- delete window;
}
void tst_QQuickPathView::modelChanges()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("propertychanges.qml"));
@@ -1284,7 +1269,7 @@ void tst_QQuickPathView::modelChanges()
pathView->setCurrentIndex(3);
QTRY_COMPARE(pathView->offset(), 6.0);
- QQuickListModel *alternateModel = window->rootObject()->findChild<QQuickListModel*>("alternateModel");
+ QQmlListModel *alternateModel = window->rootObject()->findChild<QQmlListModel*>("alternateModel");
QVERIFY(alternateModel);
QVariant modelVariant = QVariant::fromValue<QObject *>(alternateModel);
QSignalSpy modelSpy(pathView, SIGNAL(modelChanged()));
@@ -1305,12 +1290,11 @@ void tst_QQuickPathView::modelChanges()
QCOMPARE(pathView->currentIndex(), 0);
QCOMPARE(currentIndexSpy.count(), 1);
- delete window;
}
void tst_QQuickPathView::pathUpdateOnStartChanged()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("pathUpdateOnStartChanged.qml"));
@@ -1327,17 +1311,16 @@ void tst_QQuickPathView::pathUpdateOnStartChanged()
QCOMPARE(item->x(), path->startX() - item->width() / 2.0);
QCOMPARE(item->y(), path->startY() - item->height() / 2.0);
- delete window;
}
void tst_QQuickPathView::package()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("pathview_package.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
QQuickPathView *pathView = window->rootObject()->findChild<QQuickPathView*>("photoPathView");
QVERIFY(pathView);
@@ -1350,13 +1333,12 @@ void tst_QQuickPathView::package()
QVERIFY(item);
QVERIFY(item->scale() != 1.0);
- delete window;
}
//QTBUG-13017
void tst_QQuickPathView::emptyModel()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QStringListModel model;
@@ -1371,7 +1353,6 @@ void tst_QQuickPathView::emptyModel()
QCOMPARE(pathview->offset(), qreal(0.0));
- delete window;
}
void tst_QQuickPathView::emptyPath()
@@ -1411,7 +1392,7 @@ void tst_QQuickPathView::closed()
// QTBUG-14239
void tst_QQuickPathView::pathUpdate()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
QVERIFY(window);
window->setSource(testFileUrl("pathUpdate.qml"));
@@ -1422,7 +1403,6 @@ void tst_QQuickPathView::pathUpdate()
QVERIFY(item);
QCOMPARE(item->x(), 150.0);
- delete window;
}
void tst_QQuickPathView::visualDataModel()
@@ -1463,12 +1443,12 @@ void tst_QQuickPathView::undefinedPath()
void tst_QQuickPathView::mouseDrag()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -1482,12 +1462,12 @@ void tst_QQuickPathView::mouseDrag()
int current = pathview->currentIndex();
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(10,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(10,100));
QTest::qWait(100);
{
QMouseEvent mv(QEvent::MouseMove, QPoint(30,100), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
- QGuiApplication::sendEvent(window, &mv);
+ QGuiApplication::sendEvent(window.data(), &mv);
}
// first move beyond threshold does not trigger drag
QVERIFY(!pathview->isMoving());
@@ -1501,7 +1481,7 @@ void tst_QQuickPathView::mouseDrag()
{
QMouseEvent mv(QEvent::MouseMove, QPoint(90,100), Qt::LeftButton, Qt::LeftButton,Qt::NoModifier);
- QGuiApplication::sendEvent(window, &mv);
+ QGuiApplication::sendEvent(window.data(), &mv);
}
// next move beyond threshold does trigger drag
QVERIFY(pathview->isMoving());
@@ -1515,7 +1495,7 @@ void tst_QQuickPathView::mouseDrag()
QVERIFY(pathview->currentIndex() != current);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(40,100));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(40,100));
QVERIFY(!pathview->isDragging());
QCOMPARE(draggingSpy.count(), 2);
QCOMPARE(dragStartedSpy.count(), 1);
@@ -1524,12 +1504,11 @@ void tst_QQuickPathView::mouseDrag()
QTRY_COMPARE(moveEndedSpy.count(), 1);
QCOMPARE(moveStartedSpy.count(), 1);
- delete window;
}
void tst_QQuickPathView::treeModel()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QStandardItemModel model;
@@ -1552,18 +1531,17 @@ void tst_QQuickPathView::treeModel()
QTRY_VERIFY(item = findItem<QQuickText>(pathview, "wrapper", 0));
QTRY_COMPARE(item->text(), QLatin1String("Row 2 Child Item"));
- delete window;
}
void tst_QQuickPathView::changePreferredHighlight()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setGeometry(0,0,400,200);
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -1587,7 +1565,6 @@ void tst_QQuickPathView::changePreferredHighlight()
QTRY_COMPARE(firstItem->position() + offset, start);
QCOMPARE(pathview->currentIndex(), 0);
- delete window;
}
void tst_QQuickPathView::creationContext()
@@ -1608,7 +1585,7 @@ void tst_QQuickPathView::creationContext()
// QTBUG-21320
void tst_QQuickPathView::currentOffsetOnInsertion()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QaimModel model;
@@ -1681,12 +1658,11 @@ void tst_QQuickPathView::currentOffsetOnInsertion()
// verify that current item (item 1) is still at offset 0.5
QCOMPARE(item->position() + offset, start);
- delete window;
}
void tst_QQuickPathView::asynchronous()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->show();
QQmlIncubationController controller;
window->engine()->setIncubationController(&controller);
@@ -1737,7 +1713,6 @@ void tst_QQuickPathView::asynchronous()
QCOMPARE(curItem->position() + offset, itemPos);
}
- delete window;
}
void tst_QQuickPathView::missingPercent()
@@ -1752,12 +1727,12 @@ void tst_QQuickPathView::missingPercent()
void tst_QQuickPathView::cancelDrag()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -1767,10 +1742,10 @@ void tst_QQuickPathView::cancelDrag()
QSignalSpy dragEndedSpy(pathview, SIGNAL(dragEnded()));
// drag between snap points
- QTest::mousePress(window, Qt::LeftButton, 0, QPoint(10,100));
+ QTest::mousePress(window.data(), Qt::LeftButton, 0, QPoint(10,100));
QTest::qWait(100);
- QTest::mouseMove(window, QPoint(30, 100));
- QTest::mouseMove(window, QPoint(85, 100));
+ QTest::mouseMove(window.data(), QPoint(30, 100));
+ QTest::mouseMove(window.data(), QPoint(85, 100));
QTRY_VERIFY(pathview->offset() != qFloor(pathview->offset()));
QTRY_VERIFY(pathview->isMoving());
@@ -1791,25 +1766,24 @@ void tst_QQuickPathView::cancelDrag()
QCOMPARE(dragStartedSpy.count(), 1);
QCOMPARE(dragEndedSpy.count(), 1);
- QTest::mouseRelease(window, Qt::LeftButton, 0, QPoint(40,100));
+ QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(40,100));
- delete window;
}
void tst_QQuickPathView::maximumFlickVelocity()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("dragpath.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
pathview->setMaximumFlickVelocity(700);
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QVERIFY(pathview->isFlicking());
QTRY_VERIFY_WITH_TIMEOUT(!pathview->isMoving(), 50000);
@@ -1818,7 +1792,7 @@ void tst_QQuickPathView::maximumFlickVelocity()
pathview->setOffset(0.);
pathview->setMaximumFlickVelocity(300);
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QVERIFY(pathview->isFlicking());
QTRY_VERIFY_WITH_TIMEOUT(!pathview->isMoving(), 50000);
@@ -1827,7 +1801,7 @@ void tst_QQuickPathView::maximumFlickVelocity()
pathview->setOffset(0.);
pathview->setMaximumFlickVelocity(500);
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QVERIFY(pathview->isFlicking());
QTRY_VERIFY_WITH_TIMEOUT(!pathview->isMoving(), 50000);
@@ -1838,14 +1812,13 @@ void tst_QQuickPathView::maximumFlickVelocity()
QVERIFY(dist3 > dist2);
QVERIFY(dist2 < dist1);
- delete window;
}
void tst_QQuickPathView::snapToItem()
{
QFETCH(bool, enforceRange);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("panels.qml"));
QQuickPathView *pathview = window->rootObject()->findChild<QQuickPathView*>("view");
QVERIFY(pathview != 0);
@@ -1857,7 +1830,7 @@ void tst_QQuickPathView::snapToItem()
QSignalSpy snapModeSpy(pathview, SIGNAL(snapModeChanged()));
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QTRY_VERIFY(!pathview->isMoving());
@@ -1869,7 +1842,6 @@ void tst_QQuickPathView::snapToItem()
else
QVERIFY(pathview->currentIndex() == currentIndex);
- delete window;
}
void tst_QQuickPathView::snapToItem_data()
@@ -1884,12 +1856,12 @@ void tst_QQuickPathView::snapOneItem()
{
QFETCH(bool, enforceRange);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("panels.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = window->rootObject()->findChild<QQuickPathView*>("view");
QVERIFY(pathview != 0);
@@ -1905,7 +1877,7 @@ void tst_QQuickPathView::snapOneItem()
int currentIndex = pathview->currentIndex();
double startOffset = pathview->offset();
- flick(window, QPoint(200,10), QPoint(10,10), 180);
+ flick(window.data(), QPoint(200,10), QPoint(10,10), 180);
QVERIFY(pathview->isMoving());
QTRY_VERIFY(!pathview->isMoving());
@@ -1918,7 +1890,6 @@ void tst_QQuickPathView::snapOneItem()
else
QVERIFY(pathview->currentIndex() == currentIndex);
- delete window;
}
void tst_QQuickPathView::snapOneItem_data()
@@ -1938,12 +1909,12 @@ void tst_QQuickPathView::positionViewAtIndex()
QFETCH(QQuickPathView::PositionMode, mode);
QFETCH(qreal, offset);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("pathview3.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -1959,7 +1930,6 @@ void tst_QQuickPathView::positionViewAtIndex()
QCOMPARE(pathview->offset(), offset);
- delete window;
}
void tst_QQuickPathView::positionViewAtIndex_data()
@@ -2002,12 +1972,12 @@ void tst_QQuickPathView::indexAt_itemAt()
QFETCH(qreal, y);
QFETCH(int, index);
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("pathview3.qml"));
window->show();
window->requestActivate();
- QVERIFY(QTest::qWaitForWindowActive(window));
- QCOMPARE(window, qGuiApp->focusWindow());
+ QVERIFY(QTest::qWaitForWindowActive(window.data()));
+ QCOMPARE(window.data(), qGuiApp->focusWindow());
QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject());
QVERIFY(pathview != 0);
@@ -2020,7 +1990,6 @@ void tst_QQuickPathView::indexAt_itemAt()
QCOMPARE(pathview->indexAt(x,y), index);
QVERIFY(pathview->itemAt(x,y) == item);
- delete window;
}
void tst_QQuickPathView::indexAt_itemAt_data()
@@ -2038,7 +2007,7 @@ void tst_QQuickPathView::indexAt_itemAt_data()
void tst_QQuickPathView::cacheItemCount()
{
- QQuickView *window = createView();
+ QScopedPointer<QQuickView> window(createView());
window->setSource(testFileUrl("pathview3.qml"));
window->show();
@@ -2112,7 +2081,6 @@ void tst_QQuickPathView::cacheItemCount()
controller.incubateWhile(&b);
}
- delete window;
}
QTEST_MAIN(tst_QQuickPathView)
diff --git a/tests/auto/quick/qquickpositioners/data/gridtest.qml b/tests/auto/quick/qquickpositioners/data/gridtest.qml
index 50bec1377b..fbe0b22b15 100644
--- a/tests/auto/quick/qquickpositioners/data/gridtest.qml
+++ b/tests/auto/quick/qquickpositioners/data/gridtest.qml
@@ -1,11 +1,15 @@
-import QtQuick 2.0
+import QtQuick 2.1
Item {
width: 640
height: 480
property bool testRightToLeft: false
+ property int testHAlignment: Grid.AlignLeft;
+ property int testVAlignment: Grid.AlignTop;
Grid {
layoutDirection: testRightToLeft ? Qt.RightToLeft : Qt.LeftToRight
+ horizontalItemAlignment: testHAlignment
+ verticalItemAlignment: testVAlignment
objectName: "grid"
columns: 3
Rectangle {
diff --git a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
index 98999e540a..1f472a3f46 100644
--- a/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
+++ b/tests/auto/quick/qquickpositioners/tst_qquickpositioners.cpp
@@ -78,6 +78,8 @@ private slots:
void test_grid_animated();
void test_grid_animated_rightToLeft();
void test_grid_zero_columns();
+ void test_grid_H_alignment();
+ void test_grid_V_alignment();
void test_propertychanges();
void test_repeater();
void test_flow();
@@ -288,7 +290,7 @@ tst_qquickpositioners::tst_qquickpositioners()
void tst_qquickpositioners::test_horizontal()
{
- QQuickView *window = createView(testFile("horizontal.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal.qml")));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -311,13 +313,11 @@ void tst_qquickpositioners::test_horizontal()
QQuickItem *row = window->rootObject()->findChild<QQuickItem*>("row");
QCOMPARE(row->width(), 110.0);
QCOMPARE(row->height(), 50.0);
-
- delete window;
}
void tst_qquickpositioners::test_horizontal_rtl()
{
- QQuickView *window = createView(testFile("horizontal.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal.qml")));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -350,12 +350,11 @@ void tst_qquickpositioners::test_horizontal_rtl()
QCOMPARE(three->x(), 90.0);
QCOMPARE(three->y(), 0.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_spacing()
{
- QQuickView *window = createView(testFile("horizontal-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-spacing.qml")));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -379,12 +378,11 @@ void tst_qquickpositioners::test_horizontal_spacing()
QCOMPARE(row->width(), 130.0);
QCOMPARE(row->height(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_spacing_rightToLeft()
{
- QQuickView *window = createView(testFile("horizontal-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-spacing.qml")));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -408,12 +406,11 @@ void tst_qquickpositioners::test_horizontal_spacing_rightToLeft()
QCOMPARE(row->width(), 130.0);
QCOMPARE(row->height(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_animated()
{
- QQuickView *window = createView(testFile("horizontal-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-animated.qml"), false));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -431,7 +428,7 @@ void tst_qquickpositioners::test_horizontal_animated()
QCOMPARE(two->x(), -100.0);
QCOMPARE(three->x(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *row = window->rootObject()->findChild<QQuickItem*>("row");
QVERIFY(row);
@@ -462,12 +459,11 @@ void tst_qquickpositioners::test_horizontal_animated()
QTRY_COMPARE(two->x(), 50.0);
QTRY_COMPARE(three->x(), 100.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_animated_rightToLeft()
{
- QQuickView *window = createView(testFile("horizontal-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-animated.qml"), false));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -485,7 +481,7 @@ void tst_qquickpositioners::test_horizontal_animated_rightToLeft()
QCOMPARE(two->x(), -100.0);
QCOMPARE(three->x(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *row = window->rootObject()->findChild<QQuickItem*>("row");
QVERIFY(row);
@@ -518,12 +514,11 @@ void tst_qquickpositioners::test_horizontal_animated_rightToLeft()
QTRY_COMPARE(one->x(), 100.0);
QTRY_COMPARE(two->x(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_horizontal_animated_disabled()
{
- QQuickView *window = createView(testFile("horizontal-animated-disabled.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("horizontal-animated-disabled.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -556,7 +551,6 @@ void tst_qquickpositioners::test_horizontal_animated_disabled()
QTRY_COMPARE(two->x(), 50.0);
QTRY_COMPARE(three->x(), 100.0);
- delete window;
}
void tst_qquickpositioners::populateTransitions(const QString &positionerObjectName)
@@ -576,7 +570,8 @@ void tst_qquickpositioners::populateTransitions(const QString &positionerObjectN
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QQuickView *window = QQuickViewTestUtil::createView();
+ QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
+
QQmlContext *ctxt = window->rootContext();
ctxt->setContextProperty("usePopulateTransition", usePopulateTransition);
ctxt->setContextProperty("enableAddTransition", true);
@@ -592,6 +587,7 @@ void tst_qquickpositioners::populateTransitions(const QString &positionerObjectN
QQuickItem *positioner = window->rootObject()->findChild<QQuickItem*>(positionerObjectName);
QVERIFY(positioner);
window->show();
+ QTest::qWaitForWindowExposed(window.data());
qApp->processEvents();
if (!dynamicallyPopulate && usePopulateTransition) {
@@ -627,8 +623,6 @@ void tst_qquickpositioners::populateTransitions(const QString &positionerObjectN
model.insertItem(0, "new item", "");
QTRY_COMPARE(window->rootObject()->property("addTransitionsDone").toInt(), 1);
QTRY_COMPARE(window->rootObject()->property("populateTransitionsDone").toInt(), 0);
-
- delete window;
}
void tst_qquickpositioners::populateTransitions_data()
@@ -657,7 +651,7 @@ void tst_qquickpositioners::addTransitions(const QString &positionerObjectName)
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QQuickView *window = QQuickViewTestUtil::createView();
+ QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
QQmlContext *ctxt = window->rootContext();
ctxt->setContextProperty("usePopulateTransition", QVariant(false));
ctxt->setContextProperty("enableAddTransition", QVariant(true));
@@ -667,6 +661,7 @@ void tst_qquickpositioners::addTransitions(const QString &positionerObjectName)
ctxt->setContextProperty("displacedItems_transitionVia", displacedItems_transitionVia);
window->setSource(testFileUrl("transitions.qml"));
window->show();
+ QTest::qWaitForWindowExposed(window.data());
qApp->processEvents();
QQuickItem *positioner = window->rootObject()->findChild<QQuickItem*>(positionerObjectName);
@@ -733,8 +728,6 @@ void tst_qquickpositioners::addTransitions(const QString &positionerObjectName)
}
checkItemPositions(positioner, &model, window->rootObject()->property("incrementalSize").toInt());
-
- delete window;
}
void tst_qquickpositioners::addTransitions_data()
@@ -770,7 +763,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
QaimModel model_targetItems_transitionFrom;
QaimModel model_displacedItems_transitionVia;
- QQuickView *window = QQuickViewTestUtil::createView();
+ QScopedPointer<QQuickView> window(QQuickViewTestUtil::createView());
QQmlContext *ctxt = window->rootContext();
ctxt->setContextProperty("usePopulateTransition", QVariant(false));
ctxt->setContextProperty("enableAddTransition", QVariant(false));
@@ -780,6 +773,7 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
ctxt->setContextProperty("displacedItems_transitionVia", displacedItems_transitionVia);
window->setSource(testFileUrl("transitions.qml"));
window->show();
+ QTest::qWaitForWindowExposed(window.data());
qApp->processEvents();
QList<QPair<QString,QString> > expectedDisplacedValues = expectedDisplacedIndexes.getModelDataValues(model);
@@ -842,8 +836,6 @@ void tst_qquickpositioners::moveTransitions(const QString &positionerObjectName)
}
checkItemPositions(positioner, &model, window->rootObject()->property("incrementalSize").toInt());
-
- delete window;
}
void tst_qquickpositioners::moveTransitions_data()
@@ -929,7 +921,7 @@ void tst_qquickpositioners::checkItemPositions(QQuickItem *positioner, QaimModel
void tst_qquickpositioners::test_vertical()
{
- QQuickView *window = createView(testFile("vertical.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("vertical.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -952,12 +944,11 @@ void tst_qquickpositioners::test_vertical()
QCOMPARE(column->height(), 80.0);
QCOMPARE(column->width(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_vertical_spacing()
{
- QQuickView *window = createView(testFile("vertical-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("vertical-spacing.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -979,12 +970,11 @@ void tst_qquickpositioners::test_vertical_spacing()
QCOMPARE(column->height(), 100.0);
QCOMPARE(column->width(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_vertical_animated()
{
- QQuickView *window = createView(testFile("vertical-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("vertical-animated.qml"), false));
//Note that they animate in
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
@@ -999,7 +989,7 @@ void tst_qquickpositioners::test_vertical_animated()
QVERIFY(three != 0);
QCOMPARE(three->y(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *column = window->rootObject()->findChild<QQuickItem*>("column");
QVERIFY(column);
@@ -1029,12 +1019,11 @@ void tst_qquickpositioners::test_vertical_animated()
QTRY_COMPARE(two->y(), 50.0);
QTRY_COMPARE(three->y(), 100.0);
- delete window;
}
void tst_qquickpositioners::test_grid()
{
- QQuickView *window = createView(testFile("gridtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("gridtest.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1063,12 +1052,11 @@ void tst_qquickpositioners::test_grid()
QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 100.0);
- delete window;
}
void tst_qquickpositioners::test_grid_topToBottom()
{
- QQuickView *window = createView(testFile("grid-toptobottom.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("grid-toptobottom.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1097,12 +1085,11 @@ void tst_qquickpositioners::test_grid_topToBottom()
QCOMPARE(grid->width(), 100.0);
QCOMPARE(grid->height(), 120.0);
- delete window;
}
void tst_qquickpositioners::test_grid_rightToLeft()
{
- QQuickView *window = createView(testFile("gridtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("gridtest.qml")));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -1146,12 +1133,11 @@ void tst_qquickpositioners::test_grid_rightToLeft()
QCOMPARE(five->x(), 140.0);
QCOMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_grid_spacing()
{
- QQuickView *window = createView(testFile("grid-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("grid-spacing.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1179,12 +1165,11 @@ void tst_qquickpositioners::test_grid_spacing()
QCOMPARE(grid->width(), 128.0);
QCOMPARE(grid->height(), 104.0);
- delete window;
}
void tst_qquickpositioners::test_grid_row_column_spacing()
{
- QQuickView *window = createView(testFile("grid-row-column-spacing.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("grid-row-column-spacing.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1212,12 +1197,11 @@ void tst_qquickpositioners::test_grid_row_column_spacing()
QCOMPARE(grid->width(), 142.0);
QCOMPARE(grid->height(), 107.0);
- delete window;
}
void tst_qquickpositioners::test_grid_animated()
{
- QQuickView *window = createView(testFile("grid-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("grid-animated.qml"), false));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -1247,7 +1231,7 @@ void tst_qquickpositioners::test_grid_animated()
QCOMPARE(five->x(), -100.0);
QCOMPARE(five->y(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *grid = window->rootObject()->findChild<QQuickItem*>("grid");
QVERIFY(grid);
@@ -1297,12 +1281,11 @@ void tst_qquickpositioners::test_grid_animated()
QTRY_COMPARE(five->x(), 50.0);
QTRY_COMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_grid_animated_rightToLeft()
{
- QQuickView *window = createView(testFile("grid-animated.qml"), false);
+ QScopedPointer<QQuickView> window(createView(testFile("grid-animated.qml"), false));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -1332,7 +1315,7 @@ void tst_qquickpositioners::test_grid_animated_rightToLeft()
QCOMPARE(five->x(), -100.0);
QCOMPARE(five->y(), -100.0);
- QVERIFY(QTest::qWaitForWindowExposed(window)); //It may not relayout until the next frame, so it needs to be drawn
+ QVERIFY(QTest::qWaitForWindowExposed(window.data())); //It may not relayout until the next frame, so it needs to be drawn
QQuickItem *grid = window->rootObject()->findChild<QQuickItem*>("grid");
QVERIFY(grid);
@@ -1382,12 +1365,11 @@ void tst_qquickpositioners::test_grid_animated_rightToLeft()
QTRY_COMPARE(five->x(), 50.0);
QTRY_COMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_grid_zero_columns()
{
- QQuickView *window = createView(testFile("gridzerocolumns.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("gridzerocolumns.qml")));
QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
QVERIFY(one != 0);
@@ -1415,12 +1397,133 @@ void tst_qquickpositioners::test_grid_zero_columns()
QCOMPARE(grid->width(), 170.0);
QCOMPARE(grid->height(), 60.0);
- delete window;
+}
+
+void tst_qquickpositioners::test_grid_H_alignment()
+{
+ QScopedPointer<QQuickView> window(createView(testFile("gridtest.qml")));
+
+ window->rootObject()->setProperty("testHAlignment", QQuickGrid::AlignHCenter);
+
+ QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
+ QVERIFY(one != 0);
+ QQuickRectangle *two = window->rootObject()->findChild<QQuickRectangle*>("two");
+ QVERIFY(two != 0);
+ QQuickRectangle *three = window->rootObject()->findChild<QQuickRectangle*>("three");
+ QVERIFY(three != 0);
+ QQuickRectangle *four = window->rootObject()->findChild<QQuickRectangle*>("four");
+ QVERIFY(four != 0);
+ QQuickRectangle *five = window->rootObject()->findChild<QQuickRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 55.0);
+ QCOMPARE(five->y(), 50.0);
+
+ QQuickItem *grid = window->rootObject()->findChild<QQuickItem*>("grid");
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ window->rootObject()->setProperty("testHAlignment", QQuickGrid::AlignRight);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 60.0);
+ QCOMPARE(five->y(), 50.0);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ window->rootObject()->setProperty("testRightToLeft", true);
+
+ QCOMPARE(one->x(), 50.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 30.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 50.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 30.0);
+ QCOMPARE(five->y(), 50.0);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+ window->rootObject()->setProperty("testHAlignment", QQuickGrid::AlignHCenter);
+
+ QCOMPARE(one->x(), 50.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 30.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 0.0);
+ QCOMPARE(three->y(), 0.0);
+ QCOMPARE(four->x(), 50.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 35.0);
+ QCOMPARE(five->y(), 50.0);
+ QCOMPARE(grid->width(), 100.0);
+ QCOMPARE(grid->height(), 100.0);
+
+}
+
+void tst_qquickpositioners::test_grid_V_alignment()
+{
+ QScopedPointer<QQuickView> window(createView(testFile("gridtest.qml")));
+
+ window->rootObject()->setProperty("testVAlignment", QQuickGrid::AlignVCenter);
+
+ QQuickRectangle *one = window->rootObject()->findChild<QQuickRectangle*>("one");
+ QVERIFY(one != 0);
+ QQuickRectangle *two = window->rootObject()->findChild<QQuickRectangle*>("two");
+ QVERIFY(two != 0);
+ QQuickRectangle *three = window->rootObject()->findChild<QQuickRectangle*>("three");
+ QVERIFY(three != 0);
+ QQuickRectangle *four = window->rootObject()->findChild<QQuickRectangle*>("four");
+ QVERIFY(four != 0);
+ QQuickRectangle *five = window->rootObject()->findChild<QQuickRectangle*>("five");
+ QVERIFY(five != 0);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 15.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 50.0);
+ QCOMPARE(five->y(), 70.0);
+
+ window->rootObject()->setProperty("testVAlignment", QQuickGrid::AlignBottom);
+
+ QCOMPARE(one->x(), 0.0);
+ QCOMPARE(one->y(), 0.0);
+ QCOMPARE(two->x(), 50.0);
+ QCOMPARE(two->y(), 0.0);
+ QCOMPARE(three->x(), 70.0);
+ QCOMPARE(three->y(), 30.0);
+ QCOMPARE(four->x(), 0.0);
+ QCOMPARE(four->y(), 50.0);
+ QCOMPARE(five->x(), 50.0);
+ QCOMPARE(five->y(), 90.0);
+
}
void tst_qquickpositioners::test_propertychanges()
{
- QQuickView *window = createView(testFile("propertychangestest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("propertychangestest.qml")));
QQuickGrid *grid = qobject_cast<QQuickGrid*>(window->rootObject());
QVERIFY(grid != 0);
@@ -1474,12 +1577,11 @@ void tst_qquickpositioners::test_propertychanges()
QCOMPARE(columnsSpy.count(),2);
QCOMPARE(rowsSpy.count(),2);
- delete window;
}
void tst_qquickpositioners::test_repeater()
{
- QQuickView *window = createView(testFile("repeatertest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("repeatertest.qml")));
QQuickRectangle *one = findItem<QQuickRectangle>(window->contentItem(), "one");
QVERIFY(one != 0);
@@ -1497,12 +1599,11 @@ void tst_qquickpositioners::test_repeater()
QCOMPARE(three->x(), 100.0);
QCOMPARE(three->y(), 0.0);
- delete window;
}
void tst_qquickpositioners::test_flow()
{
- QQuickView *window = createView(testFile("flowtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest.qml")));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -1533,12 +1634,11 @@ void tst_qquickpositioners::test_flow()
QCOMPARE(flow->width(), 90.0);
QCOMPARE(flow->height(), 120.0);
- delete window;
}
void tst_qquickpositioners::test_flow_rightToLeft()
{
- QQuickView *window = createView(testFile("flowtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest.qml")));
window->rootObject()->setProperty("testRightToLeft", true);
@@ -1569,12 +1669,11 @@ void tst_qquickpositioners::test_flow_rightToLeft()
QCOMPARE(flow->width(), 90.0);
QCOMPARE(flow->height(), 120.0);
- delete window;
}
void tst_qquickpositioners::test_flow_topToBottom()
{
- QQuickView *window = createView(testFile("flowtest-toptobottom.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest-toptobottom.qml")));
window->rootObject()->setProperty("testRightToLeft", false);
@@ -1622,12 +1721,11 @@ void tst_qquickpositioners::test_flow_topToBottom()
QCOMPARE(five->x(), 40.0);
QCOMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_flow_resize()
{
- QQuickView *window = createView(testFile("flowtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest.qml")));
QQuickItem *root = qobject_cast<QQuickItem*>(window->rootObject());
QVERIFY(root);
@@ -1656,12 +1754,11 @@ void tst_qquickpositioners::test_flow_resize()
QTRY_COMPARE(five->x(), 50.0);
QTRY_COMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_flow_resize_rightToLeft()
{
- QQuickView *window = createView(testFile("flowtest.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flowtest.qml")));
QQuickItem *root = qobject_cast<QQuickItem*>(window->rootObject());
QVERIFY(root);
@@ -1690,12 +1787,11 @@ void tst_qquickpositioners::test_flow_resize_rightToLeft()
QCOMPARE(five->x(), 65.0);
QCOMPARE(five->y(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_flow_implicit_resize()
{
- QQuickView *window = createView(testFile("flow-testimplicitsize.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("flow-testimplicitsize.qml")));
QVERIFY(window->rootObject() != 0);
QQuickFlow *flow = window->rootObject()->findChild<QQuickFlow*>("flow");
@@ -1719,7 +1815,6 @@ void tst_qquickpositioners::test_flow_implicit_resize()
QCOMPARE(flow->width(), 220.0);
QCOMPARE(flow->height(), 50.0);
- delete window;
}
void tst_qquickpositioners::test_conflictinganchors()
@@ -1836,10 +1931,10 @@ void tst_qquickpositioners::test_mirroring()
objectNames << "one" << "two" << "three" << "four" << "five";
foreach (const QString qmlFile, qmlFiles) {
- QQuickView *windowA = createView(testFile(qmlFile));
+ QScopedPointer<QQuickView> windowA(createView(testFile(qmlFile)));
QQuickItem *rootA = qobject_cast<QQuickItem*>(windowA->rootObject());
- QQuickView *windowB = createView(testFile(qmlFile));
+ QScopedPointer<QQuickView> windowB(createView(testFile(qmlFile)));
QQuickItem *rootB = qobject_cast<QQuickItem*>(windowB->rootObject());
rootA->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft
@@ -1881,15 +1976,13 @@ void tst_qquickpositioners::test_mirroring()
QQuickItem *itemB = rootB->findChild<QQuickItem*>(objectName);
QTRY_COMPARE(itemA->x(), itemB->x());
}
- delete windowA;
- delete windowB;
}
}
void tst_qquickpositioners::test_allInvisible()
{
//QTBUG-19361
- QQuickView *window = createView(testFile("allInvisible.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("allInvisible.qml")));
QQuickItem *root = qobject_cast<QQuickItem*>(window->rootObject());
QVERIFY(root);
@@ -1908,7 +2001,7 @@ void tst_qquickpositioners::test_attachedproperties()
{
QFETCH(QString, filename);
- QQuickView *window = createView(filename);
+ QScopedPointer<QQuickView> window(createView(filename));
QVERIFY(window->rootObject() != 0);
QQuickRectangle *greenRect = window->rootObject()->findChild<QQuickRectangle *>("greenRect");
@@ -1940,7 +2033,6 @@ void tst_qquickpositioners::test_attachedproperties()
isLast = yellowRect->property("isLastItem").toBool();
QVERIFY(isLast == true);
- delete window;
}
void tst_qquickpositioners::test_attachedproperties_data()
@@ -1955,7 +2047,7 @@ void tst_qquickpositioners::test_attachedproperties_data()
void tst_qquickpositioners::test_attachedproperties_dynamic()
{
- QQuickView *window = createView(testFile("attachedproperties-dynamic.qml"));
+ QScopedPointer<QQuickView> window(createView(testFile("attachedproperties-dynamic.qml")));
QVERIFY(window->rootObject() != 0);
QQuickRow *row = window->rootObject()->findChild<QQuickRow *>("pos");
@@ -2006,7 +2098,6 @@ void tst_qquickpositioners::test_attachedproperties_dynamic()
QTRY_VERIFY(rect1->property("firstItem").toBool() == false);
QTRY_VERIFY(rect1->property("lastItem").toBool() == true);
- delete window;
}
QQuickView *tst_qquickpositioners::createView(const QString &filename, bool wait)
diff --git a/tests/auto/quick/qquicktextdocument/data/text.qml b/tests/auto/quick/qquicktextdocument/data/text.qml
new file mode 100644
index 0000000000..43a8c6bb82
--- /dev/null
+++ b/tests/auto/quick/qquicktextdocument/data/text.qml
@@ -0,0 +1,6 @@
+import QtQuick 2.1
+
+TextEdit {
+ text: ""
+}
+
diff --git a/tests/auto/qml/qquicklistcompositor/qquicklistcompositor.pro b/tests/auto/quick/qquicktextdocument/qquicktextdocument.pro
index 9d1d2bd237..e6bfdbd099 100644
--- a/tests/auto/qml/qquicklistcompositor/qquicklistcompositor.pro
+++ b/tests/auto/quick/qquicktextdocument/qquicktextdocument.pro
@@ -1,10 +1,15 @@
CONFIG += testcase
-TARGET = tst_qquicklistcompositor
+TARGET = tst_qquicktextdocument
macx:CONFIG -= app_bundle
-SOURCES += tst_qquicklistcompositor.cpp
+SOURCES += tst_qquicktextdocument.cpp
+
+include (../../shared/util.pri)
+
+TESTDATA = data/*
CONFIG += parallel_test
QT += core-private gui-private qml-private quick-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
diff --git a/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp b/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp
new file mode 100644
index 0000000000..717496cf0e
--- /dev/null
+++ b/tests/auto/quick/qquicktextdocument/tst_qquicktextdocument.cpp
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtQml module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <qtest.h>
+#include <QtTest/QtTest>
+#include <QtQuick/QQuickTextDocument>
+#include <QtQuick/QQuickItem>
+#include <QtQuick/private/qquicktextedit_p.h>
+#include <QtGui/QTextDocument>
+#include <QtGui/QTextDocumentWriter>
+#include <QtQml/QQmlEngine>
+#include <QtQml/QQmlComponent>
+#include "../../shared/util.h"
+
+class tst_qquicktextdocument : public QQmlDataTest
+{
+ Q_OBJECT
+private slots:
+ void textDocumentWriter();
+};
+
+QString text = QStringLiteral("foo bar");
+
+void tst_qquicktextdocument::textDocumentWriter()
+{
+ QQmlEngine e;
+ QQmlComponent c(&e, testFileUrl("text.qml"));
+ QObject* o = c.create();
+ QVERIFY(o);
+ QQuickTextEdit *edit = qobject_cast<QQuickTextEdit*>(o);
+ QVERIFY(edit);
+
+ QQuickTextDocument* quickDocument = qobject_cast<QQuickTextDocument*>(edit->property("textDocument").value<QObject*>());
+ QVERIFY(quickDocument->textDocument() != 0);
+
+ QBuffer output;
+ output.open(QBuffer::ReadWrite);
+ QVERIFY(output.buffer().isEmpty());
+
+ edit->setProperty("text", QVariant(text));
+ QTextDocumentWriter writer(&output, "plaintext");
+ QVERIFY(writer.write(quickDocument->textDocument()));
+ QCOMPARE(output.buffer(), text.toLatin1());
+ delete o;
+}
+
+QTEST_MAIN(tst_qquicktextdocument)
+
+#include "tst_qquicktextdocument.moc"
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index bf7539e449..c29c6c05d6 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -2225,6 +2225,7 @@ void tst_qquicktextedit::cursorDelegate()
QQuickView view(source);
view.show();
view.requestActivate();
+ QTest::qWaitForWindowActive(&view);
QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject");
QVERIFY(textEditObject != 0);
// Delegate creation is deferred until focus in or cursor visibility is forced.
@@ -2340,6 +2341,7 @@ void tst_qquicktextedit::remoteCursorDelegate()
view.setSource(testFileUrl("cursorTestRemote.qml"));
view.show();
view.requestActivate();
+ QTest::qWaitForWindowActive(&view);
QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject");
QVERIFY(textEditObject != 0);
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 86a05c3d3b..8e63b6207f 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -2665,6 +2665,7 @@ void tst_qquicktextinput::cursorDelegate()
QQuickView view(source);
view.show();
view.requestActivate();
+ QTest::qWaitForWindowActive(&view);
QQuickTextInput *textInputObject = view.rootObject()->findChild<QQuickTextInput*>("textInputObject");
QVERIFY(textInputObject != 0);
// Delegate is created on demand, and so won't be available immediately. Focus in or
@@ -2774,7 +2775,7 @@ void tst_qquicktextinput::cursorDelegate()
void tst_qquicktextinput::remoteCursorDelegate()
{
TestHTTPServer server(SERVER_PORT);
- server.serveDirectory(dataDirectory());
+ server.serveDirectory(dataDirectory(), TestHTTPServer::Delay);
QQuickView view;
@@ -2784,6 +2785,7 @@ void tst_qquicktextinput::remoteCursorDelegate()
view.setSource(testFileUrl("cursorTestRemote.qml"));
view.show();
view.requestActivate();
+ QTest::qWaitForWindowActive(&view);
QQuickTextInput *textInputObject = view.rootObject()->findChild<QQuickTextInput*>("textInputObject");
QVERIFY(textInputObject != 0);
diff --git a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
index 74c557871f..f97b0f35a6 100644
--- a/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
+++ b/tests/auto/quick/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp
@@ -52,9 +52,9 @@
#include <QtQuick/qquickview.h>
#include <private/qquicklistview_p.h>
#include <QtQuick/private/qquicktext_p.h>
-#include <QtQuick/private/qquickvisualdatamodel_p.h>
+#include <QtQml/private/qqmldelegatemodel_p.h>
#include <private/qqmlvaluetype_p.h>
-#include <private/qquickchangeset_p.h>
+#include <private/qqmlchangeset_p.h>
#include <private/qqmlengine_p.h>
#include <math.h>
#include <QtGui/qstandarditemmodel.h>
@@ -360,21 +360,21 @@ public:
int indexCreated;
public Q_SLOTS:
- void initItem(int index, QQuickItem *item)
+ void initItem(int index, QObject *item)
{
- itemInitialized = item;
+ itemInitialized = qobject_cast<QQuickItem*>(item);
indexInitialized = index;
}
- void createdItem(int index, QQuickItem *item)
+ void createdItem(int index, QObject *item)
{
- itemCreated = item;
+ itemCreated = qobject_cast<QQuickItem*>(item);
indexCreated = index;
}
- void destroyingItem(QQuickItem *item)
+ void destroyingItem(QObject *item)
{
- itemDestroyed = item;
+ itemDestroyed = qobject_cast<QQuickItem*>(item);
}
};
@@ -452,9 +452,9 @@ private:
template <int N> void get_verify(
const SingleRoleModel &model,
- QQuickVisualDataModel *visualModel,
- QQuickVisualDataGroup *visibleItems,
- QQuickVisualDataGroup *selectedItems,
+ QQmlDelegateModel *visualModel,
+ QQmlDataGroup *visibleItems,
+ QQmlDataGroup *selectedItems,
const int (&mIndex)[N],
const int (&iIndex)[N],
const int (&vIndex)[N],
@@ -467,7 +467,7 @@ private:
QQmlEngine engine;
};
-Q_DECLARE_METATYPE(QQuickChangeSet)
+Q_DECLARE_METATYPE(QQmlChangeSet)
template <typename T> static T evaluate(QObject *scope, const QString &expression)
{
@@ -489,7 +489,7 @@ template <> void evaluate<void>(QObject *scope, const QString &expression)
void tst_qquickvisualdatamodel::initTestCase()
{
QQmlDataTest::initTestCase();
- qRegisterMetaType<QQuickChangeSet>();
+ qRegisterMetaType<QQmlChangeSet>();
qmlRegisterType<SingleRoleModel>("tst_qquickvisualdatamodel", 1, 0, "SingleRoleModel");
qmlRegisterType<DataObject>("tst_qquickvisualdatamodel", 1, 0, "DataObject");
@@ -517,7 +517,7 @@ void tst_qquickvisualdatamodel::rootIndex()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *obj = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *obj = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(obj != 0);
QMetaObject::invokeMethod(obj, "setRoot");
@@ -611,7 +611,7 @@ void tst_qquickvisualdatamodel::childChanged()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *vdm = listview->findChild<QQuickVisualDataModel*>("visualModel");
+ QQmlDelegateModel *vdm = listview->findChild<QQmlDelegateModel*>("visualModel");
vdm->setRootIndex(QVariant::fromValue(model.indexFromItem(model.item(1,0))));
QCOMPARE(listview->count(), 1);
@@ -922,7 +922,7 @@ void tst_qquickvisualdatamodel::noDelegate()
QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject());
QVERIFY(listview != 0);
- QQuickVisualDataModel *vdm = listview->findChild<QQuickVisualDataModel*>("visualModel");
+ QQmlDelegateModel *vdm = listview->findChild<QQmlDelegateModel*>("visualModel");
QVERIFY(vdm != 0);
QCOMPARE(vdm->count(), 3);
@@ -1052,15 +1052,15 @@ void tst_qquickvisualdatamodel::qaimRowsMoved()
SingleRoleModel model(list);
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *obj = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *obj = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(obj != 0);
- QSignalSpy spy(obj, SIGNAL(modelUpdated(QQuickChangeSet,bool)));
+ QSignalSpy spy(obj, SIGNAL(modelUpdated(QQmlChangeSet,bool)));
model.emitMove(sourceFirst, sourceLast, destinationChild);
QCOMPARE(spy.count(), 1);
QCOMPARE(spy[0].count(), 2);
- QQuickChangeSet changeSet = spy[0][0].value<QQuickChangeSet>();
+ QQmlChangeSet changeSet = spy[0][0].value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 1);
QCOMPARE(changeSet.removes().at(0).index, expectFrom);
QCOMPARE(changeSet.removes().at(0).count, expectCount);
@@ -1115,11 +1115,11 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
QQmlComponent component(&engine, testFileUrl("visualdatamodel.qml"));
QScopedPointer<QObject> object(component.create());
- QQuickVisualDataModel *vdm = qobject_cast<QQuickVisualDataModel*>(object.data());
+ QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
QVERIFY(vdm);
- QSignalSpy spy(vdm, SIGNAL(modelUpdated(QQuickChangeSet,bool)));
- QQuickChangeSet changeSet;
+ QSignalSpy spy(vdm, SIGNAL(modelUpdated(QQmlChangeSet,bool)));
+ QQmlChangeSet changeSet;
QCOMPARE(vdm->count(), 4);
@@ -1127,7 +1127,7 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
model.move(QModelIndex(), 1, model.index(0, 0), 3, 2);
QCOMPARE(vdm->count(), 2);
QCOMPARE(spy.count(), 1);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 1);
QCOMPARE(changeSet.removes().at(0).index, 1);
QCOMPARE(changeSet.removes().at(0).count, 2);
@@ -1137,7 +1137,7 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
model.move(model.index(0, 0), 4, QModelIndex(), 2, 1);
QCOMPARE(vdm->count(), 3);
QCOMPARE(spy.count(), 2);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 0);
QCOMPARE(changeSet.inserts().count(), 1);
QCOMPARE(changeSet.inserts().at(0).index, 2);
@@ -1147,11 +1147,11 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
QCOMPARE(vdm->rootIndex().value<QModelIndex>(), model.index(2, 0));
QCOMPARE(vdm->count(), 3);
QCOMPARE(spy.count(), 4);
- changeSet = spy.at(2).at(0).value<QQuickChangeSet>();
+ changeSet = spy.at(2).at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 1);
QCOMPARE(changeSet.removes().at(0).index, 0);
QCOMPARE(changeSet.removes().at(0).count, 3);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.inserts().count(), 1);
QCOMPARE(changeSet.inserts().at(0).index, 0);
QCOMPARE(changeSet.inserts().at(0).count, 3);
@@ -1182,7 +1182,7 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
QCOMPARE(vdm->rootIndex().value<QModelIndex>(), QModelIndex());
QCOMPARE(vdm->count(), 0);
QCOMPARE(spy.count(), 5);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 1);
QCOMPARE(changeSet.removes().at(0).index, 0);
QCOMPARE(changeSet.removes().at(0).count, 3);
@@ -1192,7 +1192,7 @@ void tst_qquickvisualdatamodel::subtreeRowsMoved()
QCOMPARE(vdm->rootIndex().value<QModelIndex>(), QModelIndex());
QCOMPARE(vdm->count(), 2);
QCOMPARE(spy.count(), 6);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.removes().count(), 0);
QCOMPARE(changeSet.inserts().count(), 1);
QCOMPARE(changeSet.inserts().at(0).index, 0);
@@ -1211,17 +1211,17 @@ void tst_qquickvisualdatamodel::watchedRoles()
QQmlComponent component(&engine, testFileUrl("visualdatamodel.qml"));
QScopedPointer<QObject> object(component.create());
- QQuickVisualDataModel *vdm = qobject_cast<QQuickVisualDataModel*>(object.data());
+ QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
QVERIFY(vdm);
// VisualDataModel doesn't initialize model data until the first item is requested.
- QQuickItem *item = vdm->item(0);
+ QQuickItem *item = qobject_cast<QQuickItem*>(vdm->object(0));
QVERIFY(item);
vdm->release(item);
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); // Ensure released items are deleted before test exits.
- QSignalSpy spy(vdm, SIGNAL(modelUpdated(QQuickChangeSet,bool)));
- QQuickChangeSet changeSet;
+ QSignalSpy spy(vdm, SIGNAL(modelUpdated(QQmlChangeSet,bool)));
+ QQmlChangeSet changeSet;
QCOMPARE(vdm->count(), 30);
@@ -1238,13 +1238,13 @@ void tst_qquickvisualdatamodel::watchedRoles()
emit model.dataChanged(model.index(0), model.index(4));
QCOMPARE(spy.count(), 1);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 0);
QCOMPARE(changeSet.changes().at(0).count, 5);
emit model.dataChanged(model.index(1), model.index(6), QVector<int>() << QaimModel::Name);
QCOMPARE(spy.count(), 2);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 1);
QCOMPARE(changeSet.changes().at(0).count, 6);
@@ -1255,7 +1255,7 @@ void tst_qquickvisualdatamodel::watchedRoles()
emit model.dataChanged(model.index(0), model.index(4));
QCOMPARE(spy.count(), 3);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 0);
QCOMPARE(changeSet.changes().at(0).count, 5);
@@ -1264,7 +1264,7 @@ void tst_qquickvisualdatamodel::watchedRoles()
emit model.dataChanged(model.index(8), model.index(8), QVector<int>() << QaimModel::Number);
QCOMPARE(spy.count(), 4);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 8);
QCOMPARE(changeSet.changes().at(0).count, 1);
@@ -1272,19 +1272,19 @@ void tst_qquickvisualdatamodel::watchedRoles()
emit model.dataChanged(model.index(0), model.index(4));
QCOMPARE(spy.count(), 5);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 0);
QCOMPARE(changeSet.changes().at(0).count, 5);
emit model.dataChanged(model.index(1), model.index(6), QVector<int>() << QaimModel::Name);
QCOMPARE(spy.count(), 6);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 1);
QCOMPARE(changeSet.changes().at(0).count, 6);
emit model.dataChanged(model.index(8), model.index(8), QVector<int>() << QaimModel::Number);
QCOMPARE(spy.count(), 7);
- changeSet = spy.last().at(0).value<QQuickChangeSet>();
+ changeSet = spy.last().at(0).value<QQmlChangeSet>();
QCOMPARE(changeSet.changes().at(0).index, 8);
QCOMPARE(changeSet.changes().at(0).count, 1);
}
@@ -1301,29 +1301,29 @@ void tst_qquickvisualdatamodel::hasModelChildren()
QQmlComponent component(&engine, testFileUrl("visualdatamodel.qml"));
QScopedPointer<QObject> object(component.create());
- QQuickVisualDataModel *vdm = qobject_cast<QQuickVisualDataModel*>(object.data());
+ QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
QVERIFY(vdm);
QCOMPARE(vdm->count(), 4);
QQuickItem *item = 0;
- item = vdm->item(0);
+ item = qobject_cast<QQuickItem*>(vdm->object(0));
QVERIFY(item);
QCOMPARE(item->property("modelChildren").toBool(), true);
vdm->release(item);
- item = vdm->item(1);
+ item = qobject_cast<QQuickItem*>(vdm->object(1));
QVERIFY(item);
QCOMPARE(item->property("modelChildren").toBool(), false);
vdm->release(item);
- item = vdm->item(2);
+ item = qobject_cast<QQuickItem*>(vdm->object(2));
QVERIFY(item);
QCOMPARE(item->property("modelChildren").toBool(), true);
vdm->release(item);
- item = vdm->item(3);
+ item = qobject_cast<QQuickItem*>(vdm->object(3));
QVERIFY(item);
QCOMPARE(item->property("modelChildren").toBool(), false);
vdm->release(item);
@@ -1351,14 +1351,14 @@ void tst_qquickvisualdatamodel::setValue()
QQmlComponent component(&engine, testFileUrl("visualdatamodel.qml"));
QScopedPointer<QObject> object(component.create());
- QQuickVisualDataModel *vdm = qobject_cast<QQuickVisualDataModel*>(object.data());
+ QQmlDelegateModel *vdm = qobject_cast<QQmlDelegateModel*>(object.data());
QVERIFY(vdm);
QCOMPARE(vdm->count(), 3);
QQuickItem *item = 0;
- item = vdm->item(0);
+ item = qobject_cast<QQuickItem*>(vdm->object(0));
QVERIFY(item);
QCOMPARE(evaluate<QString>(item, "display"), QString("Row 1 Item"));
evaluate<void>(item, "display = 'Changed Item 1'");
@@ -1412,7 +1412,7 @@ void tst_qquickvisualdatamodel::remove()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
QVERIFY(visualModel);
{
@@ -1521,7 +1521,7 @@ void tst_qquickvisualdatamodel::move()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
QVERIFY(visualModel);
{
@@ -1710,13 +1710,13 @@ void tst_qquickvisualdatamodel::groups()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = listview->findChild<QQuickVisualDataModel *>("visualModel");
+ QQmlDelegateModel *visualModel = listview->findChild<QQmlDelegateModel *>("visualModel");
QVERIFY(visualModel);
- QQuickVisualDataGroup *visibleItems = listview->findChild<QQuickVisualDataGroup *>("visibleItems");
+ QQmlDataGroup *visibleItems = listview->findChild<QQmlDataGroup *>("visibleItems");
QVERIFY(visibleItems);
- QQuickVisualDataGroup *selectedItems = listview->findChild<QQuickVisualDataGroup *>("selectedItems");
+ QQmlDataGroup *selectedItems = listview->findChild<QQmlDataGroup *>("selectedItems");
QVERIFY(selectedItems);
const bool f = false;
@@ -1939,9 +1939,9 @@ void tst_qquickvisualdatamodel::groups()
template <int N> void tst_qquickvisualdatamodel::get_verify(
const SingleRoleModel &model,
- QQuickVisualDataModel *visualModel,
- QQuickVisualDataGroup *visibleItems,
- QQuickVisualDataGroup *selectedItems,
+ QQmlDelegateModel *visualModel,
+ QQmlDataGroup *visibleItems,
+ QQmlDataGroup *selectedItems,
const int (&mIndex)[N],
const int (&iIndex)[N],
const int (&vIndex)[N],
@@ -2030,13 +2030,13 @@ void tst_qquickvisualdatamodel::get()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
QVERIFY(visualModel);
- QQuickVisualDataGroup *visibleItems = visualModel->findChild<QQuickVisualDataGroup *>("visibleItems");
+ QQmlDataGroup *visibleItems = visualModel->findChild<QQmlDataGroup *>("visibleItems");
QVERIFY(visibleItems);
- QQuickVisualDataGroup *selectedItems = visualModel->findChild<QQuickVisualDataGroup *>("selectedItems");
+ QQmlDataGroup *selectedItems = visualModel->findChild<QQmlDataGroup *>("selectedItems");
QVERIFY(selectedItems);
QV8Engine *v8Engine = QQmlEnginePrivate::getV8Engine(ctxt->engine());
@@ -2154,7 +2154,7 @@ void tst_qquickvisualdatamodel::get()
void tst_qquickvisualdatamodel::invalidGroups()
{
QUrl source = testFileUrl("groups-invalid.qml");
- QTest::ignoreMessage(QtWarningMsg, (source.toString() + ":12:9: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("Group names must start with a lower case letter")).toUtf8());
+ QTest::ignoreMessage(QtWarningMsg, (source.toString() + ":12:9: QML VisualDataGroup: " + QQmlDataGroup::tr("Group names must start with a lower case letter")).toUtf8());
QQmlComponent component(&engine, source);
QScopedPointer<QObject> object(component.create());
@@ -2326,7 +2326,7 @@ void tst_qquickvisualdatamodel::create()
QQuickItem *contentItem = listview->contentItem();
QVERIFY(contentItem != 0);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel *>(qvariant_cast<QObject *>(listview->model()));
QVERIFY(visualModel);
QCOMPARE(listview->count(), 20);
@@ -2440,7 +2440,7 @@ void tst_qquickvisualdatamodel::incompleteModel()
QScopedPointer<QObject> object(component.beginCreate(engine.rootContext()));
- QQuickVisualDataModel *model = qobject_cast<QQuickVisualDataModel *>(object.data());
+ QQmlDelegateModel *model = qobject_cast<QQmlDelegateModel *>(object.data());
QVERIFY(model);
QSignalSpy itemsSpy(model->items(), SIGNAL(countChanged()));
@@ -3665,67 +3665,67 @@ void tst_qquickvisualdatamodel::warnings_data()
QTest::newRow("insert < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.insert(-2, {\"number\": \"eight\"})")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("insert: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("insert: index out of range"))
<< 4;
QTest::newRow("insert > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.insert(8, {\"number\": \"eight\"})")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("insert: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("insert: index out of range"))
<< 4;
QTest::newRow("create < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.create(-2, {\"number\": \"eight\"})")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("create: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("create: index out of range"))
<< 4;
QTest::newRow("create > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.create(8, {\"number\": \"eight\"})")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("create: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("create: index out of range"))
<< 4;
QTest::newRow("resolve from < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(-2, 3)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index out of range"))
<< 4;
QTest::newRow("resolve from > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(8, 3)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index out of range"))
<< 4;
QTest::newRow("resolve to < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(3, -2)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index out of range"))
<< 4;
QTest::newRow("resolve to > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(3, 8)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index out of range"))
<< 4;
QTest::newRow("resolve from invalid index")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(\"two\", 3)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: from index invalid"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from index invalid"))
<< 4;
QTest::newRow("resolve to invalid index")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(3, \"two\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: to index invalid"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to index invalid"))
<< 4;
QTest::newRow("resolve already resolved item")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.resolve(3, 2)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: from is not an unresolved item"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: from is not an unresolved item"))
<< 4;
QTest::newRow("resolve already resolved item")
@@ -3733,193 +3733,193 @@ void tst_qquickvisualdatamodel::warnings_data()
<< QString("{ items.insert(0, {\"number\": \"eight\"});"
"items.insert(1, {\"number\": \"seven\"});"
"items.resolve(0, 1)}")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("resolve: to is not a model item"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("resolve: to is not a model item"))
<< 6;
QTest::newRow("remove index < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(-2, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
<< 4;
QTest::newRow("remove index == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(4, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
<< 4;
QTest::newRow("remove index > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(9, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: index out of range"))
<< 4;
QTest::newRow("remove invalid index")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(\"nine\", 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: invalid index"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid index"))
<< 4;
QTest::newRow("remove count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(1, -2)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid count"))
<< 4;
QTest::newRow("remove index + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.remove(2, 4, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("remove: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("remove: invalid count"))
<< 4;
QTest::newRow("addGroups index < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(-2, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
<< 4;
QTest::newRow("addGroups index == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(4, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
<< 4;
QTest::newRow("addGroups index > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(9, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: index out of range"))
<< 4;
QTest::newRow("addGroups count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(1, -2, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: invalid count"))
<< 4;
QTest::newRow("addGroups index + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.addGroups(2, 4, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("addGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("addGroups: invalid count"))
<< 4;
QTest::newRow("removeGroups index < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(-2, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
<< 4;
QTest::newRow("removeGroups index == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(4, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
<< 4;
QTest::newRow("removeGroups index > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(9, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: index out of range"))
<< 4;
QTest::newRow("removeGroups count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(1, -2, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: invalid count"))
<< 4;
QTest::newRow("removeGroups index + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.removeGroups(2, 4, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("removeGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("removeGroups: invalid count"))
<< 4;
QTest::newRow("setGroups index < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(-2, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
<< 4;
QTest::newRow("setGroups index == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(4, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
<< 4;
QTest::newRow("setGroups index > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(9, 1, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: index out of range"))
<< 4;
QTest::newRow("setGroups count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(1, -2, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: invalid count"))
<< 4;
QTest::newRow("setGroups index + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.setGroups(2, 4, \"selected\")")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("setGroups: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("setGroups: invalid count"))
<< 4;
QTest::newRow("move from < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(-2, 1, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
<< 4;
QTest::newRow("move from == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(4, 1, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
<< 4;
QTest::newRow("move from > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(9, 1, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
<< 4;
QTest::newRow("move invalid from")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(\"nine\", 1, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: invalid from index"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid from index"))
<< 4;
QTest::newRow("move to < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, -2, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
<< 4;
QTest::newRow("move to == length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, 4, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
<< 4;
QTest::newRow("move to > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, 9, 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: to index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: to index out of range"))
<< 4;
QTest::newRow("move invalid to")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, \"nine\", 1)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: invalid to index"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid to index"))
<< 4;
QTest::newRow("move count < 0")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(1, 1, -2)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: invalid count"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: invalid count"))
<< 4;
QTest::newRow("move from + count > length")
<< testFileUrl("listmodelproperties.qml")
<< QString("items.move(2, 1, 4)")
- << ("<Unknown File>: QML VisualDataGroup: " + QQuickVisualDataGroup::tr("move: from index out of range"))
+ << ("<Unknown File>: QML VisualDataGroup: " + QQmlDataGroup::tr("move: from index out of range"))
<< 4;
}
@@ -3961,19 +3961,19 @@ void tst_qquickvisualdatamodel::invalidAttachment()
QCOMPARE(component.errors().count(), 0);
QVariant property = object->property("invalidVdm");
- QCOMPARE(property.userType(), qMetaTypeId<QQuickVisualDataModel *>());
- QVERIFY(!property.value<QQuickVisualDataModel *>());
+ QCOMPARE(property.userType(), qMetaTypeId<QQmlDelegateModel *>());
+ QVERIFY(!property.value<QQmlDelegateModel *>());
QQuickItem *item = findItem<QQuickItem>(static_cast<QQuickItem *>(object.data()), "delegate");
QVERIFY(item);
property = item->property("validVdm");
- QCOMPARE(property.userType(), qMetaTypeId<QQuickVisualDataModel *>());
- QVERIFY(property.value<QQuickVisualDataModel *>());
+ QCOMPARE(property.userType(), qMetaTypeId<QQmlDelegateModel *>());
+ QVERIFY(property.value<QQmlDelegateModel *>());
property = item->property("invalidVdm");
- QCOMPARE(property.userType(), qMetaTypeId<QQuickVisualDataModel *>());
- QVERIFY(!property.value<QQuickVisualDataModel *>());
+ QCOMPARE(property.userType(), qMetaTypeId<QQmlDelegateModel *>());
+ QVERIFY(!property.value<QQmlDelegateModel *>());
}
void tst_qquickvisualdatamodel::asynchronousInsert_data()
@@ -4005,15 +4005,15 @@ void tst_qquickvisualdatamodel::asynchronousInsert()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(visualModel);
ItemRequester requester;
- connect(visualModel, SIGNAL(initItem(int,QQuickItem*)), &requester, SLOT(initItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(createdItem(int,QQuickItem*)), &requester, SLOT(createdItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(destroyingItem(QQuickItem*)), &requester, SLOT(destroyingItem(QQuickItem*)));
+ connect(visualModel, SIGNAL(initItem(int,QObject*)), &requester, SLOT(initItem(int,QObject*)));
+ connect(visualModel, SIGNAL(createdItem(int,QObject*)), &requester, SLOT(createdItem(int,QObject*)));
+ connect(visualModel, SIGNAL(destroyingItem(QObject*)), &requester, SLOT(destroyingItem(QObject*)));
- QQuickItem *item = visualModel->item(requestIndex, true);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(requestIndex, true));
QVERIFY(!item);
QVERIFY(!requester.itemInitialized);
@@ -4025,7 +4025,7 @@ void tst_qquickvisualdatamodel::asynchronousInsert()
newItems.append(qMakePair(QLatin1String("New item") + QString::number(i), QString(QLatin1String(""))));
model.insertItems(insertIndex, newItems);
- item = visualModel->item(completeIndex, false);
+ item = qobject_cast<QQuickItem*>(visualModel->object(completeIndex, false));
QVERIFY(item);
QCOMPARE(requester.itemInitialized, item);
@@ -4070,15 +4070,15 @@ void tst_qquickvisualdatamodel::asynchronousRemove()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(visualModel);
ItemRequester requester;
- connect(visualModel, SIGNAL(initItem(int,QQuickItem*)), &requester, SLOT(initItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(createdItem(int,QQuickItem*)), &requester, SLOT(createdItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(destroyingItem(QQuickItem*)), &requester, SLOT(destroyingItem(QQuickItem*)));
+ connect(visualModel, SIGNAL(initItem(int,QObject*)), &requester, SLOT(initItem(int,QObject*)));
+ connect(visualModel, SIGNAL(createdItem(int,QObject*)), &requester, SLOT(createdItem(int,QObject*)));
+ connect(visualModel, SIGNAL(destroyingItem(QObject*)), &requester, SLOT(destroyingItem(QObject*)));
- QQuickItem *item = visualModel->item(requestIndex, true);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(requestIndex, true));
QVERIFY(!item);
QVERIFY(!requester.itemInitialized);
@@ -4098,7 +4098,7 @@ void tst_qquickvisualdatamodel::asynchronousRemove()
QCOMPARE(requester.itemCreated, requester.itemInitialized);
QCOMPARE(requester.itemDestroyed, requester.itemInitialized);
} else {
- item = visualModel->item(completeIndex, false);
+ item = qobject_cast<QQuickItem*>(visualModel->object(completeIndex, false));
QVERIFY(item);
QCOMPARE(requester.itemInitialized, item);
@@ -4148,15 +4148,15 @@ void tst_qquickvisualdatamodel::asynchronousMove()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(visualModel);
ItemRequester requester;
- connect(visualModel, SIGNAL(initItem(int,QQuickItem*)), &requester, SLOT(initItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(createdItem(int,QQuickItem*)), &requester, SLOT(createdItem(int,QQuickItem*)));
- connect(visualModel, SIGNAL(destroyingItem(QQuickItem*)), &requester, SLOT(destroyingItem(QQuickItem*)));
+ connect(visualModel, SIGNAL(initItem(int,QObject*)), &requester, SLOT(initItem(int,QObject*)));
+ connect(visualModel, SIGNAL(createdItem(int,QObject*)), &requester, SLOT(createdItem(int,QObject*)));
+ connect(visualModel, SIGNAL(destroyingItem(QObject*)), &requester, SLOT(destroyingItem(QObject*)));
- QQuickItem *item = visualModel->item(requestIndex, true);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(requestIndex, true));
QVERIFY(!item);
QVERIFY(!requester.itemInitialized);
@@ -4165,7 +4165,7 @@ void tst_qquickvisualdatamodel::asynchronousMove()
model.moveItems(from, to, count);
- item = visualModel->item(completeIndex, false);
+ item = qobject_cast<QQuickItem*>(visualModel->object(completeIndex, false));
QVERIFY(item);
@@ -4196,10 +4196,10 @@ void tst_qquickvisualdatamodel::asynchronousCancel()
engine.rootContext()->setContextProperty("myModel", &model);
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create());
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create());
QVERIFY(visualModel);
- QQuickItem *item = visualModel->item(requestIndex, true);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(requestIndex, true));
QVERIFY(!item);
QCOMPARE(controller.incubatingObjectCount(), 1);
@@ -4221,10 +4221,10 @@ void tst_qquickvisualdatamodel::invalidContext()
QQmlComponent c(&engine, testFileUrl("visualdatamodel.qml"));
- QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel*>(c.create(context.data()));
+ QQmlDelegateModel *visualModel = qobject_cast<QQmlDelegateModel*>(c.create(context.data()));
QVERIFY(visualModel);
- QQuickItem *item = visualModel->item(4, false);
+ QQuickItem *item = qobject_cast<QQuickItem*>(visualModel->object(4, false));
QVERIFY(item);
visualModel->release(item);
@@ -4232,7 +4232,7 @@ void tst_qquickvisualdatamodel::invalidContext()
model.insertItem(4, "new item", "");
- item = visualModel->item(4, false);
+ item = qobject_cast<QQuickItem*>(visualModel->object(4, false));
QVERIFY(!item);
}
diff --git a/tests/auto/quick/qquickwindow/data/focus.qml b/tests/auto/quick/qquickwindow/data/focus.qml
index 901f2fcf2e..899b999cdc 100644
--- a/tests/auto/quick/qquickwindow/data/focus.qml
+++ b/tests/auto/quick/qquickwindow/data/focus.qml
@@ -2,6 +2,10 @@ import QtQuick 2.0
import QtQuick.Window 2.0 as Window
Window.Window {
+
+ width: 400
+ height: 300
+
Item {
objectName: "item1"
}
diff --git a/tests/auto/quick/qquickwindow/data/ownershipRootItem.qml b/tests/auto/quick/qquickwindow/data/ownershipRootItem.qml
index 955304e317..03400ba673 100644
--- a/tests/auto/quick/qquickwindow/data/ownershipRootItem.qml
+++ b/tests/auto/quick/qquickwindow/data/ownershipRootItem.qml
@@ -10,6 +10,6 @@ Window.Window {
RootItemAccessor {
id:accessor
objectName:"accessor"
- Component.onCompleted:accessor.rootItem();
+ Component.onCompleted:accessor.contentItem();
}
}
diff --git a/tests/auto/quick/qquickwindow/data/showHideAnimate.qml b/tests/auto/quick/qquickwindow/data/showHideAnimate.qml
new file mode 100644
index 0000000000..e83910c5a5
--- /dev/null
+++ b/tests/auto/quick/qquickwindow/data/showHideAnimate.qml
@@ -0,0 +1,5 @@
+import QtQuick 2.0
+
+Item {
+ NumberAnimation on opacity { from: 0; to: 1; duration: 100; loops: Animation.Infinite }
+}
diff --git a/tests/auto/quick/qquickwindow/qquickwindow.pro b/tests/auto/quick/qquickwindow/qquickwindow.pro
index 9ae63a9ef1..59d96429db 100644
--- a/tests/auto/quick/qquickwindow/qquickwindow.pro
+++ b/tests/auto/quick/qquickwindow/qquickwindow.pro
@@ -13,6 +13,7 @@ TESTDATA = data/*
OTHER_FILES += \
data/AnimationsWhileHidden.qml \
- data/Headless.qml
+ data/Headless.qml \
+ data/showHideAnimate.qml
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index 3e3a35f8d1..b2e07e4c13 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -284,8 +284,11 @@ private slots:
void constantUpdates();
+ void constantUpdatesOnWindow_data();
+ void constantUpdatesOnWindow();
void mouseFiltering();
void headless();
+ void noUpdateWhenNothingChanges();
void touchEvent_basic();
void touchEvent_propagation();
@@ -312,6 +315,13 @@ private slots:
void ownershipRootItem();
+ void hideThenDelete_data();
+ void hideThenDelete();
+
+ void showHideAnimate();
+
+ void testExpose();
+
#ifndef QT_NO_CURSOR
void cursor();
#endif
@@ -331,6 +341,55 @@ void tst_qquickwindow::constantUpdates()
QTRY_VERIFY(item.iterations > 60);
}
+void tst_qquickwindow::constantUpdatesOnWindow_data()
+{
+ QTest::addColumn<bool>("blockedGui");
+ QTest::addColumn<QByteArray>("signal");
+
+ QQuickWindow window;
+ window.setGeometry(100, 100, 300, 200);
+ window.show();
+ QTest::qWaitForWindowExposed(&window);
+ bool threaded = window.openglContext()->thread() != QGuiApplication::instance()->thread();
+
+ if (threaded) {
+ QTest::newRow("blocked, beforeSync") << true << QByteArray(SIGNAL(beforeSynchronizing()));
+ QTest::newRow("blocked, beforeRender") << true << QByteArray(SIGNAL(beforeRendering()));
+ QTest::newRow("blocked, afterRender") << true << QByteArray(SIGNAL(afterRendering()));
+ QTest::newRow("blocked, swapped") << true << QByteArray(SIGNAL(frameSwapped()));
+ }
+ QTest::newRow("unblocked, beforeSync") << false << QByteArray(SIGNAL(beforeSynchronizing()));
+ QTest::newRow("unblocked, beforeRender") << false << QByteArray(SIGNAL(beforeRendering()));
+ QTest::newRow("unblocked, afterRender") << false << QByteArray(SIGNAL(afterRendering()));
+ QTest::newRow("unblocked, swapped") << false << QByteArray(SIGNAL(frameSwapped()));
+}
+
+void tst_qquickwindow::constantUpdatesOnWindow()
+{
+ QFETCH(bool, blockedGui);
+ QFETCH(QByteArray, signal);
+
+ QQuickWindow window;
+ window.setGeometry(100, 100, 300, 200);
+
+ connect(&window, signal.constData(), &window, SLOT(update()), Qt::DirectConnection);
+ window.show();
+ QTRY_VERIFY(window.isExposed());
+
+ QSignalSpy catcher(&window, SIGNAL(frameSwapped()));
+ if (blockedGui)
+ QTest::qSleep(1000);
+ else {
+ window.update();
+ QTest::qWait(1000);
+ }
+ window.hide();
+
+ // We should expect 60, but under loaded conditions we could be skipping
+ // frames, so don't expect too much.
+ QVERIFY(catcher.size() > 10);
+}
+
void tst_qquickwindow::touchEvent_basic()
{
TestTouchItem::clearMousePressCounter();
@@ -945,6 +1004,8 @@ void tst_qquickwindow::headless()
QScopedPointer<QObject> cleanup(created);
QQuickWindow* window = qobject_cast<QQuickWindow*>(created);
+ window->setPersistentOpenGLContext(false);
+ window->setPersistentSceneGraph(false);
QVERIFY(window);
window->show();
@@ -984,6 +1045,28 @@ void tst_qquickwindow::headless()
QCOMPARE(originalContent, newContent);
}
+void tst_qquickwindow::noUpdateWhenNothingChanges()
+{
+ QQuickWindow window;
+ window.setGeometry(100, 100, 300, 200);
+
+ QQuickRectangle rect(window.contentItem());
+
+ window.show();
+ QTRY_VERIFY(window.isExposed());
+
+ if (window.openglContext()->thread() == QGuiApplication::instance()->thread()) {
+ QSKIP("Only threaded renderloop implements this feature");
+ return;
+ }
+
+ QSignalSpy spy(&window, SIGNAL(frameSwapped()));
+ rect.update();
+ QTest::qWait(500);
+
+ QCOMPARE(spy.size(), 0);
+}
+
void tst_qquickwindow::focusObject()
{
QQmlEngine engine;
@@ -997,6 +1080,11 @@ void tst_qquickwindow::focusObject()
QQuickWindow *window = qobject_cast<QQuickWindow*>(created);
QVERIFY(window);
+ window->show();
+ QVERIFY(QTest::qWaitForWindowExposed(window));
+ window->requestActivate();
+ QVERIFY(QTest::qWaitForWindowActive(window));
+
QQuickItem *item1 = window->findChild<QQuickItem*>("item1");
QVERIFY(item1);
item1->setFocus(true);
@@ -1207,6 +1295,110 @@ void tst_qquickwindow::cursor()
}
#endif
+void tst_qquickwindow::hideThenDelete_data()
+{
+ QTest::addColumn<bool>("persistentSG");
+ QTest::addColumn<bool>("persistentGL");
+
+ QTest::newRow("persistent:SG=false,GL=false") << false << false;
+ QTest::newRow("persistent:SG=true,GL=false") << true << false;
+ QTest::newRow("persistent:SG=false,GL=true") << false << true;
+ QTest::newRow("persistent:SG=true,GL=true") << true << true;
+}
+
+void tst_qquickwindow::hideThenDelete()
+{
+ if (QGuiApplication::platformName() == QStringLiteral("xcb")) {
+ QSKIP("For some obscure reason this test fails in CI only");
+ return;
+ }
+
+ QFETCH(bool, persistentSG);
+ QFETCH(bool, persistentGL);
+
+ QSignalSpy *openglDestroyed = 0;
+ QSignalSpy *sgInvalidated = 0;
+
+ {
+ QQuickWindow window;
+ window.setColor(Qt::red);
+
+ window.setPersistentSceneGraph(persistentSG);
+ window.setPersistentOpenGLContext(persistentGL);
+
+ window.resize(400, 300);
+ window.show();
+
+ QTest::qWaitForWindowExposed(&window);
+
+ openglDestroyed = new QSignalSpy(window.openglContext(), SIGNAL(aboutToBeDestroyed()));
+ sgInvalidated = new QSignalSpy(&window, SIGNAL(sceneGraphInvalidated()));
+
+ window.hide();
+
+ QTRY_VERIFY(!window.isExposed());
+
+ if (!persistentSG) {
+ QVERIFY(sgInvalidated->size() > 0);
+ if (!persistentGL)
+ QVERIFY(openglDestroyed->size() > 0);
+ else
+ QVERIFY(openglDestroyed->size() == 0);
+ } else {
+ QVERIFY(sgInvalidated->size() == 0);
+ QVERIFY(openglDestroyed->size() == 0);
+ }
+ }
+
+ QVERIFY(sgInvalidated->size() > 0);
+ QVERIFY(openglDestroyed->size() > 0);
+}
+
+void tst_qquickwindow::showHideAnimate()
+{
+ // This test tries to mimick a bug triggered in the qquickanimatedimage test
+ // A window is shown, then removed again before it is exposed. This left
+ // traces in the render loop which prevent other animations from running
+ // later on.
+ {
+ QQuickWindow window;
+ window.resize(400, 300);
+ window.show();
+ }
+
+ QQmlEngine engine;
+ QQmlComponent component(&engine);
+ component.loadUrl(testFileUrl("showHideAnimate.qml"));
+ QQuickItem* created = qobject_cast<QQuickItem *>(component.create());
+
+ QVERIFY(created);
+
+ QTRY_VERIFY(created->opacity() > 0.5);
+ QTRY_VERIFY(created->opacity() < 0.5);
+}
+
+void tst_qquickwindow::testExpose()
+{
+ QQuickWindow window;
+ window.setGeometry(100, 100, 300, 200);
+
+ window.show();
+ QTRY_VERIFY(window.isExposed());
+
+ QSignalSpy swapSpy(&window, SIGNAL(frameSwapped()));
+
+ // exhaust pending exposes, as some platforms send us plenty
+ // while showing the first time
+ QTest::qWait(1000);
+ while (swapSpy.size() != 0) {
+ swapSpy.clear();
+ QTest::qWait(100);
+ }
+
+ QWindowSystemInterface::handleExposeEvent(&window, QRegion(10, 10, 20, 20));
+ QTRY_COMPARE(swapSpy.size(), 1);
+}
+
QTEST_MAIN(tst_qquickwindow)
#include "tst_qquickwindow.moc"
diff --git a/tests/auto/quick/quick.pro b/tests/auto/quick/quick.pro
index c4a4173e0f..aa1e1ec701 100644
--- a/tests/auto/quick/quick.pro
+++ b/tests/auto/quick/quick.pro
@@ -61,6 +61,7 @@ QUICKTESTS = \
qquickshadereffect \
qquickspritesequence \
qquicktext \
+ qquicktextdocument \
qquicktextedit \
qquicktextinput \
qquickvisualdatamodel \