diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-10-14 10:51:42 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-21 11:53:26 +0200 |
commit | bfb3c424abc7c839dc44de0e36024ede99ece736 (patch) | |
tree | b6814d0238bead8518b23c078beb818432de6ce4 /tests | |
parent | 2d119a137f1bc0c8b1113cd6c58413a1b89a4c1c (diff) |
Rename Qt Quick-specific classes to QQuick*
The QSG (SceneGraph) prefix is too generic for
Qt Quick(2)-specific classes.
All the classes and files in the declarative/items
directory have been renamed.
In particular, for classes that are currently public,
the renaming is as follows:
QSGView --> QQuickView
QSGCanvas --> QQuickCanvas
QSGItem --> QQuickItem
QSGPaintedItem --> QQuickPaintedItem
The header files have been renamed accordingly
(e.g. qsgview.h --> qquickview.h).
Change-Id: Iac937fff81db20bb639486a793c3aeb5230b038c
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp | 10 | ||||
-rw-r--r-- | tests/auto/declarative/declarative.pro | 54 | ||||
-rw-r--r-- | tests/auto/declarative/examples/tst_examples.cpp | 10 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp | 194 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp | 18 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp | 122 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp | 16 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp | 14 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp | 34 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp | 44 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp | 30 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp | 12 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp | 376 | ||||
-rw-r--r-- | tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qmlmin/tst_qmlmin.cpp | 3 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/colors.gif (renamed from tests/auto/declarative/qsganimatedimage/data/colors.gif) | bin | 505 -> 505 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/colors.qml (renamed from tests/auto/declarative/qsganimatedimage/data/colors.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/hearts.gif (renamed from tests/auto/declarative/qsganimatedimage/data/hearts.gif) | bin | 6524 -> 6524 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/hearts.qml (renamed from tests/auto/declarative/qsganimatedimage/data/hearts.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/qmldir (renamed from tests/auto/declarative/qsganimatedimage/data/qmldir) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/qtbug-16520.qml (renamed from tests/auto/declarative/qsganimatedimage/data/qtbug-16520.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/stickman.gif (renamed from tests/auto/declarative/qsganimatedimage/data/stickman.gif) | bin | 164923 -> 164923 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/stickman.qml (renamed from tests/auto/declarative/qsganimatedimage/data/stickman.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/stickmanerror1.qml (renamed from tests/auto/declarative/qsganimatedimage/data/stickmanerror1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/stickmanpause.qml (renamed from tests/auto/declarative/qsganimatedimage/data/stickmanpause.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/stickmanscaled.qml (renamed from tests/auto/declarative/qsganimatedimage/data/stickmanscaled.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/data/stickmanstopped.qml (renamed from tests/auto/declarative/qsganimatedimage/data/stickmanstopped.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/qquickanimatedimage.pro (renamed from tests/auto/declarative/qsganimatedimage/qsganimatedimage.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickanimatedimage/tst_qquickanimatedimage.cpp (renamed from tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp) | 90 | ||||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/data/colors-mirror.png (renamed from tests/auto/declarative/qsgborderimage/data/colors-mirror.png) | bin | 5554 -> 5554 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/data/colors-round-quotes.sci (renamed from tests/auto/declarative/qsgborderimage/data/colors-round-quotes.sci) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/data/colors-round-remote.sci (renamed from tests/auto/declarative/qsgborderimage/data/colors-round-remote.sci) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/data/colors-round.sci (renamed from tests/auto/declarative/qsgborderimage/data/colors-round.sci) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/data/colors.png (renamed from tests/auto/declarative/qsgborderimage/data/colors.png) | bin | 1655 -> 1655 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/data/heart200.png (renamed from tests/auto/declarative/qsgborderimage/data/heart200.png) | bin | 7943 -> 7943 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/data/invalid.sci (renamed from tests/auto/declarative/qsgborderimage/data/invalid.sci) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/data/mirror.qml (renamed from tests/auto/declarative/qsgborderimage/data/mirror.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/qquickborderimage.pro (renamed from tests/auto/declarative/qsgborderimage/qsgborderimage.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickborderimage/tst_qquickborderimage.cpp (renamed from tests/auto/declarative/qsgborderimage/tst_qsgborderimage.cpp) | 126 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvas/qquickcanvas.pro (renamed from tests/auto/declarative/qsgcanvas/qsgcanvas.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvas/tst_qquickcanvas.cpp (renamed from tests/auto/declarative/qsgcanvas/tst_qsgcanvas.cpp) | 58 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/anim-gr.gif (renamed from tests/auto/declarative/qsgcanvasitem/data/anim-gr.gif) | bin | 241 -> 241 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/anim-gr.png (renamed from tests/auto/declarative/qsgcanvasitem/data/anim-gr.png) | bin | 460 -> 460 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/anim-poster-gr.png (renamed from tests/auto/declarative/qsgcanvasitem/data/anim-poster-gr.png) | bin | 422 -> 422 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/background.png (renamed from tests/auto/declarative/qsgcanvasitem/data/background.png) | bin | 86 -> 86 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/broken.png (renamed from tests/auto/declarative/qsgcanvasitem/data/broken.png) | bin | 87 -> 87 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/ggrr-256x256.png (renamed from tests/auto/declarative/qsgcanvasitem/data/ggrr-256x256.png) | bin | 120 -> 120 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/green-16x16.png (renamed from tests/auto/declarative/qsgcanvasitem/data/green-16x16.png) | bin | 92 -> 92 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/green-1x1.png (renamed from tests/auto/declarative/qsgcanvasitem/data/green-1x1.png) | bin | 82 -> 82 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/green-256x256.png (renamed from tests/auto/declarative/qsgcanvasitem/data/green-256x256.png) | bin | 103 -> 103 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/green-2x2.png (renamed from tests/auto/declarative/qsgcanvasitem/data/green-2x2.png) | bin | 118 -> 118 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/green.png (renamed from tests/auto/declarative/qsgcanvasitem/data/green.png) | bin | 87 -> 87 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/grgr-256x256.png (renamed from tests/auto/declarative/qsgcanvasitem/data/grgr-256x256.png) | bin | 130 -> 130 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/red-16x16.png (renamed from tests/auto/declarative/qsgcanvasitem/data/red-16x16.png) | bin | 130 -> 130 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/red.png (renamed from tests/auto/declarative/qsgcanvasitem/data/red.png) | bin | 87 -> 87 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/redtransparent.png (renamed from tests/auto/declarative/qsgcanvasitem/data/redtransparent.png) | bin | 109 -> 109 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/rgrg-256x256.png (renamed from tests/auto/declarative/qsgcanvasitem/data/rgrg-256x256.png) | bin | 131 -> 131 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/rrgg-256x256.png (renamed from tests/auto/declarative/qsgcanvasitem/data/rrgg-256x256.png) | bin | 120 -> 120 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/testhelper.js (renamed from tests/auto/declarative/qsgcanvasitem/data/testhelper.js) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/transparent.png (renamed from tests/auto/declarative/qsgcanvasitem/data/transparent.png) | bin | 100 -> 100 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/transparent50.png (renamed from tests/auto/declarative/qsgcanvasitem/data/transparent50.png) | bin | 155 -> 155 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_arc.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_arc.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_arcto.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_arcto.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_canvas.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_canvas.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_composite.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_composite.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_drawimage.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_drawimage.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_fillStyle.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_fillStyle.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_fillrect.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_fillrect.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_gradient.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_gradient.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_line.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_line.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_path.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_path.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_pattern.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_pattern.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_pixel.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_pixel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_shadow.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_shadow.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_state.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_state.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_strokeStyle.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_strokeStyle.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_text.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_text.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/tst_transform.qml (renamed from tests/auto/declarative/qsgcanvasitem/data/tst_transform.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/yellow.png (renamed from tests/auto/declarative/qsgcanvasitem/data/yellow.png) | bin | 95 -> 95 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/data/yellow75.png (renamed from tests/auto/declarative/qsgcanvasitem/data/yellow75.png) | bin | 150 -> 150 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/qquickcanvasitem.pro (renamed from tests/auto/declarative/qsgcanvasitem/qsgcanvasitem.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickcanvasitem/tst_qquickcanvasitem.cpp (renamed from tests/auto/declarative/qsgcanvasitem/tst_qsgcanvasitem.cpp) | 2 | ||||
-rw-r--r-- | tests/auto/declarative/qquickdrag/qquickdrag.pro (renamed from tests/auto/declarative/qsgdrag/qsgdrag.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickdrag/tst_qquickdrag.cpp (renamed from tests/auto/declarative/qsgdrag/tst_qsgdrag.cpp) | 86 | ||||
-rw-r--r-- | tests/auto/declarative/qquickdroparea/qquickdroparea.pro (renamed from tests/auto/declarative/qsgdroparea/qsgdroparea.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickdroparea/tst_qquickdroparea.cpp (renamed from tests/auto/declarative/qsgdroparea/tst_qsgdroparea.cpp) | 103 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/disabled.qml (renamed from tests/auto/declarative/qsgflickable/data/disabled.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/flickable01.qml (renamed from tests/auto/declarative/qsgflickable/data/flickable01.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/flickable02.qml (renamed from tests/auto/declarative/qsgflickable/data/flickable02.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/flickable03.qml (renamed from tests/auto/declarative/qsgflickable/data/flickable03.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/flickable04.qml (renamed from tests/auto/declarative/qsgflickable/data/flickable04.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/flickableqgraphicswidget.qml (renamed from tests/auto/declarative/qsgflickable/data/flickableqgraphicswidget.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/margins.qml (renamed from tests/auto/declarative/qsgflickable/data/margins.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/nestedPressDelay.qml (renamed from tests/auto/declarative/qsgflickable/data/nestedPressDelay.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/resize.qml (renamed from tests/auto/declarative/qsgflickable/data/resize.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/data/wheel.qml (renamed from tests/auto/declarative/qsgflickable/data/wheel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/qquickflickable.pro (renamed from tests/auto/declarative/qsgflickable/qsgflickable.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflickable/tst_qquickflickable.cpp (renamed from tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp) | 156 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflipable/data/crash.qml (renamed from tests/auto/declarative/qsgflipable/data/crash.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflipable/data/flipable-abort.qml (renamed from tests/auto/declarative/qsgflipable/data/flipable-abort.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflipable/data/test-flipable.qml (renamed from tests/auto/declarative/qsgflipable/data/test-flipable.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflipable/qquickflipable.pro (renamed from tests/auto/declarative/qsgflipable/qsgflipable.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickflipable/tst_qquickflipable.cpp (renamed from tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp) | 48 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/canvasFocus.qml (renamed from tests/auto/declarative/qsgfocusscope/data/canvasFocus.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/chain.qml (renamed from tests/auto/declarative/qsgfocusscope/data/chain.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/forceActiveFocus.qml (renamed from tests/auto/declarative/qsgfocusscope/data/forceActiveFocus.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/forcefocus.qml (renamed from tests/auto/declarative/qsgfocusscope/data/forcefocus.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/qtBug13380.qml (renamed from tests/auto/declarative/qsgfocusscope/data/qtBug13380.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/signalEmission.qml (renamed from tests/auto/declarative/qsgfocusscope/data/signalEmission.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/test.qml (renamed from tests/auto/declarative/qsgfocusscope/data/test.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/test2.qml (renamed from tests/auto/declarative/qsgfocusscope/data/test2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/test3.qml (renamed from tests/auto/declarative/qsgfocusscope/data/test3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/test4.qml (renamed from tests/auto/declarative/qsgfocusscope/data/test4.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/data/test5.qml (renamed from tests/auto/declarative/qsgfocusscope/data/test5.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/qquickfocusscope.pro (renamed from tests/auto/declarative/qsgfocusscope/qsgfocusscope.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickfocusscope/tst_qquickfocusscope.cpp (renamed from tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp) | 152 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/ComponentView.qml (renamed from tests/auto/declarative/qsggridview/data/ComponentView.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/attachedSignals.qml (renamed from tests/auto/declarative/qsggridview/data/attachedSignals.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/creationContext.qml (renamed from tests/auto/declarative/qsggridview/data/creationContext.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/displaygrid.qml (renamed from tests/auto/declarative/qsggridview/data/displaygrid.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/footer.qml (renamed from tests/auto/declarative/qsggridview/data/footer.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml (renamed from tests/auto/declarative/qsggridview/data/gridview-enforcerange.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml (renamed from tests/auto/declarative/qsggridview/data/gridview-initCurrent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/gridview-noCurrent.qml (renamed from tests/auto/declarative/qsggridview/data/gridview-noCurrent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/gridview1.qml (renamed from tests/auto/declarative/qsggridview/data/gridview1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/gridview2.qml (renamed from tests/auto/declarative/qsggridview/data/gridview2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/gridview3.qml (renamed from tests/auto/declarative/qsggridview/data/gridview3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/gridview4.qml (renamed from tests/auto/declarative/qsggridview/data/gridview4.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/header.qml (renamed from tests/auto/declarative/qsggridview/data/header.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/manual-highlight.qml (renamed from tests/auto/declarative/qsggridview/data/manual-highlight.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/margins.qml (renamed from tests/auto/declarative/qsggridview/data/margins.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/mirroring.qml (renamed from tests/auto/declarative/qsggridview/data/mirroring.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/propertychangestest.qml (renamed from tests/auto/declarative/qsggridview/data/propertychangestest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/resizeview.qml (renamed from tests/auto/declarative/qsggridview/data/resizeview.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/setindex.qml (renamed from tests/auto/declarative/qsggridview/data/setindex.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/data/snapToRow.qml (renamed from tests/auto/declarative/qsggridview/data/snapToRow.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/qquickgridview.pro (renamed from tests/auto/declarative/qsggridview/qsggridview.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp (renamed from tests/auto/declarative/qsggridview/tst_qsggridview.cpp) | 758 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/aspectratio.qml (renamed from tests/auto/declarative/qsgimage/data/aspectratio.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/big.jpeg (renamed from tests/auto/declarative/qsgimage/data/big.jpeg) | bin | 1700081 -> 1700081 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/big256.png (renamed from tests/auto/declarative/qsgimage/data/big256.png) | bin | 3566 -> 3566 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/colors.png (renamed from tests/auto/declarative/qsgimage/data/colors.png) | bin | 1655 -> 1655 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/colors1.png (renamed from tests/auto/declarative/qsgimage/data/colors1.png) | bin | 1655 -> 1655 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/green.png (renamed from tests/auto/declarative/qsgimage/data/green.png) | bin | 314 -> 314 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/heart-win32.png (renamed from tests/auto/declarative/qsgimage/data/heart-win32.png) | bin | 12621 -> 12621 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/heart.png (renamed from tests/auto/declarative/qsgimage/data/heart.png) | bin | 12577 -> 12577 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/heart.svg (renamed from tests/auto/declarative/qsgimage/data/heart.svg) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/heart200-win32.png (renamed from tests/auto/declarative/qsgimage/data/heart200-win32.png) | bin | 8062 -> 8062 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/heart200.png (renamed from tests/auto/declarative/qsgimage/data/heart200.png) | bin | 8063 -> 8063 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/htiling.qml (renamed from tests/auto/declarative/qsgimage/data/htiling.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/mirror.qml (renamed from tests/auto/declarative/qsgimage/data/mirror.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/nullpixmap.qml (renamed from tests/auto/declarative/qsgimage/data/nullpixmap.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/pattern.png (renamed from tests/auto/declarative/qsgimage/data/pattern.png) | bin | 1371 -> 1371 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/qtbug_16389.qml (renamed from tests/auto/declarative/qsgimage/data/qtbug_16389.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/rect.png (renamed from tests/auto/declarative/qsgimage/data/rect.png) | bin | 171 -> 171 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquickimage/data/vtiling.qml (renamed from tests/auto/declarative/qsgimage/data/vtiling.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/qquickimage.pro (renamed from tests/auto/declarative/qsgimage/qsgimage.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickimage/tst_qquickimage.cpp (renamed from tests/auto/declarative/qsgimage/tst_qsgimage.cpp) | 168 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem/qquickitem.pro (renamed from tests/auto/declarative/qsgitem/qsgitem.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem/tst_qquickitem.cpp (renamed from tests/auto/declarative/qsgitem/tst_qsgitem.cpp) | 244 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/childrenProperty.qml (renamed from tests/auto/declarative/qsgitem2/data/childrenProperty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/childrenRect.qml (renamed from tests/auto/declarative/qsgitem2/data/childrenRect.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/childrenRectBug.qml (renamed from tests/auto/declarative/qsgitem2/data/childrenRectBug.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml (renamed from tests/auto/declarative/qsgitem2/data/childrenRectBug2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/childrenRectBug3.qml (renamed from tests/auto/declarative/qsgitem2/data/childrenRectBug3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/implicitsize.qml (renamed from tests/auto/declarative/qsgitem2/data/implicitsize.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/keynavigationtest.qml (renamed from tests/auto/declarative/qsgitem2/data/keynavigationtest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/keynavigationtest_implicit.qml (renamed from tests/auto/declarative/qsgitem2/data/keynavigationtest_implicit.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/keyspriority.qml (renamed from tests/auto/declarative/qsgitem2/data/keyspriority.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/keystest.qml (renamed from tests/auto/declarative/qsgitem2/data/keystest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/layoutmirroring.qml (renamed from tests/auto/declarative/qsgitem2/data/layoutmirroring.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/mapCoordinates.qml (renamed from tests/auto/declarative/qsgitem2/data/mapCoordinates.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/propertychanges.qml (renamed from tests/auto/declarative/qsgitem2/data/propertychanges.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/qtbug_16871.qml (renamed from tests/auto/declarative/qsgitem2/data/qtbug_16871.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/resourcesProperty.qml (renamed from tests/auto/declarative/qsgitem2/data/resourcesProperty.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/data/transformCrash.qml (renamed from tests/auto/declarative/qsgitem2/data/transformCrash.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/qquickitem2.pro (renamed from tests/auto/declarative/qsgitem2/qsgitem2.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickitem2/tst_qquickitem.cpp (renamed from tests/auto/declarative/qsgitem2/tst_qsgitem.cpp) | 270 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/ComponentView.qml (renamed from tests/auto/declarative/qsglistview/data/ComponentView.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/attachedSignals.qml (renamed from tests/auto/declarative/qsglistview/data/attachedSignals.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/creationContext.qml (renamed from tests/auto/declarative/qsglistview/data/creationContext.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/displaylist.qml (renamed from tests/auto/declarative/qsglistview/data/displaylist.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/fillModelOnComponentCompleted.qml (renamed from tests/auto/declarative/qsglistview/data/fillModelOnComponentCompleted.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/footer.qml (renamed from tests/auto/declarative/qsglistview/data/footer.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/header.qml (renamed from tests/auto/declarative/qsglistview/data/header.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/headerfooter.qml (renamed from tests/auto/declarative/qsglistview/data/headerfooter.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/itemlist.qml (renamed from tests/auto/declarative/qsglistview/data/itemlist.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/listview-enforcerange-nohighlight.qml (renamed from tests/auto/declarative/qsglistview/data/listview-enforcerange-nohighlight.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/listview-enforcerange.qml (renamed from tests/auto/declarative/qsglistview/data/listview-enforcerange.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/listview-initCurrent.qml (renamed from tests/auto/declarative/qsglistview/data/listview-initCurrent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/listview-noCurrent.qml (renamed from tests/auto/declarative/qsglistview/data/listview-noCurrent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/listview-sections.qml (renamed from tests/auto/declarative/qsglistview/data/listview-sections.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/listview-sections_delegate.qml (renamed from tests/auto/declarative/qsglistview/data/listview-sections_delegate.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/listviewtest.qml (renamed from tests/auto/declarative/qsglistview/data/listviewtest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/manual-highlight.qml (renamed from tests/auto/declarative/qsglistview/data/manual-highlight.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/margins.qml (renamed from tests/auto/declarative/qsglistview/data/margins.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/propertychangestest.qml (renamed from tests/auto/declarative/qsglistview/data/propertychangestest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/qtbug-21742.qml (renamed from tests/auto/declarative/qsglistview/data/qtbug-21742.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/qtbug14821.qml (renamed from tests/auto/declarative/qsglistview/data/qtbug14821.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/qtbug16037.qml (renamed from tests/auto/declarative/qsglistview/data/qtbug16037.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/resizeview.qml (renamed from tests/auto/declarative/qsglistview/data/resizeview.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/rightToLeft.qml (renamed from tests/auto/declarative/qsglistview/data/rightToLeft.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/sizelessthan1.qml (renamed from tests/auto/declarative/qsglistview/data/sizelessthan1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/snapToItem.qml (renamed from tests/auto/declarative/qsglistview/data/snapToItem.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/data/strictlyenforcerange.qml (renamed from tests/auto/declarative/qsglistview/data/strictlyenforcerange.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/incrementalmodel.cpp (renamed from tests/auto/declarative/qsglistview/incrementalmodel.cpp) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/incrementalmodel.h (renamed from tests/auto/declarative/qsglistview/incrementalmodel.h) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/qquicklistview.pro (renamed from tests/auto/declarative/qsglistview/qsglistview.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquicklistview/tst_qquicklistview.cpp (renamed from tests/auto/declarative/qsglistview/tst_qsglistview.cpp) | 972 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/ActiveComponent.qml (renamed from tests/auto/declarative/qsgloader/data/ActiveComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/AnchoredLoader.qml (renamed from tests/auto/declarative/qsgloader/data/AnchoredLoader.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/BigComponent.qml (renamed from tests/auto/declarative/qsgloader/data/BigComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/BlueRect.qml (renamed from tests/auto/declarative/qsgloader/data/BlueRect.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/CreationContextLoader.qml (renamed from tests/auto/declarative/qsgloader/data/CreationContextLoader.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/GraphicsWidget250x250.qml (renamed from tests/auto/declarative/qsgloader/data/GraphicsWidget250x250.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/GreenRect.qml (renamed from tests/auto/declarative/qsgloader/data/GreenRect.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/InitialPropertyValuesComponent.qml (renamed from tests/auto/declarative/qsgloader/data/InitialPropertyValuesComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/InvalidSourceComponent.qml (renamed from tests/auto/declarative/qsgloader/data/InvalidSourceComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/NoResize.qml (renamed from tests/auto/declarative/qsgloader/data/NoResize.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/NoResizeGraphicsWidget.qml (renamed from tests/auto/declarative/qsgloader/data/NoResizeGraphicsWidget.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/QTBUG_16928.qml (renamed from tests/auto/declarative/qsgloader/data/QTBUG_16928.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/QTBUG_17114.qml (renamed from tests/auto/declarative/qsgloader/data/QTBUG_17114.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/Rect120x60.qml (renamed from tests/auto/declarative/qsgloader/data/Rect120x60.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/SetSourceComponent.qml (renamed from tests/auto/declarative/qsgloader/data/SetSourceComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/SizeGraphicsWidgetToLoader.qml (renamed from tests/auto/declarative/qsgloader/data/SizeGraphicsWidgetToLoader.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/SizeLoaderToGraphicsWidget.qml (renamed from tests/auto/declarative/qsgloader/data/SizeLoaderToGraphicsWidget.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/SizeToItem.qml (renamed from tests/auto/declarative/qsgloader/data/SizeToItem.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/SizeToLoader.qml (renamed from tests/auto/declarative/qsgloader/data/SizeToLoader.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/VmeError.qml (renamed from tests/auto/declarative/qsgloader/data/VmeError.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/active.1.qml (renamed from tests/auto/declarative/qsgloader/data/active.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/active.2.qml (renamed from tests/auto/declarative/qsgloader/data/active.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/active.3.qml (renamed from tests/auto/declarative/qsgloader/data/active.3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/active.4.qml (renamed from tests/auto/declarative/qsgloader/data/active.4.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/active.5.qml (renamed from tests/auto/declarative/qsgloader/data/active.5.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/active.6.qml (renamed from tests/auto/declarative/qsgloader/data/active.6.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/active.7.qml (renamed from tests/auto/declarative/qsgloader/data/active.7.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/active.8.qml (renamed from tests/auto/declarative/qsgloader/data/active.8.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/asynchronous.qml (renamed from tests/auto/declarative/qsgloader/data/asynchronous.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/crash.qml (renamed from tests/auto/declarative/qsgloader/data/crash.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/creationContext.qml (renamed from tests/auto/declarative/qsgloader/data/creationContext.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/differentorigin.qml (renamed from tests/auto/declarative/qsgloader/data/differentorigin.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/implicitSize.qml (renamed from tests/auto/declarative/qsgloader/data/implicitSize.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.1.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.2.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.3.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.4.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.4.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.5.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.5.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.6.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.6.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.7.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.7.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.8.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.8.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.binding.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.binding.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.error.1.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.error.1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.error.2.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.error.2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.error.3.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.error.3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/initialPropertyValues.error.4.qml (renamed from tests/auto/declarative/qsgloader/data/initialPropertyValues.error.4.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/nonItem.qml (renamed from tests/auto/declarative/qsgloader/data/nonItem.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/qmldir (renamed from tests/auto/declarative/qsgloader/data/qmldir) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/sameorigin-load.qml (renamed from tests/auto/declarative/qsgloader/data/sameorigin-load.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/sameorigin.qml (renamed from tests/auto/declarative/qsgloader/data/sameorigin.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/data/vmeErrors.qml (renamed from tests/auto/declarative/qsgloader/data/vmeErrors.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/qquickloader.pro (renamed from tests/auto/declarative/qsgloader/qsgloader.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickloader/tst_qquickloader.cpp (renamed from tests/auto/declarative/qsgloader/tst_qsgloader.cpp) | 214 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/clickThrough.qml (renamed from tests/auto/declarative/qsgmousearea/data/clickThrough.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/clickThrough2.qml (renamed from tests/auto/declarative/qsgmousearea/data/clickThrough2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/clickandhold.qml (renamed from tests/auto/declarative/qsgmousearea/data/clickandhold.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/clicktwice.qml (renamed from tests/auto/declarative/qsgmousearea/data/clicktwice.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/doubleclick.qml (renamed from tests/auto/declarative/qsgmousearea/data/doubleclick.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/dragging.qml (renamed from tests/auto/declarative/qsgmousearea/data/dragging.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/dragproperties.qml (renamed from tests/auto/declarative/qsgmousearea/data/dragproperties.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/dragreset.qml (renamed from tests/auto/declarative/qsgmousearea/data/dragreset.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/hoverPosition.qml (renamed from tests/auto/declarative/qsgmousearea/data/hoverPosition.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/hoverPropagation.qml (renamed from tests/auto/declarative/qsgmousearea/data/hoverPropagation.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/noclickandhold.qml (renamed from tests/auto/declarative/qsgmousearea/data/noclickandhold.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/pressedCanceled.qml (renamed from tests/auto/declarative/qsgmousearea/data/pressedCanceled.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/pressedOrdering.qml (renamed from tests/auto/declarative/qsgmousearea/data/pressedOrdering.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/preventstealing.qml (renamed from tests/auto/declarative/qsgmousearea/data/preventstealing.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/rejectEvent.qml (renamed from tests/auto/declarative/qsgmousearea/data/rejectEvent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/updateMousePosOnClick.qml (renamed from tests/auto/declarative/qsgmousearea/data/updateMousePosOnClick.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/data/updateMousePosOnResize.qml (renamed from tests/auto/declarative/qsgmousearea/data/updateMousePosOnResize.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/qquickmousearea.pro (renamed from tests/auto/declarative/qsgmousearea/qsgmousearea.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickmousearea/tst_qquickmousearea.cpp (renamed from tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp) | 138 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/ComponentView.qml (renamed from tests/auto/declarative/qsgpathview/data/ComponentView.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/closedPath.qml (renamed from tests/auto/declarative/qsgpathview/data/closedPath.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/creationContext.qml (renamed from tests/auto/declarative/qsgpathview/data/creationContext.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/datamodel.qml (renamed from tests/auto/declarative/qsgpathview/data/datamodel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/displaypath.qml (renamed from tests/auto/declarative/qsgpathview/data/displaypath.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/dragpath.qml (renamed from tests/auto/declarative/qsgpathview/data/dragpath.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/emptymodel.qml (renamed from tests/auto/declarative/qsgpathview/data/emptymodel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/missingPercent.qml (renamed from tests/auto/declarative/qsgpathview/data/missingPercent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/openPath.qml (renamed from tests/auto/declarative/qsgpathview/data/openPath.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/pathUpdate.qml (renamed from tests/auto/declarative/qsgpathview/data/pathUpdate.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/pathUpdateOnStartChanged.qml (renamed from tests/auto/declarative/qsgpathview/data/pathUpdateOnStartChanged.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/pathtest.qml (renamed from tests/auto/declarative/qsgpathview/data/pathtest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/pathview0.qml (renamed from tests/auto/declarative/qsgpathview/data/pathview0.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/pathview1.qml (renamed from tests/auto/declarative/qsgpathview/data/pathview1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/pathview2.qml (renamed from tests/auto/declarative/qsgpathview/data/pathview2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/pathview3.qml (renamed from tests/auto/declarative/qsgpathview/data/pathview3.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/pathview_package.qml (renamed from tests/auto/declarative/qsgpathview/data/pathview_package.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/propertychanges.qml (renamed from tests/auto/declarative/qsgpathview/data/propertychanges.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/treemodel.qml (renamed from tests/auto/declarative/qsgpathview/data/treemodel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/undefinedpath.qml (renamed from tests/auto/declarative/qsgpathview/data/undefinedpath.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/data/vdm.qml (renamed from tests/auto/declarative/qsgpathview/data/vdm.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/qquickpathview.pro (renamed from tests/auto/declarative/qsgpathview/qsgpathview.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpathview/tst_qquickpathview.cpp (renamed from tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp) | 272 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpincharea/data/pinchproperties.qml (renamed from tests/auto/declarative/qsgpincharea/data/pinchproperties.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpincharea/qquickpincharea.pro (renamed from tests/auto/declarative/qsgpincharea/qsgpincharea.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpincharea/tst_qquickpincharea.cpp (renamed from tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp) | 84 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/allInvisible.qml (renamed from tests/auto/declarative/qsgpositioners/data/allInvisible.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/attachedproperties-column.qml (renamed from tests/auto/declarative/qsgpositioners/data/attachedproperties-column.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/attachedproperties-dynamic.qml (renamed from tests/auto/declarative/qsgpositioners/data/attachedproperties-dynamic.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/attachedproperties-flow.qml (renamed from tests/auto/declarative/qsgpositioners/data/attachedproperties-flow.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/attachedproperties-grid.qml (renamed from tests/auto/declarative/qsgpositioners/data/attachedproperties-grid.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/attachedproperties-row.qml (renamed from tests/auto/declarative/qsgpositioners/data/attachedproperties-row.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/flow-testimplicitsize.qml (renamed from tests/auto/declarative/qsgpositioners/data/flow-testimplicitsize.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/flowtest-toptobottom.qml (renamed from tests/auto/declarative/qsgpositioners/data/flowtest-toptobottom.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/flowtest.qml (renamed from tests/auto/declarative/qsgpositioners/data/flowtest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/grid-animated.qml (renamed from tests/auto/declarative/qsgpositioners/data/grid-animated.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/grid-row-column-spacing.qml (renamed from tests/auto/declarative/qsgpositioners/data/grid-row-column-spacing.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/grid-spacing.qml (renamed from tests/auto/declarative/qsgpositioners/data/grid-spacing.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/grid-toptobottom.qml (renamed from tests/auto/declarative/qsgpositioners/data/grid-toptobottom.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/gridtest.qml (renamed from tests/auto/declarative/qsgpositioners/data/gridtest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/gridzerocolumns.qml (renamed from tests/auto/declarative/qsgpositioners/data/gridzerocolumns.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/horizontal-animated-disabled.qml (renamed from tests/auto/declarative/qsgpositioners/data/horizontal-animated-disabled.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/horizontal-animated.qml (renamed from tests/auto/declarative/qsgpositioners/data/horizontal-animated.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/horizontal-spacing.qml (renamed from tests/auto/declarative/qsgpositioners/data/horizontal-spacing.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/horizontal.qml (renamed from tests/auto/declarative/qsgpositioners/data/horizontal.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/propertychangestest.qml (renamed from tests/auto/declarative/qsgpositioners/data/propertychangestest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/rectangleComponent.qml (renamed from tests/auto/declarative/qsgpositioners/data/rectangleComponent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/repeatertest.qml (renamed from tests/auto/declarative/qsgpositioners/data/repeatertest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/vertical-animated.qml (renamed from tests/auto/declarative/qsgpositioners/data/vertical-animated.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/vertical-spacing.qml (renamed from tests/auto/declarative/qsgpositioners/data/vertical-spacing.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/data/vertical.qml (renamed from tests/auto/declarative/qsgpositioners/data/vertical.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/qquickpositioners.pro (renamed from tests/auto/declarative/qsgpositioners/qsgpositioners.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickpositioners/tst_qquickpositioners.cpp (renamed from tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp) | 468 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/data/intmodel.qml (renamed from tests/auto/declarative/qsgrepeater/data/intmodel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/data/itemlist.qml (renamed from tests/auto/declarative/qsgrepeater/data/itemlist.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/data/modelChanged.qml (renamed from tests/auto/declarative/qsgrepeater/data/modelChanged.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/data/objlist.qml (renamed from tests/auto/declarative/qsgrepeater/data/objlist.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/data/properties.qml (renamed from tests/auto/declarative/qsgrepeater/data/properties.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/data/repeater1.qml (renamed from tests/auto/declarative/qsgrepeater/data/repeater1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/data/repeater2.qml (renamed from tests/auto/declarative/qsgrepeater/data/repeater2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/qquickrepeater.pro (renamed from tests/auto/declarative/qsgrepeater/qsgrepeater.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickrepeater/tst_qquickrepeater.cpp (renamed from tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp) | 150 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments.qml (renamed from tests/auto/declarative/qsgtext/data/alignments.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_cb.png (renamed from tests/auto/declarative/qsgtext/data/alignments_cb.png) | bin | 496 -> 496 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_cc.png (renamed from tests/auto/declarative/qsgtext/data/alignments_cc.png) | bin | 556 -> 556 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_ct.png (renamed from tests/auto/declarative/qsgtext/data/alignments_ct.png) | bin | 533 -> 533 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_lb.png (renamed from tests/auto/declarative/qsgtext/data/alignments_lb.png) | bin | 496 -> 496 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_lc.png (renamed from tests/auto/declarative/qsgtext/data/alignments_lc.png) | bin | 535 -> 535 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_lt.png (renamed from tests/auto/declarative/qsgtext/data/alignments_lt.png) | bin | 514 -> 514 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_rb.png (renamed from tests/auto/declarative/qsgtext/data/alignments_rb.png) | bin | 505 -> 505 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_rc.png (renamed from tests/auto/declarative/qsgtext/data/alignments_rc.png) | bin | 559 -> 559 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/alignments_rt.png (renamed from tests/auto/declarative/qsgtext/data/alignments_rt.png) | bin | 539 -> 539 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/embeddedImagesLocal.qml (renamed from tests/auto/declarative/qsgtext/data/embeddedImagesLocal.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/embeddedImagesLocalError.qml (renamed from tests/auto/declarative/qsgtext/data/embeddedImagesLocalError.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/embeddedImagesRemote.qml (renamed from tests/auto/declarative/qsgtext/data/embeddedImagesRemote.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/embeddedImagesRemoteError.qml (renamed from tests/auto/declarative/qsgtext/data/embeddedImagesRemoteError.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/horizontalAlignment_RightToLeft.qml (renamed from tests/auto/declarative/qsgtext/data/horizontalAlignment_RightToLeft.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/http/exists.png (renamed from tests/auto/declarative/qsgtext/data/http/exists.png) | bin | 2738 -> 2738 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/lineCount.qml (renamed from tests/auto/declarative/qsgtext/data/lineCount.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/lineHeight.qml (renamed from tests/auto/declarative/qsgtext/data/lineHeight.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/lineLayout.qml (renamed from tests/auto/declarative/qsgtext/data/lineLayout.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/qtbug_14734.qml (renamed from tests/auto/declarative/qsgtext/data/qtbug_14734.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/data/rotated.qml (renamed from tests/auto/declarative/qsgtext/data/rotated.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/qquicktext.pro (renamed from tests/auto/declarative/qsgtext/qsgtext.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktext/tst_qquicktext.cpp (renamed from tests/auto/declarative/qsgtext/tst_qsgtext.cpp) | 332 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/CursorRect.qml (renamed from tests/auto/declarative/qsgtextedit/data/CursorRect.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments.qml (renamed from tests/auto/declarative/qsgtextedit/data/alignments.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_cb.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_cb.png) | bin | 496 -> 496 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_cc.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_cc.png) | bin | 556 -> 556 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_ct.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_ct.png) | bin | 533 -> 533 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_lb.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_lb.png) | bin | 496 -> 496 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_lc.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_lc.png) | bin | 535 -> 535 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_lt.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_lt.png) | bin | 514 -> 514 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_rb.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_rb.png) | bin | 505 -> 505 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_rc.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_rc.png) | bin | 559 -> 559 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/alignments_rt.png (renamed from tests/auto/declarative/qsgtextedit/data/alignments_rt.png) | bin | 539 -> 539 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/cursorTest.qml (renamed from tests/auto/declarative/qsgtextedit/data/cursorTest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/cursorVisible.qml (renamed from tests/auto/declarative/qsgtextedit/data/cursorVisible.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/geometrySignals.qml (renamed from tests/auto/declarative/qsgtextedit/data/geometrySignals.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/horizontalAlignment_RightToLeft.qml (renamed from tests/auto/declarative/qsgtextedit/data/horizontalAlignment_RightToLeft.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/http/ErrItem.qml (renamed from tests/auto/declarative/qsgtextedit/data/http/ErrItem.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/http/NormItem.qml (renamed from tests/auto/declarative/qsgtextedit/data/http/NormItem.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/http/cursorHttpTest.qml (renamed from tests/auto/declarative/qsgtextedit/data/http/cursorHttpTest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestFail1.qml (renamed from tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestFail1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestFail2.qml (renamed from tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestFail2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestPass.qml (renamed from tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestPass.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/http/qmldir (renamed from tests/auto/declarative/qsgtextedit/data/http/qmldir) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/httpfail/FailItem.qml (renamed from tests/auto/declarative/qsgtextedit/data/httpfail/FailItem.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/httpslow/WaitItem.qml (renamed from tests/auto/declarative/qsgtextedit/data/httpslow/WaitItem.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/inputContext.qml (renamed from tests/auto/declarative/qsgtextedit/data/inputContext.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/inputMethodEvent.qml (renamed from tests/auto/declarative/qsgtextedit/data/inputMethodEvent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/inputmethodhints.qml (renamed from tests/auto/declarative/qsgtextedit/data/inputmethodhints.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/mouseselection_default.qml (renamed from tests/auto/declarative/qsgtextedit/data/mouseselection_default.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/mouseselection_false.qml (renamed from tests/auto/declarative/qsgtextedit/data/mouseselection_false.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/mouseselection_false_words.qml (renamed from tests/auto/declarative/qsgtextedit/data/mouseselection_false_words.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/mouseselection_true.qml (renamed from tests/auto/declarative/qsgtextedit/data/mouseselection_true.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/mouseselection_true_words.qml (renamed from tests/auto/declarative/qsgtextedit/data/mouseselection_true_words.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/mouseselectionmode_characters.qml (renamed from tests/auto/declarative/qsgtextedit/data/mouseselectionmode_characters.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/mouseselectionmode_default.qml (renamed from tests/auto/declarative/qsgtextedit/data/mouseselectionmode_default.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/mouseselectionmode_words.qml (renamed from tests/auto/declarative/qsgtextedit/data/mouseselectionmode_words.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/navigation.qml (renamed from tests/auto/declarative/qsgtextedit/data/navigation.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/openInputPanel.qml (renamed from tests/auto/declarative/qsgtextedit/data/openInputPanel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/positionAt.qml (renamed from tests/auto/declarative/qsgtextedit/data/positionAt.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/qtbug-22058.qml (renamed from tests/auto/declarative/qsgtextedit/data/qtbug-22058.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/data/readOnly.qml (renamed from tests/auto/declarative/qsgtextedit/data/readOnly.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/qquicktextedit.pro (renamed from tests/auto/declarative/qsgtextedit/qsgtextedit.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextedit/tst_qquicktextedit.cpp (renamed from tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp) | 528 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/cursorTest.qml (renamed from tests/auto/declarative/qsgtextinput/data/cursorTest.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/cursorVisible.qml (renamed from tests/auto/declarative/qsgtextinput/data/cursorVisible.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/echoMode.qml (renamed from tests/auto/declarative/qsgtextinput/data/echoMode.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/geometrySignals.qml (renamed from tests/auto/declarative/qsgtextinput/data/geometrySignals.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/halign_center.png (renamed from tests/auto/declarative/qsgtextinput/data/halign_center.png) | bin | 293 -> 293 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/halign_left.png (renamed from tests/auto/declarative/qsgtextinput/data/halign_left.png) | bin | 291 -> 291 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/halign_right.png (renamed from tests/auto/declarative/qsgtextinput/data/halign_right.png) | bin | 292 -> 292 bytes | |||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/horizontalAlignment.qml (renamed from tests/auto/declarative/qsgtextinput/data/horizontalAlignment.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/horizontalAlignment_RightToLeft.qml (renamed from tests/auto/declarative/qsgtextinput/data/horizontalAlignment_RightToLeft.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/inputContext.qml (renamed from tests/auto/declarative/qsgtextinput/data/inputContext.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/inputMethodEvent.qml (renamed from tests/auto/declarative/qsgtextinput/data/inputMethodEvent.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/inputmethods.qml (renamed from tests/auto/declarative/qsgtextinput/data/inputmethods.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/masks.qml (renamed from tests/auto/declarative/qsgtextinput/data/masks.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/maxLength.qml (renamed from tests/auto/declarative/qsgtextinput/data/maxLength.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/mouseselection_true.qml (renamed from tests/auto/declarative/qsgtextinput/data/mouseselection_true.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/mouseselectionmode_characters.qml (renamed from tests/auto/declarative/qsgtextinput/data/mouseselectionmode_characters.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/mouseselectionmode_default.qml (renamed from tests/auto/declarative/qsgtextinput/data/mouseselectionmode_default.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/mouseselectionmode_words.qml (renamed from tests/auto/declarative/qsgtextinput/data/mouseselectionmode_words.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/navigation.qml (renamed from tests/auto/declarative/qsgtextinput/data/navigation.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/openInputPanel.qml (renamed from tests/auto/declarative/qsgtextinput/data/openInputPanel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/positionAt.qml (renamed from tests/auto/declarative/qsgtextinput/data/positionAt.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/preeditAutoScroll.qml (renamed from tests/auto/declarative/qsgtextinput/data/preeditAutoScroll.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/qtbug-19956double.qml (renamed from tests/auto/declarative/qsgtextinput/data/qtbug-19956double.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/qtbug-19956int.qml (renamed from tests/auto/declarative/qsgtextinput/data/qtbug-19956int.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/qtbug-19956regexp.qml (renamed from tests/auto/declarative/qsgtextinput/data/qtbug-19956regexp.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/readOnly.qml (renamed from tests/auto/declarative/qsgtextinput/data/readOnly.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/data/validators.qml (renamed from tests/auto/declarative/qsgtextinput/data/validators.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/qquicktextinput.pro (renamed from tests/auto/declarative/qsgtextinput/qsgtextinput.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp (renamed from tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp) | 530 | ||||
-rw-r--r-- | tests/auto/declarative/qquickview/data/error1.qml (renamed from tests/auto/declarative/qsgview/data/error1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickview/data/resizemodeitem.qml (renamed from tests/auto/declarative/qsgview/data/resizemodeitem.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickview/qquickview.pro (renamed from tests/auto/declarative/qsgview/qsgview.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickview/tst_qquickview.cpp (renamed from tests/auto/declarative/qsgview/tst_qsgview.cpp) | 44 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/create.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/create.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/datalist.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/datalist.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/groups.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/groups.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/modelproperties.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/modelproperties.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/modelproperties2.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/modelproperties2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/objectlist.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/objectlist.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/singlerole1.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/singlerole1.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/singlerole2.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/singlerole2.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/data/visualdatamodel.qml (renamed from tests/auto/declarative/qsgvisualdatamodel/data/visualdatamodel.qml) | 0 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/qquickvisualdatamodel.pro (renamed from tests/auto/declarative/qsgvisualdatamodel/qsgvisualdatamodel.pro) | 4 | ||||
-rw-r--r-- | tests/auto/declarative/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp (renamed from tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp) | 284 | ||||
-rw-r--r-- | tests/auto/particles/qsgage/tst_qsgage.cpp | 8 | ||||
-rw-r--r-- | tests/auto/particles/qsgangleddirection/tst_qsgangleddirection.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgcumulativedirection/tst_qsgcumulativedirection.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgcustomparticle/tst_qsgcustomparticle.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgellipseextruder/tst_qsgellipseextruder.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgfriction/tst_qsgfriction.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsggravity/tst_qsggravity.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgimageparticle/tst_qsgimageparticle.cpp | 10 | ||||
-rw-r--r-- | tests/auto/particles/qsgitemparticle/tst_qsgitemparticle.cpp | 6 | ||||
-rw-r--r-- | tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgmaskextruder/tst_qsgmaskextruder.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgparticlegroup/tst_qsgparticlegroup.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgparticlesystem/tst_qsgparticlesystem.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgpointattractor/tst_qsgpointattractor.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgpointdirection/tst_qsgpointdirection.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgrectangleextruder/tst_qsgrectangleextruder.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgtargetdirection/tst_qsgtargetdirection.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgtrailemitter/tst_qsgtrailemitter.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/qsgwander/tst_qsgwander.cpp | 2 | ||||
-rw-r--r-- | tests/auto/particles/shared/particlestestsshared.h | 8 | ||||
-rw-r--r-- | tests/auto/qmltest/borderimage/tst_borderimage.qml | 4 | ||||
-rw-r--r-- | tests/benchmarks/particles/affectors/tst_affectors.cpp | 4 | ||||
-rw-r--r-- | tests/benchmarks/particles/emission/tst_emission.cpp | 2 |
481 files changed, 3709 insertions, 3703 deletions
diff --git a/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp b/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp index 8e31303aa4..65333cca2b 100644 --- a/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp +++ b/tests/auto/declarative/debugger/qdeclarativeenginedebug/tst_qdeclarativeenginedebug.cpp @@ -50,7 +50,7 @@ #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativeexpression.h> #include <QtDeclarative/qdeclarativeproperty.h> -#include <QtDeclarative/qsgitem.h> +#include <QtDeclarative/qquickitem.h> #include <private/qdeclarativebinding_p.h> #include <private/qdeclarativeenginedebug_p.h> @@ -80,7 +80,7 @@ private: QDeclarativeDebugConnection *m_conn; QDeclarativeEngineDebug *m_dbg; QDeclarativeEngine *m_engine; - QSGItem *m_rootItem; + QQuickItem *m_rootItem; QObjectList m_components; @@ -224,7 +224,7 @@ void tst_QDeclarativeEngineDebug::recursiveObjectTest(QObject *o, const QDeclara QCOMPARE(p.value(), pmeta.read(o)); if (p.name() == "parent") - QVERIFY(p.valueTypeName() == "QGraphicsObject*" || p.valueTypeName() == "QSGItem*"); + QVERIFY(p.valueTypeName() == "QGraphicsObject*" || p.valueTypeName() == "QQuickItem*"); else QCOMPARE(p.valueTypeName(), QString::fromUtf8(pmeta.typeName())); @@ -362,9 +362,9 @@ void tst_QDeclarativeEngineDebug::initTestCase() QDeclarativeComponent component(m_engine); component.setData(qml[i], QUrl::fromLocalFile("")); QVERIFY(component.isReady()); // fails if bad syntax - m_components << qobject_cast<QSGItem*>(component.create()); + m_components << qobject_cast<QQuickItem*>(component.create()); } - m_rootItem = qobject_cast<QSGItem*>(m_components.first()); + m_rootItem = qobject_cast<QQuickItem*>(m_components.first()); // add an extra context to test for multiple contexts QDeclarativeContext *context = new QDeclarativeContext(m_engine->rootContext(), this); diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 0d9459f81b..cd4309486f 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -61,32 +61,32 @@ PRIVATETESTS += \ # This test requires the xmlpatterns module !contains(QT_CONFIG,xmlpatterns):PRIVATETESTS -= qdeclarativexmllistmodel -SGTESTS = \ - qsganimatedimage \ - qsgborderimage \ - qsgcanvas \ - qsgdrag \ - qsgdroparea \ - qsgflickable \ - qsgflipable \ - qsgfocusscope \ - qsggridview \ - qsgimage \ - qsgitem \ - qsgitem2 \ - qsglistview \ - qsgloader \ - qsgmousearea \ - qsgpathview \ - qsgpincharea \ - qsgpositioners \ - qsgrepeater \ - qsgtext \ - qsgtextedit \ - qsgtextinput \ - qsgvisualdatamodel \ - qsgview \ - qsgcanvasitem \ +QUICKTESTS = \ + qquickanimatedimage \ + qquickborderimage \ + qquickcanvas \ + qquickdrag \ + qquickdroparea \ + qquickflickable \ + qquickflipable \ + qquickfocusscope \ + qquickgridview \ + qquickimage \ + qquickitem \ + qquickitem2 \ + qquicklistview \ + qquickloader \ + qquickmousearea \ + qquickpathview \ + qquickpincharea \ + qquickpositioners \ + qquickrepeater \ + qquicktext \ + qquicktextedit \ + qquicktextinput \ + qquickvisualdatamodel \ + qquickview \ + qquickcanvasitem \ SUBDIRS += $$PUBLICTESTS @@ -95,5 +95,5 @@ SUBDIRS += debugger contains(QT_CONFIG, private_tests) { SUBDIRS += $$PRIVATETESTS - SUBDIRS += $$SGTESTS + SUBDIRS += $$QUICKTESTS } diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp index 58f16a49d6..c14d41ac48 100644 --- a/tests/auto/declarative/examples/tst_examples.cpp +++ b/tests/auto/declarative/examples/tst_examples.cpp @@ -44,7 +44,7 @@ #include <QDir> #include <QProcess> #include <QDebug> -#include <QSGView> +#include <QQuickView> #include <QDeclarativeError> class tst_examples : public QObject @@ -72,7 +72,7 @@ tst_examples::tst_examples() excludedDirs << "examples/declarative/text/fonts"; // QTBUG-21415 #endif - // Not run in QSGView + // Not run in QQuickView excludedDirs << "examples/declarative/qtquick1"; // These snippets are not expected to run on their own. @@ -207,16 +207,16 @@ void tst_examples::sgexamples() { QFETCH(QString, file); - QSGView view; + QQuickView view; QtMsgHandler old = qInstallMsgHandler(silentErrorsMsgHandler); view.setSource(file); qInstallMsgHandler(old); - if (view.status() == QSGView::Error) + if (view.status() == QQuickView::Error) qWarning() << view.errors(); - QCOMPARE(view.status(), QSGView::Ready); + QCOMPARE(view.status(), QQuickView::Ready); view.show(); QTest::qWait(100); diff --git a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp index 9d3f41563d..515c8fa918 100644 --- a/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp +++ b/tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp @@ -41,13 +41,13 @@ #include <QtTest/QtTest> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgview.h> -#include <QtDeclarative/private/qsgrectangle_p.h> +#include <QtDeclarative/qquickview.h> +#include <QtDeclarative/private/qquickrectangle_p.h> #include <QtDeclarative/private/qdeclarativeanimation_p.h> #include <QtDeclarative/private/qdeclarativetransition_p.h> -#include <QtDeclarative/private/qsganimation_p.h> +#include <QtDeclarative/private/qquickanimation_p.h> #include <QtDeclarative/private/qdeclarativepathinterpolator_p.h> -#include <QtDeclarative/private/qsgitem_p.h> +#include <QtDeclarative/private/qquickitem_p.h> #include <QVariantAnimation> #include <QEasingCurve> @@ -111,7 +111,7 @@ private slots: void tst_qdeclarativeanimations::simpleProperty() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -136,7 +136,7 @@ void tst_qdeclarativeanimations::simpleProperty() void tst_qdeclarativeanimations::simpleNumber() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativeNumberAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -161,7 +161,7 @@ void tst_qdeclarativeanimations::simpleNumber() void tst_qdeclarativeanimations::simpleColor() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativeColorAnimation animation; animation.setTarget(&rect); animation.setProperty("color"); @@ -195,7 +195,7 @@ void tst_qdeclarativeanimations::simpleColor() void tst_qdeclarativeanimations::simpleRotation() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativeRotationAnimation animation; animation.setTarget(&rect); animation.setProperty("rotation"); @@ -224,12 +224,12 @@ void tst_qdeclarativeanimations::simplePath() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pathAnimation.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *redRect = rect->findChild<QSGRectangle*>(); + QQuickRectangle *redRect = rect->findChild<QQuickRectangle*>(); QVERIFY(redRect); - QSGPathAnimation *pathAnim = rect->findChild<QSGPathAnimation*>(); + QQuickPathAnimation *pathAnim = rect->findChild<QQuickPathAnimation*>(); QVERIFY(pathAnim); pathAnim->start(); @@ -250,8 +250,8 @@ void tst_qdeclarativeanimations::simplePath() QTRY_COMPARE(redRect->x(), qreal(300)); QCOMPARE(redRect->y(), qreal(300)); - pathAnim->setOrientation(QSGPathAnimation::RightFirst); - QCOMPARE(pathAnim->orientation(), QSGPathAnimation::RightFirst); + pathAnim->setOrientation(QQuickPathAnimation::RightFirst); + QCOMPARE(pathAnim->orientation(), QQuickPathAnimation::RightFirst); pathAnim->start(); QTRY_VERIFY(redRect->rotation() != 0); pathAnim->stop(); @@ -260,15 +260,15 @@ void tst_qdeclarativeanimations::simplePath() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pathAnimation2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *redRect = rect->findChild<QSGRectangle*>(); + QQuickRectangle *redRect = rect->findChild<QQuickRectangle*>(); QVERIFY(redRect); - QSGPathAnimation *pathAnim = rect->findChild<QSGPathAnimation*>(); + QQuickPathAnimation *pathAnim = rect->findChild<QQuickPathAnimation*>(); QVERIFY(pathAnim); - QCOMPARE(pathAnim->orientation(), QSGPathAnimation::RightFirst); + QCOMPARE(pathAnim->orientation(), QQuickPathAnimation::RightFirst); pathAnim->start(); pathAnim->pause(); @@ -349,12 +349,12 @@ void tst_qdeclarativeanimations::pathWithNoStart() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pathAnimationNoStart.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *redRect = rect->findChild<QSGRectangle*>(); + QQuickRectangle *redRect = rect->findChild<QQuickRectangle*>(); QVERIFY(redRect); - QSGPathAnimation *pathAnim = rect->findChild<QSGPathAnimation*>(); + QQuickPathAnimation *pathAnim = rect->findChild<QQuickPathAnimation*>(); QVERIFY(pathAnim); pathAnim->start(); @@ -381,7 +381,7 @@ void tst_qdeclarativeanimations::pathWithNoStart() void tst_qdeclarativeanimations::alwaysRunToEnd() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -401,7 +401,7 @@ void tst_qdeclarativeanimations::alwaysRunToEnd() void tst_qdeclarativeanimations::complete() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -422,7 +422,7 @@ void tst_qdeclarativeanimations::complete() void tst_qdeclarativeanimations::resume() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -449,7 +449,7 @@ void tst_qdeclarativeanimations::resume() void tst_qdeclarativeanimations::dotProperty() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativeNumberAnimation animation; animation.setTarget(&rect); animation.setProperty("border.width"); @@ -470,7 +470,7 @@ void tst_qdeclarativeanimations::badTypes() { //don't crash { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("badtype1.qml"))); qApp->processEvents(); @@ -504,12 +504,12 @@ void tst_qdeclarativeanimations::badTypes() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("badtype4.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGItemPrivate::get(rect)->setState("state1"); + QQuickItemPrivate::get(rect)->setState("state1"); QTest::qWait(1000 + 50); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("MyRect"); QVERIFY(myRect); QCOMPARE(myRect->x(),qreal(200)); } @@ -524,13 +524,13 @@ void tst_qdeclarativeanimations::badProperties() QDeclarativeComponent c1(&engine, QUrl::fromLocalFile(TESTDATA("badproperty1.qml"))); QByteArray message = QUrl::fromLocalFile(TESTDATA("badproperty1.qml")).toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate non-existent property \"border.colr\""; QTest::ignoreMessage(QtWarningMsg, message); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c1.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c1.create()); QVERIFY(rect); QDeclarativeComponent c2(&engine, QUrl::fromLocalFile(TESTDATA("badproperty2.qml"))); message = QUrl::fromLocalFile(TESTDATA("badproperty2.qml")).toString().toUtf8() + ":18:9: QML ColorAnimation: Cannot animate read-only property \"border\""; QTest::ignoreMessage(QtWarningMsg, message); - rect = qobject_cast<QSGRectangle*>(c2.create()); + rect = qobject_cast<QQuickRectangle*>(c2.create()); QVERIFY(rect); //### should we warn here are well? @@ -546,12 +546,12 @@ void tst_qdeclarativeanimations::mixedTypes() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("mixedtype1.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGItemPrivate::get(rect)->setState("state1"); + QQuickItemPrivate::get(rect)->setState("state1"); QTest::qWait(500); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("MyRect"); QVERIFY(myRect); //rather inexact -- is there a better way? @@ -562,12 +562,12 @@ void tst_qdeclarativeanimations::mixedTypes() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("mixedtype2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGItemPrivate::get(rect)->setState("state1"); + QQuickItemPrivate::get(rect)->setState("state1"); QTest::qWait(500); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("MyRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("MyRect"); QVERIFY(myRect); //rather inexact -- is there a better way? @@ -582,10 +582,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("properties.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -594,10 +594,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("properties2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -606,10 +606,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("properties3.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(300)); @@ -618,10 +618,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("properties4.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->y(),qreal(200)); @@ -631,10 +631,10 @@ void tst_qdeclarativeanimations::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("properties5.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(100)); @@ -648,11 +648,11 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("propertiesTransition.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGItemPrivate::get(rect)->setState("moved"); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickItemPrivate::get(rect)->setState("moved"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -661,12 +661,12 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("propertiesTransition2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(200)); QCOMPARE(myRect->y(),qreal(100)); QTest::qWait(waitDuration); @@ -676,12 +676,12 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("propertiesTransition3.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(200)); QCOMPARE(myRect->y(),qreal(100)); } @@ -689,12 +689,12 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("propertiesTransition4.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(100)); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -703,12 +703,12 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("propertiesTransition5.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(100)); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -717,12 +717,12 @@ void tst_qdeclarativeanimations::propertiesTransition() /*{ QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("propertiesTransition6.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(100)); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(100)); @@ -731,11 +731,11 @@ void tst_qdeclarativeanimations::propertiesTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("propertiesTransition7.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGItemPrivate::get(rect)->setState("moved"); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickItemPrivate::get(rect)->setState("moved"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); QTest::qWait(waitDuration); QTIMED_COMPARE(myRect->x(),qreal(200)); @@ -747,18 +747,18 @@ void tst_qdeclarativeanimations::pathTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pathTransition.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("redRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("redRect"); QVERIFY(myRect); - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); QTRY_VERIFY(myRect->x() < 500 && myRect->x() > 100 && myRect->y() > 50 && myRect->y() < 700 ); //animation started QTRY_VERIFY(qFuzzyCompare(myRect->x(), qreal(100)) && qFuzzyCompare(myRect->y(), qreal(700))); QTest::qWait(100); - QSGItemPrivate::get(rect)->setState(""); + QQuickItemPrivate::get(rect)->setState(""); QTRY_VERIFY(myRect->x() < 500 && myRect->x() > 100 && myRect->y() > 50 && myRect->y() < 700 ); //animation started QTRY_VERIFY(qFuzzyCompare(myRect->x(), qreal(500)) && qFuzzyCompare(myRect->y(), qreal(50))); } @@ -767,10 +767,10 @@ void tst_qdeclarativeanimations::disabledTransition() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("disabledTransition.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *myRect = rect->findChild<QSGRectangle*>("TheRect"); + QQuickRectangle *myRect = rect->findChild<QQuickRectangle*>("TheRect"); QVERIFY(myRect); QDeclarativeTransition *trans = rect->findChild<QDeclarativeTransition*>(); @@ -778,12 +778,12 @@ void tst_qdeclarativeanimations::disabledTransition() QCOMPARE(trans->enabled(), false); - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); QCOMPARE(myRect->x(),qreal(200)); trans->setEnabled(true); - QSGItemPrivate::get(rect)->setState(""); + QQuickItemPrivate::get(rect)->setState(""); QCOMPARE(myRect->x(),qreal(200)); QTest::qWait(300); QTIMED_COMPARE(myRect->x(),qreal(100)); @@ -809,7 +809,7 @@ void tst_qdeclarativeanimations::attached() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("attached.qml"))); QTest::ignoreMessage(QtDebugMsg, "off"); QTest::ignoreMessage(QtDebugMsg, "on"); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); } @@ -820,7 +820,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("valuesource.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -833,7 +833,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("valuesource2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -846,7 +846,7 @@ void tst_qdeclarativeanimations::propertyValueSourceDefaultStart() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("dontAutoStart.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -865,7 +865,7 @@ void tst_qdeclarativeanimations::dontStart() QString warning = c.url().toString() + ":14:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes."; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -880,7 +880,7 @@ void tst_qdeclarativeanimations::dontStart() QString warning = c.url().toString() + ":15:17: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes."; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -944,15 +944,15 @@ void tst_qdeclarativeanimations::rotation() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("rotation.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *rr = rect->findChild<QSGRectangle*>("rr"); - QSGRectangle *rr2 = rect->findChild<QSGRectangle*>("rr2"); - QSGRectangle *rr3 = rect->findChild<QSGRectangle*>("rr3"); - QSGRectangle *rr4 = rect->findChild<QSGRectangle*>("rr4"); + QQuickRectangle *rr = rect->findChild<QQuickRectangle*>("rr"); + QQuickRectangle *rr2 = rect->findChild<QQuickRectangle*>("rr2"); + QQuickRectangle *rr3 = rect->findChild<QQuickRectangle*>("rr3"); + QQuickRectangle *rr4 = rect->findChild<QQuickRectangle*>("rr4"); - QSGItemPrivate::get(rect)->setState("state1"); + QQuickItemPrivate::get(rect)->setState("state1"); QTest::qWait(800); qreal r1 = rr->rotation(); qreal r2 = rr2->rotation(); @@ -975,10 +975,10 @@ void tst_qdeclarativeanimations::runningTrueBug() //ensure we start correctly when "running: true" is explicitly set QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("runningTrueBug.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *cloud = rect->findChild<QSGRectangle*>("cloud"); + QQuickRectangle *cloud = rect->findChild<QQuickRectangle*>("cloud"); QVERIFY(cloud); QTest::qWait(1000); QVERIFY(cloud->x() > qreal(0)); @@ -992,10 +992,10 @@ void tst_qdeclarativeanimations::nonTransitionBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("nonTransitionBug.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); - QSGRectangle *mover = rect->findChild<QSGRectangle*>("mover"); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); + QQuickRectangle *mover = rect->findChild<QQuickRectangle*>("mover"); mover->setX(100); QCOMPARE(mover->x(), qreal(100)); @@ -1018,7 +1018,7 @@ void tst_qdeclarativeanimations::registrationBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("registrationBug.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); QTRY_COMPARE(rect->property("value"), QVariant(int(100))); } @@ -1028,7 +1028,7 @@ void tst_qdeclarativeanimations::doubleRegistrationBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("doubleRegistrationBug.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); QDeclarativeAbstractAnimation *anim = rect->findChild<QDeclarativeAbstractAnimation*>("animation"); @@ -1039,7 +1039,7 @@ void tst_qdeclarativeanimations::doubleRegistrationBug() //QTBUG-16736 void tst_qdeclarativeanimations::alwaysRunToEndRestartBug() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativePropertyAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -1066,7 +1066,7 @@ void tst_qdeclarativeanimations::transitionAssignmentBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("transitionAssignmentBug.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); QCOMPARE(rect->property("nullObject").toBool(), false); @@ -1078,7 +1078,7 @@ void tst_qdeclarativeanimations::pauseBindingBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pauseBindingBug.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); QDeclarativeAbstractAnimation *anim = rect->findChild<QDeclarativeAbstractAnimation*>("animation"); QVERIFY(anim->qtAnimation()->state() == QAbstractAnimation::Paused); diff --git a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp index b3fa38de38..db345e38fd 100644 --- a/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp +++ b/tests/auto/declarative/qdeclarativeapplication/tst_qdeclarativeapplication.cpp @@ -42,8 +42,8 @@ #include <qtest.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qsgitem.h> -#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/qquickitem.h> +#include <QtDeclarative/qquickview.h> #include <QtGui/qinputpanel.h> class tst_qdeclarativeapplication : public QObject @@ -71,9 +71,9 @@ void tst_qdeclarativeapplication::active() QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Item { property bool active: Qt.application.active }", QUrl::fromLocalFile("")); - QSGItem *item = qobject_cast<QSGItem *>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem *>(component.create()); QVERIFY(item); - QSGView view; + QQuickView view; item->setParentItem(view.rootObject()); // not active @@ -84,7 +84,7 @@ void tst_qdeclarativeapplication::active() view.show(); view.requestActivateWindow(); QTest::qWait(50); - QTRY_COMPARE(view.status(), QSGView::Ready); + QTRY_COMPARE(view.status(), QQuickView::Ready); QCOMPARE(item->property("active").toBool(), QGuiApplication::activeWindow() != 0); // not active again @@ -104,9 +104,9 @@ void tst_qdeclarativeapplication::layoutDirection() QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Item { property bool layoutDirection: Qt.application.layoutDirection }", QUrl::fromLocalFile("")); - QSGItem *item = qobject_cast<QSGItem *>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem *>(component.create()); QVERIFY(item); - QSGView view; + QQuickView view; item->setParentItem(view.rootObject()); // not mirrored @@ -125,9 +125,9 @@ void tst_qdeclarativeapplication::inputPanel() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Item { property variant inputPanel: Qt.application.inputPanel }", QUrl::fromLocalFile("")); - QSGItem *item = qobject_cast<QSGItem *>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem *>(component.create()); QVERIFY(item); - QSGView view; + QQuickView view; item->setParentItem(view.rootObject()); // check that the inputPanel property maches with application's input panel diff --git a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp index b2aa311434..b6e68d6677 100644 --- a/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp +++ b/tests/auto/declarative/qdeclarativebehaviors/tst_qdeclarativebehaviors.cpp @@ -42,12 +42,12 @@ #include <qsignalspy.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsgrectangle_p.h> -#include <private/qsgtext_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquickrectangle_p.h> +#include <private/qquicktext_p.h> #include <private/qdeclarativebehavior_p.h> #include <private/qdeclarativeanimation_p.h> -#include <private/qsgitem_p.h> +#include <private/qquickitem_p.h> #include "../shared/util.h" class tst_qdeclarativebehaviors : public QObject @@ -83,13 +83,13 @@ void tst_qdeclarativebehaviors::simpleBehavior() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("simple.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QTRY_VERIFY(rect); QTRY_VERIFY(qobject_cast<QDeclarativeBehavior*>(rect->findChild<QDeclarativeBehavior*>("MyBehavior"))->animation()); - QSGItemPrivate::get(rect)->setState("moved"); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() > 0); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() < 200); + QQuickItemPrivate::get(rect)->setState("moved"); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x() > 0); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x() < 200); //i.e. the behavior has been triggered delete rect; @@ -99,12 +99,12 @@ void tst_qdeclarativebehaviors::scriptTriggered() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("scripttrigger.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QTRY_VERIFY(rect); rect->setColor(QColor("red")); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() > 0); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() < 200); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x() > 0); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x() < 200); //i.e. the behavior has been triggered delete rect; @@ -114,10 +114,10 @@ void tst_qdeclarativebehaviors::cppTriggered() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("cpptrigger.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QTRY_VERIFY(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QTRY_VERIFY(innerRect); innerRect->setProperty("x", 200); @@ -132,11 +132,11 @@ void tst_qdeclarativebehaviors::loop() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("loop.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QTRY_VERIFY(rect); //don't crash - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); delete rect; } @@ -145,12 +145,12 @@ void tst_qdeclarativebehaviors::colorBehavior() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("color.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QTRY_VERIFY(rect); - QSGItemPrivate::get(rect)->setState("red"); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->color() != QColor("red")); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->color() != QColor("green")); + QQuickItemPrivate::get(rect)->setState("red"); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->color() != QColor("red")); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->color() != QColor("green")); //i.e. the behavior has been triggered delete rect; @@ -160,12 +160,12 @@ void tst_qdeclarativebehaviors::parentBehavior() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("parent.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QTRY_VERIFY(rect); - QSGItemPrivate::get(rect)->setState("reparented"); - QTRY_VERIFY(rect->findChild<QSGRectangle*>("MyRect")->parentItem() != rect->findChild<QSGItem*>("NewParent")); - QTRY_VERIFY(rect->findChild<QSGRectangle*>("MyRect")->parentItem() == rect->findChild<QSGItem*>("NewParent")); + QQuickItemPrivate::get(rect)->setState("reparented"); + QTRY_VERIFY(rect->findChild<QQuickRectangle*>("MyRect")->parentItem() != rect->findChild<QQuickItem*>("NewParent")); + QTRY_VERIFY(rect->findChild<QQuickRectangle*>("MyRect")->parentItem() == rect->findChild<QQuickItem*>("NewParent")); delete rect; } @@ -174,11 +174,11 @@ void tst_qdeclarativebehaviors::replaceBinding() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("binding.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QTRY_VERIFY(rect); - QSGItemPrivate::get(rect)->setState("moved"); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickItemPrivate::get(rect)->setState("moved"); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QTRY_VERIFY(innerRect); QTRY_VERIFY(innerRect->x() > 0); QTRY_VERIFY(innerRect->x() < 200); @@ -189,7 +189,7 @@ void tst_qdeclarativebehaviors::replaceBinding() rect->setProperty("movedx", 210); QTRY_COMPARE(innerRect->x(), (qreal)210); - QSGItemPrivate::get(rect)->setState(""); + QQuickItemPrivate::get(rect)->setState(""); QTRY_VERIFY(innerRect->x() > 10); QTRY_VERIFY(innerRect->x() < 210); //i.e. the behavior has been triggered QTRY_COMPARE(innerRect->x(), (qreal)10); @@ -207,14 +207,14 @@ void tst_qdeclarativebehaviors::group() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("groupProperty.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); qDebug() << c.errorString(); QTRY_VERIFY(rect); - QSGItemPrivate::get(rect)->setState("moved"); + QQuickItemPrivate::get(rect)->setState("moved"); //QTest::qWait(200); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() > 0); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() < 200); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x() > 0); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x() < 200); //i.e. the behavior has been triggered delete rect; @@ -224,12 +224,12 @@ void tst_qdeclarativebehaviors::group() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("groupProperty2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QTRY_VERIFY(rect); - QSGItemPrivate::get(rect)->setState("moved"); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->border()->width() > 0); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->border()->width() < 4); + QQuickItemPrivate::get(rect)->setState("moved"); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->border()->width() > 0); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->border()->width() < 4); //i.e. the behavior has been triggered delete rect; @@ -240,11 +240,11 @@ void tst_qdeclarativebehaviors::emptyBehavior() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("empty.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGItemPrivate::get(rect)->setState("moved"); - qreal x = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x(); + QQuickItemPrivate::get(rect)->setState("moved"); + qreal x = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x(); QCOMPARE(x, qreal(200)); //should change immediately delete rect; @@ -254,12 +254,12 @@ void tst_qdeclarativebehaviors::explicitSelection() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("explicit.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGItemPrivate::get(rect)->setState("moved"); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() > 0); - QTRY_VERIFY(qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x() < 200); + QQuickItemPrivate::get(rect)->setState("moved"); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x() > 0); + QTRY_VERIFY(qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x() < 200); //i.e. the behavior has been triggered delete rect; @@ -269,11 +269,11 @@ void tst_qdeclarativebehaviors::nonSelectingBehavior() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("nonSelecting2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGItemPrivate::get(rect)->setState("moved"); - qreal x = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x(); + QQuickItemPrivate::get(rect)->setState("moved"); + qreal x = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x(); QCOMPARE(x, qreal(200)); //should change immediately delete rect; @@ -285,7 +285,7 @@ void tst_qdeclarativebehaviors::reassignedAnimation() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("reassignedAnimation.qml"))); QString warning = QUrl::fromLocalFile(TESTDATA("reassignedAnimation.qml")).toString() + ":9:9: QML Behavior: Cannot change the animation assigned to a Behavior."; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QCOMPARE(qobject_cast<QDeclarativeNumberAnimation*>( rect->findChild<QDeclarativeBehavior*>("MyBehavior")->animation())->duration(), 200); @@ -297,12 +297,12 @@ void tst_qdeclarativebehaviors::disabled() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("disabled.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QCOMPARE(rect->findChild<QDeclarativeBehavior*>("MyBehavior")->enabled(), false); - QSGItemPrivate::get(rect)->setState("moved"); - qreal x = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect"))->x(); + QQuickItemPrivate::get(rect)->setState("moved"); + qreal x = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect"))->x(); QCOMPARE(x, qreal(200)); //should change immediately delete rect; @@ -316,7 +316,7 @@ void tst_qdeclarativebehaviors::dontStart() QString warning = c.url().toString() + ":13:13: QML NumberAnimation: setRunning() cannot be used on non-root animation nodes."; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning)); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *myAnim = rect->findChild<QDeclarativeAbstractAnimation*>("MyAnim"); @@ -331,10 +331,10 @@ void tst_qdeclarativebehaviors::startup() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("startup.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *innerRect = rect->findChild<QSGRectangle*>("innerRect"); + QQuickRectangle *innerRect = rect->findChild<QQuickRectangle*>("innerRect"); QVERIFY(innerRect); QCOMPARE(innerRect->x(), qreal(100)); //should be set immediately @@ -345,13 +345,13 @@ void tst_qdeclarativebehaviors::startup() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("startup2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *innerRect = rect->findChild<QSGRectangle*>("innerRect"); + QQuickRectangle *innerRect = rect->findChild<QQuickRectangle*>("innerRect"); QVERIFY(innerRect); - QSGText *text = rect->findChild<QSGText*>(); + QQuickText *text = rect->findChild<QQuickText*>(); QVERIFY(text); QCOMPARE(innerRect->x(), text->width()); //should be set immediately @@ -365,7 +365,7 @@ void tst_qdeclarativebehaviors::groupedPropertyCrash() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("groupedPropertyCrash.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); //don't crash } @@ -374,7 +374,7 @@ void tst_qdeclarativebehaviors::runningTrue() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("runningTrue.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); QDeclarativeAbstractAnimation *animation = rect->findChild<QDeclarativeAbstractAnimation*>("rotAnim"); @@ -390,10 +390,10 @@ void tst_qdeclarativebehaviors::sameValue() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("qtbug12295.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *target = rect->findChild<QSGRectangle*>("myRect"); + QQuickRectangle *target = rect->findChild<QQuickRectangle*>("myRect"); QVERIFY(target); target->setX(100); @@ -421,10 +421,10 @@ void tst_qdeclarativebehaviors::delayedRegistration() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("delayedRegistration.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItem *innerRect = rect->property("myItem").value<QSGItem*>(); + QQuickItem *innerRect = rect->property("myItem").value<QQuickItem*>(); QVERIFY(innerRect != 0); QCOMPARE(innerRect->property("x").toInt(), int(0)); diff --git a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp index de34d9e009..ea05963827 100644 --- a/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp +++ b/tests/auto/declarative/qdeclarativebinding/tst_qdeclarativebinding.cpp @@ -42,7 +42,7 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <private/qdeclarativebind_p.h> -#include <private/qsgrectangle_p.h> +#include <private/qquickrectangle_p.h> #include "../shared/util.h" class tst_qdeclarativebinding : public QObject @@ -70,7 +70,7 @@ void tst_qdeclarativebinding::binding() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("test-binding.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); QDeclarativeBind *binding3 = qobject_cast<QDeclarativeBind*>(rect->findChild<QDeclarativeBind*>("binding3")); @@ -98,7 +98,7 @@ void tst_qdeclarativebinding::whenAfterValue() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("test-binding2.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(), QColor("yellow")); @@ -114,10 +114,10 @@ void tst_qdeclarativebinding::restoreBinding() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("restoreBinding.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGRectangle *myItem = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("myItem")); + QQuickRectangle *myItem = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("myItem")); QVERIFY(myItem != 0); myItem->setY(25); @@ -144,10 +144,10 @@ void tst_qdeclarativebinding::restoreBindingWithLoop() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("restoreBindingWithLoop.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGRectangle *myItem = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("myItem")); + QQuickRectangle *myItem = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("myItem")); QVERIFY(myItem != 0); myItem->setY(25); @@ -179,7 +179,7 @@ void tst_qdeclarativebinding::deletedObject() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("deletedObject.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); QGuiApplication::sendPostedEvents(0, QEvent::DeferredDelete); diff --git a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp index f3354ac5db..1dcaaa1b06 100644 --- a/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp +++ b/tests/auto/declarative/qdeclarativecomponent/tst_qdeclarativecomponent.cpp @@ -43,7 +43,7 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgitem.h> +#include <QtDeclarative/qquickitem.h> #include <QtDeclarative/qdeclarativeproperty.h> #include <QtDeclarative/qdeclarativeincubator.h> #include <qcolor.h> @@ -133,7 +133,7 @@ void tst_qdeclarativecomponent::qmlCreateObject() QObject *testObject2 = object->property("declarativeitem").value<QObject*>(); QVERIFY(testObject2); QVERIFY(testObject2->parent() == object); - QCOMPARE(testObject2->metaObject()->className(), "QSGItem"); + QCOMPARE(testObject2->metaObject()->className(), "QQuickItem"); } void tst_qdeclarativecomponent::qmlCreateObjectWithProperties() diff --git a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp index ec04833548..450f16c036 100644 --- a/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp +++ b/tests/auto/declarative/qdeclarativeconnection/tst_qdeclarativeconnection.cpp @@ -42,7 +42,7 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <private/qdeclarativeconnections_p.h> -#include <private/qsgitem_p.h> +#include <private/qquickitem_p.h> #include "../shared/util.h" #include <QtDeclarative/qdeclarativescriptstring.h> @@ -102,7 +102,7 @@ void tst_qdeclarativeconnection::connection() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("test-connection.qml"))); - QSGItem *item = qobject_cast<QSGItem*>(c.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(c.create()); QVERIFY(item != 0); @@ -119,7 +119,7 @@ void tst_qdeclarativeconnection::trimming() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("trimming.qml"))); - QSGItem *item = qobject_cast<QSGItem*>(c.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(c.create()); QVERIFY(item != 0); @@ -140,18 +140,18 @@ void tst_qdeclarativeconnection::targetChanged() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("connection-targetchange.qml"))); - QSGItem *item = qobject_cast<QSGItem*>(c.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(c.create()); QVERIFY(item != 0); QDeclarativeConnections *connections = item->findChild<QDeclarativeConnections*>("connections"); QVERIFY(connections); - QSGItem *item1 = item->findChild<QSGItem*>("item1"); + QQuickItem *item1 = item->findChild<QQuickItem*>("item1"); QVERIFY(item1); item1->setWidth(200); - QSGItem *item2 = item->findChild<QSGItem*>("item2"); + QQuickItem *item2 = item->findChild<QQuickItem*>("item2"); QVERIFY(item2); QVERIFY(connections->target() == item2); @@ -185,7 +185,7 @@ void tst_qdeclarativeconnection::unknownSignals() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, url); - QSGItem *item = qobject_cast<QSGItem*>(c.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(c.create()); QVERIFY(item != 0); // check that connection is created (they are all runtime errors) diff --git a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp index 9f4e131cbd..e438885dbf 100644 --- a/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp +++ b/tests/auto/declarative/qdeclarativeimageprovider/tst_qdeclarativeimageprovider.cpp @@ -42,7 +42,7 @@ #include <QtTest/QtTest> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativeimageprovider.h> -#include <private/qsgimage_p.h> +#include <private/qquickimage_p.h> #include <QImageReader> #include <QWaitCondition> @@ -228,19 +228,19 @@ void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvide + properties + " }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); if (async) - QTRY_VERIFY(obj->status() == QSGImage::Loading); + QTRY_VERIFY(obj->status() == QQuickImage::Loading); QCOMPARE(obj->source(), QUrl(source)); if (error.isEmpty()) { if (async) - QTRY_VERIFY(obj->status() == QSGImage::Ready); + QTRY_VERIFY(obj->status() == QQuickImage::Ready); else - QVERIFY(obj->status() == QSGImage::Ready); + QVERIFY(obj->status() == QQuickImage::Ready); if (QByteArray(QTest::currentDataTag()).startsWith("qimage")) QCOMPARE(static_cast<TestQImageProvider*>(provider)->lastImageId, imageId); else @@ -248,13 +248,13 @@ void tst_qdeclarativeimageprovider::runTest(bool async, QDeclarativeImageProvide QCOMPARE(obj->width(), qreal(size.width())); QCOMPARE(obj->height(), qreal(size.height())); - QCOMPARE(obj->fillMode(), QSGImage::Stretch); + QCOMPARE(obj->fillMode(), QQuickImage::Stretch); QCOMPARE(obj->progress(), 1.0); } else { if (async) - QTRY_VERIFY(obj->status() == QSGImage::Error); + QTRY_VERIFY(obj->status() == QQuickImage::Error); else - QVERIFY(obj->status() == QSGImage::Error); + QVERIFY(obj->status() == QQuickImage::Error); } delete obj; @@ -308,7 +308,7 @@ void tst_qdeclarativeimageprovider::requestPixmap_async() QString componentStr = "import QtQuick 2.0\nImage { asynchronous: true; source: \"image://test/pixmap-async-test.png\" }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); delete obj; @@ -335,10 +335,10 @@ void tst_qdeclarativeimageprovider::removeProvider() QString componentStr = "import QtQuick 2.0\nImage { source: \"" + newImageFileName() + "\" }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); - QCOMPARE(obj->status(), QSGImage::Ready); + QCOMPARE(obj->status(), QQuickImage::Ready); // remove the provider and confirm QString fileName = newImageFileName(); @@ -348,7 +348,7 @@ void tst_qdeclarativeimageprovider::removeProvider() engine.removeImageProvider("test"); obj->setSource(QUrl(fileName)); - QCOMPARE(obj->status(), QSGImage::Error); + QCOMPARE(obj->status(), QQuickImage::Error); delete obj; } @@ -404,17 +404,17 @@ void tst_qdeclarativeimageprovider::threadTest() QObject *obj = component.create(); //MUST not deadlock QVERIFY(obj != 0); - QList<QSGImage *> images = obj->findChildren<QSGImage *>(); + QList<QQuickImage *> images = obj->findChildren<QQuickImage *>(); QCOMPARE(images.count(), 4); QTest::qWait(100); - foreach (QSGImage *img, images) { - QCOMPARE(img->status(), QSGImage::Loading); + foreach (QQuickImage *img, images) { + QCOMPARE(img->status(), QQuickImage::Loading); } provider->ok = true; provider->cond.wakeAll(); QTest::qWait(250); - foreach (QSGImage *img, images) { - QTRY_VERIFY(img->status() == QSGImage::Ready); + foreach (QQuickImage *img, images) { + QTRY_VERIFY(img->status() == QQuickImage::Ready); } } diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index bde2c14fd9..538ebbb1a3 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -1644,17 +1644,17 @@ void tst_qdeclarativelanguage::importsLocal_data() QTest::newRow("local import") << "import \"subdir\"\n" // QT-613 "Test {}" - << "QSGRectangle" + << "QQuickRectangle" << ""; QTest::newRow("local import second") << "import QtQuick 2.0\nimport \"subdir\"\n" "Test {}" - << "QSGRectangle" + << "QQuickRectangle" << ""; QTest::newRow("local import subsubdir") << "import QtQuick 2.0\nimport \"subdir/subsubdir\"\n" "SubTest {}" - << "QSGRectangle" + << "QQuickRectangle" << ""; QTest::newRow("local import QTBUG-7721 A") << "subdir.Test {}" // no longer allowed (QTBUG-7721) @@ -1668,7 +1668,7 @@ void tst_qdeclarativelanguage::importsLocal_data() QTest::newRow("local import as") << "import \"subdir\" as T\n" "T.Test {}" - << "QSGRectangle" + << "QQuickRectangle" << ""; QTest::newRow("wrong local import as") << "import \"subdir\" as T\n" @@ -1734,11 +1734,11 @@ void tst_qdeclarativelanguage::importsRemote_data() QString serverdir = "http://127.0.0.1:14447/qtest/declarative/qmllanguage"; - QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QSGRectangle" + QTest::newRow("remote import") << "import \""+serverdir+"\"\nTest {}" << "QQuickRectangle" << ""; - QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QSGText" + QTest::newRow("remote import with subdir") << "import \""+serverdir+"\"\nTestSubDir {}" << "QQuickText" << ""; - QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QSGImage" + QTest::newRow("remote import with local") << "import \""+serverdir+"\"\nTestLocal {}" << "QQuickImage" << ""; QTest::newRow("wrong remote import with undeclared local") << "import \""+serverdir+"\"\nWrongTestLocal {}" << "" << "WrongTestLocal is not a type"; @@ -1772,27 +1772,27 @@ void tst_qdeclarativelanguage::importsInstalled_data() QTest::newRow("installed import 0") << "import com.nokia.installedtest0 0.0\n" "InstalledTestTP {}" - << "QSGRectangle" + << "QQuickRectangle" << ""; QTest::newRow("installed import 0 as TP") << "import com.nokia.installedtest0 0.0 as TP\n" "TP.InstalledTestTP {}" - << "QSGRectangle" + << "QQuickRectangle" << ""; QTest::newRow("installed import 1") << "import com.nokia.installedtest 1.0\n" "InstalledTest {}" - << "QSGRectangle" + << "QQuickRectangle" << ""; QTest::newRow("installed import 2") << "import com.nokia.installedtest 1.3\n" "InstalledTest {}" - << "QSGRectangle" + << "QQuickRectangle" << ""; QTest::newRow("installed import 3") << "import com.nokia.installedtest 1.4\n" "InstalledTest {}" - << "QSGText" + << "QQuickText" << ""; QTest::newRow("installed import minor version not available") // QTBUG-11936 << "import com.nokia.installedtest 0.1\n" @@ -1835,26 +1835,26 @@ void tst_qdeclarativelanguage::importsOrder_data() "import com.nokia.installedtest 1.4\n" "import com.nokia.installedtest 1.4\n" "InstalledTest {}" - << (!qmlCheckTypes()?"QSGText":"") + << (!qmlCheckTypes()?"QQuickText":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.4"); QTest::newRow("installed import overrides 1") << "import com.nokia.installedtest 1.0\n" "import com.nokia.installedtest 1.4\n" "InstalledTest {}" - << (!qmlCheckTypes()?"QSGText":"") + << (!qmlCheckTypes()?"QQuickText":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0"); QTest::newRow("installed import overrides 2") << "import com.nokia.installedtest 1.4\n" "import com.nokia.installedtest 1.0\n" "InstalledTest {}" - << (!qmlCheckTypes()?"QSGRectangle":"") + << (!qmlCheckTypes()?"QQuickRectangle":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4"); QTest::newRow("installed import re-overrides 1") << "import com.nokia.installedtest 1.4\n" "import com.nokia.installedtest 1.0\n" "import com.nokia.installedtest 1.4\n" "InstalledTest {}" - << (!qmlCheckTypes()?"QSGText":"") + << (!qmlCheckTypes()?"QQuickText":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.4 and 1.0"); QTest::newRow("installed import re-overrides 2") << "import com.nokia.installedtest 1.4\n" @@ -1862,20 +1862,20 @@ void tst_qdeclarativelanguage::importsOrder_data() "import com.nokia.installedtest 1.4\n" "import com.nokia.installedtest 1.0\n" "InstalledTest {}" - << (!qmlCheckTypes()?"QSGRectangle":"") + << (!qmlCheckTypes()?"QQuickRectangle":"") << (!qmlCheckTypes()?"":"InstalledTest is ambiguous. Found in lib/com/nokia/installedtest in version 1.0 and 1.4"); QTest::newRow("installed import versus builtin 1") << "import com.nokia.installedtest 1.5\n" "import QtQuick 2.0\n" "Rectangle {}" - << (!qmlCheckTypes()?"QSGRectangle":"") + << (!qmlCheckTypes()?"QQuickRectangle":"") << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in Qt and in lib/com/nokia/installedtest"); QTest::newRow("installed import versus builtin 2") << "import QtQuick 2.0\n" "import com.nokia.installedtest 1.5\n" "Rectangle {}" - << (!qmlCheckTypes()?"QSGText":"") + << (!qmlCheckTypes()?"QQuickText":"") << (!qmlCheckTypes()?"":"Rectangle is ambiguous. Found in lib/com/nokia/installedtest and in Qt"); QTest::newRow("namespaces cannot be overridden by types 1") << "import QtQuick 2.0 as Rectangle\n" @@ -1887,16 +1887,16 @@ void tst_qdeclarativelanguage::importsOrder_data() "import QtQuick 2.0 as Rectangle\n" "import com.nokia.installedtest 1.5\n" "Rectangle.Image {}" - << "QSGImage" + << "QQuickImage" << ""; QTest::newRow("local last 1") << "LocalLast {}" - << "QSGText" + << "QQuickText" << ""; QTest::newRow("local last 2") << "import com.nokia.installedtest 1.0\n" "LocalLast {}" - << (!qmlCheckTypes()?"QSGRectangle":"")// i.e. from com.nokia.installedtest, not data/LocalLast.qml + << (!qmlCheckTypes()?"QQuickRectangle":"")// i.e. from com.nokia.installedtest, not data/LocalLast.qml << (!qmlCheckTypes()?"":"LocalLast is ambiguous. Found in lib/com/nokia/installedtest and in local directory"); } diff --git a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp index 92e3a8f58d..bc6c99102e 100644 --- a/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp +++ b/tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ #include <qtest.h> -#include <QtDeclarative/private/qsgitem_p.h> -#include <QtDeclarative/private/qsgtext_p.h> +#include <QtDeclarative/private/qquickitem_p.h> +#include <QtDeclarative/private/qquicktext_p.h> #include <QtDeclarative/private/qdeclarativeengine_p.h> #include <QtDeclarative/private/qdeclarativelistmodel_p.h> #include <QtDeclarative/private/qdeclarativeexpression_p.h> @@ -62,8 +62,8 @@ public: private: int roleFromName(const QDeclarativeListModel *model, const QString &roleName); - QSGItem *createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model); - void waitForWorker(QSGItem *item); + QQuickItem *createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model); + void waitForWorker(QQuickItem *item); private slots: void static_types(); @@ -113,16 +113,16 @@ int tst_qdeclarativelistmodel::roleFromName(const QDeclarativeListModel *model, return -1; } -QSGItem *tst_qdeclarativelistmodel::createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model) +QQuickItem *tst_qdeclarativelistmodel::createWorkerTest(QDeclarativeEngine *eng, QDeclarativeComponent *component, QDeclarativeListModel *model) { - QSGItem *item = qobject_cast<QSGItem*>(component->create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component->create()); QDeclarativeEngine::setContextForObject(model, eng->rootContext()); if (item) item->setProperty("model", qVariantFromValue(model)); return item; } -void tst_qdeclarativelistmodel::waitForWorker(QSGItem *item) +void tst_qdeclarativelistmodel::waitForWorker(QQuickItem *item) { QEventLoop loop; QTimer timer; @@ -164,7 +164,7 @@ void tst_qdeclarativelistmodel::static_types_data() QTest::newRow("enum") << "ListElement { foo: Text.AlignHCenter }" - << QVariant(double(QSGText::AlignHCenter)); + << QVariant(double(QQuickText::AlignHCenter)); QTest::newRow("Qt enum") << "ListElement { foo: Qt.AlignBottom }" @@ -456,7 +456,7 @@ void tst_qdeclarativelistmodel::dynamic_worker() QDeclarativeListModel model; QDeclarativeEngine eng; QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml")); - QSGItem *item = createWorkerTest(&eng, &component, &model); + QQuickItem *item = createWorkerTest(&eng, &component, &model); QVERIFY(item != 0); QSignalSpy spyCount(&model, SIGNAL(countChanged())); @@ -502,7 +502,7 @@ void tst_qdeclarativelistmodel::dynamic_worker_sync() QDeclarativeListModel model; QDeclarativeEngine eng; QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml")); - QSGItem *item = createWorkerTest(&eng, &component, &model); + QQuickItem *item = createWorkerTest(&eng, &component, &model); QVERIFY(item != 0); if (script[0] == QLatin1Char('{') && script[script.length()-1] == QLatin1Char('}')) @@ -556,7 +556,7 @@ void tst_qdeclarativelistmodel::convertNestedToFlat_fail() QDeclarativeListModel model; QDeclarativeEngine eng; QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml")); - QSGItem *item = createWorkerTest(&eng, &component, &model); + QQuickItem *item = createWorkerTest(&eng, &component, &model); QVERIFY(item != 0); RUNEVAL(item, "model.append({foo: 123})"); @@ -599,7 +599,7 @@ void tst_qdeclarativelistmodel::convertNestedToFlat_ok() QDeclarativeListModel model; QDeclarativeEngine eng; QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml")); - QSGItem *item = createWorkerTest(&eng, &component, &model); + QQuickItem *item = createWorkerTest(&eng, &component, &model); QVERIFY(item != 0); RUNEVAL(item, "model.append({foo: 123})"); @@ -643,7 +643,7 @@ void tst_qdeclarativelistmodel::enumerate() QDeclarativeEngine eng; QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/enumerate.qml")); QVERIFY(!component.isError()); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item != 0); QStringList r = item->property("result").toString().split(":"); QCOMPARE(r[0],QLatin1String("val1=1Y")); @@ -830,7 +830,7 @@ void tst_qdeclarativelistmodel::get_worker() QDeclarativeListModel model; QDeclarativeEngine eng; QDeclarativeComponent component(&eng, QUrl::fromLocalFile(SRCDIR "/data/model.qml")); - QSGItem *item = createWorkerTest(&eng, &component, &model); + QQuickItem *item = createWorkerTest(&eng, &component, &model); QVERIFY(item != 0); // Add some values like get() test @@ -1131,7 +1131,7 @@ void tst_qdeclarativelistmodel::property_changes_worker() QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile(SRCDIR "/data/model.qml")); QVERIFY2(component.errorString().isEmpty(), component.errorString().toUtf8()); - QSGItem *item = createWorkerTest(&engine, &component, &model); + QQuickItem *item = createWorkerTest(&engine, &component, &model); QVERIFY(item != 0); QDeclarativeExpression expr(engine.rootContext(), &model, script_setup); diff --git a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp index 966ac1950c..510bc595be 100644 --- a/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp +++ b/tests/auto/declarative/qdeclarativepropertymap/tst_qdeclarativepropertymap.cpp @@ -43,7 +43,7 @@ #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativepropertymap.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <private/qsgtext_p.h> +#include <private/qquicktext_p.h> #include <QSignalSpy> class tst_QDeclarativePropertyMap : public QObject @@ -176,7 +176,7 @@ void tst_QDeclarativePropertyMap::changed() component.setData("import QtQuick 2.0\nText { text: { testdata.key1 = 'Hello World'; 'X' } }", QUrl::fromLocalFile("")); QVERIFY(component.isReady()); - QSGText *txt = qobject_cast<QSGText*>(component.create()); + QQuickText *txt = qobject_cast<QQuickText*>(component.create()); QVERIFY(txt); QCOMPARE(txt->text(), QString('X')); QCOMPARE(spy.count(), 1); diff --git a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp index dbf5373599..b4ac2dfc66 100644 --- a/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp +++ b/tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp @@ -50,7 +50,7 @@ #include <QDir> #include <QVector3D> #include <QCryptographicHash> -#include <QSGItem> +#include <QQuickItem> #include <QSignalSpy> #include "../shared/util.h" @@ -451,7 +451,7 @@ void tst_qdeclarativeqt::createQmlObject() QCOMPARE(object->property("emptyArg").toBool(), true); QCOMPARE(object->property("success").toBool(), true); - QSGItem *item = qobject_cast<QSGItem *>(object); + QQuickItem *item = qobject_cast<QQuickItem *>(object); QVERIFY(item != 0); QVERIFY(item->childItems().count() == 1); diff --git a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp index 989edfab8b..735af520fe 100644 --- a/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp +++ b/tests/auto/declarative/qdeclarativesmoothedanimation/tst_qdeclarativesmoothedanimation.cpp @@ -42,7 +42,7 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <private/qdeclarativesmoothedanimation_p.h> -#include <private/qsgrectangle_p.h> +#include <private/qquickrectangle_p.h> #include <private/qdeclarativevaluetype_p.h> #include "../shared/util.h" @@ -120,7 +120,7 @@ void tst_qdeclarativesmoothedanimation::disabled() void tst_qdeclarativesmoothedanimation::simpleAnimation() { - QSGRectangle rect; + QQuickRectangle rect; QDeclarativeSmoothedAnimation animation; animation.setTarget(&rect); animation.setProperty("x"); @@ -150,10 +150,10 @@ void tst_qdeclarativesmoothedanimation::valueSource() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("smoothedanimationValueSource.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *theRect = rect->findChild<QSGRectangle*>("theRect"); + QQuickRectangle *theRect = rect->findChild<QQuickRectangle*>("theRect"); QVERIFY(theRect); QDeclarativeSmoothedAnimation *easeX = rect->findChild<QDeclarativeSmoothedAnimation*>("easeX"); @@ -182,10 +182,10 @@ void tst_qdeclarativesmoothedanimation::behavior() QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("smoothedanimationBehavior.qml"))); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect); - QSGRectangle *theRect = rect->findChild<QSGRectangle*>("theRect"); + QQuickRectangle *theRect = rect->findChild<QQuickRectangle*>("theRect"); QVERIFY(theRect); QDeclarativeSmoothedAnimation *easeX = rect->findChild<QDeclarativeSmoothedAnimation*>("easeX"); diff --git a/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp b/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp index b7e04b7e70..f7c520d283 100644 --- a/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp +++ b/tests/auto/declarative/qdeclarativesqldatabase/tst_qdeclarativesqldatabase.cpp @@ -41,7 +41,7 @@ #include <qtest.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <private/qsgtext_p.h> +#include <private/qquicktext_p.h> #include <private/qdeclarativeengine_p.h> #include <QtCore/qcryptographichash.h> /* @@ -206,7 +206,7 @@ void tst_qdeclarativesqldatabase::testQml() QDeclarativeComponent component(engine); component.setData(qml.toUtf8(), QUrl::fromLocalFile(TESTDATA("empty.qml"))); // just a file for relative local imports QVERIFY(!component.isError()); - QSGText *text = qobject_cast<QSGText*>(component.create()); + QQuickText *text = qobject_cast<QQuickText*>(component.create()); QVERIFY(text != 0); QCOMPARE(text->text(),QString("passed")); } diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp index ac24a0b6c5..f6ab6526aa 100644 --- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp +++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp @@ -41,14 +41,14 @@ #include <qtest.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsgstateoperations_p.h> -#include <private/qsganchors_p_p.h> -#include <private/qsgrectangle_p.h> -#include <private/qsgimage_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquickstateoperations_p.h> +#include <private/qquickanchors_p_p.h> +#include <private/qquickrectangle_p.h> +#include <private/qquickimage_p.h> #include <private/qdeclarativepropertychanges_p.h> #include <private/qdeclarativestategroup_p.h> -#include <private/qsgitem_p.h> +#include <private/qquickitem_p.h> #include <private/qdeclarativeproperty_p.h> #include "../shared/util.h" @@ -66,7 +66,7 @@ private: int m_foo; }; -class MyRect : public QSGRectangle +class MyRect : public QQuickRectangle { Q_OBJECT Q_PROPERTY(int propertyWithNotify READ propertyWithNotify WRITE setPropertyWithNotify NOTIFY oddlyNamedNotifySignal) @@ -163,8 +163,8 @@ void tst_qdeclarativestates::basicChanges() { QDeclarativeComponent rectComponent(&engine, TESTDATA("basicChanges.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -178,8 +178,8 @@ void tst_qdeclarativestates::basicChanges() { QDeclarativeComponent rectComponent(&engine, TESTDATA("basicChanges2.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -199,8 +199,8 @@ void tst_qdeclarativestates::basicChanges() { QDeclarativeComponent rectComponent(&engine, TESTDATA("basicChanges3.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -259,7 +259,7 @@ void tst_qdeclarativestates::attachedPropertyChanges() QDeclarativeComponent component(&engine, TESTDATA("attachedPropertyChanges.qml")); QVERIFY(component.isReady()); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item != 0); QCOMPARE(item->width(), 50.0); @@ -279,8 +279,8 @@ void tst_qdeclarativestates::basicExtension() { QDeclarativeComponent rectComponent(&engine, TESTDATA("basicExtension.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -313,8 +313,8 @@ void tst_qdeclarativestates::basicExtension() { QDeclarativeComponent rectComponent(&engine, TESTDATA("fakeExtension.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -345,8 +345,8 @@ void tst_qdeclarativestates::basicBinding() { QDeclarativeComponent rectComponent(&engine, TESTDATA("basicBinding.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -373,8 +373,8 @@ void tst_qdeclarativestates::basicBinding() { QDeclarativeComponent rectComponent(&engine, TESTDATA("basicBinding2.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -404,8 +404,8 @@ void tst_qdeclarativestates::basicBinding() { QDeclarativeComponent rectComponent(&engine, TESTDATA("basicBinding3.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -429,8 +429,8 @@ void tst_qdeclarativestates::basicBinding() { QDeclarativeComponent rectComponent(&engine, TESTDATA("basicBinding4.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); @@ -469,7 +469,7 @@ void tst_qdeclarativestates::signalOverride() rect->doSomething(); QCOMPARE(rect->color(),QColor("blue")); - QSGItemPrivate::get(rect)->setState("green"); + QQuickItemPrivate::get(rect)->setState("green"); rect->doSomething(); QCOMPARE(rect->color(),QColor("green")); } @@ -483,8 +483,8 @@ void tst_qdeclarativestates::signalOverride() rect->doSomething(); QCOMPARE(rect->color(),QColor("blue")); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("extendedRect")); - QSGItemPrivate::get(innerRect)->setState("green"); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("extendedRect")); + QQuickItemPrivate::get(innerRect)->setState("green"); rect->doSomething(); QCOMPARE(rect->color(),QColor("blue")); QCOMPARE(innerRect->color(),QColor("green")); @@ -500,7 +500,7 @@ void tst_qdeclarativestates::signalOverrideCrash() MyRect *rect = qobject_cast<MyRect*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate::get(rect)->setState("overridden"); + QQuickItemPrivate::get(rect)->setState("overridden"); rect->doSomething(); } @@ -509,12 +509,12 @@ void tst_qdeclarativestates::signalOverrideCrash2() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("signalOverrideCrash2.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate::get(rect)->setState("state1"); - QSGItemPrivate::get(rect)->setState("state2"); - QSGItemPrivate::get(rect)->setState("state1"); + QQuickItemPrivate::get(rect)->setState("state1"); + QQuickItemPrivate::get(rect)->setState("state2"); + QQuickItemPrivate::get(rect)->setState("state1"); delete rect; } @@ -525,10 +525,10 @@ void tst_qdeclarativestates::parentChange() { QDeclarativeComponent rectComponent(&engine, TESTDATA("parentChange1.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); QDeclarativeListReference list(rect, "states"); @@ -536,14 +536,14 @@ void tst_qdeclarativestates::parentChange() QVERIFY(state != 0); qmlExecuteDeferred(state); - QSGParentChange *pChange = qobject_cast<QSGParentChange*>(state->operationAt(0)); + QQuickParentChange *pChange = qobject_cast<QQuickParentChange*>(state->operationAt(0)); QVERIFY(pChange != 0); - QSGItem *nParent = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("NewParent")); + QQuickItem *nParent = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("NewParent")); QVERIFY(nParent != 0); QCOMPARE(pChange->parent(), nParent); - QSGItemPrivate::get(rect)->setState("reparented"); + QQuickItemPrivate::get(rect)->setState("reparented"); QCOMPARE(innerRect->rotation(), qreal(0)); QCOMPARE(innerRect->scale(), qreal(1)); QCOMPARE(innerRect->x(), qreal(-133)); @@ -552,10 +552,10 @@ void tst_qdeclarativestates::parentChange() { QDeclarativeComponent rectComponent(&engine, TESTDATA("parentChange2.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); rectPrivate->setState("reparented"); @@ -567,10 +567,10 @@ void tst_qdeclarativestates::parentChange() { QDeclarativeComponent rectComponent(&engine, TESTDATA("parentChange3.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); rectPrivate->setState("reparented"); @@ -589,13 +589,13 @@ void tst_qdeclarativestates::parentChange() { QDeclarativeComponent rectComponent(&engine, TESTDATA("parentChange6.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); - QSGItemPrivate::get(rect)->setState("reparented"); + QQuickItemPrivate::get(rect)->setState("reparented"); QCOMPARE(innerRect->rotation(), qreal(180)); QCOMPARE(innerRect->scale(), qreal(1)); QCOMPARE(innerRect->x(), qreal(-105)); @@ -609,14 +609,14 @@ void tst_qdeclarativestates::parentChangeErrors() { QDeclarativeComponent rectComponent(&engine, TESTDATA("parentChange4.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); QTest::ignoreMessage(QtWarningMsg, fullDataPath("parentChange4.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under non-uniform scale"); - QSGItemPrivate::get(rect)->setState("reparented"); + QQuickItemPrivate::get(rect)->setState("reparented"); QCOMPARE(innerRect->rotation(), qreal(0)); QCOMPARE(innerRect->scale(), qreal(1)); QCOMPARE(innerRect->x(), qreal(5)); @@ -625,14 +625,14 @@ void tst_qdeclarativestates::parentChangeErrors() { QDeclarativeComponent rectComponent(&engine, TESTDATA("parentChange5.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); QTest::ignoreMessage(QtWarningMsg, fullDataPath("parentChange5.qml") + ":25:9: QML ParentChange: Unable to preserve appearance under complex transform"); - QSGItemPrivate::get(rect)->setState("reparented"); + QQuickItemPrivate::get(rect)->setState("reparented"); QCOMPARE(innerRect->rotation(), qreal(0)); QCOMPARE(innerRect->scale(), qreal(1)); QCOMPARE(innerRect->x(), qreal(5)); @@ -645,11 +645,11 @@ void tst_qdeclarativestates::anchorChanges() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChanges1.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); QDeclarativeListReference list(rect, "states"); @@ -657,15 +657,15 @@ void tst_qdeclarativestates::anchorChanges() QVERIFY(state != 0); qmlExecuteDeferred(state); - QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0)); + QQuickAnchorChanges *aChanges = qobject_cast<QQuickAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rectPrivate->setState("right"); QCOMPARE(innerRect->x(), qreal(150)); - QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect)); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QSGAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all) - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine); + QCOMPARE(aChanges->object(), qobject_cast<QQuickItem*>(innerRect)); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QQuickAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all) + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine); rectPrivate->setState(""); QCOMPARE(innerRect->x(), qreal(5)); @@ -678,11 +678,11 @@ void tst_qdeclarativestates::anchorChanges2() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChanges2.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); rectPrivate->setState("right"); @@ -699,17 +699,17 @@ void tst_qdeclarativestates::anchorChanges3() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChanges3.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); - QSGItem *leftGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("LeftGuideline")); + QQuickItem *leftGuideline = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("LeftGuideline")); QVERIFY(leftGuideline != 0); - QSGItem *bottomGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("BottomGuideline")); + QQuickItem *bottomGuideline = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); QDeclarativeListReference list(rect, "states"); @@ -717,19 +717,19 @@ void tst_qdeclarativestates::anchorChanges3() QVERIFY(state != 0); qmlExecuteDeferred(state); - QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0)); + QQuickAnchorChanges *aChanges = qobject_cast<QQuickAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rectPrivate->setState("reanchored"); - QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect)); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().item, QSGItemPrivate::get(leftGuideline)->left().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QSGItemPrivate::get(leftGuideline)->left().anchorLine); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->bottom().item, QSGItemPrivate::get(bottomGuideline)->bottom().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QSGItemPrivate::get(bottomGuideline)->bottom().anchorLine); + QCOMPARE(aChanges->object(), qobject_cast<QQuickItem*>(innerRect)); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->left().item, QQuickItemPrivate::get(leftGuideline)->left().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QQuickItemPrivate::get(leftGuideline)->left().anchorLine); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->bottom().item, QQuickItemPrivate::get(bottomGuideline)->bottom().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QQuickItemPrivate::get(bottomGuideline)->bottom().anchorLine); QCOMPARE(innerRect->x(), qreal(10)); QCOMPARE(innerRect->y(), qreal(0)); @@ -750,16 +750,16 @@ void tst_qdeclarativestates::anchorChanges4() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChanges4.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); - QSGItem *leftGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("LeftGuideline")); + QQuickItem *leftGuideline = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("LeftGuideline")); QVERIFY(leftGuideline != 0); - QSGItem *bottomGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("BottomGuideline")); + QQuickItem *bottomGuideline = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); QDeclarativeListReference list(rect, "states"); @@ -767,15 +767,15 @@ void tst_qdeclarativestates::anchorChanges4() QVERIFY(state != 0); qmlExecuteDeferred(state); - QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0)); + QQuickAnchorChanges *aChanges = qobject_cast<QQuickAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); - QSGItemPrivate::get(rect)->setState("reanchored"); - QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect)); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().item, QSGItemPrivate::get(bottomGuideline)->horizontalCenter().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().anchorLine, QSGItemPrivate::get(bottomGuideline)->horizontalCenter().anchorLine); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->verticalCenter().item, QSGItemPrivate::get(leftGuideline)->verticalCenter().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->verticalCenter().anchorLine, QSGItemPrivate::get(leftGuideline)->verticalCenter().anchorLine); + QQuickItemPrivate::get(rect)->setState("reanchored"); + QCOMPARE(aChanges->object(), qobject_cast<QQuickItem*>(innerRect)); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().item, QQuickItemPrivate::get(bottomGuideline)->horizontalCenter().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->horizontalCenter().anchorLine, QQuickItemPrivate::get(bottomGuideline)->horizontalCenter().anchorLine); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->verticalCenter().item, QQuickItemPrivate::get(leftGuideline)->verticalCenter().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->verticalCenter().anchorLine, QQuickItemPrivate::get(leftGuideline)->verticalCenter().anchorLine); delete rect; } @@ -785,16 +785,16 @@ void tst_qdeclarativestates::anchorChanges5() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChanges5.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); - QSGItem *leftGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("LeftGuideline")); + QQuickItem *leftGuideline = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("LeftGuideline")); QVERIFY(leftGuideline != 0); - QSGItem *bottomGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("BottomGuideline")); + QQuickItem *bottomGuideline = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); QDeclarativeListReference list(rect, "states"); @@ -802,11 +802,11 @@ void tst_qdeclarativestates::anchorChanges5() QVERIFY(state != 0); qmlExecuteDeferred(state); - QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0)); + QQuickAnchorChanges *aChanges = qobject_cast<QQuickAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); - QSGItemPrivate::get(rect)->setState("reanchored"); - QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect)); + QQuickItemPrivate::get(rect)->setState("reanchored"); + QCOMPARE(aChanges->object(), qobject_cast<QQuickItem*>(innerRect)); //QCOMPARE(aChanges->anchors()->horizontalCenter().item, bottomGuideline->horizontalCenter().item); //QCOMPARE(aChanges->anchors()->horizontalCenter().anchorLine, bottomGuideline->horizontalCenter().anchorLine); //QCOMPARE(aChanges->anchors()->baseline().item, leftGuideline->baseline().item); @@ -815,12 +815,12 @@ void tst_qdeclarativestates::anchorChanges5() delete rect; } -void mirrorAnchors(QSGItem *item) { - QSGItemPrivate *itemPrivate = QSGItemPrivate::get(item); +void mirrorAnchors(QQuickItem *item) { + QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); itemPrivate->setLayoutMirror(true); } -qreal offsetRTL(QSGItem *anchorItem, QSGItem *item) { +qreal offsetRTL(QQuickItem *anchorItem, QQuickItem *item) { return anchorItem->width()+2*anchorItem->x()-item->width(); } @@ -829,11 +829,11 @@ void tst_qdeclarativestates::anchorChangesRTL() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChanges1.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); mirrorAnchors(innerRect); @@ -842,15 +842,15 @@ void tst_qdeclarativestates::anchorChangesRTL() QVERIFY(state != 0); qmlExecuteDeferred(state); - QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0)); + QQuickAnchorChanges *aChanges = qobject_cast<QQuickAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rectPrivate->setState("right"); QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) - qreal(150)); - QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect)); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QSGAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all) - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine); + QCOMPARE(aChanges->object(), qobject_cast<QQuickItem*>(innerRect)); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QQuickAnchorLine::Invalid); //### was reset (how do we distinguish from not set at all) + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine); rectPrivate->setState(""); QCOMPARE(innerRect->x(), offsetRTL(rect, innerRect) -qreal(5)); @@ -863,11 +863,11 @@ void tst_qdeclarativestates::anchorChangesRTL2() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChanges2.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); mirrorAnchors(innerRect); @@ -885,18 +885,18 @@ void tst_qdeclarativestates::anchorChangesRTL3() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChanges3.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); - QSGRectangle *innerRect = qobject_cast<QSGRectangle*>(rect->findChild<QSGRectangle*>("MyRect")); + QQuickRectangle *innerRect = qobject_cast<QQuickRectangle*>(rect->findChild<QQuickRectangle*>("MyRect")); QVERIFY(innerRect != 0); mirrorAnchors(innerRect); - QSGItem *leftGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("LeftGuideline")); + QQuickItem *leftGuideline = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("LeftGuideline")); QVERIFY(leftGuideline != 0); - QSGItem *bottomGuideline = qobject_cast<QSGItem*>(rect->findChild<QSGItem*>("BottomGuideline")); + QQuickItem *bottomGuideline = qobject_cast<QQuickItem*>(rect->findChild<QQuickItem*>("BottomGuideline")); QVERIFY(bottomGuideline != 0); QDeclarativeListReference list(rect, "states"); @@ -904,19 +904,19 @@ void tst_qdeclarativestates::anchorChangesRTL3() QVERIFY(state != 0); qmlExecuteDeferred(state); - QSGAnchorChanges *aChanges = qobject_cast<QSGAnchorChanges*>(state->operationAt(0)); + QQuickAnchorChanges *aChanges = qobject_cast<QQuickAnchorChanges*>(state->operationAt(0)); QVERIFY(aChanges != 0); rectPrivate->setState("reanchored"); - QCOMPARE(aChanges->object(), qobject_cast<QSGItem*>(innerRect)); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().item, QSGItemPrivate::get(leftGuideline)->left().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QSGItemPrivate::get(leftGuideline)->left().anchorLine); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->bottom().item, QSGItemPrivate::get(bottomGuideline)->bottom().item); - QCOMPARE(QSGItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QSGItemPrivate::get(bottomGuideline)->bottom().anchorLine); + QCOMPARE(aChanges->object(), qobject_cast<QQuickItem*>(innerRect)); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->left().item, QQuickItemPrivate::get(leftGuideline)->left().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->left().anchorLine, QQuickItemPrivate::get(leftGuideline)->left().anchorLine); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->right().item, rectPrivate->right().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->right().anchorLine, rectPrivate->right().anchorLine); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->top().item, rectPrivate->top().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->top().anchorLine, rectPrivate->top().anchorLine); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->bottom().item, QQuickItemPrivate::get(bottomGuideline)->bottom().item); + QCOMPARE(QQuickItemPrivate::get(aChanges->object())->anchors()->bottom().anchorLine, QQuickItemPrivate::get(bottomGuideline)->bottom().anchorLine); QCOMPARE(innerRect->x(), offsetRTL(leftGuideline, innerRect) - qreal(10)); QCOMPARE(innerRect->y(), qreal(0)); @@ -940,10 +940,10 @@ void tst_qdeclarativestates::anchorChangesCrash() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorChangesCrash.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate::get(rect)->setState("reanchored"); + QQuickItemPrivate::get(rect)->setState("reanchored"); delete rect; } @@ -951,7 +951,7 @@ void tst_qdeclarativestates::anchorChangesCrash() // QTBUG-12273 void tst_qdeclarativestates::anchorRewindBug() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("anchorRewindBug.qml"))); view->show(); @@ -959,29 +959,29 @@ void tst_qdeclarativestates::anchorRewindBug() QTest::qWaitForWindowShown(view); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(view->rootObject()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(view->rootObject()); QVERIFY(rect != 0); - QSGItem * column = rect->findChild<QSGItem*>("column"); + QQuickItem * column = rect->findChild<QQuickItem*>("column"); QVERIFY(column != 0); - QVERIFY(!QSGItemPrivate::get(column)->heightValid); - QVERIFY(!QSGItemPrivate::get(column)->widthValid); + QVERIFY(!QQuickItemPrivate::get(column)->heightValid); + QVERIFY(!QQuickItemPrivate::get(column)->widthValid); QCOMPARE(column->height(), 200.0); - QSGItemPrivate::get(rect)->setState("reanchored"); + QQuickItemPrivate::get(rect)->setState("reanchored"); // column height and width should stay implicit // and column's implicit resizing should still work - QVERIFY(!QSGItemPrivate::get(column)->heightValid); - QVERIFY(!QSGItemPrivate::get(column)->widthValid); + QVERIFY(!QQuickItemPrivate::get(column)->heightValid); + QVERIFY(!QQuickItemPrivate::get(column)->widthValid); QTRY_COMPARE(column->height(), 100.0); - QSGItemPrivate::get(rect)->setState(""); + QQuickItemPrivate::get(rect)->setState(""); // column height and width should stay implicit // and column's implicit resizing should still work - QVERIFY(!QSGItemPrivate::get(column)->heightValid); - QVERIFY(!QSGItemPrivate::get(column)->widthValid); + QVERIFY(!QQuickItemPrivate::get(column)->heightValid); + QVERIFY(!QQuickItemPrivate::get(column)->widthValid); QTRY_COMPARE(column->height(), 200.0); delete view; @@ -993,20 +993,20 @@ void tst_qdeclarativestates::anchorRewindBug2() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("anchorRewindBug2.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGRectangle *mover = rect->findChild<QSGRectangle*>("mover"); + QQuickRectangle *mover = rect->findChild<QQuickRectangle*>("mover"); QVERIFY(mover != 0); QCOMPARE(mover->y(), qreal(0.0)); QCOMPARE(mover->width(), qreal(50.0)); - QSGItemPrivate::get(rect)->setState("anchored"); + QQuickItemPrivate::get(rect)->setState("anchored"); QCOMPARE(mover->y(), qreal(250.0)); QCOMPARE(mover->width(), qreal(200.0)); - QSGItemPrivate::get(rect)->setState(""); + QQuickItemPrivate::get(rect)->setState(""); QCOMPARE(mover->y(), qreal(0.0)); QCOMPARE(mover->width(), qreal(50.0)); @@ -1019,9 +1019,9 @@ void tst_qdeclarativestates::script() { QDeclarativeComponent rectComponent(&engine, TESTDATA("script.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QCOMPARE(rect->color(),QColor("red")); rectPrivate->setState("blue"); @@ -1037,9 +1037,9 @@ void tst_qdeclarativestates::restoreEntryValues() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("restoreEntryValues.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QCOMPARE(rect->color(),QColor("red")); rectPrivate->setState("blue"); @@ -1054,9 +1054,9 @@ void tst_qdeclarativestates::explicitChanges() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("explicit.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QDeclarativeListReference list(rect, "states"); QDeclarativeState *state = qobject_cast<QDeclarativeState*>(list.at(0)); QVERIFY(state != 0); @@ -1087,14 +1087,14 @@ void tst_qdeclarativestates::propertyErrors() { QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("propertyErrors.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); QCOMPARE(rect->color(),QColor("red")); QTest::ignoreMessage(QtWarningMsg, fullDataPath("propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\""); QTest::ignoreMessage(QtWarningMsg, fullDataPath("propertyErrors.qml") + ":8:9: QML PropertyChanges: Cannot assign to read-only property \"activeFocus\""); - QSGItemPrivate::get(rect)->setState("blue"); + QQuickItemPrivate::get(rect)->setState("blue"); } void tst_qdeclarativestates::incorrectRestoreBug() @@ -1102,9 +1102,9 @@ void tst_qdeclarativestates::incorrectRestoreBug() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("basicChanges.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QCOMPARE(rect->color(),QColor("red")); rectPrivate->setState("blue"); @@ -1145,9 +1145,9 @@ void tst_qdeclarativestates::deletingChange() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("deleting.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); rectPrivate->setState("blue"); QCOMPARE(rect->color(),QColor("blue")); QCOMPARE(rect->radius(),qreal(5)); @@ -1177,7 +1177,7 @@ void tst_qdeclarativestates::deletingState() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("deletingState.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); QDeclarativeStateGroup *sg = rect->findChild<QDeclarativeStateGroup*>(); @@ -1208,9 +1208,9 @@ void tst_qdeclarativestates::tempState() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("legalTempState.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QTest::ignoreMessage(QtDebugMsg, "entering placed"); QTest::ignoreMessage(QtDebugMsg, "entering idle"); rectPrivate->setState("placed"); @@ -1222,9 +1222,9 @@ void tst_qdeclarativestates::illegalTempState() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("illegalTempState.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QTest::ignoreMessage(QtWarningMsg, "<Unknown File>: QML StateGroup: Can't apply a state change as part of a state definition."); rectPrivate->setState("placed"); QCOMPARE(rectPrivate->state(), QLatin1String("placed")); @@ -1235,9 +1235,9 @@ void tst_qdeclarativestates::nonExistantProperty() QDeclarativeEngine engine; QDeclarativeComponent rectComponent(&engine, TESTDATA("nonExistantProp.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(rectComponent.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(rectComponent.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QTest::ignoreMessage(QtWarningMsg, fullDataPath("nonExistantProp.qml") + ":9:9: QML PropertyChanges: Cannot assign to non-existent property \"colr\""); rectPrivate->setState("blue"); QCOMPARE(rectPrivate->state(), QLatin1String("blue")); @@ -1248,15 +1248,15 @@ void tst_qdeclarativestates::reset() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, TESTDATA("reset.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGImage *image = rect->findChild<QSGImage*>(); + QQuickImage *image = rect->findChild<QQuickImage*>(); QVERIFY(image != 0); QCOMPARE(image->width(), qreal(40.)); QCOMPARE(image->height(), qreal(20.)); - QSGItemPrivate::get(rect)->setState("state1"); + QQuickItemPrivate::get(rect)->setState("state1"); QCOMPARE(image->width(), 20.0); QCOMPARE(image->height(), qreal(20.)); @@ -1280,9 +1280,9 @@ void tst_qdeclarativestates::whenOrdering() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, TESTDATA("whenOrdering.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QCOMPARE(rectPrivate->state(), QLatin1String("")); rect->setProperty("condition2", true); @@ -1303,16 +1303,16 @@ void tst_qdeclarativestates::urlResolution() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, TESTDATA("urlResolution.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItem *myType = rect->findChild<QSGItem*>("MyType"); - QSGImage *image1 = rect->findChild<QSGImage*>("image1"); - QSGImage *image2 = rect->findChild<QSGImage*>("image2"); - QSGImage *image3 = rect->findChild<QSGImage*>("image3"); + QQuickItem *myType = rect->findChild<QQuickItem*>("MyType"); + QQuickImage *image1 = rect->findChild<QQuickImage*>("image1"); + QQuickImage *image2 = rect->findChild<QQuickImage*>("image2"); + QQuickImage *image3 = rect->findChild<QQuickImage*>("image3"); QVERIFY(myType != 0 && image1 != 0 && image2 != 0 && image3 != 0); - QSGItemPrivate::get(myType)->setState("SetImageState"); + QQuickItemPrivate::get(myType)->setState("SetImageState"); QUrl resolved = QUrl::fromLocalFile(TESTDATA("Implementation/images/qt-logo.png")); QCOMPARE(image1->source(), resolved); QCOMPARE(image2->source(), resolved); @@ -1324,9 +1324,9 @@ void tst_qdeclarativestates::unnamedWhen() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, TESTDATA("unnamedWhen.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QCOMPARE(rectPrivate->state(), QLatin1String("")); QCOMPARE(rect->property("stateString").toString(), QLatin1String("")); @@ -1343,9 +1343,9 @@ void tst_qdeclarativestates::returnToBase() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, TESTDATA("returnToBase.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QCOMPARE(rectPrivate->state(), QLatin1String("")); QCOMPARE(rect->property("stateString").toString(), QLatin1String("")); @@ -1363,10 +1363,10 @@ void tst_qdeclarativestates::extendsBug() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, TESTDATA("extendsBug.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); - QSGRectangle *greenRect = rect->findChild<QSGRectangle*>("greenRect"); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); + QQuickRectangle *greenRect = rect->findChild<QQuickRectangle*>("greenRect"); rectPrivate->setState("b"); QCOMPARE(greenRect->x(), qreal(100)); @@ -1378,10 +1378,10 @@ void tst_qdeclarativestates::editProperties() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, TESTDATA("editProperties.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); QDeclarativeStateGroup *stateGroup = rectPrivate->_states(); QVERIFY(stateGroup != 0); @@ -1401,7 +1401,7 @@ void tst_qdeclarativestates::editProperties() QDeclarativePropertyChanges *propertyChangesGreen = qobject_cast<QDeclarativePropertyChanges*>(greenState->operationAt(0)); QVERIFY(propertyChangesGreen != 0); - QSGRectangle *childRect = rect->findChild<QSGRectangle*>("rect2"); + QQuickRectangle *childRect = rect->findChild<QQuickRectangle*>("rect2"); QVERIFY(childRect != 0); QCOMPARE(childRect->width(), qreal(402)); QVERIFY(QDeclarativePropertyPrivate::binding(QDeclarativeProperty(childRect, "width"))); @@ -1506,9 +1506,9 @@ void tst_qdeclarativestates::QTBUG_14830() QDeclarativeEngine engine; QDeclarativeComponent c(&engine, TESTDATA("QTBUG-14830.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItem *item = rect->findChild<QSGItem*>("area"); + QQuickItem *item = rect->findChild<QQuickItem*>("area"); QCOMPARE(item->width(), qreal(171)); } @@ -1519,10 +1519,10 @@ void tst_qdeclarativestates::avoidFastForward() //shouldn't fast forward if there isn't a transition QDeclarativeComponent c(&engine, TESTDATA("avoidFastForward.qml")); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(c.create()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(c.create()); QVERIFY(rect != 0); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); rectPrivate->setState("a"); QCOMPARE(rect->property("updateCount").toInt(), 1); } diff --git a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp index d6cf8c058f..1e795099e8 100644 --- a/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp +++ b/tests/auto/declarative/qdeclarativetimer/tst_qdeclarativetimer.cpp @@ -43,7 +43,7 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <private/qdeclarativetimer_p.h> -#include <QtDeclarative/qsgitem.h> +#include <QtDeclarative/qquickitem.h> #include <QDebug> class tst_qdeclarativetimer : public QObject @@ -319,7 +319,7 @@ void tst_qdeclarativetimer::parentProperty() QDeclarativeEngine engine; QDeclarativeComponent component(&engine); component.setData(QByteArray("import QtQuick 2.0\nItem { Timer { objectName: \"timer\"; running: parent.visible } }"), QUrl::fromLocalFile("")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item != 0); QDeclarativeTimer *timer = item->findChild<QDeclarativeTimer*>("timer"); QVERIFY(timer != 0); diff --git a/tests/auto/declarative/qmlmin/tst_qmlmin.cpp b/tests/auto/declarative/qmlmin/tst_qmlmin.cpp index 7c33670327..38de65f826 100644 --- a/tests/auto/declarative/qmlmin/tst_qmlmin.cpp +++ b/tests/auto/declarative/qmlmin/tst_qmlmin.cpp @@ -44,7 +44,6 @@ #include <QDir> #include <QProcess> #include <QDebug> -#include <QSGView> #include <QDeclarativeError> #include <cstdlib> @@ -95,7 +94,7 @@ void tst_qmlmin::initTestCase() excludedDirs << "doc/src/snippets/qtquick1/imports"; // Add invalid files (i.e. files with syntax errors) - invalidFiles << "tests/auto/declarative/qsgloader/data/InvalidSourceComponent.qml"; + invalidFiles << "tests/auto/declarative/qquickloader/data/InvalidSourceComponent.qml"; invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/dynamicObjectProperties.2.qml"; invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/signal.3.qml"; invalidFiles << "tests/auto/declarative/qdeclarativelanguage/data/property.4.qml"; diff --git a/tests/auto/declarative/qsganimatedimage/data/colors.gif b/tests/auto/declarative/qquickanimatedimage/data/colors.gif Binary files differindex 1270bfaa79..1270bfaa79 100644 --- a/tests/auto/declarative/qsganimatedimage/data/colors.gif +++ b/tests/auto/declarative/qquickanimatedimage/data/colors.gif diff --git a/tests/auto/declarative/qsganimatedimage/data/colors.qml b/tests/auto/declarative/qquickanimatedimage/data/colors.qml index 5ccc0148dd..5ccc0148dd 100644 --- a/tests/auto/declarative/qsganimatedimage/data/colors.qml +++ b/tests/auto/declarative/qquickanimatedimage/data/colors.qml diff --git a/tests/auto/declarative/qsganimatedimage/data/hearts.gif b/tests/auto/declarative/qquickanimatedimage/data/hearts.gif Binary files differindex cfb55f27f5..cfb55f27f5 100644 --- a/tests/auto/declarative/qsganimatedimage/data/hearts.gif +++ b/tests/auto/declarative/qquickanimatedimage/data/hearts.gif diff --git a/tests/auto/declarative/qsganimatedimage/data/hearts.qml b/tests/auto/declarative/qquickanimatedimage/data/hearts.qml index 717bab430b..717bab430b 100644 --- a/tests/auto/declarative/qsganimatedimage/data/hearts.qml +++ b/tests/auto/declarative/qquickanimatedimage/data/hearts.qml diff --git a/tests/auto/declarative/qsganimatedimage/data/qmldir b/tests/auto/declarative/qquickanimatedimage/data/qmldir index ef7c1f44f3..ef7c1f44f3 100644 --- a/tests/auto/declarative/qsganimatedimage/data/qmldir +++ b/tests/auto/declarative/qquickanimatedimage/data/qmldir diff --git a/tests/auto/declarative/qsganimatedimage/data/qtbug-16520.qml b/tests/auto/declarative/qquickanimatedimage/data/qtbug-16520.qml index da77a4063b..da77a4063b 100644 --- a/tests/auto/declarative/qsganimatedimage/data/qtbug-16520.qml +++ b/tests/auto/declarative/qquickanimatedimage/data/qtbug-16520.qml diff --git a/tests/auto/declarative/qsganimatedimage/data/stickman.gif b/tests/auto/declarative/qquickanimatedimage/data/stickman.gif Binary files differindex 7c4cd18687..7c4cd18687 100644 --- a/tests/auto/declarative/qsganimatedimage/data/stickman.gif +++ b/tests/auto/declarative/qquickanimatedimage/data/stickman.gif diff --git a/tests/auto/declarative/qsganimatedimage/data/stickman.qml b/tests/auto/declarative/qquickanimatedimage/data/stickman.qml index a47924de21..a47924de21 100644 --- a/tests/auto/declarative/qsganimatedimage/data/stickman.qml +++ b/tests/auto/declarative/qquickanimatedimage/data/stickman.qml diff --git a/tests/auto/declarative/qsganimatedimage/data/stickmanerror1.qml b/tests/auto/declarative/qquickanimatedimage/data/stickmanerror1.qml index 4f823b3d70..4f823b3d70 100644 --- a/tests/auto/declarative/qsganimatedimage/data/stickmanerror1.qml +++ b/tests/auto/declarative/qquickanimatedimage/data/stickmanerror1.qml diff --git a/tests/auto/declarative/qsganimatedimage/data/stickmanpause.qml b/tests/auto/declarative/qquickanimatedimage/data/stickmanpause.qml index ef771ed56f..ef771ed56f 100644 --- a/tests/auto/declarative/qsganimatedimage/data/stickmanpause.qml +++ b/tests/auto/declarative/qquickanimatedimage/data/stickmanpause.qml diff --git a/tests/auto/declarative/qsganimatedimage/data/stickmanscaled.qml b/tests/auto/declarative/qquickanimatedimage/data/stickmanscaled.qml index 1ef1f95165..1ef1f95165 100644 --- a/tests/auto/declarative/qsganimatedimage/data/stickmanscaled.qml +++ b/tests/auto/declarative/qquickanimatedimage/data/stickmanscaled.qml diff --git a/tests/auto/declarative/qsganimatedimage/data/stickmanstopped.qml b/tests/auto/declarative/qquickanimatedimage/data/stickmanstopped.qml index 0bf80b8972..0bf80b8972 100644 --- a/tests/auto/declarative/qsganimatedimage/data/stickmanstopped.qml +++ b/tests/auto/declarative/qquickanimatedimage/data/stickmanstopped.qml diff --git a/tests/auto/declarative/qsganimatedimage/qsganimatedimage.pro b/tests/auto/declarative/qquickanimatedimage/qquickanimatedimage.pro index eaf83ccfef..d6a40e11ce 100644 --- a/tests/auto/declarative/qsganimatedimage/qsganimatedimage.pro +++ b/tests/auto/declarative/qquickanimatedimage/qquickanimatedimage.pro @@ -1,7 +1,7 @@ CONFIG += testcase -TARGET = tst_qsganimatedimage +TARGET = tst_qquickanimatedimage HEADERS += ../shared/testhttpserver.h -SOURCES += tst_qsganimatedimage.cpp ../shared/testhttpserver.cpp +SOURCES += tst_qquickanimatedimage.cpp ../shared/testhttpserver.cpp macx:CONFIG -= app_bundle testDataFiles.files = data diff --git a/tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp b/tests/auto/declarative/qquickanimatedimage/tst_qquickanimatedimage.cpp index aa39c52a31..c9394efa37 100644 --- a/tests/auto/declarative/qsganimatedimage/tst_qsganimatedimage.cpp +++ b/tests/auto/declarative/qquickanimatedimage/tst_qquickanimatedimage.cpp @@ -41,21 +41,21 @@ #include <qtest.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsgrectangle_p.h> -#include <private/qsgimage_p.h> -#include <private/qsganimatedimage_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquickrectangle_p.h> +#include <private/qquickimage_p.h> +#include <private/qquickanimatedimage_p.h> #include <QSignalSpy> #include <QtDeclarative/qdeclarativecontext.h> #include "../shared/testhttpserver.h" #include "../shared/util.h" -class tst_qsganimatedimage : public QObject +class tst_qquickanimatedimage : public QObject { Q_OBJECT public: - tst_qsganimatedimage() {} + tst_qquickanimatedimage() {} private slots: void play(); @@ -76,22 +76,22 @@ private slots: }; -void tst_qsganimatedimage::play() +void tst_qquickanimatedimage::play() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("stickman.qml"))); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(component.create()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create()); QVERIFY(anim); QVERIFY(anim->isPlaying()); delete anim; } -void tst_qsganimatedimage::pause() +void tst_qquickanimatedimage::pause() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("stickmanpause.qml"))); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(component.create()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create()); QVERIFY(anim); QVERIFY(anim->isPlaying()); QVERIFY(anim->isPaused()); @@ -99,11 +99,11 @@ void tst_qsganimatedimage::pause() delete anim; } -void tst_qsganimatedimage::stopped() +void tst_qquickanimatedimage::stopped() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("stickmanstopped.qml"))); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(component.create()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create()); QVERIFY(anim); QVERIFY(!anim->isPlaying()); QCOMPARE(anim->currentFrame(), 0); @@ -111,11 +111,11 @@ void tst_qsganimatedimage::stopped() delete anim; } -void tst_qsganimatedimage::setFrame() +void tst_qquickanimatedimage::setFrame() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("stickmanpause.qml"))); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(component.create()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create()); QVERIFY(anim); QVERIFY(anim->isPlaying()); QCOMPARE(anim->currentFrame(), 2); @@ -123,11 +123,11 @@ void tst_qsganimatedimage::setFrame() delete anim; } -void tst_qsganimatedimage::frameCount() +void tst_qquickanimatedimage::frameCount() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("colors.qml"))); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(component.create()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create()); QVERIFY(anim); QVERIFY(anim->isPlaying()); QCOMPARE(anim->frameCount(), 3); @@ -135,15 +135,15 @@ void tst_qsganimatedimage::frameCount() delete anim; } -void tst_qsganimatedimage::mirror_running() +void tst_qquickanimatedimage::mirror_running() { // test where mirror is set to true after animation has started - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->show(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("hearts.qml"))); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(canvas->rootObject()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(canvas->rootObject()); QVERIFY(anim); int width = anim->property("width").toInt(); @@ -182,15 +182,15 @@ void tst_qsganimatedimage::mirror_running() delete canvas; } -void tst_qsganimatedimage::mirror_notRunning() +void tst_qquickanimatedimage::mirror_notRunning() { QFETCH(QUrl, fileUrl); - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->show(); canvas->setSource(fileUrl); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(canvas->rootObject()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(canvas->rootObject()); QVERIFY(anim); int width = anim->property("width").toInt(); @@ -218,7 +218,7 @@ void tst_qsganimatedimage::mirror_notRunning() delete canvas; } -void tst_qsganimatedimage::mirror_notRunning_data() +void tst_qquickanimatedimage::mirror_notRunning_data() { QTest::addColumn<QUrl>("fileUrl"); @@ -226,7 +226,7 @@ void tst_qsganimatedimage::mirror_notRunning_data() QTest::newRow("stopped") << QUrl::fromLocalFile(TESTDATA("stickmanstopped.qml")); } -void tst_qsganimatedimage::remote() +void tst_qquickanimatedimage::remote() { QFETCH(QString, fileName); QFETCH(bool, paused); @@ -239,7 +239,7 @@ void tst_qsganimatedimage::remote() QDeclarativeComponent component(&engine, QUrl("http://127.0.0.1:14449/" + fileName)); QTRY_VERIFY(component.isReady()); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(component.create()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create()); QVERIFY(anim); QTRY_VERIFY(anim->isPlaying()); @@ -247,16 +247,16 @@ void tst_qsganimatedimage::remote() QTRY_VERIFY(anim->isPaused()); QCOMPARE(anim->currentFrame(), 2); } - QVERIFY(anim->status() != QSGAnimatedImage::Error); + QVERIFY(anim->status() != QQuickAnimatedImage::Error); delete anim; } -void tst_qsganimatedimage::sourceSize() +void tst_qquickanimatedimage::sourceSize() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("stickmanscaled.qml"))); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(component.create()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create()); QVERIFY(anim); QCOMPARE(anim->width(),240.0); QCOMPARE(anim->height(),180.0); @@ -265,7 +265,7 @@ void tst_qsganimatedimage::sourceSize() delete anim; } -void tst_qsganimatedimage::sourceSizeReadOnly() +void tst_qquickanimatedimage::sourceSizeReadOnly() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("stickmanerror1.qml"))); @@ -273,7 +273,7 @@ void tst_qsganimatedimage::sourceSizeReadOnly() QCOMPARE(component.errors().at(0).description(), QString("Invalid property assignment: \"sourceSize\" is a read-only property")); } -void tst_qsganimatedimage::remote_data() +void tst_qquickanimatedimage::remote_data() { QTest::addColumn<QString>("fileName"); QTest::addColumn<bool>("paused"); @@ -282,7 +282,7 @@ void tst_qsganimatedimage::remote_data() QTest::newRow("paused") << "stickmanpause.qml" << true; } -void tst_qsganimatedimage::invalidSource() +void tst_qquickanimatedimage::invalidSource() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine); @@ -291,7 +291,7 @@ void tst_qsganimatedimage::invalidSource() QTest::ignoreMessage(QtWarningMsg, "file::2:2: QML AnimatedImage: Error Reading Animated Image File file:no-such-file.gif"); - QSGAnimatedImage *anim = qobject_cast<QSGAnimatedImage *>(component.create()); + QQuickAnimatedImage *anim = qobject_cast<QQuickAnimatedImage *>(component.create()); QVERIFY(anim); QVERIFY(!anim->isPlaying()); @@ -301,7 +301,7 @@ void tst_qsganimatedimage::invalidSource() QTRY_VERIFY(anim->status() == 3); } -void tst_qsganimatedimage::qtbug_16520() +void tst_qquickanimatedimage::qtbug_16520() { TestHTTPServer server(14449); QVERIFY(server.isValid()); @@ -311,9 +311,9 @@ void tst_qsganimatedimage::qtbug_16520() QDeclarativeComponent component(&engine, QUrl::fromLocalFile(TESTDATA("qtbug-16520.qml"))); QTRY_VERIFY(component.isReady()); - QSGRectangle *root = qobject_cast<QSGRectangle *>(component.create()); + QQuickRectangle *root = qobject_cast<QQuickRectangle *>(component.create()); QVERIFY(root); - QSGAnimatedImage *anim = root->findChild<QSGAnimatedImage*>("anim"); + QQuickAnimatedImage *anim = root->findChild<QQuickAnimatedImage*>("anim"); anim->setProperty("source", "http://127.0.0.1:14449/stickman.gif"); @@ -323,7 +323,7 @@ void tst_qsganimatedimage::qtbug_16520() delete anim; } -void tst_qsganimatedimage::progressAndStatusChanges() +void tst_qquickanimatedimage::progressAndStatusChanges() { TestHTTPServer server(14449); QVERIFY(server.isValid()); @@ -335,18 +335,18 @@ void tst_qsganimatedimage::progressAndStatusChanges() ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(TESTDATA("stickman.gif"))); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); - QVERIFY(obj->status() == QSGImage::Ready); + QVERIFY(obj->status() == QQuickImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &))); QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal))); - QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QSGImageBase::Status))); + QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QQuickImageBase::Status))); // Loading local file ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(TESTDATA("colors.gif"))); - QTRY_VERIFY(obj->status() == QSGImage::Ready); + QTRY_VERIFY(obj->status() == QQuickImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 1); QTRY_COMPARE(progressSpy.count(), 0); @@ -354,22 +354,22 @@ void tst_qsganimatedimage::progressAndStatusChanges() // Loading remote file ctxt->setContextProperty("srcImage", "http://127.0.0.1:14449/stickman.gif"); - QTRY_VERIFY(obj->status() == QSGImage::Loading); + QTRY_VERIFY(obj->status() == QQuickImage::Loading); QTRY_VERIFY(obj->progress() == 0.0); - QTRY_VERIFY(obj->status() == QSGImage::Ready); + QTRY_VERIFY(obj->status() == QQuickImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 2); QTRY_VERIFY(progressSpy.count() > 1); QTRY_COMPARE(statusSpy.count(), 2); ctxt->setContextProperty("srcImage", ""); - QTRY_VERIFY(obj->status() == QSGImage::Null); + QTRY_VERIFY(obj->status() == QQuickImage::Null); QTRY_VERIFY(obj->progress() == 0.0); QTRY_COMPARE(sourceSpy.count(), 3); QTRY_VERIFY(progressSpy.count() > 2); QTRY_COMPARE(statusSpy.count(), 3); } -QTEST_MAIN(tst_qsganimatedimage) +QTEST_MAIN(tst_qquickanimatedimage) -#include "tst_qsganimatedimage.moc" +#include "tst_qquickanimatedimage.moc" diff --git a/tests/auto/declarative/qsgborderimage/data/colors-mirror.png b/tests/auto/declarative/qquickborderimage/data/colors-mirror.png Binary files differindex e30870dd1e..e30870dd1e 100644 --- a/tests/auto/declarative/qsgborderimage/data/colors-mirror.png +++ b/tests/auto/declarative/qquickborderimage/data/colors-mirror.png diff --git a/tests/auto/declarative/qsgborderimage/data/colors-round-quotes.sci b/tests/auto/declarative/qquickborderimage/data/colors-round-quotes.sci index 294f3cfe48..294f3cfe48 100644 --- a/tests/auto/declarative/qsgborderimage/data/colors-round-quotes.sci +++ b/tests/auto/declarative/qquickborderimage/data/colors-round-quotes.sci diff --git a/tests/auto/declarative/qsgborderimage/data/colors-round-remote.sci b/tests/auto/declarative/qquickborderimage/data/colors-round-remote.sci index c673bed598..c673bed598 100644 --- a/tests/auto/declarative/qsgborderimage/data/colors-round-remote.sci +++ b/tests/auto/declarative/qquickborderimage/data/colors-round-remote.sci diff --git a/tests/auto/declarative/qsgborderimage/data/colors-round.sci b/tests/auto/declarative/qquickborderimage/data/colors-round.sci index 5d2f49f0e1..5d2f49f0e1 100644 --- a/tests/auto/declarative/qsgborderimage/data/colors-round.sci +++ b/tests/auto/declarative/qquickborderimage/data/colors-round.sci diff --git a/tests/auto/declarative/qsgborderimage/data/colors.png b/tests/auto/declarative/qquickborderimage/data/colors.png Binary files differindex dfb62f3d64..dfb62f3d64 100644 --- a/tests/auto/declarative/qsgborderimage/data/colors.png +++ b/tests/auto/declarative/qquickborderimage/data/colors.png diff --git a/tests/auto/declarative/qsgborderimage/data/heart200.png b/tests/auto/declarative/qquickborderimage/data/heart200.png Binary files differindex 5a31ae8f4d..5a31ae8f4d 100644 --- a/tests/auto/declarative/qsgborderimage/data/heart200.png +++ b/tests/auto/declarative/qquickborderimage/data/heart200.png diff --git a/tests/auto/declarative/qsgborderimage/data/invalid.sci b/tests/auto/declarative/qquickborderimage/data/invalid.sci index 98c72c9bf1..98c72c9bf1 100644 --- a/tests/auto/declarative/qsgborderimage/data/invalid.sci +++ b/tests/auto/declarative/qquickborderimage/data/invalid.sci diff --git a/tests/auto/declarative/qsgborderimage/data/mirror.qml b/tests/auto/declarative/qquickborderimage/data/mirror.qml index abab076e08..abab076e08 100644 --- a/tests/auto/declarative/qsgborderimage/data/mirror.qml +++ b/tests/auto/declarative/qquickborderimage/data/mirror.qml diff --git a/tests/auto/declarative/qsgborderimage/qsgborderimage.pro b/tests/auto/declarative/qquickborderimage/qquickborderimage.pro index 65200a9a93..b1ccf4a939 100644 --- a/tests/auto/declarative/qsgborderimage/qsgborderimage.pro +++ b/tests/auto/declarative/qquickborderimage/qquickborderimage.pro @@ -1,9 +1,9 @@ CONFIG += testcase -TARGET = tst_qsgborderimage +TARGET = tst_qquickborderimage macx:CONFIG -= app_bundle HEADERS += ../shared/testhttpserver.h -SOURCES += tst_qsgborderimage.cpp ../shared/testhttpserver.cpp +SOURCES += tst_qquickborderimage.cpp ../shared/testhttpserver.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgborderimage/tst_qsgborderimage.cpp b/tests/auto/declarative/qquickborderimage/tst_qquickborderimage.cpp index 0835a66dd7..4fb6ed7057 100644 --- a/tests/auto/declarative/qsgborderimage/tst_qsgborderimage.cpp +++ b/tests/auto/declarative/qquickborderimage/tst_qquickborderimage.cpp @@ -48,11 +48,11 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <private/qsgborderimage_p.h> -#include <private/qsgimagebase_p.h> -#include <private/qsgscalegrid_p_p.h> -#include <private/qsgloader_p.h> -#include <QtDeclarative/qsgview.h> +#include <private/qquickborderimage_p.h> +#include <private/qquickimagebase_p.h> +#include <private/qquickscalegrid_p_p.h> +#include <private/qquickloader_p.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativecontext.h> #include "../shared/testhttpserver.h" @@ -61,12 +61,12 @@ #define SERVER_PORT 14446 #define SERVER_ADDR "http://127.0.0.1:14446" -class tst_qsgborderimage : public QObject +class tst_qquickborderimage : public QObject { Q_OBJECT public: - tst_qsgborderimage(); + tst_qquickborderimage(); private slots: void noSource(); @@ -87,27 +87,27 @@ private: QDeclarativeEngine engine; }; -tst_qsgborderimage::tst_qsgborderimage() +tst_qquickborderimage::tst_qquickborderimage() { } -void tst_qsgborderimage::noSource() +void tst_qquickborderimage::noSource() { QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"\" }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->source(), QUrl()); QCOMPARE(obj->width(), 0.); QCOMPARE(obj->height(), 0.); - QCOMPARE(obj->horizontalTileMode(), QSGBorderImage::Stretch); - QCOMPARE(obj->verticalTileMode(), QSGBorderImage::Stretch); + QCOMPARE(obj->horizontalTileMode(), QQuickBorderImage::Stretch); + QCOMPARE(obj->verticalTileMode(), QQuickBorderImage::Stretch); delete obj; } -void tst_qsgborderimage::imageSource_data() +void tst_qquickborderimage::imageSource_data() { QTest::addColumn<QString>("source"); QTest::addColumn<bool>("remote"); @@ -121,7 +121,7 @@ void tst_qsgborderimage::imageSource_data() << "file::2:1: QML BorderImage: Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found"; } -void tst_qsgborderimage::imageSource() +void tst_qquickborderimage::imageSource() { QFETCH(QString, source); QFETCH(bool, remote); @@ -140,90 +140,90 @@ void tst_qsgborderimage::imageSource() QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + source + "\" }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); if (remote) - QTRY_VERIFY(obj->status() == QSGBorderImage::Loading); + QTRY_VERIFY(obj->status() == QQuickBorderImage::Loading); QCOMPARE(obj->source(), remote ? source : QUrl(source)); if (error.isEmpty()) { - QTRY_VERIFY(obj->status() == QSGBorderImage::Ready); + QTRY_VERIFY(obj->status() == QQuickBorderImage::Ready); QCOMPARE(obj->width(), 120.); QCOMPARE(obj->height(), 120.); QCOMPARE(obj->sourceSize().width(), 120); QCOMPARE(obj->sourceSize().height(), 120); - QCOMPARE(obj->horizontalTileMode(), QSGBorderImage::Stretch); - QCOMPARE(obj->verticalTileMode(), QSGBorderImage::Stretch); + QCOMPARE(obj->horizontalTileMode(), QQuickBorderImage::Stretch); + QCOMPARE(obj->verticalTileMode(), QQuickBorderImage::Stretch); } else { - QTRY_VERIFY(obj->status() == QSGBorderImage::Error); + QTRY_VERIFY(obj->status() == QQuickBorderImage::Error); } delete obj; delete server; } -void tst_qsgborderimage::clearSource() +void tst_qquickborderimage::clearSource() { QString componentStr = "import QtQuick 2.0\nBorderImage { source: srcImage }"; QDeclarativeContext *ctxt = engine.rootContext(); ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(TESTDATA("colors.png"))); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); - QVERIFY(obj->status() == QSGBorderImage::Ready); + QVERIFY(obj->status() == QQuickBorderImage::Ready); QCOMPARE(obj->width(), 120.); QCOMPARE(obj->height(), 120.); ctxt->setContextProperty("srcImage", ""); QVERIFY(obj->source().isEmpty()); - QVERIFY(obj->status() == QSGBorderImage::Null); + QVERIFY(obj->status() == QQuickBorderImage::Null); QCOMPARE(obj->width(), 0.); QCOMPARE(obj->height(), 0.); } -void tst_qsgborderimage::resized() +void tst_qquickborderimage::resized() { QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + QUrl::fromLocalFile(TESTDATA("colors.png")).toString() + "\"; width: 300; height: 300 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); QCOMPARE(obj->sourceSize().width(), 120); QCOMPARE(obj->sourceSize().height(), 120); - QCOMPARE(obj->horizontalTileMode(), QSGBorderImage::Stretch); - QCOMPARE(obj->verticalTileMode(), QSGBorderImage::Stretch); + QCOMPARE(obj->horizontalTileMode(), QQuickBorderImage::Stretch); + QCOMPARE(obj->verticalTileMode(), QQuickBorderImage::Stretch); delete obj; } -void tst_qsgborderimage::smooth() +void tst_qquickborderimage::smooth() { QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + TESTDATA("colors.png") + "\"; smooth: true; width: 300; height: 300 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); QCOMPARE(obj->smooth(), true); - QCOMPARE(obj->horizontalTileMode(), QSGBorderImage::Stretch); - QCOMPARE(obj->verticalTileMode(), QSGBorderImage::Stretch); + QCOMPARE(obj->horizontalTileMode(), QQuickBorderImage::Stretch); + QCOMPARE(obj->verticalTileMode(), QQuickBorderImage::Stretch); delete obj; } -void tst_qsgborderimage::mirror() +void tst_qquickborderimage::mirror() { - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->show(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("mirror.qml"))); - QSGBorderImage *image = qobject_cast<QSGBorderImage*>(canvas->rootObject()); + QQuickBorderImage *image = qobject_cast<QQuickBorderImage*>(canvas->rootObject()); QVERIFY(image != 0); canvas->show(); @@ -241,18 +241,18 @@ void tst_qsgborderimage::mirror() delete canvas; } -void tst_qsgborderimage::tileModes() +void tst_qquickborderimage::tileModes() { { QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + TESTDATA("colors.png") + "\"; width: 100; height: 300; horizontalTileMode: BorderImage.Repeat; verticalTileMode: BorderImage.Repeat }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 100.); QCOMPARE(obj->height(), 300.); - QCOMPARE(obj->horizontalTileMode(), QSGBorderImage::Repeat); - QCOMPARE(obj->verticalTileMode(), QSGBorderImage::Repeat); + QCOMPARE(obj->horizontalTileMode(), QQuickBorderImage::Repeat); + QCOMPARE(obj->verticalTileMode(), QQuickBorderImage::Repeat); delete obj; } @@ -260,18 +260,18 @@ void tst_qsgborderimage::tileModes() QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + TESTDATA("colors.png") + "\"; width: 300; height: 150; horizontalTileMode: BorderImage.Round; verticalTileMode: BorderImage.Round }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 150.); - QCOMPARE(obj->horizontalTileMode(), QSGBorderImage::Round); - QCOMPARE(obj->verticalTileMode(), QSGBorderImage::Round); + QCOMPARE(obj->horizontalTileMode(), QQuickBorderImage::Round); + QCOMPARE(obj->verticalTileMode(), QQuickBorderImage::Round); delete obj; } } -void tst_qsgborderimage::sciSource() +void tst_qquickborderimage::sciSource() { QFETCH(QString, source); QFETCH(bool, valid); @@ -287,33 +287,33 @@ void tst_qsgborderimage::sciSource() QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + source + "\"; width: 300; height: 300 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); if (remote) - QTRY_VERIFY(obj->status() == QSGBorderImage::Loading); + QTRY_VERIFY(obj->status() == QQuickBorderImage::Loading); QCOMPARE(obj->source(), remote ? source : QUrl(source)); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); if (valid) { - QTRY_VERIFY(obj->status() == QSGBorderImage::Ready); + QTRY_VERIFY(obj->status() == QQuickBorderImage::Ready); QCOMPARE(obj->border()->left(), 10); QCOMPARE(obj->border()->top(), 20); QCOMPARE(obj->border()->right(), 30); QCOMPARE(obj->border()->bottom(), 40); - QCOMPARE(obj->horizontalTileMode(), QSGBorderImage::Round); - QCOMPARE(obj->verticalTileMode(), QSGBorderImage::Repeat); + QCOMPARE(obj->horizontalTileMode(), QQuickBorderImage::Round); + QCOMPARE(obj->verticalTileMode(), QQuickBorderImage::Repeat); } else { - QTRY_VERIFY(obj->status() == QSGBorderImage::Error); + QTRY_VERIFY(obj->status() == QQuickBorderImage::Error); } delete obj; delete server; } -void tst_qsgborderimage::sciSource_data() +void tst_qquickborderimage::sciSource_data() { QTest::addColumn<QString>("source"); QTest::addColumn<bool>("valid"); @@ -327,35 +327,35 @@ void tst_qsgborderimage::sciSource_data() QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.sci" << false; } -void tst_qsgborderimage::invalidSciFile() +void tst_qquickborderimage::invalidSciFile() { - QTest::ignoreMessage(QtWarningMsg, "QSGGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Roun" - QTest::ignoreMessage(QtWarningMsg, "QSGGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Repea" + QTest::ignoreMessage(QtWarningMsg, "QQuickGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Roun" + QTest::ignoreMessage(QtWarningMsg, "QQuickGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Repea" QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + QUrl::fromLocalFile(TESTDATA("invalid.sci")).toString() +"\"; width: 300; height: 300 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); - QCOMPARE(obj->status(), QSGImageBase::Error); - QCOMPARE(obj->horizontalTileMode(), QSGBorderImage::Stretch); - QCOMPARE(obj->verticalTileMode(), QSGBorderImage::Stretch); + QCOMPARE(obj->status(), QQuickImageBase::Error); + QCOMPARE(obj->horizontalTileMode(), QQuickBorderImage::Stretch); + QCOMPARE(obj->verticalTileMode(), QQuickBorderImage::Stretch); delete obj; } -void tst_qsgborderimage::pendingRemoteRequest() +void tst_qquickborderimage::pendingRemoteRequest() { QFETCH(QString, source); QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + source + "\" }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create()); + QQuickBorderImage *obj = qobject_cast<QQuickBorderImage*>(component.create()); QVERIFY(obj != 0); - QCOMPARE(obj->status(), QSGBorderImage::Loading); + QCOMPARE(obj->status(), QQuickBorderImage::Loading); // verify no crash // This will cause a delayed "QThread: Destroyed while thread is still running" warning @@ -363,7 +363,7 @@ void tst_qsgborderimage::pendingRemoteRequest() QTest::qWait(50); } -void tst_qsgborderimage::pendingRemoteRequest_data() +void tst_qquickborderimage::pendingRemoteRequest_data() { QTest::addColumn<QString>("source"); @@ -371,6 +371,6 @@ void tst_qsgborderimage::pendingRemoteRequest_data() QTest::newRow("sci file") << "http://localhost/none.sci"; } -QTEST_MAIN(tst_qsgborderimage) +QTEST_MAIN(tst_qquickborderimage) -#include "tst_qsgborderimage.moc" +#include "tst_qquickborderimage.moc" diff --git a/tests/auto/declarative/qsgcanvas/qsgcanvas.pro b/tests/auto/declarative/qquickcanvas/qquickcanvas.pro index d8749112d5..b45a3597d4 100644 --- a/tests/auto/declarative/qsgcanvas/qsgcanvas.pro +++ b/tests/auto/declarative/qquickcanvas/qquickcanvas.pro @@ -1,6 +1,6 @@ CONFIG += testcase -TARGET = tst_qsgcanvas -SOURCES += tst_qsgcanvas.cpp +TARGET = tst_qquickcanvas +SOURCES += tst_qquickcanvas.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qsgcanvas/tst_qsgcanvas.cpp b/tests/auto/declarative/qquickcanvas/tst_qquickcanvas.cpp index d8135ed233..d2b691d461 100644 --- a/tests/auto/declarative/qsgcanvas/tst_qsgcanvas.cpp +++ b/tests/auto/declarative/qquickcanvas/tst_qquickcanvas.cpp @@ -42,9 +42,9 @@ #include <qtest.h> #include <QDebug> #include <QTouchEvent> -#include <QtDeclarative/QSGItem> -#include <QtDeclarative/QSGCanvas> -#include <QtDeclarative/private/qsgrectangle_p.h> +#include <QtDeclarative/QQuickItem> +#include <QtDeclarative/QQuickCanvas> +#include <QtDeclarative/private/qquickrectangle_p.h> #include <QtGui/QWindowSystemInterface> struct TouchEventData { @@ -55,7 +55,7 @@ struct TouchEventData { QList<QTouchEvent::TouchPoint> touchPoints; }; -static QTouchEvent::TouchPoint makeTouchPoint(QSGItem *item, const QPointF &p, const QPointF &lastPoint = QPointF()) +static QTouchEvent::TouchPoint makeTouchPoint(QQuickItem *item, const QPointF &p, const QPointF &lastPoint = QPointF()) { QPointF last = lastPoint.isNull() ? p : lastPoint; @@ -115,12 +115,12 @@ static TouchEventData makeTouchData(QEvent::Type type, QWindow *w, Qt::TouchPoin } \ } -class TestTouchItem : public QSGRectangle +class TestTouchItem : public QQuickRectangle { Q_OBJECT public: - TestTouchItem(QSGItem *parent = 0) - : QSGRectangle(parent), acceptEvents(true), mousePressId(0) + TestTouchItem(QQuickItem *parent = 0) + : QQuickRectangle(parent), acceptEvents(true), mousePressId(0) { border()->setWidth(1); setAcceptedMouseButtons(Qt::LeftButton); @@ -153,7 +153,7 @@ protected: mousePressId = ++mousePressNum; } - bool childMouseEventFilter(QSGItem *, QEvent *) { + bool childMouseEventFilter(QQuickItem *, QEvent *) { mousePressId = ++mousePressNum; return false; } @@ -163,11 +163,11 @@ protected: int TestTouchItem::mousePressNum = 0; -class ConstantUpdateItem : public QSGItem +class ConstantUpdateItem : public QQuickItem { Q_OBJECT public: - ConstantUpdateItem(QSGItem *parent = 0) : QSGItem(parent), iterations(0) {setFlag(ItemHasContents);} + ConstantUpdateItem(QQuickItem *parent = 0) : QQuickItem(parent), iterations(0) {setFlag(ItemHasContents);} int iterations; protected: @@ -178,11 +178,11 @@ protected: } }; -class tst_qsgcanvas : public QObject +class tst_qquickcanvas : public QObject { Q_OBJECT public: - tst_qsgcanvas(); + tst_qquickcanvas(); private slots: void initTestCase(); @@ -198,30 +198,30 @@ private slots: void mouseFiltering(); }; -tst_qsgcanvas::tst_qsgcanvas() +tst_qquickcanvas::tst_qquickcanvas() { } -void tst_qsgcanvas::initTestCase() +void tst_qquickcanvas::initTestCase() { } -void tst_qsgcanvas::cleanupTestCase() +void tst_qquickcanvas::cleanupTestCase() { } //If the item calls update inside updatePaintNode, it should schedule another update -void tst_qsgcanvas::constantUpdates() +void tst_qquickcanvas::constantUpdates() { - QSGCanvas canvas; + QQuickCanvas canvas; ConstantUpdateItem item(canvas.rootItem()); canvas.show(); QTRY_VERIFY(item.iterations > 60); } -void tst_qsgcanvas::touchEvent_basic() +void tst_qquickcanvas::touchEvent_basic() { - QSGCanvas *canvas = new QSGCanvas; + QQuickCanvas *canvas = new QQuickCanvas; canvas->resize(250, 250); canvas->move(100, 100); canvas->show(); @@ -334,13 +334,13 @@ void tst_qsgcanvas::touchEvent_basic() delete canvas; } -void tst_qsgcanvas::touchEvent_propagation() +void tst_qquickcanvas::touchEvent_propagation() { QFETCH(bool, acceptEvents); QFETCH(bool, enableItem); QFETCH(qreal, itemOpacity); - QSGCanvas *canvas = new QSGCanvas; + QQuickCanvas *canvas = new QQuickCanvas; canvas->resize(250, 250); canvas->move(100, 100); canvas->show(); @@ -453,7 +453,7 @@ void tst_qsgcanvas::touchEvent_propagation() delete canvas; } -void tst_qsgcanvas::touchEvent_propagation_data() +void tst_qquickcanvas::touchEvent_propagation_data() { QTest::addColumn<bool>("acceptEvents"); QTest::addColumn<bool>("enableItem"); @@ -464,10 +464,10 @@ void tst_qsgcanvas::touchEvent_propagation_data() QTest::newRow("opacity of 0") << true << true << 0.0; } -void tst_qsgcanvas::clearCanvas() +void tst_qquickcanvas::clearCanvas() { - QSGCanvas *canvas = new QSGCanvas; - QSGItem *item = new QSGItem; + QQuickCanvas *canvas = new QQuickCanvas; + QQuickItem *item = new QQuickItem; item->setParentItem(canvas->rootItem()); QVERIFY(item->canvas() == canvas); @@ -479,9 +479,9 @@ void tst_qsgcanvas::clearCanvas() delete item; } -void tst_qsgcanvas::mouseFiltering() +void tst_qquickcanvas::mouseFiltering() { - QSGCanvas *canvas = new QSGCanvas; + QQuickCanvas *canvas = new QQuickCanvas; canvas->resize(250, 250); canvas->move(100, 100); canvas->show(); @@ -516,6 +516,6 @@ void tst_qsgcanvas::mouseFiltering() } -QTEST_MAIN(tst_qsgcanvas) +QTEST_MAIN(tst_qquickcanvas) -#include "tst_qsgcanvas.moc" +#include "tst_qquickcanvas.moc" diff --git a/tests/auto/declarative/qsgcanvasitem/data/anim-gr.gif b/tests/auto/declarative/qquickcanvasitem/data/anim-gr.gif Binary files differindex 45263e0afb..45263e0afb 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/anim-gr.gif +++ b/tests/auto/declarative/qquickcanvasitem/data/anim-gr.gif diff --git a/tests/auto/declarative/qsgcanvasitem/data/anim-gr.png b/tests/auto/declarative/qquickcanvasitem/data/anim-gr.png Binary files differindex 925e2efc9a..925e2efc9a 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/anim-gr.png +++ b/tests/auto/declarative/qquickcanvasitem/data/anim-gr.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/anim-poster-gr.png b/tests/auto/declarative/qquickcanvasitem/data/anim-poster-gr.png Binary files differindex 6941207373..6941207373 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/anim-poster-gr.png +++ b/tests/auto/declarative/qquickcanvasitem/data/anim-poster-gr.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/background.png b/tests/auto/declarative/qquickcanvasitem/data/background.png Binary files differindex 6db6c6b1b9..6db6c6b1b9 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/background.png +++ b/tests/auto/declarative/qquickcanvasitem/data/background.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/broken.png b/tests/auto/declarative/qquickcanvasitem/data/broken.png Binary files differindex f2581017b4..f2581017b4 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/broken.png +++ b/tests/auto/declarative/qquickcanvasitem/data/broken.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/ggrr-256x256.png b/tests/auto/declarative/qquickcanvasitem/data/ggrr-256x256.png Binary files differindex 0342e4a384..0342e4a384 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/ggrr-256x256.png +++ b/tests/auto/declarative/qquickcanvasitem/data/ggrr-256x256.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/green-16x16.png b/tests/auto/declarative/qquickcanvasitem/data/green-16x16.png Binary files differindex e19a3ffddd..e19a3ffddd 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/green-16x16.png +++ b/tests/auto/declarative/qquickcanvasitem/data/green-16x16.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/green-1x1.png b/tests/auto/declarative/qquickcanvasitem/data/green-1x1.png Binary files differindex 862d1dd10c..862d1dd10c 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/green-1x1.png +++ b/tests/auto/declarative/qquickcanvasitem/data/green-1x1.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/green-256x256.png b/tests/auto/declarative/qquickcanvasitem/data/green-256x256.png Binary files differindex b06945c310..b06945c310 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/green-256x256.png +++ b/tests/auto/declarative/qquickcanvasitem/data/green-256x256.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/green-2x2.png b/tests/auto/declarative/qquickcanvasitem/data/green-2x2.png Binary files differindex adc059449c..adc059449c 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/green-2x2.png +++ b/tests/auto/declarative/qquickcanvasitem/data/green-2x2.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/green.png b/tests/auto/declarative/qquickcanvasitem/data/green.png Binary files differindex 28a1faab37..28a1faab37 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/green.png +++ b/tests/auto/declarative/qquickcanvasitem/data/green.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/grgr-256x256.png b/tests/auto/declarative/qquickcanvasitem/data/grgr-256x256.png Binary files differindex b8c7189d62..b8c7189d62 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/grgr-256x256.png +++ b/tests/auto/declarative/qquickcanvasitem/data/grgr-256x256.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/red-16x16.png b/tests/auto/declarative/qquickcanvasitem/data/red-16x16.png Binary files differindex 9038fef784..9038fef784 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/red-16x16.png +++ b/tests/auto/declarative/qquickcanvasitem/data/red-16x16.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/red.png b/tests/auto/declarative/qquickcanvasitem/data/red.png Binary files differindex a6e195d59c..a6e195d59c 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/red.png +++ b/tests/auto/declarative/qquickcanvasitem/data/red.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/redtransparent.png b/tests/auto/declarative/qquickcanvasitem/data/redtransparent.png Binary files differindex 75da08c3d6..75da08c3d6 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/redtransparent.png +++ b/tests/auto/declarative/qquickcanvasitem/data/redtransparent.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/rgrg-256x256.png b/tests/auto/declarative/qquickcanvasitem/data/rgrg-256x256.png Binary files differindex e6fba3daa5..e6fba3daa5 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/rgrg-256x256.png +++ b/tests/auto/declarative/qquickcanvasitem/data/rgrg-256x256.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/rrgg-256x256.png b/tests/auto/declarative/qquickcanvasitem/data/rrgg-256x256.png Binary files differindex 7f63515654..7f63515654 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/rrgg-256x256.png +++ b/tests/auto/declarative/qquickcanvasitem/data/rrgg-256x256.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/testhelper.js b/tests/auto/declarative/qquickcanvasitem/data/testhelper.js index bac0210e16..bac0210e16 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/testhelper.js +++ b/tests/auto/declarative/qquickcanvasitem/data/testhelper.js diff --git a/tests/auto/declarative/qsgcanvasitem/data/transparent.png b/tests/auto/declarative/qquickcanvasitem/data/transparent.png Binary files differindex 2b498699a8..2b498699a8 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/transparent.png +++ b/tests/auto/declarative/qquickcanvasitem/data/transparent.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/transparent50.png b/tests/auto/declarative/qquickcanvasitem/data/transparent50.png Binary files differindex 55f8e69325..55f8e69325 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/transparent50.png +++ b/tests/auto/declarative/qquickcanvasitem/data/transparent50.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_arc.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_arc.qml index 6006a5a4c0..6006a5a4c0 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_arc.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_arc.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_arcto.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_arcto.qml index cc1d88672b..cc1d88672b 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_arcto.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_arcto.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_canvas.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_canvas.qml index 70bedb2131..70bedb2131 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_canvas.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_canvas.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_composite.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_composite.qml index 11e1dce902..11e1dce902 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_composite.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_composite.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_drawimage.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_drawimage.qml index 3752f528be..3752f528be 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_drawimage.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_drawimage.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_fillStyle.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_fillStyle.qml index 8f5a78cec0..8f5a78cec0 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_fillStyle.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_fillStyle.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_fillrect.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_fillrect.qml index 2061647268..2061647268 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_fillrect.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_fillrect.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_gradient.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_gradient.qml index d454c2efe1..d454c2efe1 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_gradient.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_gradient.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_line.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_line.qml index baf9987ce3..baf9987ce3 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_line.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_line.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_path.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_path.qml index b04ccf5458..b04ccf5458 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_path.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_path.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_pattern.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_pattern.qml index dd5b6628e8..dd5b6628e8 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_pattern.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_pattern.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_pixel.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_pixel.qml index 1a3793d7a3..1a3793d7a3 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_pixel.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_pixel.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_shadow.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_shadow.qml index 4405ca6c0e..4405ca6c0e 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_shadow.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_shadow.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_state.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_state.qml index 8042cf6a1d..8042cf6a1d 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_state.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_state.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_strokeStyle.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_strokeStyle.qml index 6b42f8a770..6b42f8a770 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_strokeStyle.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_strokeStyle.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_text.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_text.qml index baeb17c9fb..baeb17c9fb 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_text.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_text.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/tst_transform.qml b/tests/auto/declarative/qquickcanvasitem/data/tst_transform.qml index 834a22f549..834a22f549 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/tst_transform.qml +++ b/tests/auto/declarative/qquickcanvasitem/data/tst_transform.qml diff --git a/tests/auto/declarative/qsgcanvasitem/data/yellow.png b/tests/auto/declarative/qquickcanvasitem/data/yellow.png Binary files differindex 51e8aaf38c..51e8aaf38c 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/yellow.png +++ b/tests/auto/declarative/qquickcanvasitem/data/yellow.png diff --git a/tests/auto/declarative/qsgcanvasitem/data/yellow75.png b/tests/auto/declarative/qquickcanvasitem/data/yellow75.png Binary files differindex 2bb82c9834..2bb82c9834 100644 --- a/tests/auto/declarative/qsgcanvasitem/data/yellow75.png +++ b/tests/auto/declarative/qquickcanvasitem/data/yellow75.png diff --git a/tests/auto/declarative/qsgcanvasitem/qsgcanvasitem.pro b/tests/auto/declarative/qquickcanvasitem/qquickcanvasitem.pro index 18c1ea6d4a..269aabbbac 100644 --- a/tests/auto/declarative/qsgcanvasitem/qsgcanvasitem.pro +++ b/tests/auto/declarative/qquickcanvasitem/qquickcanvasitem.pro @@ -1,10 +1,10 @@ QT += core-private gui-private declarative-private widgets TEMPLATE=app -TARGET=tst_qsgcanvasitem +TARGET=tst_qquickcanvasitem CONFIG+=insignificant_test CONFIG += warn_on qmltestcase -SOURCES += tst_qsgcanvasitem.cpp +SOURCES += tst_qquickcanvasitem.cpp importFiles.files = data importFiles.path = . diff --git a/tests/auto/declarative/qsgcanvasitem/tst_qsgcanvasitem.cpp b/tests/auto/declarative/qquickcanvasitem/tst_qquickcanvasitem.cpp index 680e45238e..57195babb7 100644 --- a/tests/auto/declarative/qsgcanvasitem/tst_qsgcanvasitem.cpp +++ b/tests/auto/declarative/qquickcanvasitem/tst_qquickcanvasitem.cpp @@ -39,4 +39,4 @@ ** ****************************************************************************/ #include <QtQuickTest/quicktest.h> -QUICK_TEST_MAIN(qsgcanvasitem) +QUICK_TEST_MAIN(qquickcanvasitem) diff --git a/tests/auto/declarative/qsgdrag/qsgdrag.pro b/tests/auto/declarative/qquickdrag/qquickdrag.pro index a799860be9..416ecdbe8e 100644 --- a/tests/auto/declarative/qsgdrag/qsgdrag.pro +++ b/tests/auto/declarative/qquickdrag/qquickdrag.pro @@ -1,8 +1,8 @@ -TARGET = tst_qsgdrag +TARGET = tst_qquickdrag CONFIG += testcase macx:CONFIG -= app_bundle -SOURCES += tst_qsgdrag.cpp +SOURCES += tst_qquickdrag.cpp CONFIG += parallel_test diff --git a/tests/auto/declarative/qsgdrag/tst_qsgdrag.cpp b/tests/auto/declarative/qquickdrag/tst_qquickdrag.cpp index 9719114662..6bc0866a6e 100644 --- a/tests/auto/declarative/qsgdrag/tst_qsgdrag.cpp +++ b/tests/auto/declarative/qquickdrag/tst_qquickdrag.cpp @@ -41,8 +41,8 @@ #include <QtTest/QtTest> #include <QtTest/QSignalSpy> -#include <QtDeclarative/qsgitem.h> -#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/qquickitem.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativeexpression.h> @@ -66,12 +66,12 @@ template <> void evaluate<void>(QObject *scope, const QString &expression) Q_DECLARE_METATYPE(Qt::DropActions) -class TestDropTarget : public QSGItem +class TestDropTarget : public QQuickItem { Q_OBJECT public: - TestDropTarget(QSGItem *parent = 0) - : QSGItem(parent) + TestDropTarget(QQuickItem *parent = 0) + : QQuickItem(parent) , enterEvents(0) , moveEvents(0) , leaveEvents(0) @@ -144,7 +144,7 @@ public: bool accept; }; -class tst_QSGDrag: public QObject +class tst_QQuickDrag: public QObject { Q_OBJECT private slots: @@ -164,19 +164,19 @@ private: QDeclarativeEngine engine; }; -void tst_QSGDrag::initTestCase() +void tst_QQuickDrag::initTestCase() { } -void tst_QSGDrag::cleanupTestCase() +void tst_QQuickDrag::cleanupTestCase() { } -void tst_QSGDrag::active() +void tst_QQuickDrag::active() { - QSGCanvas canvas; + QQuickCanvas canvas; TestDropTarget dropTarget(canvas.rootItem()); dropTarget.setSize(QSizeF(100, 100)); QDeclarativeComponent component(&engine); @@ -189,7 +189,7 @@ void tst_QSGDrag::active() "width: 10; height: 10\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *item = qobject_cast<QSGItem *>(object.data()); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); item->setParentItem(&dropTarget); @@ -244,8 +244,8 @@ void tst_QSGDrag::active() QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(0)); QCOMPARE(dropTarget.enterEvents, 0); QCOMPARE(dropTarget.leaveEvents, 1); - // Enter events aren't sent to items without the QSGItem::ItemAcceptsDrops flag. - dropTarget.setFlags(QSGItem::Flags()); + // Enter events aren't sent to items without the QQuickItem::ItemAcceptsDrops flag. + dropTarget.setFlags(QQuickItem::Flags()); dropTarget.reset(); evaluate<void>(item, "Drag.active = true"); @@ -263,7 +263,7 @@ void tst_QSGDrag::active() QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(0)); QCOMPARE(dropTarget.enterEvents, 0); QCOMPARE(dropTarget.leaveEvents, 0); - dropTarget.setFlags(QSGItem::ItemAcceptsDrops); + dropTarget.setFlags(QQuickItem::ItemAcceptsDrops); dropTarget.reset(); evaluate<void>(item, "Drag.active = true"); @@ -273,7 +273,7 @@ void tst_QSGDrag::active() QCOMPARE(evaluate<QObject *>(item, "dragTarget"), static_cast<QObject *>(&dropTarget)); QCOMPARE(dropTarget.enterEvents, 1); QCOMPARE(dropTarget.leaveEvents, 0); - dropTarget.setFlags(QSGItem::Flags()); + dropTarget.setFlags(QQuickItem::Flags()); dropTarget.reset(); evaluate<void>(item, "Drag.active = false"); @@ -284,7 +284,7 @@ void tst_QSGDrag::active() QCOMPARE(dropTarget.enterEvents, 0); QCOMPARE(dropTarget.leaveEvents, 1); // Follow up events aren't sent to items if the enter event isn't accepted. - dropTarget.setFlags(QSGItem::ItemAcceptsDrops); + dropTarget.setFlags(QQuickItem::ItemAcceptsDrops); dropTarget.accept = false; dropTarget.reset(); @@ -359,9 +359,9 @@ void tst_QSGDrag::active() QCOMPARE(dropTarget.enterEvents, 0); QCOMPARE(dropTarget.leaveEvents, 0); } -void tst_QSGDrag::drop() +void tst_QQuickDrag::drop() { - QSGCanvas canvas; + QQuickCanvas canvas; TestDropTarget outerTarget(canvas.rootItem()); outerTarget.setSize(QSizeF(100, 100)); outerTarget.acceptAction = Qt::CopyAction; @@ -378,7 +378,7 @@ void tst_QSGDrag::drop() "width: 10; height: 10\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *item = qobject_cast<QSGItem *>(object.data()); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); item->setParentItem(&outerTarget); @@ -424,7 +424,7 @@ void tst_QSGDrag::drop() // Inner target doesn't accept enter so drop goes directly to outer. innerTarget.accept = true; - innerTarget.setFlags(QSGItem::Flags()); + innerTarget.setFlags(QQuickItem::Flags()); innerTarget.reset(); outerTarget.reset(); evaluate<void>(item, "Drag.active = true"); @@ -478,9 +478,9 @@ void tst_QSGDrag::drop() QCOMPARE(innerTarget.enterEvents, 0); QCOMPARE(innerTarget.leaveEvents, 0); QCOMPARE(innerTarget.dropEvents, 0); } -void tst_QSGDrag::move() +void tst_QQuickDrag::move() { - QSGCanvas canvas; + QQuickCanvas canvas; TestDropTarget outerTarget(canvas.rootItem()); outerTarget.setSize(QSizeF(100, 100)); TestDropTarget leftTarget(&outerTarget); @@ -499,7 +499,7 @@ void tst_QSGDrag::move() "width: 10; height: 10\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *item = qobject_cast<QSGItem *>(object.data()); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); item->setParentItem(&outerTarget); @@ -589,8 +589,8 @@ void tst_QSGDrag::move() QCOMPARE(rightTarget.enterEvents, 0); QCOMPARE(rightTarget.leaveEvents, 0); QCOMPARE(rightTarget.moveEvents, 0); QCOMPARE(outerTarget.position.x(), qreal(60)); QCOMPARE(outerTarget.position.y(), qreal(50)); - // Clear the QSGItem::ItemAcceptsDrops flag from the outer target after it accepted an enter event. - outerTarget.setFlags(QSGItem::Flags()); + // Clear the QQuickItem::ItemAcceptsDrops flag from the outer target after it accepted an enter event. + outerTarget.setFlags(QQuickItem::Flags()); outerTarget.reset(); leftTarget.reset(); rightTarget.reset(); item->setPos(QPointF(40, 50)); @@ -601,8 +601,8 @@ void tst_QSGDrag::move() QCOMPARE(rightTarget.enterEvents, 0); QCOMPARE(rightTarget.leaveEvents, 0); QCOMPARE(rightTarget.moveEvents, 0); QCOMPARE(outerTarget.position.x(), qreal(40)); QCOMPARE(outerTarget.position.y(), qreal(50)); - // Clear the QSGItem::ItemAcceptsDrops flag from the left target before it accepts an enter event. - leftTarget.setFlags(QSGItem::Flags()); + // Clear the QQuickItem::ItemAcceptsDrops flag from the left target before it accepts an enter event. + leftTarget.setFlags(QQuickItem::Flags()); outerTarget.reset(); leftTarget.reset(); rightTarget.reset(); item->setPos(QPointF(25, 50)); @@ -615,9 +615,9 @@ void tst_QSGDrag::move() } -void tst_QSGDrag::hotSpot() +void tst_QQuickDrag::hotSpot() { - QSGCanvas canvas; + QQuickCanvas canvas; TestDropTarget dropTarget(canvas.rootItem()); dropTarget.setSize(QSizeF(100, 100)); QDeclarativeComponent component(&engine); @@ -630,7 +630,7 @@ void tst_QSGDrag::hotSpot() "width: 10; height: 10\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *item = qobject_cast<QSGItem *>(object.data()); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); item->setParentItem(&dropTarget); @@ -671,9 +671,9 @@ void tst_QSGDrag::hotSpot() QCOMPARE(dropTarget.position.y(), qreal(30)); } -void tst_QSGDrag::supportedActions() +void tst_QQuickDrag::supportedActions() { - QSGCanvas canvas; + QQuickCanvas canvas; TestDropTarget dropTarget(canvas.rootItem()); dropTarget.setSize(QSizeF(100, 100)); QDeclarativeComponent component(&engine); @@ -685,7 +685,7 @@ void tst_QSGDrag::supportedActions() "width: 10; height: 10\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *item = qobject_cast<QSGItem *>(object.data()); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); item->setParentItem(&dropTarget); @@ -719,9 +719,9 @@ void tst_QSGDrag::supportedActions() QCOMPARE(dropTarget.supportedActions, Qt::MoveAction); } -void tst_QSGDrag::proposedAction() +void tst_QQuickDrag::proposedAction() { - QSGCanvas canvas; + QQuickCanvas canvas; TestDropTarget dropTarget(canvas.rootItem()); dropTarget.setSize(QSizeF(100, 100)); QDeclarativeComponent component(&engine); @@ -733,7 +733,7 @@ void tst_QSGDrag::proposedAction() "width: 10; height: 10\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *item = qobject_cast<QSGItem *>(object.data()); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); item->setParentItem(&dropTarget); @@ -767,7 +767,7 @@ void tst_QSGDrag::proposedAction() QCOMPARE(dropTarget.proposedAction, Qt::LinkAction); } -void tst_QSGDrag::keys() +void tst_QQuickDrag::keys() { QDeclarativeComponent component(&engine); component.setData( @@ -778,7 +778,7 @@ void tst_QSGDrag::keys() "width: 10; height: 10\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *item = qobject_cast<QSGItem *>(object.data()); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); // QCOMPARE(evaluate<QStringList>(item, "Drag.keys"), QStringList()); @@ -791,7 +791,7 @@ void tst_QSGDrag::keys() QCOMPARE(item->property("keys").toStringList(), QStringList() << "red" << "blue"); } -void tst_QSGDrag::source() +void tst_QQuickDrag::source() { QDeclarativeComponent component(&engine); @@ -804,13 +804,13 @@ void tst_QSGDrag::source() "Item { id: proxySource; objectName: \"proxySource\" }\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *item = qobject_cast<QSGItem *>(object.data()); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item); QCOMPARE(evaluate<QObject *>(item, "Drag.source"), static_cast<QObject *>(item)); QCOMPARE(evaluate<QObject *>(item, "source"), static_cast<QObject *>(item)); - QSGItem *proxySource = item->findChild<QSGItem *>("proxySource"); + QQuickItem *proxySource = item->findChild<QQuickItem *>("proxySource"); QVERIFY(proxySource); evaluate<void>(item, "Drag.source = proxySource"); @@ -822,6 +822,6 @@ void tst_QSGDrag::source() QCOMPARE(evaluate<QObject *>(item, "source"), static_cast<QObject *>(item)); } -QTEST_MAIN(tst_QSGDrag) +QTEST_MAIN(tst_QQuickDrag) -#include "tst_qsgdrag.moc" +#include "tst_qquickdrag.moc" diff --git a/tests/auto/declarative/qsgdroparea/qsgdroparea.pro b/tests/auto/declarative/qquickdroparea/qquickdroparea.pro index f07071f9dc..eff08a2e94 100644 --- a/tests/auto/declarative/qsgdroparea/qsgdroparea.pro +++ b/tests/auto/declarative/qquickdroparea/qquickdroparea.pro @@ -1,8 +1,8 @@ -TARGET = tst_qsgdroparea +TARGET = tst_qquickdroparea CONFIG += testcase macx:CONFIG -= app_bundle -SOURCES += tst_qsgdroparea.cpp +SOURCES += tst_qquickdroparea.cpp CONFIG += parallel_test diff --git a/tests/auto/declarative/qsgdroparea/tst_qsgdroparea.cpp b/tests/auto/declarative/qquickdroparea/tst_qquickdroparea.cpp index 1c303b4b3e..0147536abf 100644 --- a/tests/auto/declarative/qsgdroparea/tst_qsgdroparea.cpp +++ b/tests/auto/declarative/qquickdroparea/tst_qquickdroparea.cpp @@ -41,8 +41,8 @@ #include <QtTest/QtTest> #include <QtTest/QSignalSpy> -#include <QtDeclarative/qsgitem.h> -#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/qquickitem.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativeexpression.h> @@ -66,7 +66,7 @@ template <> void evaluate<void>(QObject *scope, const QString &expression) qWarning() << expr.error().toString(); } -class tst_QSGDropArea: public QObject +class tst_QQuickDropArea: public QObject { Q_OBJECT private slots: @@ -89,19 +89,19 @@ private: QDeclarativeEngine engine; }; -void tst_QSGDropArea::initTestCase() +void tst_QQuickDropArea::initTestCase() { } -void tst_QSGDropArea::cleanupTestCase() +void tst_QQuickDropArea::cleanupTestCase() { } -void tst_QSGDropArea::containsDrag_internal() +void tst_QQuickDropArea::containsDrag_internal() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -119,11 +119,11 @@ void tst_QSGDropArea::containsDrag_internal() "}\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); QVERIFY(dropArea); dropArea->setParentItem(canvas.rootItem()); - QSGItem *dragItem = dropArea->findChild<QSGItem *>("dragItem"); + QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); @@ -168,9 +168,9 @@ void tst_QSGDropArea::containsDrag_internal() evaluate<void>(dragItem, "Drag.active = false"); } -void tst_QSGDropArea::containsDrag_external() +void tst_QQuickDropArea::containsDrag_external() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -183,11 +183,12 @@ void tst_QSGDropArea::containsDrag_external() "onExited: {++exitEvents}\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); + QVERIFY(dropArea); dropArea->setParentItem(canvas.rootItem()); QMimeData data; - QSGCanvas alternateCanvas; + QQuickCanvas alternateCanvas; QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), false); @@ -230,9 +231,9 @@ void tst_QSGDropArea::containsDrag_external() QWindowSystemInterface::handleDrop(&canvas, &data, QPoint(150, 50)); } -void tst_QSGDropArea::keys_internal() +void tst_QQuickDropArea::keys_internal() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -250,10 +251,11 @@ void tst_QSGDropArea::keys_internal() "}\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); + QVERIFY(dropArea); dropArea->setParentItem(canvas.rootItem()); - QSGItem *dragItem = dropArea->findChild<QSGItem *>("dragItem"); + QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); @@ -336,9 +338,9 @@ void tst_QSGDropArea::keys_internal() QCOMPARE(dropArea->property("dragKeys").toStringList(), QStringList() << "red" << "blue"); } -void tst_QSGDropArea::keys_external() +void tst_QQuickDropArea::keys_external() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -350,11 +352,11 @@ void tst_QSGDropArea::keys_external() "onEntered: {++enterEvents; dragKeys = drag.keys }\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); dropArea->setParentItem(canvas.rootItem()); QMimeData data; - QSGCanvas alternateCanvas; + QQuickCanvas alternateCanvas; data.setData("text/x-red", "red"); data.setData("text/x-blue", "blue"); @@ -437,9 +439,9 @@ void tst_QSGDropArea::keys_external() QWindowSystemInterface::handleDrop(&canvas, &data, QPoint(50, 50)); } -void tst_QSGDropArea::source_internal() +void tst_QQuickDropArea::source_internal() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -456,13 +458,14 @@ void tst_QSGDropArea::source_internal() "Item { id: dragSource; objectName: \"dragSource\" }\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); + QVERIFY(dropArea); dropArea->setParentItem(canvas.rootItem()); - QSGItem *dragItem = dropArea->findChild<QSGItem *>("dragItem"); + QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); - QSGItem *dragSource = dropArea->findChild<QSGItem *>("dragSource"); + QQuickItem *dragSource = dropArea->findChild<QQuickItem *>("dragSource"); QVERIFY(dragSource); QCOMPARE(evaluate<QObject *>(dropArea, "source"), static_cast<QObject *>(0)); @@ -493,13 +496,13 @@ void tst_QSGDropArea::source_internal() // Setting a source can't be emulated using the QWindowSystemInterface API. -//void tst_QSGDropArea::source_external() +//void tst_QQuickDropArea::source_external() //{ //} -void tst_QSGDropArea::position_internal() +void tst_QQuickDropArea::position_internal() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -520,10 +523,11 @@ void tst_QSGDropArea::position_internal() "}\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); + QVERIFY(dropArea); dropArea->setParentItem(canvas.rootItem()); - QSGItem *dragItem = dropArea->findChild<QSGItem *>("dragItem"); + QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); evaluate<void>(dragItem, "Drag.active = true"); @@ -561,9 +565,9 @@ void tst_QSGDropArea::position_internal() evaluate<void>(dragItem, "Drag.active = false"); } -void tst_QSGDropArea::position_external() +void tst_QQuickDropArea::position_external() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -579,7 +583,8 @@ void tst_QSGDropArea::position_external() "onPositionChanged: {++moveEvents; eventX = drag.x; eventY = drag.y}\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); + QVERIFY(dropArea); dropArea->setParentItem(canvas.rootItem()); QMimeData data; @@ -619,9 +624,9 @@ void tst_QSGDropArea::position_external() QWindowSystemInterface::handleDrop(&canvas, &data, QPoint(75, 25)); } -void tst_QSGDropArea::drop_internal() +void tst_QQuickDropArea::drop_internal() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -655,10 +660,11 @@ void tst_QSGDropArea::drop_internal() "}\n" "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea = qobject_cast<QQuickItem *>(object.data()); + QVERIFY(dropArea); dropArea->setParentItem(canvas.rootItem()); - QSGItem *dragItem = dropArea->findChild<QSGItem *>("dragItem"); + QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem"); QVERIFY(dragItem); evaluate<void>(dragItem, "Drag.active = true"); @@ -752,13 +758,13 @@ void tst_QSGDropArea::drop_internal() // Setting the supportedActions can't be emulated using the QWindowSystemInterface API. -//void tst_QSGDropArea::drop_external() +//void tst_QQuickDropArea::drop_external() //{ //} -void tst_QSGDropArea::simultaneousDrags() +void tst_QQuickDropArea::simultaneousDrags() { - QSGCanvas canvas; + QQuickCanvas canvas; QDeclarativeComponent component(&engine); component.setData( "import QtQuick 2.0\n" @@ -793,23 +799,24 @@ void tst_QSGDropArea::simultaneousDrags() "}", QUrl()); QScopedPointer<QObject> object(component.create()); - QSGItem *dropArea1 = qobject_cast<QSGItem *>(object.data()); + QQuickItem *dropArea1 = qobject_cast<QQuickItem *>(object.data()); + QVERIFY(dropArea1); dropArea1->setParentItem(canvas.rootItem()); - QSGItem *dropArea2 = dropArea1->findChild<QSGItem *>("dropArea2"); + QQuickItem *dropArea2 = dropArea1->findChild<QQuickItem *>("dropArea2"); QVERIFY(dropArea2); - QSGItem *dragItem1 = dropArea1->findChild<QSGItem *>("dragItem1"); + QQuickItem *dragItem1 = dropArea1->findChild<QQuickItem *>("dragItem1"); QVERIFY(dragItem1); - QSGItem *dragItem2 = dropArea1->findChild<QSGItem *>("dragItem2"); + QQuickItem *dragItem2 = dropArea1->findChild<QQuickItem *>("dragItem2"); QVERIFY(dragItem2); QMimeData data; data.setData("text/x-red", "red"); data.setData("text/x-blue", "blue"); - QSGCanvas alternateCanvas; + QQuickCanvas alternateCanvas; // Mixed internal drags. evaluate<void>(dropArea1, "{ enterEvents = 0; exitEvents = 0 }"); @@ -1105,6 +1112,6 @@ void tst_QSGDropArea::simultaneousDrags() QWindowSystemInterface::handleDrop(&alternateCanvas, &data, QPoint(50, 50)); } -QTEST_MAIN(tst_QSGDropArea) +QTEST_MAIN(tst_QQuickDropArea) -#include "tst_qsgdroparea.moc" +#include "tst_qquickdroparea.moc" diff --git a/tests/auto/declarative/qsgflickable/data/disabled.qml b/tests/auto/declarative/qquickflickable/data/disabled.qml index 9b679827c7..9b679827c7 100644 --- a/tests/auto/declarative/qsgflickable/data/disabled.qml +++ b/tests/auto/declarative/qquickflickable/data/disabled.qml diff --git a/tests/auto/declarative/qsgflickable/data/flickable01.qml b/tests/auto/declarative/qquickflickable/data/flickable01.qml index cbec44bb4f..cbec44bb4f 100644 --- a/tests/auto/declarative/qsgflickable/data/flickable01.qml +++ b/tests/auto/declarative/qquickflickable/data/flickable01.qml diff --git a/tests/auto/declarative/qsgflickable/data/flickable02.qml b/tests/auto/declarative/qquickflickable/data/flickable02.qml index 80caa32da5..80caa32da5 100644 --- a/tests/auto/declarative/qsgflickable/data/flickable02.qml +++ b/tests/auto/declarative/qquickflickable/data/flickable02.qml diff --git a/tests/auto/declarative/qsgflickable/data/flickable03.qml b/tests/auto/declarative/qquickflickable/data/flickable03.qml index ebc49ba90a..ebc49ba90a 100644 --- a/tests/auto/declarative/qsgflickable/data/flickable03.qml +++ b/tests/auto/declarative/qquickflickable/data/flickable03.qml diff --git a/tests/auto/declarative/qsgflickable/data/flickable04.qml b/tests/auto/declarative/qquickflickable/data/flickable04.qml index b2f30b84ec..b2f30b84ec 100644 --- a/tests/auto/declarative/qsgflickable/data/flickable04.qml +++ b/tests/auto/declarative/qquickflickable/data/flickable04.qml diff --git a/tests/auto/declarative/qsgflickable/data/flickableqgraphicswidget.qml b/tests/auto/declarative/qquickflickable/data/flickableqgraphicswidget.qml index bb8f1eefc6..bb8f1eefc6 100644 --- a/tests/auto/declarative/qsgflickable/data/flickableqgraphicswidget.qml +++ b/tests/auto/declarative/qquickflickable/data/flickableqgraphicswidget.qml diff --git a/tests/auto/declarative/qsgflickable/data/margins.qml b/tests/auto/declarative/qquickflickable/data/margins.qml index 4866bd8301..4866bd8301 100644 --- a/tests/auto/declarative/qsgflickable/data/margins.qml +++ b/tests/auto/declarative/qquickflickable/data/margins.qml diff --git a/tests/auto/declarative/qsgflickable/data/nestedPressDelay.qml b/tests/auto/declarative/qquickflickable/data/nestedPressDelay.qml index 60dadcc73c..60dadcc73c 100644 --- a/tests/auto/declarative/qsgflickable/data/nestedPressDelay.qml +++ b/tests/auto/declarative/qquickflickable/data/nestedPressDelay.qml diff --git a/tests/auto/declarative/qsgflickable/data/resize.qml b/tests/auto/declarative/qquickflickable/data/resize.qml index 1a9ef54107..1a9ef54107 100644 --- a/tests/auto/declarative/qsgflickable/data/resize.qml +++ b/tests/auto/declarative/qquickflickable/data/resize.qml diff --git a/tests/auto/declarative/qsgflickable/data/wheel.qml b/tests/auto/declarative/qquickflickable/data/wheel.qml index 2928bbcd72..2928bbcd72 100644 --- a/tests/auto/declarative/qsgflickable/data/wheel.qml +++ b/tests/auto/declarative/qquickflickable/data/wheel.qml diff --git a/tests/auto/declarative/qsgflickable/qsgflickable.pro b/tests/auto/declarative/qquickflickable/qquickflickable.pro index 48cf8b6335..ba951cc051 100644 --- a/tests/auto/declarative/qsgflickable/qsgflickable.pro +++ b/tests/auto/declarative/qquickflickable/qquickflickable.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgflickable +TARGET = tst_qquickflickable macx:CONFIG -= app_bundle -SOURCES += tst_qsgflickable.cpp +SOURCES += tst_qquickflickable.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp b/tests/auto/declarative/qquickflickable/tst_qquickflickable.cpp index f8d7bfd28d..2f155e298e 100644 --- a/tests/auto/declarative/qsgflickable/tst_qsgflickable.cpp +++ b/tests/auto/declarative/qquickflickable/tst_qquickflickable.cpp @@ -42,18 +42,18 @@ #include <QtTest/QSignalSpy> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsgflickable_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquickflickable_p.h> #include <private/qdeclarativevaluetype_p.h> #include <math.h> #include "../shared/util.h" #include <QtOpenGL/QGLShaderProgram> -class tst_qsgflickable : public QObject +class tst_qquickflickable : public QObject { Q_OBJECT public: - tst_qsgflickable(); + tst_qquickflickable(); private slots: void initTestCase(); @@ -80,30 +80,30 @@ private slots: private: QDeclarativeEngine engine; - void flick(QSGView *canvas, const QPoint &from, const QPoint &to, int duration); + void flick(QQuickView *canvas, const QPoint &from, const QPoint &to, int duration); template<typename T> - T *findItem(QSGItem *parent, const QString &objectName); + T *findItem(QQuickItem *parent, const QString &objectName); }; -tst_qsgflickable::tst_qsgflickable() +tst_qquickflickable::tst_qquickflickable() { } -void tst_qsgflickable::initTestCase() +void tst_qquickflickable::initTestCase() { } -void tst_qsgflickable::cleanupTestCase() +void tst_qquickflickable::cleanupTestCase() { } -void tst_qsgflickable::create() +void tst_qquickflickable::create() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("flickable01.qml"))); - QSGFlickable *obj = qobject_cast<QSGFlickable*>(c.create()); + QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(c.create()); QVERIFY(obj != 0); QCOMPARE(obj->isAtXBeginning(), true); @@ -117,18 +117,18 @@ void tst_qsgflickable::create() QCOMPARE(obj->verticalVelocity(), 0.); QCOMPARE(obj->isInteractive(), true); - QCOMPARE(obj->boundsBehavior(), QSGFlickable::DragAndOvershootBounds); + QCOMPARE(obj->boundsBehavior(), QQuickFlickable::DragAndOvershootBounds); QCOMPARE(obj->pressDelay(), 0); QCOMPARE(obj->maximumFlickVelocity(), 2500.); delete obj; } -void tst_qsgflickable::horizontalViewportSize() +void tst_qquickflickable::horizontalViewportSize() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("flickable02.qml"))); - QSGFlickable *obj = qobject_cast<QSGFlickable*>(c.create()); + QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(c.create()); QVERIFY(obj != 0); QCOMPARE(obj->contentWidth(), 800.); @@ -141,11 +141,11 @@ void tst_qsgflickable::horizontalViewportSize() delete obj; } -void tst_qsgflickable::verticalViewportSize() +void tst_qquickflickable::verticalViewportSize() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("flickable03.qml"))); - QSGFlickable *obj = qobject_cast<QSGFlickable*>(c.create()); + QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(c.create()); QVERIFY(obj != 0); QCOMPARE(obj->contentWidth(), 200.); @@ -158,15 +158,15 @@ void tst_qsgflickable::verticalViewportSize() delete obj; } -void tst_qsgflickable::properties() +void tst_qquickflickable::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("flickable04.qml"))); - QSGFlickable *obj = qobject_cast<QSGFlickable*>(c.create()); + QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(c.create()); QVERIFY(obj != 0); QCOMPARE(obj->isInteractive(), false); - QCOMPARE(obj->boundsBehavior(), QSGFlickable::StopAtBounds); + QCOMPARE(obj->boundsBehavior(), QQuickFlickable::StopAtBounds); QCOMPARE(obj->pressDelay(), 200); QCOMPARE(obj->maximumFlickVelocity(), 2000.); @@ -177,40 +177,40 @@ void tst_qsgflickable::properties() delete obj; } -void tst_qsgflickable::boundsBehavior() +void tst_qquickflickable::boundsBehavior() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { boundsBehavior: Flickable.StopAtBounds }", QUrl::fromLocalFile("")); - QSGFlickable *flickable = qobject_cast<QSGFlickable*>(component.create()); + QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create()); QSignalSpy spy(flickable, SIGNAL(boundsBehaviorChanged())); QVERIFY(flickable); - QVERIFY(flickable->boundsBehavior() == QSGFlickable::StopAtBounds); + QVERIFY(flickable->boundsBehavior() == QQuickFlickable::StopAtBounds); - flickable->setBoundsBehavior(QSGFlickable::DragAndOvershootBounds); - QVERIFY(flickable->boundsBehavior() == QSGFlickable::DragAndOvershootBounds); + flickable->setBoundsBehavior(QQuickFlickable::DragAndOvershootBounds); + QVERIFY(flickable->boundsBehavior() == QQuickFlickable::DragAndOvershootBounds); QCOMPARE(spy.count(),1); - flickable->setBoundsBehavior(QSGFlickable::DragAndOvershootBounds); + flickable->setBoundsBehavior(QQuickFlickable::DragAndOvershootBounds); QCOMPARE(spy.count(),1); - flickable->setBoundsBehavior(QSGFlickable::DragOverBounds); - QVERIFY(flickable->boundsBehavior() == QSGFlickable::DragOverBounds); + flickable->setBoundsBehavior(QQuickFlickable::DragOverBounds); + QVERIFY(flickable->boundsBehavior() == QQuickFlickable::DragOverBounds); QCOMPARE(spy.count(),2); - flickable->setBoundsBehavior(QSGFlickable::DragOverBounds); + flickable->setBoundsBehavior(QQuickFlickable::DragOverBounds); QCOMPARE(spy.count(),2); - flickable->setBoundsBehavior(QSGFlickable::StopAtBounds); - QVERIFY(flickable->boundsBehavior() == QSGFlickable::StopAtBounds); + flickable->setBoundsBehavior(QQuickFlickable::StopAtBounds); + QVERIFY(flickable->boundsBehavior() == QQuickFlickable::StopAtBounds); QCOMPARE(spy.count(),3); - flickable->setBoundsBehavior(QSGFlickable::StopAtBounds); + flickable->setBoundsBehavior(QQuickFlickable::StopAtBounds); QCOMPARE(spy.count(),3); } -void tst_qsgflickable::maximumFlickVelocity() +void tst_qquickflickable::maximumFlickVelocity() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { maximumFlickVelocity: 1.0; }", QUrl::fromLocalFile("")); - QSGFlickable *flickable = qobject_cast<QSGFlickable*>(component.create()); + QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create()); QSignalSpy spy(flickable, SIGNAL(maximumFlickVelocityChanged())); QVERIFY(flickable); @@ -223,11 +223,11 @@ void tst_qsgflickable::maximumFlickVelocity() QCOMPARE(spy.count(),1); } -void tst_qsgflickable::flickDeceleration() +void tst_qquickflickable::flickDeceleration() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { flickDeceleration: 1.0; }", QUrl::fromLocalFile("")); - QSGFlickable *flickable = qobject_cast<QSGFlickable*>(component.create()); + QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create()); QSignalSpy spy(flickable, SIGNAL(flickDecelerationChanged())); QVERIFY(flickable); @@ -240,11 +240,11 @@ void tst_qsgflickable::flickDeceleration() QCOMPARE(spy.count(),1); } -void tst_qsgflickable::pressDelay() +void tst_qquickflickable::pressDelay() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { pressDelay: 100; }", QUrl::fromLocalFile("")); - QSGFlickable *flickable = qobject_cast<QSGFlickable*>(component.create()); + QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create()); QSignalSpy spy(flickable, SIGNAL(pressDelayChanged())); QVERIFY(flickable); @@ -258,18 +258,18 @@ void tst_qsgflickable::pressDelay() } // QTBUG-17361 -void tst_qsgflickable::nestedPressDelay() +void tst_qquickflickable::nestedPressDelay() { - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->setSource(QUrl::fromLocalFile(TESTDATA("nestedPressDelay.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGFlickable *outer = qobject_cast<QSGFlickable*>(canvas->rootObject()); + QQuickFlickable *outer = qobject_cast<QQuickFlickable*>(canvas->rootObject()); QVERIFY(outer != 0); - QSGFlickable *inner = canvas->rootObject()->findChild<QSGFlickable*>("innerFlickable"); + QQuickFlickable *inner = canvas->rootObject()->findChild<QQuickFlickable*>("innerFlickable"); QVERIFY(inner != 0); QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(150, 150)); @@ -285,40 +285,40 @@ void tst_qsgflickable::nestedPressDelay() delete canvas; } -void tst_qsgflickable::flickableDirection() +void tst_qquickflickable::flickableDirection() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Flickable { flickableDirection: Flickable.VerticalFlick; }", QUrl::fromLocalFile("")); - QSGFlickable *flickable = qobject_cast<QSGFlickable*>(component.create()); + QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(component.create()); QSignalSpy spy(flickable, SIGNAL(flickableDirectionChanged())); QVERIFY(flickable); - QCOMPARE(flickable->flickableDirection(), QSGFlickable::VerticalFlick); + QCOMPARE(flickable->flickableDirection(), QQuickFlickable::VerticalFlick); - flickable->setFlickableDirection(QSGFlickable::HorizontalAndVerticalFlick); - QCOMPARE(flickable->flickableDirection(), QSGFlickable::HorizontalAndVerticalFlick); + flickable->setFlickableDirection(QQuickFlickable::HorizontalAndVerticalFlick); + QCOMPARE(flickable->flickableDirection(), QQuickFlickable::HorizontalAndVerticalFlick); QCOMPARE(spy.count(),1); - flickable->setFlickableDirection(QSGFlickable::AutoFlickDirection); - QCOMPARE(flickable->flickableDirection(), QSGFlickable::AutoFlickDirection); + flickable->setFlickableDirection(QQuickFlickable::AutoFlickDirection); + QCOMPARE(flickable->flickableDirection(), QQuickFlickable::AutoFlickDirection); QCOMPARE(spy.count(),2); - flickable->setFlickableDirection(QSGFlickable::HorizontalFlick); - QCOMPARE(flickable->flickableDirection(), QSGFlickable::HorizontalFlick); + flickable->setFlickableDirection(QQuickFlickable::HorizontalFlick); + QCOMPARE(flickable->flickableDirection(), QQuickFlickable::HorizontalFlick); QCOMPARE(spy.count(),3); - flickable->setFlickableDirection(QSGFlickable::HorizontalFlick); - QCOMPARE(flickable->flickableDirection(), QSGFlickable::HorizontalFlick); + flickable->setFlickableDirection(QQuickFlickable::HorizontalFlick); + QCOMPARE(flickable->flickableDirection(), QQuickFlickable::HorizontalFlick); QCOMPARE(spy.count(),3); } // QtQuick 1.1 -void tst_qsgflickable::resizeContent() +void tst_qquickflickable::resizeContent() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("resize.qml"))); - QSGItem *root = qobject_cast<QSGItem*>(c.create()); - QSGFlickable *obj = findItem<QSGFlickable>(root, "flick"); + QQuickItem *root = qobject_cast<QQuickItem*>(c.create()); + QQuickFlickable *obj = findItem<QQuickFlickable>(root, "flick"); QVERIFY(obj != 0); QCOMPARE(obj->contentX(), 0.); @@ -337,12 +337,12 @@ void tst_qsgflickable::resizeContent() } // QtQuick 1.1 -void tst_qsgflickable::returnToBounds() +void tst_qquickflickable::returnToBounds() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("resize.qml"))); - QSGItem *root = qobject_cast<QSGItem*>(c.create()); - QSGFlickable *obj = findItem<QSGFlickable>(root, "flick"); + QQuickItem *root = qobject_cast<QQuickItem*>(c.create()); + QQuickFlickable *obj = findItem<QQuickFlickable>(root, "flick"); QVERIFY(obj != 0); QCOMPARE(obj->contentX(), 0.); @@ -363,15 +363,15 @@ void tst_qsgflickable::returnToBounds() delete root; } -void tst_qsgflickable::wheel() +void tst_qquickflickable::wheel() { - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->setSource(QUrl::fromLocalFile(TESTDATA("wheel.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGFlickable *flick = canvas->rootObject()->findChild<QSGFlickable*>("flick"); + QQuickFlickable *flick = canvas->rootObject()->findChild<QQuickFlickable*>("flick"); QVERIFY(flick != 0); { @@ -398,16 +398,16 @@ void tst_qsgflickable::wheel() delete canvas; } -void tst_qsgflickable::movingAndDragging() +void tst_qquickflickable::movingAndDragging() { - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->setSource(QUrl::fromLocalFile(TESTDATA("flickable03.qml"))); canvas->show(); canvas->requestActivateWindow(); QTest::qWaitForWindowShown(canvas); QVERIFY(canvas->rootObject() != 0); - QSGFlickable *flickable = qobject_cast<QSGFlickable*>(canvas->rootObject()); + QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(canvas->rootObject()); QVERIFY(flickable != 0); QSignalSpy vDragSpy(flickable, SIGNAL(draggingVerticallyChanged())); @@ -503,15 +503,15 @@ void tst_qsgflickable::movingAndDragging() delete canvas; } -void tst_qsgflickable::disabled() +void tst_qquickflickable::disabled() { - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->setSource(QUrl::fromLocalFile(TESTDATA("disabled.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGFlickable *flick = canvas->rootObject()->findChild<QSGFlickable*>("flickable"); + QQuickFlickable *flick = canvas->rootObject()->findChild<QQuickFlickable*>("flickable"); QVERIFY(flick != 0); QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(50, 90)); @@ -531,19 +531,19 @@ void tst_qsgflickable::disabled() QTRY_VERIFY(canvas->rootObject()->property("clicked").toBool() == true); } -void tst_qsgflickable::flickVelocity() +void tst_qquickflickable::flickVelocity() { #ifdef Q_WS_MAC QSKIP("Producing flicks on Mac CI impossible due to timing problems"); #endif - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->setSource(QUrl::fromLocalFile(TESTDATA("flickable03.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGFlickable *flickable = qobject_cast<QSGFlickable*>(canvas->rootObject()); + QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(canvas->rootObject()); QVERIFY(flickable != 0); // flick up @@ -559,12 +559,12 @@ void tst_qsgflickable::flickVelocity() delete canvas; } -void tst_qsgflickable::margins() +void tst_qquickflickable::margins() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("margins.qml"))); - QSGItem *root = qobject_cast<QSGItem*>(c.create()); - QSGFlickable *obj = qobject_cast<QSGFlickable*>(root); + QQuickItem *root = qobject_cast<QQuickItem*>(c.create()); + QQuickFlickable *obj = qobject_cast<QQuickFlickable*>(root); QVERIFY(obj != 0); // starting state @@ -618,7 +618,7 @@ void tst_qsgflickable::margins() delete root; } -void tst_qsgflickable::flick(QSGView *canvas, const QPoint &from, const QPoint &to, int duration) +void tst_qquickflickable::flick(QQuickView *canvas, const QPoint &from, const QPoint &to, int duration) { const int pointCount = 5; QPoint diff = to - from; @@ -637,12 +637,12 @@ void tst_qsgflickable::flick(QSGView *canvas, const QPoint &from, const QPoint & } template<typename T> -T *tst_qsgflickable::findItem(QSGItem *parent, const QString &objectName) +T *tst_qquickflickable::findItem(QQuickItem *parent, const QString &objectName) { const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -657,6 +657,6 @@ T *tst_qsgflickable::findItem(QSGItem *parent, const QString &objectName) return 0; } -QTEST_MAIN(tst_qsgflickable) +QTEST_MAIN(tst_qquickflickable) -#include "tst_qsgflickable.moc" +#include "tst_qquickflickable.moc" diff --git a/tests/auto/declarative/qsgflipable/data/crash.qml b/tests/auto/declarative/qquickflipable/data/crash.qml index a0327918cb..a0327918cb 100644 --- a/tests/auto/declarative/qsgflipable/data/crash.qml +++ b/tests/auto/declarative/qquickflipable/data/crash.qml diff --git a/tests/auto/declarative/qsgflipable/data/flipable-abort.qml b/tests/auto/declarative/qquickflipable/data/flipable-abort.qml index 90fc03a5f9..90fc03a5f9 100644 --- a/tests/auto/declarative/qsgflipable/data/flipable-abort.qml +++ b/tests/auto/declarative/qquickflipable/data/flipable-abort.qml diff --git a/tests/auto/declarative/qsgflipable/data/test-flipable.qml b/tests/auto/declarative/qquickflipable/data/test-flipable.qml index dff6d3fe39..dff6d3fe39 100644 --- a/tests/auto/declarative/qsgflipable/data/test-flipable.qml +++ b/tests/auto/declarative/qquickflipable/data/test-flipable.qml diff --git a/tests/auto/declarative/qsgflipable/qsgflipable.pro b/tests/auto/declarative/qquickflipable/qquickflipable.pro index 806aeb28e7..a36c468c1c 100644 --- a/tests/auto/declarative/qsgflipable/qsgflipable.pro +++ b/tests/auto/declarative/qquickflipable/qquickflipable.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgflipable +TARGET = tst_qquickflipable macx:CONFIG -= app_bundle -SOURCES += tst_qsgflipable.cpp +SOURCES += tst_qquickflipable.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp b/tests/auto/declarative/qquickflipable/tst_qquickflipable.cpp index 2fc1924c9a..7243836031 100644 --- a/tests/auto/declarative/qsgflipable/tst_qsgflipable.cpp +++ b/tests/auto/declarative/qquickflipable/tst_qquickflipable.cpp @@ -41,20 +41,20 @@ #include <qtest.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsgflipable_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquickflipable_p.h> #include <private/qdeclarativevaluetype_p.h> #include <QFontMetrics> -#include <private/qsgrectangle_p.h> +#include <private/qquickrectangle_p.h> #include <math.h> #include <QtOpenGL/QGLShaderProgram> #include "../shared/util.h" -class tst_qsgflipable : public QObject +class tst_qquickflipable : public QObject { Q_OBJECT public: - tst_qsgflipable(); + tst_qquickflipable(); private slots: void initTestCase(); @@ -71,33 +71,33 @@ private: QDeclarativeEngine engine; }; -tst_qsgflipable::tst_qsgflipable() +tst_qquickflipable::tst_qquickflipable() { } -void tst_qsgflipable::initTestCase() +void tst_qquickflipable::initTestCase() { } -void tst_qsgflipable::cleanupTestCase() +void tst_qquickflipable::cleanupTestCase() { } -void tst_qsgflipable::create() +void tst_qquickflipable::create() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("test-flipable.qml"))); - QSGFlipable *obj = qobject_cast<QSGFlipable*>(c.create()); + QQuickFlipable *obj = qobject_cast<QQuickFlipable*>(c.create()); QVERIFY(obj != 0); delete obj; } -void tst_qsgflipable::checkFrontAndBack() +void tst_qquickflipable::checkFrontAndBack() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("test-flipable.qml"))); - QSGFlipable *obj = qobject_cast<QSGFlipable*>(c.create()); + QQuickFlipable *obj = qobject_cast<QQuickFlipable*>(c.create()); QVERIFY(obj != 0); QVERIFY(obj->front() != 0); @@ -105,11 +105,11 @@ void tst_qsgflipable::checkFrontAndBack() delete obj; } -void tst_qsgflipable::setFrontAndBack() +void tst_qquickflipable::setFrontAndBack() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("test-flipable.qml"))); - QSGFlipable *obj = qobject_cast<QSGFlipable*>(c.create()); + QQuickFlipable *obj = qobject_cast<QQuickFlipable*>(c.create()); QVERIFY(obj != 0); QVERIFY(obj->front() != 0); @@ -117,34 +117,34 @@ void tst_qsgflipable::setFrontAndBack() QString message = c.url().toString() + ":3:1: QML Flipable: front is a write-once property"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); - obj->setFront(new QSGRectangle()); + obj->setFront(new QQuickRectangle()); message = c.url().toString() + ":3:1: QML Flipable: back is a write-once property"; QTest::ignoreMessage(QtWarningMsg, qPrintable(message)); - obj->setBack(new QSGRectangle()); + obj->setBack(new QQuickRectangle()); delete obj; } -void tst_qsgflipable::QTBUG_9161_crash() +void tst_qquickflipable::QTBUG_9161_crash() { - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->setSource(QUrl::fromLocalFile(TESTDATA("crash.qml"))); - QSGItem *root = canvas->rootObject(); + QQuickItem *root = canvas->rootObject(); QVERIFY(root != 0); canvas->show(); delete canvas; } -void tst_qsgflipable::QTBUG_8474_qgv_abort() +void tst_qquickflipable::QTBUG_8474_qgv_abort() { - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; canvas->setSource(QUrl::fromLocalFile(TESTDATA("flipable-abort.qml"))); - QSGItem *root = canvas->rootObject(); + QQuickItem *root = canvas->rootObject(); QVERIFY(root != 0); canvas->show(); delete canvas; } -QTEST_MAIN(tst_qsgflipable) +QTEST_MAIN(tst_qquickflipable) -#include "tst_qsgflipable.moc" +#include "tst_qquickflipable.moc" diff --git a/tests/auto/declarative/qsgfocusscope/data/canvasFocus.qml b/tests/auto/declarative/qquickfocusscope/data/canvasFocus.qml index 7d8dac5a22..7d8dac5a22 100644 --- a/tests/auto/declarative/qsgfocusscope/data/canvasFocus.qml +++ b/tests/auto/declarative/qquickfocusscope/data/canvasFocus.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/chain.qml b/tests/auto/declarative/qquickfocusscope/data/chain.qml index 4b96662318..4b96662318 100644 --- a/tests/auto/declarative/qsgfocusscope/data/chain.qml +++ b/tests/auto/declarative/qquickfocusscope/data/chain.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/forceActiveFocus.qml b/tests/auto/declarative/qquickfocusscope/data/forceActiveFocus.qml index 74d2106888..74d2106888 100644 --- a/tests/auto/declarative/qsgfocusscope/data/forceActiveFocus.qml +++ b/tests/auto/declarative/qquickfocusscope/data/forceActiveFocus.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/forcefocus.qml b/tests/auto/declarative/qquickfocusscope/data/forcefocus.qml index f41582a951..f41582a951 100644 --- a/tests/auto/declarative/qsgfocusscope/data/forcefocus.qml +++ b/tests/auto/declarative/qquickfocusscope/data/forcefocus.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/qtBug13380.qml b/tests/auto/declarative/qquickfocusscope/data/qtBug13380.qml index 29de046b38..29de046b38 100644 --- a/tests/auto/declarative/qsgfocusscope/data/qtBug13380.qml +++ b/tests/auto/declarative/qquickfocusscope/data/qtBug13380.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/signalEmission.qml b/tests/auto/declarative/qquickfocusscope/data/signalEmission.qml index 999a40c5ad..999a40c5ad 100644 --- a/tests/auto/declarative/qsgfocusscope/data/signalEmission.qml +++ b/tests/auto/declarative/qquickfocusscope/data/signalEmission.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/test.qml b/tests/auto/declarative/qquickfocusscope/data/test.qml index 67be29c3fb..67be29c3fb 100644 --- a/tests/auto/declarative/qsgfocusscope/data/test.qml +++ b/tests/auto/declarative/qquickfocusscope/data/test.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/test2.qml b/tests/auto/declarative/qquickfocusscope/data/test2.qml index ad74f3e9f4..ad74f3e9f4 100644 --- a/tests/auto/declarative/qsgfocusscope/data/test2.qml +++ b/tests/auto/declarative/qquickfocusscope/data/test2.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/test3.qml b/tests/auto/declarative/qquickfocusscope/data/test3.qml index 537c30816e..537c30816e 100644 --- a/tests/auto/declarative/qsgfocusscope/data/test3.qml +++ b/tests/auto/declarative/qquickfocusscope/data/test3.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/test4.qml b/tests/auto/declarative/qquickfocusscope/data/test4.qml index 0eea649f5d..0eea649f5d 100644 --- a/tests/auto/declarative/qsgfocusscope/data/test4.qml +++ b/tests/auto/declarative/qquickfocusscope/data/test4.qml diff --git a/tests/auto/declarative/qsgfocusscope/data/test5.qml b/tests/auto/declarative/qquickfocusscope/data/test5.qml index 9c37cd1303..9c37cd1303 100644 --- a/tests/auto/declarative/qsgfocusscope/data/test5.qml +++ b/tests/auto/declarative/qquickfocusscope/data/test5.qml diff --git a/tests/auto/declarative/qsgfocusscope/qsgfocusscope.pro b/tests/auto/declarative/qquickfocusscope/qquickfocusscope.pro index 4b7b436ac6..79649ebb8a 100644 --- a/tests/auto/declarative/qsgfocusscope/qsgfocusscope.pro +++ b/tests/auto/declarative/qquickfocusscope/qquickfocusscope.pro @@ -1,6 +1,6 @@ CONFIG += testcase -TARGET = tst_qsgfocusscope -SOURCES += tst_qsgfocusscope.cpp +TARGET = tst_qquickfocusscope +SOURCES += tst_qquickfocusscope.cpp macx:CONFIG -= app_bundle testDataFiles.files = data diff --git a/tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp b/tests/auto/declarative/qquickfocusscope/tst_qquickfocusscope.cpp index c70ba69f36..6e7dd98940 100644 --- a/tests/auto/declarative/qsgfocusscope/tst_qsgfocusscope.cpp +++ b/tests/auto/declarative/qquickfocusscope/tst_qquickfocusscope.cpp @@ -42,21 +42,21 @@ #include <QSignalSpy> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsgrectangle_p.h> -#include <private/qsgtextedit_p.h> -#include <private/qsgtext_p.h> -#include <QtDeclarative/private/qsgfocusscope_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquickrectangle_p.h> +#include <private/qquicktextedit_p.h> +#include <private/qquicktext_p.h> +#include <QtDeclarative/private/qquickfocusscope_p.h> #include "../shared/util.h" -class tst_qsgfocusscope : public QObject +class tst_qquickfocusscope : public QObject { Q_OBJECT public: - tst_qsgfocusscope() {} + tst_qquickfocusscope() {} template<typename T> - T *findItem(QSGItem *parent, const QString &id); + T *findItem(QQuickItem *parent, const QString &id); private slots: void initTestCase(); @@ -72,11 +72,11 @@ private slots: void forceActiveFocus(); void canvasFocus(); }; -void tst_qsgfocusscope::initTestCase() +void tst_qquickfocusscope::initTestCase() { } -void tst_qsgfocusscope::cleanupTestCase() +void tst_qquickfocusscope::cleanupTestCase() { } @@ -85,12 +85,12 @@ void tst_qsgfocusscope::cleanupTestCase() Find an item with the specified id. */ template<typename T> -T *tst_qsgfocusscope::findItem(QSGItem *parent, const QString &objectName) +T *tst_qquickfocusscope::findItem(QQuickItem *parent, const QString &objectName) { const QMetaObject &mo = T::staticMetaObject; - QList<QSGItem *> children = parent->childItems(); + QList<QQuickItem *> children = parent->childItems(); for (int i = 0; i < children.count(); ++i) { - QSGItem *item = children.at(i); + QQuickItem *item = children.at(i); if (item) { if (mo.cast(item) && (objectName.isEmpty() || item->objectName() == objectName)) { return static_cast<T*>(item); @@ -103,15 +103,15 @@ T *tst_qsgfocusscope::findItem(QSGItem *parent, const QString &objectName) return 0; } -void tst_qsgfocusscope::basic() +void tst_qquickfocusscope::basic() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("test.qml"))); - QSGFocusScope *item0 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item0")); - QSGRectangle *item1 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item1")); - QSGRectangle *item2 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item2")); - QSGRectangle *item3 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item3")); + QQuickFocusScope *item0 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item0")); + QQuickRectangle *item1 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item1")); + QQuickRectangle *item2 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item2")); + QQuickRectangle *item3 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item3")); QVERIFY(item0 != 0); QVERIFY(item1 != 0); QVERIFY(item2 != 0); @@ -145,16 +145,16 @@ void tst_qsgfocusscope::basic() delete view; } -void tst_qsgfocusscope::nested() +void tst_qquickfocusscope::nested() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("test2.qml"))); - QSGFocusScope *item1 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item1")); - QSGFocusScope *item2 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item2")); - QSGFocusScope *item3 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item3")); - QSGFocusScope *item4 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item4")); - QSGFocusScope *item5 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item5")); + QQuickFocusScope *item1 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item1")); + QQuickFocusScope *item2 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item2")); + QQuickFocusScope *item3 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item3")); + QQuickFocusScope *item4 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item4")); + QQuickFocusScope *item5 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item5")); QVERIFY(item1 != 0); QVERIFY(item2 != 0); QVERIFY(item3 != 0); @@ -174,15 +174,15 @@ void tst_qsgfocusscope::nested() delete view; } -void tst_qsgfocusscope::noFocus() +void tst_qquickfocusscope::noFocus() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("test4.qml"))); - QSGRectangle *item0 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item0")); - QSGRectangle *item1 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item1")); - QSGRectangle *item2 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item2")); - QSGRectangle *item3 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item3")); + QQuickRectangle *item0 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item0")); + QQuickRectangle *item1 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item1")); + QQuickRectangle *item2 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item2")); + QQuickRectangle *item3 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item3")); QVERIFY(item0 != 0); QVERIFY(item1 != 0); QVERIFY(item2 != 0); @@ -212,15 +212,15 @@ void tst_qsgfocusscope::noFocus() delete view; } -void tst_qsgfocusscope::textEdit() +void tst_qquickfocusscope::textEdit() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("test5.qml"))); - QSGFocusScope *item0 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item0")); - QSGTextEdit *item1 = findItem<QSGTextEdit>(view->rootObject(), QLatin1String("item1")); - QSGRectangle *item2 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item2")); - QSGTextEdit *item3 = findItem<QSGTextEdit>(view->rootObject(), QLatin1String("item3")); + QQuickFocusScope *item0 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item0")); + QQuickTextEdit *item1 = findItem<QQuickTextEdit>(view->rootObject(), QLatin1String("item1")); + QQuickRectangle *item2 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item2")); + QQuickTextEdit *item3 = findItem<QQuickTextEdit>(view->rootObject(), QLatin1String("item3")); QVERIFY(item0 != 0); QVERIFY(item1 != 0); QVERIFY(item2 != 0); @@ -262,17 +262,17 @@ void tst_qsgfocusscope::textEdit() delete view; } -void tst_qsgfocusscope::forceFocus() +void tst_qquickfocusscope::forceFocus() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("forcefocus.qml"))); - QSGFocusScope *item0 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item0")); - QSGRectangle *item1 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item1")); - QSGRectangle *item2 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item2")); - QSGFocusScope *item3 = findItem<QSGFocusScope>(view->rootObject(), QLatin1String("item3")); - QSGRectangle *item4 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item4")); - QSGRectangle *item5 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item5")); + QQuickFocusScope *item0 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item0")); + QQuickRectangle *item1 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item1")); + QQuickRectangle *item2 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item2")); + QQuickFocusScope *item3 = findItem<QQuickFocusScope>(view->rootObject(), QLatin1String("item3")); + QQuickRectangle *item4 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item4")); + QQuickRectangle *item5 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item5")); QVERIFY(item0 != 0); QVERIFY(item1 != 0); QVERIFY(item2 != 0); @@ -310,9 +310,9 @@ void tst_qsgfocusscope::forceFocus() delete view; } -void tst_qsgfocusscope::noParentFocus() +void tst_qquickfocusscope::noParentFocus() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("chain.qml"))); QVERIFY(view->rootObject()); @@ -334,15 +334,15 @@ void tst_qsgfocusscope::noParentFocus() delete view; } -void tst_qsgfocusscope::signalEmission() +void tst_qquickfocusscope::signalEmission() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("signalEmission.qml"))); - QSGRectangle *item1 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item1")); - QSGRectangle *item2 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item2")); - QSGRectangle *item3 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item3")); - QSGRectangle *item4 = findItem<QSGRectangle>(view->rootObject(), QLatin1String("item4")); + QQuickRectangle *item1 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item1")); + QQuickRectangle *item2 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item2")); + QQuickRectangle *item3 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item3")); + QQuickRectangle *item4 = findItem<QQuickRectangle>(view->rootObject(), QLatin1String("item4")); QVERIFY(item1 != 0); QVERIFY(item2 != 0); QVERIFY(item3 != 0); @@ -389,9 +389,9 @@ void tst_qsgfocusscope::signalEmission() delete view; } -void tst_qsgfocusscope::qtBug13380() +void tst_qquickfocusscope::qtBug13380() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("qtBug13380.qml"))); view->show(); @@ -410,9 +410,9 @@ void tst_qsgfocusscope::qtBug13380() delete view; } -void tst_qsgfocusscope::forceActiveFocus() +void tst_qquickfocusscope::forceActiveFocus() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("forceActiveFocus.qml"))); view->show(); @@ -424,16 +424,16 @@ void tst_qsgfocusscope::forceActiveFocus() qt_x11_wait_for_window_manager(view); #endif - QSGItem *rootObject = view->rootObject(); + QQuickItem *rootObject = view->rootObject(); QVERIFY(rootObject); - QSGItem *scope = findItem<QSGItem>(rootObject, QLatin1String("scope")); - QSGItem *itemA1 = findItem<QSGItem>(rootObject, QLatin1String("item-a1")); - QSGItem *scopeA = findItem<QSGItem>(rootObject, QLatin1String("scope-a")); - QSGItem *itemA2 = findItem<QSGItem>(rootObject, QLatin1String("item-a2")); - QSGItem *itemB1 = findItem<QSGItem>(rootObject, QLatin1String("item-b1")); - QSGItem *scopeB = findItem<QSGItem>(rootObject, QLatin1String("scope-b")); - QSGItem *itemB2 = findItem<QSGItem>(rootObject, QLatin1String("item-b2")); + QQuickItem *scope = findItem<QQuickItem>(rootObject, QLatin1String("scope")); + QQuickItem *itemA1 = findItem<QQuickItem>(rootObject, QLatin1String("item-a1")); + QQuickItem *scopeA = findItem<QQuickItem>(rootObject, QLatin1String("scope-a")); + QQuickItem *itemA2 = findItem<QQuickItem>(rootObject, QLatin1String("item-a2")); + QQuickItem *itemB1 = findItem<QQuickItem>(rootObject, QLatin1String("item-b1")); + QQuickItem *scopeB = findItem<QQuickItem>(rootObject, QLatin1String("scope-b")); + QQuickItem *itemB2 = findItem<QQuickItem>(rootObject, QLatin1String("item-b2")); QVERIFY(scope); QVERIFY(itemA1); @@ -528,19 +528,19 @@ void tst_qsgfocusscope::forceActiveFocus() delete view; } -void tst_qsgfocusscope::canvasFocus() +void tst_qquickfocusscope::canvasFocus() { - QSGView *view = new QSGView; + QQuickView *view = new QQuickView; view->setSource(QUrl::fromLocalFile(TESTDATA("canvasFocus.qml"))); - QSGItem *rootObject = view->rootObject(); + QQuickItem *rootObject = view->rootObject(); QVERIFY(rootObject); - QSGItem *rootItem = view->rootItem(); - QSGItem *scope1 = findItem<QSGItem>(rootObject, QLatin1String("scope1")); - QSGItem *item1 = findItem<QSGItem>(rootObject, QLatin1String("item1")); - QSGItem *scope2 = findItem<QSGItem>(rootObject, QLatin1String("scope2")); - QSGItem *item2 = findItem<QSGItem>(rootObject, QLatin1String("item2")); + QQuickItem *rootItem = view->rootItem(); + QQuickItem *scope1 = findItem<QQuickItem>(rootObject, QLatin1String("scope1")); + QQuickItem *item1 = findItem<QQuickItem>(rootObject, QLatin1String("item1")); + QQuickItem *scope2 = findItem<QQuickItem>(rootObject, QLatin1String("scope2")); + QQuickItem *item2 = findItem<QQuickItem>(rootObject, QLatin1String("item2")); QVERIFY(scope1); QVERIFY(item1); @@ -653,6 +653,6 @@ void tst_qsgfocusscope::canvasFocus() delete view; } -QTEST_MAIN(tst_qsgfocusscope) +QTEST_MAIN(tst_qquickfocusscope) -#include "tst_qsgfocusscope.moc" +#include "tst_qquickfocusscope.moc" diff --git a/tests/auto/declarative/qsggridview/data/ComponentView.qml b/tests/auto/declarative/qquickgridview/data/ComponentView.qml index 12ab6c92d1..12ab6c92d1 100644 --- a/tests/auto/declarative/qsggridview/data/ComponentView.qml +++ b/tests/auto/declarative/qquickgridview/data/ComponentView.qml diff --git a/tests/auto/declarative/qsggridview/data/attachedSignals.qml b/tests/auto/declarative/qquickgridview/data/attachedSignals.qml index 73c10d8caf..73c10d8caf 100644 --- a/tests/auto/declarative/qsggridview/data/attachedSignals.qml +++ b/tests/auto/declarative/qquickgridview/data/attachedSignals.qml diff --git a/tests/auto/declarative/qsggridview/data/creationContext.qml b/tests/auto/declarative/qquickgridview/data/creationContext.qml index 79a682788b..79a682788b 100644 --- a/tests/auto/declarative/qsggridview/data/creationContext.qml +++ b/tests/auto/declarative/qquickgridview/data/creationContext.qml diff --git a/tests/auto/declarative/qsggridview/data/displaygrid.qml b/tests/auto/declarative/qquickgridview/data/displaygrid.qml index 1da4fe50ac..1da4fe50ac 100644 --- a/tests/auto/declarative/qsggridview/data/displaygrid.qml +++ b/tests/auto/declarative/qquickgridview/data/displaygrid.qml diff --git a/tests/auto/declarative/qsggridview/data/footer.qml b/tests/auto/declarative/qquickgridview/data/footer.qml index 9083f9f57c..9083f9f57c 100644 --- a/tests/auto/declarative/qsggridview/data/footer.qml +++ b/tests/auto/declarative/qquickgridview/data/footer.qml diff --git a/tests/auto/declarative/qsggridview/data/gridview-enforcerange.qml b/tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml index 2bfe7da78e..2bfe7da78e 100644 --- a/tests/auto/declarative/qsggridview/data/gridview-enforcerange.qml +++ b/tests/auto/declarative/qquickgridview/data/gridview-enforcerange.qml diff --git a/tests/auto/declarative/qsggridview/data/gridview-initCurrent.qml b/tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml index e3ec8f2d4a..e3ec8f2d4a 100644 --- a/tests/auto/declarative/qsggridview/data/gridview-initCurrent.qml +++ b/tests/auto/declarative/qquickgridview/data/gridview-initCurrent.qml diff --git a/tests/auto/declarative/qsggridview/data/gridview-noCurrent.qml b/tests/auto/declarative/qquickgridview/data/gridview-noCurrent.qml index 600716e2d4..600716e2d4 100644 --- a/tests/auto/declarative/qsggridview/data/gridview-noCurrent.qml +++ b/tests/auto/declarative/qquickgridview/data/gridview-noCurrent.qml diff --git a/tests/auto/declarative/qsggridview/data/gridview1.qml b/tests/auto/declarative/qquickgridview/data/gridview1.qml index e6a3923532..e6a3923532 100644 --- a/tests/auto/declarative/qsggridview/data/gridview1.qml +++ b/tests/auto/declarative/qquickgridview/data/gridview1.qml diff --git a/tests/auto/declarative/qsggridview/data/gridview2.qml b/tests/auto/declarative/qquickgridview/data/gridview2.qml index 5fb45a1613..5fb45a1613 100644 --- a/tests/auto/declarative/qsggridview/data/gridview2.qml +++ b/tests/auto/declarative/qquickgridview/data/gridview2.qml diff --git a/tests/auto/declarative/qsggridview/data/gridview3.qml b/tests/auto/declarative/qquickgridview/data/gridview3.qml index a8c1c5a0f7..a8c1c5a0f7 100644 --- a/tests/auto/declarative/qsggridview/data/gridview3.qml +++ b/tests/auto/declarative/qquickgridview/data/gridview3.qml diff --git a/tests/auto/declarative/qsggridview/data/gridview4.qml b/tests/auto/declarative/qquickgridview/data/gridview4.qml index eed3a2bdb1..eed3a2bdb1 100644 --- a/tests/auto/declarative/qsggridview/data/gridview4.qml +++ b/tests/auto/declarative/qquickgridview/data/gridview4.qml diff --git a/tests/auto/declarative/qsggridview/data/header.qml b/tests/auto/declarative/qquickgridview/data/header.qml index 648e2a2298..648e2a2298 100644 --- a/tests/auto/declarative/qsggridview/data/header.qml +++ b/tests/auto/declarative/qquickgridview/data/header.qml diff --git a/tests/auto/declarative/qsggridview/data/manual-highlight.qml b/tests/auto/declarative/qquickgridview/data/manual-highlight.qml index c2f1d20fb1..c2f1d20fb1 100644 --- a/tests/auto/declarative/qsggridview/data/manual-highlight.qml +++ b/tests/auto/declarative/qquickgridview/data/manual-highlight.qml diff --git a/tests/auto/declarative/qsggridview/data/margins.qml b/tests/auto/declarative/qquickgridview/data/margins.qml index d369658a91..d369658a91 100644 --- a/tests/auto/declarative/qsggridview/data/margins.qml +++ b/tests/auto/declarative/qquickgridview/data/margins.qml diff --git a/tests/auto/declarative/qsggridview/data/mirroring.qml b/tests/auto/declarative/qquickgridview/data/mirroring.qml index b9aff501c1..b9aff501c1 100644 --- a/tests/auto/declarative/qsggridview/data/mirroring.qml +++ b/tests/auto/declarative/qquickgridview/data/mirroring.qml diff --git a/tests/auto/declarative/qsggridview/data/propertychangestest.qml b/tests/auto/declarative/qquickgridview/data/propertychangestest.qml index 97efbe78f5..97efbe78f5 100644 --- a/tests/auto/declarative/qsggridview/data/propertychangestest.qml +++ b/tests/auto/declarative/qquickgridview/data/propertychangestest.qml diff --git a/tests/auto/declarative/qsggridview/data/resizeview.qml b/tests/auto/declarative/qquickgridview/data/resizeview.qml index 1f730a4a8a..1f730a4a8a 100644 --- a/tests/auto/declarative/qsggridview/data/resizeview.qml +++ b/tests/auto/declarative/qquickgridview/data/resizeview.qml diff --git a/tests/auto/declarative/qsggridview/data/setindex.qml b/tests/auto/declarative/qquickgridview/data/setindex.qml index ef80f3a2fb..ef80f3a2fb 100644 --- a/tests/auto/declarative/qsggridview/data/setindex.qml +++ b/tests/auto/declarative/qquickgridview/data/setindex.qml diff --git a/tests/auto/declarative/qsggridview/data/snapToRow.qml b/tests/auto/declarative/qquickgridview/data/snapToRow.qml index f079a048f0..f079a048f0 100644 --- a/tests/auto/declarative/qsggridview/data/snapToRow.qml +++ b/tests/auto/declarative/qquickgridview/data/snapToRow.qml diff --git a/tests/auto/declarative/qsggridview/qsggridview.pro b/tests/auto/declarative/qquickgridview/qquickgridview.pro index 6588472779..cf0302433f 100644 --- a/tests/auto/declarative/qsggridview/qsggridview.pro +++ b/tests/auto/declarative/qquickgridview/qquickgridview.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsggridview +TARGET = tst_qquickgridview macx:CONFIG -= app_bundle -SOURCES += tst_qsggridview.cpp +SOURCES += tst_qquickgridview.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp b/tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp index 9e5c425632..333398a50e 100644 --- a/tests/auto/declarative/qsggridview/tst_qsggridview.cpp +++ b/tests/auto/declarative/qquickgridview/tst_qquickgridview.cpp @@ -41,27 +41,27 @@ #include <QtTest/QtTest> #include <QtWidgets/qstringlistmodel.h> -#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/private/qsgitem_p.h> +#include <QtDeclarative/private/qquickitem_p.h> #include <QtDeclarative/private/qlistmodelinterface_p.h> -#include <QtDeclarative/private/qsggridview_p.h> -#include <QtDeclarative/private/qsgtext_p.h> +#include <QtDeclarative/private/qquickgridview_p.h> +#include <QtDeclarative/private/qquicktext_p.h> #include <QtDeclarative/private/qdeclarativelistmodel_p.h> #include "../shared/util.h" #include <QtGui/qguiapplication.h> Q_DECLARE_METATYPE(Qt::LayoutDirection) -Q_DECLARE_METATYPE(QSGGridView::Flow) +Q_DECLARE_METATYPE(QQuickGridView::Flow) -class tst_QSGGridView : public QObject +class tst_QQuickGridView : public QObject { Q_OBJECT public: - tst_QSGGridView(); + tst_QQuickGridView(); private slots: void initTestCase(); @@ -114,17 +114,17 @@ private slots: void snapToRow(); private: - QSGView *createView(); - void flick(QSGView *canvas, const QPoint &from, const QPoint &to, int duration); + QQuickView *createView(); + void flick(QQuickView *canvas, const QPoint &from, const QPoint &to, int duration); template<typename T> - T *findItem(QSGItem *parent, const QString &id, int index=-1); + T *findItem(QQuickItem *parent, const QString &id, int index=-1); template<typename T> - QList<T*> findItems(QSGItem *parent, const QString &objectName); - void dumpTree(QSGItem *parent, int depth = 0); + QList<T*> findItems(QQuickItem *parent, const QString &objectName); + void dumpTree(QQuickItem *parent, int depth = 0); }; template<typename T> -void tst_qsggridview_move(int from, int to, int n, T *items) +void tst_qquickgridview_move(int from, int to, int n, T *items) { if (n == 1) { items->move(from, to); @@ -145,11 +145,11 @@ void tst_qsggridview_move(int from, int to, int n, T *items) } } -void tst_QSGGridView::initTestCase() +void tst_QQuickGridView::initTestCase() { } -void tst_QSGGridView::cleanupTestCase() +void tst_QQuickGridView::cleanupTestCase() { } @@ -229,7 +229,7 @@ public: void moveItems(int from, int to, int count) { emit beginMoveRows(QModelIndex(), from, from+count-1, QModelIndex(), to > from ? to+count : to); - tst_qsggridview_move(from, to, count, &list); + tst_qquickgridview_move(from, to, count, &list); emit endMoveRows(); } @@ -250,13 +250,13 @@ private: QList<QPair<QString,QString> > list; }; -tst_QSGGridView::tst_QSGGridView() +tst_QQuickGridView::tst_QQuickGridView() { } -void tst_QSGGridView::items() +void tst_QQuickGridView::items() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; model.addItem("Fred", "12345"); @@ -275,10 +275,10 @@ void tst_QSGGridView::items() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_COMPARE(gridview->count(), model.count()); @@ -286,10 +286,10 @@ void tst_QSGGridView::items() QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item for (int i = 0; i < model.count(); ++i) { - QSGText *name = findItem<QSGText>(contentItem, "textName", i); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", i); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", i); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", i); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -298,15 +298,15 @@ void tst_QSGGridView::items() TestModel model2; ctxt->setContextProperty("testModel", &model2); - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); QTRY_VERIFY(itemCount == 0); delete canvas; } -void tst_QSGGridView::changed() +void tst_QQuickGridView::changed() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; model.addItem("Fred", "12345"); @@ -325,26 +325,26 @@ void tst_QSGGridView::changed() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGFlickable *gridview = findItem<QSGFlickable>(canvas->rootObject(), "grid"); + QQuickFlickable *gridview = findItem<QQuickFlickable>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); model.modifyItem(1, "Will", "9876"); - QSGText *name = findItem<QSGText>(contentItem, "textName", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 1); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(1)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 1); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 1); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(1)); delete canvas; } -void tst_QSGGridView::inserted() +void tst_QQuickGridView::inserted() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -360,10 +360,10 @@ void tst_QSGGridView::inserted() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); model.insertItem(1, "Will", "9876"); @@ -371,10 +371,10 @@ void tst_QSGGridView::inserted() QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - QSGText *name = findItem<QSGText>(contentItem, "textName", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 1); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(1)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 1); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 1); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(1)); @@ -384,7 +384,7 @@ void tst_QSGGridView::inserted() // Confirm items positioned correctly for (int i = 0; i < model.count(); ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QTRY_COMPARE(item->x(), (i%3)*80.0); QTRY_COMPARE(item->y(), (i/3)*60.0); } @@ -393,10 +393,10 @@ void tst_QSGGridView::inserted() QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - name = findItem<QSGText>(contentItem, "textName", 0); + name = findItem<QQuickText>(contentItem, "textName", 0); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(0)); - number = findItem<QSGText>(contentItem, "textNumber", 0); + number = findItem<QQuickText>(contentItem, "textNumber", 0); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(0)); @@ -404,7 +404,7 @@ void tst_QSGGridView::inserted() // Confirm items positioned correctly for (int i = 0; i < model.count(); ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QTRY_VERIFY(item->x() == (i%3)*80); QTRY_VERIFY(item->y() == (i/3)*60); } @@ -422,16 +422,16 @@ void tst_QSGGridView::inserted() delete canvas; } -void tst_QSGGridView::inserted_more() +void tst_QQuickGridView::inserted_more() { QFETCH(qreal, contentY); QFETCH(int, insertIndex); QFETCH(int, insertCount); QFETCH(qreal, itemsOffsetAfterMove); - QSGText *name; - QSGText *number; - QSGView *canvas = createView(); + QQuickText *name; + QQuickText *number; + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -446,9 +446,9 @@ void tst_QSGGridView::inserted_more() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); gridview->setContentY(contentY); @@ -460,11 +460,11 @@ void tst_QSGGridView::inserted_more() QTRY_COMPARE(gridview->property("count").toInt(), model.count()); // check visibleItems.first() is in correct position - QSGItem *item0 = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item0 = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item0); QCOMPARE(item0->y(), itemsOffsetAfterMove); - QList<QSGItem*> items = findItems<QSGItem>(contentItem, "wrapper"); + QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper"); int firstVisibleIndex = -1; for (int i=0; i<items.count(); i++) { if (items[i]->y() >= contentY) { @@ -476,18 +476,18 @@ void tst_QSGGridView::inserted_more() QVERIFY2(firstVisibleIndex >= 0, QTest::toString(firstVisibleIndex)); // Confirm items positioned correctly and indexes correct - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = firstVisibleIndex; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); QCOMPARE(item->x(), (i%3)*80.0); QCOMPARE(item->y(), (i/3)*60.0 + itemsOffsetAfterMove); - name = findItem<QSGText>(contentItem, "textName", i); + name = findItem<QQuickText>(contentItem, "textName", i); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(i)); - number = findItem<QSGText>(contentItem, "textNumber", i); + number = findItem<QQuickText>(contentItem, "textNumber", i); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(i)); } @@ -495,7 +495,7 @@ void tst_QSGGridView::inserted_more() delete canvas; } -void tst_QSGGridView::inserted_more_data() +void tst_QQuickGridView::inserted_more_data() { QTest::addColumn<qreal>("contentY"); QTest::addColumn<int>("insertIndex"); @@ -594,9 +594,9 @@ void tst_QSGGridView::inserted_more_data() << 0.0; } -void tst_QSGGridView::removed() +void tst_QQuickGridView::removed() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -611,19 +611,19 @@ void tst_QSGGridView::removed() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); model.removeItem(1); QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); - QSGText *name = findItem<QSGText>(contentItem, "textName", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 1); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(1)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 1); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 1); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(1)); @@ -633,9 +633,9 @@ void tst_QSGGridView::removed() QTRY_COMPARE(removed, QString("Item1")); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item->x() == (i%3)*80); QTRY_VERIFY(item->y() == (i/3)*60); @@ -645,18 +645,18 @@ void tst_QSGGridView::removed() model.removeItem(0); QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); - name = findItem<QSGText>(contentItem, "textName", 0); + name = findItem<QQuickText>(contentItem, "textName", 0); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(0)); - number = findItem<QSGText>(contentItem, "textNumber", 0); + number = findItem<QQuickText>(contentItem, "textNumber", 0); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(0)); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item->x() == (i%3)*80); QTRY_VERIFY(item->y() == (i/3)*60); @@ -667,9 +667,9 @@ void tst_QSGGridView::removed() QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item->x() == (i%3)*80); QTRY_VERIFY(item->y() == (i/3)*60); @@ -687,14 +687,14 @@ void tst_QSGGridView::removed() // Confirm items positioned correctly for (int i = 6; i < 18; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item->x() == (i%3)*80); QTRY_VERIFY(item->y() == (i/3)*60); } // Remove currentIndex - QSGItem *oldCurrent = gridview->currentItem(); + QQuickItem *oldCurrent = gridview->currentItem(); model.removeItem(9); QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); @@ -706,9 +706,9 @@ void tst_QSGGridView::removed() QTest::qWait(300); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QTRY_VERIFY(item->x() == (i%3)*80); QTRY_VERIFY(item->y() == (i/3)*60); } @@ -740,9 +740,9 @@ void tst_QSGGridView::removed() delete canvas; } -void tst_QSGGridView::clear() +void tst_QQuickGridView::clear() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -756,10 +756,10 @@ void tst_QSGGridView::clear() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QVERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QVERIFY(contentItem != 0); model.clear(); @@ -778,7 +778,7 @@ void tst_QSGGridView::clear() delete canvas; } -void tst_QSGGridView::moved() +void tst_QQuickGridView::moved() { QFETCH(qreal, contentY); QFETCH(int, from); @@ -786,9 +786,9 @@ void tst_QSGGridView::moved() QFETCH(int, count); QFETCH(qreal, itemsOffsetAfterMove); - QSGText *name; - QSGText *number; - QSGView *canvas = createView(); + QQuickText *name; + QQuickText *number; + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -803,13 +803,13 @@ void tst_QSGGridView::moved() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGItem *currentItem = gridview->currentItem(); + QQuickItem *currentItem = gridview->currentItem(); QTRY_VERIFY(currentItem != 0); gridview->setContentY(contentY); @@ -820,20 +820,20 @@ void tst_QSGGridView::moved() // Confirm items positioned correctly and indexes correct int firstVisibleIndex = qCeil(contentY / 60.0) * 3; - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = firstVisibleIndex; i < model.count() && i < itemCount; ++i) { if (i >= firstVisibleIndex + 18) // index has moved out of view continue; - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); QTRY_COMPARE(item->x(), (i%3)*80.0); QTRY_COMPARE(item->y(), (i/3)*60.0 + itemsOffsetAfterMove); - name = findItem<QSGText>(contentItem, "textName", i); + name = findItem<QQuickText>(contentItem, "textName", i); QVERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - number = findItem<QSGText>(contentItem, "textNumber", i); + number = findItem<QQuickText>(contentItem, "textNumber", i); QVERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); @@ -845,7 +845,7 @@ void tst_QSGGridView::moved() delete canvas; } -void tst_QSGGridView::moved_data() +void tst_QQuickGridView::moved_data() { QTest::addColumn<qreal>("contentY"); QTest::addColumn<int>("from"); @@ -983,14 +983,14 @@ struct ListChange { }; Q_DECLARE_METATYPE(QList<ListChange>) -void tst_QSGGridView::multipleChanges() +void tst_QQuickGridView::multipleChanges() { QFETCH(int, startCount); QFETCH(QList<ListChange>, changes); QFETCH(int, newCount); QFETCH(int, newCurrentIndex); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -1005,7 +1005,7 @@ void tst_QSGGridView::multipleChanges() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); for (int i=0; i<changes.count(); i++) { @@ -1034,18 +1034,18 @@ void tst_QSGGridView::multipleChanges() QCOMPARE(gridview->count(), model.count()); QTRY_COMPARE(gridview->currentIndex(), newCurrentIndex); - QSGText *name; - QSGText *number; - QSGItem *contentItem = gridview->contentItem(); + QQuickText *name; + QQuickText *number; + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i=0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); - name = findItem<QSGText>(contentItem, "textName", i); + name = findItem<QQuickText>(contentItem, "textName", i); QVERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - number = findItem<QSGText>(contentItem, "textNumber", i); + number = findItem<QQuickText>(contentItem, "textNumber", i); QVERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -1053,7 +1053,7 @@ void tst_QSGGridView::multipleChanges() delete canvas; } -void tst_QSGGridView::multipleChanges_data() +void tst_QQuickGridView::multipleChanges_data() { QTest::addColumn<int>("startCount"); QTest::addColumn<QList<ListChange> >("changes"); @@ -1204,10 +1204,10 @@ void tst_QSGGridView::multipleChanges_data() } -void tst_QSGGridView::swapWithFirstItem() +void tst_QQuickGridView::swapWithFirstItem() { // QTBUG_9697 - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -1222,7 +1222,7 @@ void tst_QSGGridView::swapWithFirstItem() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); // ensure content position is stable @@ -1233,13 +1233,13 @@ void tst_QSGGridView::swapWithFirstItem() delete canvas; } -void tst_QSGGridView::currentIndex() +void tst_QQuickGridView::currentIndex() { TestModel model; for (int i = 0; i < 60; i++) model.addItem("Item" + QString::number(i), QString::number(i)); - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); canvas->show(); @@ -1251,15 +1251,15 @@ void tst_QSGGridView::currentIndex() qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QVERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QVERIFY(contentItem != 0); // current item should be third item QCOMPARE(gridview->currentIndex(), 35); - QCOMPARE(gridview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 35)); + QCOMPARE(gridview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 35)); QCOMPARE(gridview->currentItem()->y(), gridview->highlightItem()->y()); QCOMPARE(gridview->contentY(), 400.0); @@ -1362,7 +1362,7 @@ void tst_QSGGridView::currentIndex() QTRY_COMPARE(gridview->contentY(), 0.0); - gridview->setFlow(QSGGridView::TopToBottom); + gridview->setFlow(QQuickGridView::TopToBottom); canvas->requestActivateWindow(); QTest::qWaitForWindowShown(canvas); @@ -1426,7 +1426,7 @@ void tst_QSGGridView::currentIndex() gridview->setHighlightFollowsCurrentItem(true); - gridview->setFlow(QSGGridView::LeftToRight); + gridview->setFlow(QQuickGridView::LeftToRight); gridview->setLayoutDirection(Qt::RightToLeft); canvas->requestActivateWindow(); @@ -1475,13 +1475,13 @@ void tst_QSGGridView::currentIndex() delete canvas; } -void tst_QSGGridView::noCurrentIndex() +void tst_QQuickGridView::noCurrentIndex() { TestModel model; for (int i = 0; i < 60; i++) model.addItem("Item" + QString::number(i), QString::number(i)); - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); QDeclarativeContext *ctxt = canvas->rootContext(); @@ -1492,10 +1492,10 @@ void tst_QSGGridView::noCurrentIndex() qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QVERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QVERIFY(contentItem != 0); // current index should be -1 @@ -1512,9 +1512,9 @@ void tst_QSGGridView::noCurrentIndex() delete canvas; } -void tst_QSGGridView::changeFlow() +void tst_QQuickGridView::changeFlow() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -1528,24 +1528,24 @@ void tst_QSGGridView::changeFlow() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly and indexes correct - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal((i%3)*80)); QTRY_COMPARE(item->y(), qreal((i/3)*60)); - QSGText *name = findItem<QSGText>(contentItem, "textName", i); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", i); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", i); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", i); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -1553,17 +1553,17 @@ void tst_QSGGridView::changeFlow() ctxt->setContextProperty("testTopToBottom", QVariant(true)); // Confirm items positioned correctly and indexes correct - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal((i/5)*80)); QTRY_COMPARE(item->y(), qreal((i%5)*60)); - QSGText *name = findItem<QSGText>(contentItem, "textName", i); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", i); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", i); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", i); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -1571,17 +1571,17 @@ void tst_QSGGridView::changeFlow() ctxt->setContextProperty("testRightToLeft", QVariant(true)); // Confirm items positioned correctly and indexes correct - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal(-(i/5)*80 - item->width())); QTRY_COMPARE(item->y(), qreal((i%5)*60)); - QSGText *name = findItem<QSGText>(contentItem, "textName", i); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", i); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", i); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", i); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -1591,17 +1591,17 @@ void tst_QSGGridView::changeFlow() QTRY_COMPARE(gridview->contentX(), 0.); // Confirm items positioned correctly and indexes correct - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal(240 - (i%3+1)*80)); QTRY_COMPARE(item->y(), qreal((i/3)*60)); - QSGText *name = findItem<QSGText>(contentItem, "textName", i); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", i); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", i); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", i); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -1609,11 +1609,11 @@ void tst_QSGGridView::changeFlow() delete canvas; } -void tst_QSGGridView::defaultValues() +void tst_QQuickGridView::defaultValues() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("gridview3.qml"))); - QSGGridView *obj = qobject_cast<QSGGridView*>(c.create()); + QQuickGridView *obj = qobject_cast<QQuickGridView*>(c.create()); QTRY_VERIFY(obj != 0); QTRY_VERIFY(obj->model() == QVariant()); @@ -1632,11 +1632,11 @@ void tst_QSGGridView::defaultValues() delete obj; } -void tst_QSGGridView::properties() +void tst_QQuickGridView::properties() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("gridview2.qml"))); - QSGGridView *obj = qobject_cast<QSGGridView*>(c.create()); + QQuickGridView *obj = qobject_cast<QQuickGridView*>(c.create()); QTRY_VERIFY(obj != 0); QTRY_VERIFY(obj->model() != QVariant()); @@ -1655,13 +1655,13 @@ void tst_QSGGridView::properties() delete obj; } -void tst_QSGGridView::propertyChanges() +void tst_QQuickGridView::propertyChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QTRY_VERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychangestest.qml"))); - QSGGridView *gridView = canvas->rootObject()->findChild<QSGGridView*>("gridView"); + QQuickGridView *gridView = canvas->rootObject()->findChild<QQuickGridView*>("gridView"); QTRY_VERIFY(gridView); QSignalSpy keyNavigationWrapsSpy(gridView, SIGNAL(keyNavigationWrapsChanged())); @@ -1671,15 +1671,15 @@ void tst_QSGGridView::propertyChanges() QTRY_COMPARE(gridView->isWrapEnabled(), true); QTRY_COMPARE(gridView->cacheBuffer(), 10); - QTRY_COMPARE(gridView->flow(), QSGGridView::LeftToRight); + QTRY_COMPARE(gridView->flow(), QQuickGridView::LeftToRight); gridView->setWrapEnabled(false); gridView->setCacheBuffer(3); - gridView->setFlow(QSGGridView::TopToBottom); + gridView->setFlow(QQuickGridView::TopToBottom); QTRY_COMPARE(gridView->isWrapEnabled(), false); QTRY_COMPARE(gridView->cacheBuffer(), 3); - QTRY_COMPARE(gridView->flow(), QSGGridView::TopToBottom); + QTRY_COMPARE(gridView->flow(), QQuickGridView::TopToBottom); QTRY_COMPARE(keyNavigationWrapsSpy.count(),1); QTRY_COMPARE(cacheBufferSpy.count(),1); @@ -1687,14 +1687,14 @@ void tst_QSGGridView::propertyChanges() gridView->setWrapEnabled(false); gridView->setCacheBuffer(3); - gridView->setFlow(QSGGridView::TopToBottom); + gridView->setFlow(QQuickGridView::TopToBottom); QTRY_COMPARE(keyNavigationWrapsSpy.count(),1); QTRY_COMPARE(cacheBufferSpy.count(),1); QTRY_COMPARE(flowSpy.count(),1); - gridView->setFlow(QSGGridView::LeftToRight); - QTRY_COMPARE(gridView->flow(), QSGGridView::LeftToRight); + gridView->setFlow(QQuickGridView::LeftToRight); + QTRY_COMPARE(gridView->flow(), QQuickGridView::LeftToRight); gridView->setWrapEnabled(true); gridView->setCacheBuffer(5); @@ -1718,23 +1718,23 @@ void tst_QSGGridView::propertyChanges() QTRY_COMPARE(layoutSpy.count(),1); QTRY_COMPARE(flowSpy.count(),2); - gridView->setFlow(QSGGridView::TopToBottom); - QTRY_COMPARE(gridView->flow(), QSGGridView::TopToBottom); + gridView->setFlow(QQuickGridView::TopToBottom); + QTRY_COMPARE(gridView->flow(), QQuickGridView::TopToBottom); QTRY_COMPARE(flowSpy.count(),3); - gridView->setFlow(QSGGridView::TopToBottom); + gridView->setFlow(QQuickGridView::TopToBottom); QTRY_COMPARE(flowSpy.count(),3); delete canvas; } -void tst_QSGGridView::componentChanges() +void tst_QQuickGridView::componentChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QTRY_VERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychangestest.qml"))); - QSGGridView *gridView = canvas->rootObject()->findChild<QSGGridView*>("gridView"); + QQuickGridView *gridView = canvas->rootObject()->findChild<QQuickGridView*>("gridView"); QTRY_VERIFY(gridView); QDeclarativeComponent component(canvas->engine()); @@ -1776,13 +1776,13 @@ void tst_QSGGridView::componentChanges() delete canvas; } -void tst_QSGGridView::modelChanges() +void tst_QQuickGridView::modelChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QTRY_VERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychangestest.qml"))); - QSGGridView *gridView = canvas->rootObject()->findChild<QSGGridView*>("gridView"); + QQuickGridView *gridView = canvas->rootObject()->findChild<QQuickGridView*>("gridView"); QTRY_VERIFY(gridView); QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel"); @@ -1802,9 +1802,9 @@ void tst_QSGGridView::modelChanges() delete canvas; } -void tst_QSGGridView::positionViewAtIndex() +void tst_QQuickGridView::positionViewAtIndex() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 40; i++) @@ -1818,16 +1818,16 @@ void tst_QSGGridView::positionViewAtIndex() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), (i%3)*80.); @@ -1835,14 +1835,14 @@ void tst_QSGGridView::positionViewAtIndex() } // Position on a currently visible item - gridview->positionViewAtIndex(4, QSGGridView::Beginning); + gridview->positionViewAtIndex(4, QQuickGridView::Beginning); QTRY_COMPARE(gridview->indexAt(120, 90), 4); QTRY_COMPARE(gridview->contentY(), 60.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 3; i < model.count() && i < itemCount-3-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), (i%3)*80.); @@ -1850,14 +1850,14 @@ void tst_QSGGridView::positionViewAtIndex() } // Position on an item beyond the visible items - gridview->positionViewAtIndex(21, QSGGridView::Beginning); + gridview->positionViewAtIndex(21, QQuickGridView::Beginning); QTRY_COMPARE(gridview->indexAt(40, 450), 21); QTRY_COMPARE(gridview->contentY(), 420.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 22; i < model.count() && i < itemCount-22-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), (i%3)*80.); @@ -1865,14 +1865,14 @@ void tst_QSGGridView::positionViewAtIndex() } // Position on an item that would leave empty space if positioned at the top - gridview->positionViewAtIndex(31, QSGGridView::Beginning); + gridview->positionViewAtIndex(31, QQuickGridView::Beginning); QTRY_COMPARE(gridview->indexAt(120, 630), 31); QTRY_COMPARE(gridview->contentY(), 520.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 24; i < model.count() && i < itemCount-24-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), (i%3)*80.); @@ -1880,16 +1880,16 @@ void tst_QSGGridView::positionViewAtIndex() } // Position at the beginning again - gridview->positionViewAtIndex(0, QSGGridView::Beginning); + gridview->positionViewAtIndex(0, QQuickGridView::Beginning); QTRY_COMPARE(gridview->indexAt(0, 0), 0); QTRY_COMPARE(gridview->indexAt(40, 30), 0); QTRY_COMPARE(gridview->indexAt(80, 60), 4); QTRY_COMPARE(gridview->contentY(), 0.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), (i%3)*80.); @@ -1897,53 +1897,53 @@ void tst_QSGGridView::positionViewAtIndex() } // Position at End - gridview->positionViewAtIndex(30, QSGGridView::End); + gridview->positionViewAtIndex(30, QQuickGridView::End); QTRY_COMPARE(gridview->contentY(), 340.); // Position in Center - gridview->positionViewAtIndex(15, QSGGridView::Center); + gridview->positionViewAtIndex(15, QQuickGridView::Center); QTRY_COMPARE(gridview->contentY(), 170.); // Ensure at least partially visible - gridview->positionViewAtIndex(15, QSGGridView::Visible); + gridview->positionViewAtIndex(15, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentY(), 170.); gridview->setContentY(302); - gridview->positionViewAtIndex(15, QSGGridView::Visible); + gridview->positionViewAtIndex(15, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentY(), 302.); gridview->setContentY(360); - gridview->positionViewAtIndex(15, QSGGridView::Visible); + gridview->positionViewAtIndex(15, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentY(), 300.); gridview->setContentY(60); - gridview->positionViewAtIndex(20, QSGGridView::Visible); + gridview->positionViewAtIndex(20, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentY(), 60.); gridview->setContentY(20); - gridview->positionViewAtIndex(20, QSGGridView::Visible); + gridview->positionViewAtIndex(20, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentY(), 100.); // Ensure completely visible gridview->setContentY(120); - gridview->positionViewAtIndex(20, QSGGridView::Contain); + gridview->positionViewAtIndex(20, QQuickGridView::Contain); QTRY_COMPARE(gridview->contentY(), 120.); gridview->setContentY(302); - gridview->positionViewAtIndex(15, QSGGridView::Contain); + gridview->positionViewAtIndex(15, QQuickGridView::Contain); QTRY_COMPARE(gridview->contentY(), 300.); gridview->setContentY(60); - gridview->positionViewAtIndex(20, QSGGridView::Contain); + gridview->positionViewAtIndex(20, QQuickGridView::Contain); QTRY_COMPARE(gridview->contentY(), 100.); // Test for Top To Bottom layout ctxt->setContextProperty("testTopToBottom", QVariant(true)); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), (i/5)*80.); @@ -1951,27 +1951,27 @@ void tst_QSGGridView::positionViewAtIndex() } // Position at End - gridview->positionViewAtIndex(30, QSGGridView::End); + gridview->positionViewAtIndex(30, QQuickGridView::End); QTRY_COMPARE(gridview->contentX(), 320.); QTRY_COMPARE(gridview->contentY(), 0.); // Position in Center - gridview->positionViewAtIndex(15, QSGGridView::Center); + gridview->positionViewAtIndex(15, QQuickGridView::Center); QTRY_COMPARE(gridview->contentX(), 160.); // Ensure at least partially visible - gridview->positionViewAtIndex(15, QSGGridView::Visible); + gridview->positionViewAtIndex(15, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentX(), 160.); gridview->setContentX(170); - gridview->positionViewAtIndex(25, QSGGridView::Visible); + gridview->positionViewAtIndex(25, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentX(), 170.); - gridview->positionViewAtIndex(30, QSGGridView::Visible); + gridview->positionViewAtIndex(30, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentX(), 320.); gridview->setContentX(170); - gridview->positionViewAtIndex(25, QSGGridView::Contain); + gridview->positionViewAtIndex(25, QQuickGridView::Contain); QTRY_COMPARE(gridview->contentX(), 240.); // positionViewAtBeginning @@ -2003,9 +2003,9 @@ void tst_QSGGridView::positionViewAtIndex() delete canvas; } -void tst_QSGGridView::snapping() +void tst_QQuickGridView::snapping() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 40; i++) @@ -2019,41 +2019,41 @@ void tst_QSGGridView::snapping() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); gridview->setHeight(220); QCOMPARE(gridview->height(), 220.); - gridview->positionViewAtIndex(12, QSGGridView::Visible); + gridview->positionViewAtIndex(12, QQuickGridView::Visible); QCOMPARE(gridview->contentY(), 80.); gridview->setContentY(0); QCOMPARE(gridview->contentY(), 0.); - gridview->setSnapMode(QSGGridView::SnapToRow); - QCOMPARE(gridview->snapMode(), QSGGridView::SnapToRow); + gridview->setSnapMode(QQuickGridView::SnapToRow); + QCOMPARE(gridview->snapMode(), QQuickGridView::SnapToRow); - gridview->positionViewAtIndex(12, QSGGridView::Visible); + gridview->positionViewAtIndex(12, QQuickGridView::Visible); QCOMPARE(gridview->contentY(), 60.); - gridview->positionViewAtIndex(15, QSGGridView::End); + gridview->positionViewAtIndex(15, QQuickGridView::End); QCOMPARE(gridview->contentY(), 120.); delete canvas; } -void tst_QSGGridView::mirroring() +void tst_QQuickGridView::mirroring() { - QSGView *canvasA = createView(); + QQuickView *canvasA = createView(); canvasA->setSource(QUrl::fromLocalFile(TESTDATA("mirroring.qml"))); - QSGGridView *gridviewA = findItem<QSGGridView>(canvasA->rootObject(), "view"); + QQuickGridView *gridviewA = findItem<QQuickGridView>(canvasA->rootObject(), "view"); QTRY_VERIFY(gridviewA != 0); - QSGView *canvasB = createView(); + QQuickView *canvasB = createView(); canvasB->setSource(QUrl::fromLocalFile(TESTDATA("mirroring.qml"))); - QSGGridView *gridviewB = findItem<QSGGridView>(canvasB->rootObject(), "view"); + QQuickGridView *gridviewB = findItem<QQuickGridView>(canvasB->rootObject(), "view"); QTRY_VERIFY(gridviewA != 0); qApp->processEvents(); @@ -2066,48 +2066,48 @@ void tst_QSGGridView::mirroring() // LTR != RTL foreach (const QString objectName, objectNames) - QVERIFY(findItem<QSGItem>(gridviewA, objectName)->x() != findItem<QSGItem>(gridviewB, objectName)->x()); + QVERIFY(findItem<QQuickItem>(gridviewA, objectName)->x() != findItem<QQuickItem>(gridviewB, objectName)->x()); gridviewA->setProperty("layoutDirection", Qt::LeftToRight); gridviewB->setProperty("layoutDirection", Qt::LeftToRight); // LTR == LTR foreach (const QString objectName, objectNames) - QCOMPARE(findItem<QSGItem>(gridviewA, objectName)->x(), findItem<QSGItem>(gridviewB, objectName)->x()); + QCOMPARE(findItem<QQuickItem>(gridviewA, objectName)->x(), findItem<QQuickItem>(gridviewB, objectName)->x()); QVERIFY(gridviewB->layoutDirection() == gridviewB->effectiveLayoutDirection()); - QSGItemPrivate::get(gridviewB)->setLayoutMirror(true); + QQuickItemPrivate::get(gridviewB)->setLayoutMirror(true); QVERIFY(gridviewB->layoutDirection() != gridviewB->effectiveLayoutDirection()); // LTR != LTR+mirror foreach (const QString objectName, objectNames) - QVERIFY(findItem<QSGItem>(gridviewA, objectName)->x() != findItem<QSGItem>(gridviewB, objectName)->x()); + QVERIFY(findItem<QQuickItem>(gridviewA, objectName)->x() != findItem<QQuickItem>(gridviewB, objectName)->x()); gridviewA->setProperty("layoutDirection", Qt::RightToLeft); // RTL == LTR+mirror foreach (const QString objectName, objectNames) - QCOMPARE(findItem<QSGItem>(gridviewA, objectName)->x(), findItem<QSGItem>(gridviewB, objectName)->x()); + QCOMPARE(findItem<QQuickItem>(gridviewA, objectName)->x(), findItem<QQuickItem>(gridviewB, objectName)->x()); gridviewB->setProperty("layoutDirection", Qt::RightToLeft); // RTL != RTL+mirror foreach (const QString objectName, objectNames) - QVERIFY(findItem<QSGItem>(gridviewA, objectName)->x() != findItem<QSGItem>(gridviewB, objectName)->x()); + QVERIFY(findItem<QQuickItem>(gridviewA, objectName)->x() != findItem<QQuickItem>(gridviewB, objectName)->x()); gridviewA->setProperty("layoutDirection", Qt::LeftToRight); // LTR == RTL+mirror foreach (const QString objectName, objectNames) - QCOMPARE(findItem<QSGItem>(gridviewA, objectName)->x(), findItem<QSGItem>(gridviewB, objectName)->x()); + QCOMPARE(findItem<QQuickItem>(gridviewA, objectName)->x(), findItem<QQuickItem>(gridviewB, objectName)->x()); delete canvasA; delete canvasB; } -void tst_QSGGridView::positionViewAtIndex_rightToLeft() +void tst_QQuickGridView::positionViewAtIndex_rightToLeft() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 40; i++) @@ -2121,16 +2121,16 @@ void tst_QSGGridView::positionViewAtIndex_rightToLeft() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width())); @@ -2138,13 +2138,13 @@ void tst_QSGGridView::positionViewAtIndex_rightToLeft() } // Position on a currently visible item - gridview->positionViewAtIndex(6, QSGGridView::Beginning); + gridview->positionViewAtIndex(6, QQuickGridView::Beginning); QTRY_COMPARE(gridview->contentX(), -320.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 3; i < model.count() && i < itemCount-3-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width())); @@ -2152,13 +2152,13 @@ void tst_QSGGridView::positionViewAtIndex_rightToLeft() } // Position on an item beyond the visible items - gridview->positionViewAtIndex(21, QSGGridView::Beginning); + gridview->positionViewAtIndex(21, QQuickGridView::Beginning); QTRY_COMPARE(gridview->contentX(), -560.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 22; i < model.count() && i < itemCount-22-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width())); @@ -2166,13 +2166,13 @@ void tst_QSGGridView::positionViewAtIndex_rightToLeft() } // Position on an item that would leave empty space if positioned at the top - gridview->positionViewAtIndex(31, QSGGridView::Beginning); + gridview->positionViewAtIndex(31, QQuickGridView::Beginning); QTRY_COMPARE(gridview->contentX(), -640.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 24; i < model.count() && i < itemCount-24-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width())); @@ -2180,13 +2180,13 @@ void tst_QSGGridView::positionViewAtIndex_rightToLeft() } // Position at the beginning again - gridview->positionViewAtIndex(0, QSGGridView::Beginning); + gridview->positionViewAtIndex(0, QQuickGridView::Beginning); QTRY_COMPARE(gridview->contentX(), -240.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), qreal(-(i/5)*80-item->width())); @@ -2194,52 +2194,52 @@ void tst_QSGGridView::positionViewAtIndex_rightToLeft() } // Position at End - gridview->positionViewAtIndex(30, QSGGridView::End); + gridview->positionViewAtIndex(30, QQuickGridView::End); QTRY_COMPARE(gridview->contentX(), -560.); // Position in Center - gridview->positionViewAtIndex(15, QSGGridView::Center); + gridview->positionViewAtIndex(15, QQuickGridView::Center); QTRY_COMPARE(gridview->contentX(), -400.); // Ensure at least partially visible - gridview->positionViewAtIndex(15, QSGGridView::Visible); + gridview->positionViewAtIndex(15, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentX(), -400.); gridview->setContentX(-555.); - gridview->positionViewAtIndex(15, QSGGridView::Visible); + gridview->positionViewAtIndex(15, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentX(), -555.); gridview->setContentX(-239); - gridview->positionViewAtIndex(15, QSGGridView::Visible); + gridview->positionViewAtIndex(15, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentX(), -320.); gridview->setContentX(-239); - gridview->positionViewAtIndex(20, QSGGridView::Visible); + gridview->positionViewAtIndex(20, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentX(), -400.); gridview->setContentX(-640); - gridview->positionViewAtIndex(20, QSGGridView::Visible); + gridview->positionViewAtIndex(20, QQuickGridView::Visible); QTRY_COMPARE(gridview->contentX(), -560.); // Ensure completely visible gridview->setContentX(-400); - gridview->positionViewAtIndex(20, QSGGridView::Contain); + gridview->positionViewAtIndex(20, QQuickGridView::Contain); QTRY_COMPARE(gridview->contentX(), -400.); gridview->setContentX(-315); - gridview->positionViewAtIndex(15, QSGGridView::Contain); + gridview->positionViewAtIndex(15, QQuickGridView::Contain); QTRY_COMPARE(gridview->contentX(), -320.); gridview->setContentX(-640); - gridview->positionViewAtIndex(20, QSGGridView::Contain); + gridview->positionViewAtIndex(20, QQuickGridView::Contain); QTRY_COMPARE(gridview->contentX(), -560.); delete canvas; } -void tst_QSGGridView::resetModel() +void tst_QQuickGridView::resetModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QStringList strings; strings << "one" << "two" << "three"; @@ -2251,16 +2251,16 @@ void tst_QSGGridView::resetModel() canvas->setSource(QUrl::fromLocalFile(TESTDATA("displaygrid.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_COMPARE(gridview->count(), model.rowCount()); for (int i = 0; i < model.rowCount(); ++i) { - QSGText *display = findItem<QSGText>(contentItem, "displayText", i); + QQuickText *display = findItem<QQuickText>(contentItem, "displayText", i); QTRY_VERIFY(display != 0); QTRY_COMPARE(display->text(), strings.at(i)); } @@ -2272,7 +2272,7 @@ void tst_QSGGridView::resetModel() QTRY_COMPARE(gridview->count(), model.rowCount()); for (int i = 0; i < model.rowCount(); ++i) { - QSGText *display = findItem<QSGText>(contentItem, "displayText", i); + QQuickText *display = findItem<QQuickText>(contentItem, "displayText", i); QTRY_VERIFY(display != 0); QTRY_COMPARE(display->text(), strings.at(i)); } @@ -2280,9 +2280,9 @@ void tst_QSGGridView::resetModel() delete canvas; } -void tst_QSGGridView::enforceRange() +void tst_QQuickGridView::enforceRange() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -2297,25 +2297,25 @@ void tst_QSGGridView::enforceRange() qApp->processEvents(); QVERIFY(canvas->rootObject() != 0); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); QTRY_COMPARE(gridview->preferredHighlightBegin(), 100.0); QTRY_COMPARE(gridview->preferredHighlightEnd(), 100.0); - QTRY_COMPARE(gridview->highlightRangeMode(), QSGGridView::StrictlyEnforceRange); + QTRY_COMPARE(gridview->highlightRangeMode(), QQuickGridView::StrictlyEnforceRange); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); // view should be positioned at the top of the range. - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QTRY_VERIFY(item); QTRY_COMPARE(gridview->contentY(), -100.0); - QSGText *name = findItem<QSGText>(contentItem, "textName", 0); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 0); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(0)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 0); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 0); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(0)); @@ -2336,9 +2336,9 @@ void tst_QSGGridView::enforceRange() delete canvas; } -void tst_QSGGridView::enforceRange_rightToLeft() +void tst_QQuickGridView::enforceRange_rightToLeft() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -2353,26 +2353,26 @@ void tst_QSGGridView::enforceRange_rightToLeft() qApp->processEvents(); QVERIFY(canvas->rootObject() != 0); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); QTRY_COMPARE(gridview->preferredHighlightBegin(), 100.0); QTRY_COMPARE(gridview->preferredHighlightEnd(), 100.0); - QTRY_COMPARE(gridview->highlightRangeMode(), QSGGridView::StrictlyEnforceRange); + QTRY_COMPARE(gridview->highlightRangeMode(), QQuickGridView::StrictlyEnforceRange); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); // view should be positioned at the top of the range. - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QTRY_VERIFY(item); QTRY_COMPARE(gridview->contentX(), -100.); QTRY_COMPARE(gridview->contentY(), 0.0); - QSGText *name = findItem<QSGText>(contentItem, "textName", 0); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 0); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(0)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 0); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 0); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(0)); @@ -2394,14 +2394,14 @@ void tst_QSGGridView::enforceRange_rightToLeft() delete canvas; } -void tst_QSGGridView::QTBUG_8456() +void tst_QQuickGridView::QTBUG_8456() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("setindex.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); QTRY_COMPARE(gridview->currentIndex(), 0); @@ -2409,46 +2409,46 @@ void tst_QSGGridView::QTBUG_8456() delete canvas; } -void tst_QSGGridView::manualHighlight() +void tst_QQuickGridView::manualHighlight() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QString filename(TESTDATA("manual-highlight.qml")); canvas->setSource(QUrl::fromLocalFile(filename)); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_COMPARE(gridview->currentIndex(), 0); - QTRY_COMPARE(gridview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 0)); + QTRY_COMPARE(gridview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 0)); QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y()); QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x()); gridview->setCurrentIndex(2); QTRY_COMPARE(gridview->currentIndex(), 2); - QTRY_COMPARE(gridview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 2)); + QTRY_COMPARE(gridview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 2)); QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y()); QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x()); - gridview->positionViewAtIndex(8, QSGGridView::Contain); + gridview->positionViewAtIndex(8, QQuickGridView::Contain); QTRY_COMPARE(gridview->currentIndex(), 2); - QTRY_COMPARE(gridview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 2)); + QTRY_COMPARE(gridview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 2)); QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y()); QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x()); - gridview->setFlow(QSGGridView::TopToBottom); - QTRY_COMPARE(gridview->flow(), QSGGridView::TopToBottom); + gridview->setFlow(QQuickGridView::TopToBottom); + QTRY_COMPARE(gridview->flow(), QQuickGridView::TopToBottom); gridview->setCurrentIndex(0); QTRY_COMPARE(gridview->currentIndex(), 0); - QTRY_COMPARE(gridview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 0)); + QTRY_COMPARE(gridview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 0)); QTRY_COMPARE(gridview->highlightItem()->y() - 5, gridview->currentItem()->y()); QTRY_COMPARE(gridview->highlightItem()->x() - 5, gridview->currentItem()->x()); @@ -2456,9 +2456,9 @@ void tst_QSGGridView::manualHighlight() } -void tst_QSGGridView::footer() +void tst_QQuickGridView::footer() { - QFETCH(QSGGridView::Flow, flow); + QFETCH(QQuickGridView::Flow, flow); QFETCH(Qt::LayoutDirection, layoutDirection); QFETCH(QPointF, initialFooterPos); QFETCH(QPointF, changedFooterPos); @@ -2467,7 +2467,7 @@ void tst_QSGGridView::footer() QFETCH(QPointF, firstDelegatePos); QFETCH(QPointF, resizeContentPos); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -2480,15 +2480,15 @@ void tst_QSGGridView::footer() canvas->setSource(QUrl::fromLocalFile(TESTDATA("footer.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); gridview->setFlow(flow); gridview->setLayoutDirection(layoutDirection); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGText *footer = findItem<QSGText>(contentItem, "footer"); + QQuickText *footer = findItem<QQuickText>(contentItem, "footer"); QVERIFY(footer); QVERIFY(footer == gridview->footerItem()); @@ -2498,11 +2498,11 @@ void tst_QSGGridView::footer() QCOMPARE(footer->height(), 30.); QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos); - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); - if (flow == QSGGridView::LeftToRight) { + if (flow == QQuickGridView::LeftToRight) { // shrink by one row model.removeItem(2); QTRY_COMPARE(footer->y(), initialFooterPos.y() - gridview->cellHeight()); @@ -2521,12 +2521,12 @@ void tst_QSGGridView::footer() QPointF posWhenNoItems(0, 0); if (layoutDirection == Qt::RightToLeft) - posWhenNoItems.setX(flow == QSGGridView::LeftToRight ? gridview->width() - footer->width() : -footer->width()); + posWhenNoItems.setX(flow == QQuickGridView::LeftToRight ? gridview->width() - footer->width() : -footer->width()); QTRY_COMPARE(footer->pos(), posWhenNoItems); // if header is present, it's at a negative pos, so the footer should not move canvas->rootObject()->setProperty("showHeader", true); - QVERIFY(findItem<QSGItem>(contentItem, "header") != 0); + QVERIFY(findItem<QQuickItem>(contentItem, "header") != 0); QTRY_COMPARE(footer->pos(), posWhenNoItems); canvas->rootObject()->setProperty("showHeader", false); @@ -2539,9 +2539,9 @@ void tst_QSGGridView::footer() QCOMPARE(footerItemSpy.count(), 1); - footer = findItem<QSGText>(contentItem, "footer"); + footer = findItem<QQuickText>(contentItem, "footer"); QVERIFY(!footer); - footer = findItem<QSGText>(contentItem, "footer2"); + footer = findItem<QQuickText>(contentItem, "footer2"); QVERIFY(footer); QVERIFY(footer == gridview->footerItem()); @@ -2551,7 +2551,7 @@ void tst_QSGGridView::footer() QCOMPARE(footer->height(), 20.); QTRY_COMPARE(QPointF(gridview->contentX(), gridview->contentY()), changedContentPos); - item = findItem<QSGItem>(contentItem, "wrapper", 0); + item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -2563,9 +2563,9 @@ void tst_QSGGridView::footer() delete canvas; } -void tst_QSGGridView::footer_data() +void tst_QQuickGridView::footer_data() { - QTest::addColumn<QSGGridView::Flow>("flow"); + QTest::addColumn<QQuickGridView::Flow>("flow"); QTest::addColumn<Qt::LayoutDirection>("layoutDirection"); QTest::addColumn<QPointF>("initialFooterPos"); QTest::addColumn<QPointF>("changedFooterPos"); @@ -2581,7 +2581,7 @@ void tst_QSGGridView::footer_data() // view height = 320 // footer below items, bottom left - QTest::newRow("flow left to right") << QSGGridView::LeftToRight << Qt::LeftToRight + QTest::newRow("flow left to right") << QQuickGridView::LeftToRight << Qt::LeftToRight << QPointF(0, 3 * 60) // 180 = height of 3 rows (cell height is 60) << QPointF(0, 10 * 60) // 30 items = 10 rows << QPointF(0, 0) @@ -2590,7 +2590,7 @@ void tst_QSGGridView::footer_data() << QPointF(0, 10 * 60 - 320 + 10); // footer below items, bottom right - QTest::newRow("flow left to right, layout right to left") << QSGGridView::LeftToRight << Qt::RightToLeft + QTest::newRow("flow left to right, layout right to left") << QQuickGridView::LeftToRight << Qt::RightToLeft << QPointF(240 - 100, 3 * 60) << QPointF((240 - 100) + 50, 10 * 60) // 50 = width diff between old and new footers << QPointF(0, 0) @@ -2599,7 +2599,7 @@ void tst_QSGGridView::footer_data() << QPointF(0, 10 * 60 - 320 + 10); // footer to right of items - QTest::newRow("flow top to bottom, layout left to right") << QSGGridView::TopToBottom << Qt::LeftToRight + QTest::newRow("flow top to bottom, layout left to right") << QQuickGridView::TopToBottom << Qt::LeftToRight << QPointF(2 * 80, 0) // 2 columns, cell width 80 << QPointF(6 * 80, 0) // 30 items = 6 columns << QPointF(0, 0) @@ -2608,7 +2608,7 @@ void tst_QSGGridView::footer_data() << QPointF(6 * 80 - 240 + 40, 0); // footer to left of items - QTest::newRow("flow top to bottom, layout right to left") << QSGGridView::TopToBottom << Qt::RightToLeft + QTest::newRow("flow top to bottom, layout right to left") << QQuickGridView::TopToBottom << Qt::RightToLeft << QPointF(-(2 * 80) - 100, 0) << QPointF(-(6 * 80) - 50, 0) // 50 = new footer width << QPointF(-240, 0) @@ -2617,9 +2617,9 @@ void tst_QSGGridView::footer_data() << QPointF(-(6 * 80) - 40, 0); } -void tst_QSGGridView::header() +void tst_QQuickGridView::header() { - QFETCH(QSGGridView::Flow, flow); + QFETCH(QQuickGridView::Flow, flow); QFETCH(Qt::LayoutDirection, layoutDirection); QFETCH(QPointF, initialHeaderPos); QFETCH(QPointF, changedHeaderPos); @@ -2632,21 +2632,21 @@ void tst_QSGGridView::header() for (int i = 0; i < 30; i++) model.addItem("Item" + QString::number(i), ""); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->rootContext()->setContextProperty("testModel", &model); canvas->rootContext()->setContextProperty("initialViewWidth", 240); canvas->rootContext()->setContextProperty("initialViewHeight", 320); canvas->setSource(QUrl::fromLocalFile(TESTDATA("header.qml"))); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); gridview->setFlow(flow); gridview->setLayoutDirection(layoutDirection); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGText *header = findItem<QSGText>(contentItem, "header"); + QQuickText *header = findItem<QQuickText>(contentItem, "header"); QVERIFY(header); QVERIFY(header == gridview->headerItem()); @@ -2656,7 +2656,7 @@ void tst_QSGGridView::header() QCOMPARE(header->height(), 30.); QCOMPARE(QPointF(gridview->contentX(), gridview->contentY()), initialContentPos); - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -2671,9 +2671,9 @@ void tst_QSGGridView::header() QCOMPARE(headerItemSpy.count(), 1); - header = findItem<QSGText>(contentItem, "header"); + header = findItem<QQuickText>(contentItem, "header"); QVERIFY(!header); - header = findItem<QSGText>(contentItem, "header2"); + header = findItem<QQuickText>(contentItem, "header2"); QVERIFY(header); QVERIFY(header == gridview->headerItem()); @@ -2683,7 +2683,7 @@ void tst_QSGGridView::header() QCOMPARE(header->height(), 20.); QTRY_COMPARE(QPointF(gridview->contentX(), gridview->contentY()), changedContentPos); - item = findItem<QSGItem>(contentItem, "wrapper", 0); + item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -2702,7 +2702,7 @@ void tst_QSGGridView::header() canvas->rootContext()->setContextProperty("initialViewHeight", 320); canvas->setSource(QUrl::fromLocalFile(TESTDATA("header.qml"))); - gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); gridview->setFlow(flow); gridview->setLayoutDirection(layoutDirection); @@ -2715,9 +2715,9 @@ void tst_QSGGridView::header() delete canvas; } -void tst_QSGGridView::header_data() +void tst_QQuickGridView::header_data() { - QTest::addColumn<QSGGridView::Flow>("flow"); + QTest::addColumn<QQuickGridView::Flow>("flow"); QTest::addColumn<Qt::LayoutDirection>("layoutDirection"); QTest::addColumn<QPointF>("initialHeaderPos"); QTest::addColumn<QPointF>("changedHeaderPos"); @@ -2732,7 +2732,7 @@ void tst_QSGGridView::header_data() // view width = 240 // header above items, top left - QTest::newRow("flow left to right") << QSGGridView::LeftToRight << Qt::LeftToRight + QTest::newRow("flow left to right") << QQuickGridView::LeftToRight << Qt::LeftToRight << QPointF(0, -30) << QPointF(0, -20) << QPointF(0, -30) @@ -2741,7 +2741,7 @@ void tst_QSGGridView::header_data() << QPointF(0, -10); // header above items, top right - QTest::newRow("flow left to right, layout right to left") << QSGGridView::LeftToRight << Qt::RightToLeft + QTest::newRow("flow left to right, layout right to left") << QQuickGridView::LeftToRight << Qt::RightToLeft << QPointF(240 - 100, -30) << QPointF((240 - 100) + 50, -20) // 50 = width diff between old and new headers << QPointF(0, -30) @@ -2750,7 +2750,7 @@ void tst_QSGGridView::header_data() << QPointF(0, -10); // header to left of items - QTest::newRow("flow top to bottom, layout left to right") << QSGGridView::TopToBottom << Qt::LeftToRight + QTest::newRow("flow top to bottom, layout left to right") << QQuickGridView::TopToBottom << Qt::LeftToRight << QPointF(-100, 0) << QPointF(-50, 0) << QPointF(-100, 0) @@ -2759,7 +2759,7 @@ void tst_QSGGridView::header_data() << QPointF(-40, 0); // header to right of items - QTest::newRow("flow top to bottom, layout right to left") << QSGGridView::TopToBottom << Qt::RightToLeft + QTest::newRow("flow top to bottom, layout right to left") << QQuickGridView::TopToBottom << Qt::RightToLeft << QPointF(0, 0) << QPointF(0, 0) << QPointF(-(240 - 100), 0) @@ -2768,9 +2768,9 @@ void tst_QSGGridView::header_data() << QPointF(-(240 - 40), 0); } -void tst_QSGGridView::resizeViewAndRepaint() +void tst_QQuickGridView::resizeViewAndRepaint() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -2784,26 +2784,26 @@ void tst_QSGGridView::resizeViewAndRepaint() canvas->setSource(QUrl::fromLocalFile(TESTDATA("resizeview.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); // item at index 10 should not be currently visible - QVERIFY(!findItem<QSGItem>(contentItem, "wrapper", 10)); + QVERIFY(!findItem<QQuickItem>(contentItem, "wrapper", 10)); gridview->setHeight(320); - QTRY_VERIFY(findItem<QSGItem>(contentItem, "wrapper", 10)); + QTRY_VERIFY(findItem<QQuickItem>(contentItem, "wrapper", 10)); gridview->setHeight(100); - QTRY_VERIFY(!findItem<QSGItem>(contentItem, "wrapper", 10)); + QTRY_VERIFY(!findItem<QQuickItem>(contentItem, "wrapper", 10)); delete canvas; } -void tst_QSGGridView::indexAt() +void tst_QQuickGridView::indexAt() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; model.addItem("Fred", "12345"); @@ -2822,10 +2822,10 @@ void tst_QSGGridView::indexAt() canvas->setSource(QUrl::fromLocalFile(TESTDATA("gridview1.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_COMPARE(gridview->count(), model.count()); @@ -2839,7 +2839,7 @@ void tst_QSGGridView::indexAt() delete canvas; } -void tst_QSGGridView::onAdd() +void tst_QQuickGridView::onAdd() { QFETCH(int, initialItemCount); QFETCH(int, itemsToAdd); @@ -2847,7 +2847,7 @@ void tst_QSGGridView::onAdd() const int delegateWidth = 50; const int delegateHeight = 100; TestModel model; - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setGeometry(0,0,5 * delegateWidth, 5 * delegateHeight); // just ensure all items fit // these initial items should not trigger GridView.onAdd @@ -2870,7 +2870,7 @@ void tst_QSGGridView::onAdd() items << qMakePair(QString("value %1").arg(i), QString::number(i)); model.addItems(items); - QTRY_COMPARE(model.count(), qobject_cast<QSGGridView*>(canvas->rootObject())->count()); + QTRY_COMPARE(model.count(), qobject_cast<QQuickGridView*>(canvas->rootObject())->count()); qApp->processEvents(); QVariantList result = object->property("addedDelegates").toList(); @@ -2881,7 +2881,7 @@ void tst_QSGGridView::onAdd() delete canvas; } -void tst_QSGGridView::onAdd_data() +void tst_QQuickGridView::onAdd_data() { QTest::addColumn<int>("initialItemCount"); QTest::addColumn<int>("itemsToAdd"); @@ -2899,7 +2899,7 @@ void tst_QSGGridView::onAdd_data() QTest::newRow("5, add 10") << 5 << 10; } -void tst_QSGGridView::onRemove() +void tst_QQuickGridView::onRemove() { QFETCH(int, initialItemCount); QFETCH(int, indexToRemove); @@ -2911,7 +2911,7 @@ void tst_QSGGridView::onRemove() for (int i=0; i<initialItemCount; i++) model.addItem(QString("value %1").arg(i), "dummy value"); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("delegateWidth", delegateWidth); @@ -2920,13 +2920,13 @@ void tst_QSGGridView::onRemove() QObject *object = canvas->rootObject(); model.removeItems(indexToRemove, removeCount); - QTRY_COMPARE(model.count(), qobject_cast<QSGGridView*>(canvas->rootObject())->count()); + QTRY_COMPARE(model.count(), qobject_cast<QQuickGridView*>(canvas->rootObject())->count()); QCOMPARE(object->property("removedDelegateCount"), QVariant(removeCount)); delete canvas; } -void tst_QSGGridView::onRemove_data() +void tst_QQuickGridView::onRemove_data() { QTest::addColumn<int>("initialItemCount"); QTest::addColumn<int>("indexToRemove"); @@ -2949,7 +2949,7 @@ void tst_QSGGridView::onRemove_data() QTest::newRow("ten items, remove 4-10") << 10 << 4 << 6; } -void tst_QSGGridView::testQtQuick11Attributes() +void tst_QQuickGridView::testQtQuick11Attributes() { QFETCH(QString, code); QFETCH(QString, warning); @@ -2973,7 +2973,7 @@ void tst_QSGGridView::testQtQuick11Attributes() delete obj; } -void tst_QSGGridView::testQtQuick11Attributes_data() +void tst_QQuickGridView::testQtQuick11Attributes_data() { QTest::addColumn<QString>("code"); QTest::addColumn<QString>("warning"); @@ -2988,29 +2988,29 @@ void tst_QSGGridView::testQtQuick11Attributes_data() << ""; } -void tst_QSGGridView::columnCount() +void tst_QQuickGridView::columnCount() { - QSGView canvas; + QQuickView canvas; canvas.setSource(QUrl::fromLocalFile(TESTDATA("gridview4.qml"))); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); - QSGGridView *view = qobject_cast<QSGGridView*>(canvas.rootObject()); + QQuickGridView *view = qobject_cast<QQuickGridView*>(canvas.rootObject()); QCOMPARE(view->cellWidth(), qreal(405)/qreal(9)); QCOMPARE(view->cellHeight(), qreal(100)); - QList<QSGItem*> items = findItems<QSGItem>(view, "delegate"); + QList<QQuickItem*> items = findItems<QQuickItem>(view, "delegate"); QCOMPARE(items.size(), 18); QCOMPARE(items.at(8)->y(), qreal(0)); QCOMPARE(items.at(9)->y(), qreal(100)); } -void tst_QSGGridView::margins() +void tst_QQuickGridView::margins() { { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -3024,10 +3024,10 @@ void tst_QSGGridView::margins() canvas->setSource(QUrl::fromLocalFile(TESTDATA("margins.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); QCOMPARE(gridview->contentX(), -30.); @@ -3073,7 +3073,7 @@ void tst_QSGGridView::margins() } { //RTL - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -3087,10 +3087,10 @@ void tst_QSGGridView::margins() canvas->setSource(QUrl::fromLocalFile(TESTDATA("margins.qml"))); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); QCOMPARE(gridview->contentX(), -240+30.); @@ -3137,29 +3137,29 @@ void tst_QSGGridView::margins() } } -void tst_QSGGridView::creationContext() +void tst_QQuickGridView::creationContext() { - QSGView canvas; + QQuickView canvas; canvas.setGeometry(0,0,240,320); canvas.setSource(QUrl::fromLocalFile(TESTDATA("creationContext.qml"))); qApp->processEvents(); - QSGItem *rootItem = qobject_cast<QSGItem *>(canvas.rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem *>(canvas.rootObject()); QVERIFY(rootItem); QVERIFY(rootItem->property("count").toInt() > 0); - QSGItem *item; - QVERIFY(item = rootItem->findChild<QSGItem *>("listItem")); + QQuickItem *item; + QVERIFY(item = rootItem->findChild<QQuickItem *>("listItem")); QCOMPARE(item->property("text").toString(), QString("Hello!")); - QVERIFY(item = rootItem->findChild<QSGItem *>("header")); + QVERIFY(item = rootItem->findChild<QQuickItem *>("header")); QCOMPARE(item->property("text").toString(), QString("Hello!")); - QVERIFY(item = rootItem->findChild<QSGItem *>("footer")); + QVERIFY(item = rootItem->findChild<QQuickItem *>("footer")); QCOMPARE(item->property("text").toString(), QString("Hello!")); } -void tst_QSGGridView::snapToRow_data() +void tst_QQuickGridView::snapToRow_data() { - QTest::addColumn<QSGGridView::Flow>("flow"); + QTest::addColumn<QQuickGridView::Flow>("flow"); QTest::addColumn<Qt::LayoutDirection>("layoutDirection"); QTest::addColumn<int>("highlightRangeMode"); QTest::addColumn<QPoint>("flickStart"); @@ -3168,28 +3168,28 @@ void tst_QSGGridView::snapToRow_data() QTest::addColumn<qreal>("endExtent"); QTest::addColumn<qreal>("startExtent"); - QTest::newRow("vertical, left to right") << QSGGridView::LeftToRight << Qt::LeftToRight << int(QSGItemView::NoHighlightRange) + QTest::newRow("vertical, left to right") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0; - QTest::newRow("horizontal, left to right") << QSGGridView::TopToBottom << Qt::LeftToRight << int(QSGItemView::NoHighlightRange) + QTest::newRow("horizontal, left to right") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0; - QTest::newRow("horizontal, right to left") << QSGGridView::TopToBottom << Qt::RightToLeft << int(QSGItemView::NoHighlightRange) + QTest::newRow("horizontal, right to left") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange) << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 << -240.0; - QTest::newRow("vertical, left to right, enforce range") << QSGGridView::LeftToRight << Qt::LeftToRight << int(QSGItemView::StrictlyEnforceRange) + QTest::newRow("vertical, left to right, enforce range") << QQuickGridView::LeftToRight << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0; - QTest::newRow("horizontal, left to right, enforce range") << QSGGridView::TopToBottom << Qt::LeftToRight << int(QSGItemView::StrictlyEnforceRange) + QTest::newRow("horizontal, left to right, enforce range") << QQuickGridView::TopToBottom << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0; - QTest::newRow("horizontal, right to left, enforce range") << QSGGridView::TopToBottom << Qt::RightToLeft << int(QSGItemView::StrictlyEnforceRange) + QTest::newRow("horizontal, right to left, enforce range") << QQuickGridView::TopToBottom << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange) << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 - 140.0 << -220.0; } -void tst_QSGGridView::snapToRow() +void tst_QQuickGridView::snapToRow() { - QFETCH(QSGGridView::Flow, flow); + QFETCH(QQuickGridView::Flow, flow); QFETCH(Qt::LayoutDirection, layoutDirection); QFETCH(int, highlightRangeMode); QFETCH(QPoint, flickStart); @@ -3198,26 +3198,26 @@ void tst_QSGGridView::snapToRow() QFETCH(qreal, endExtent); QFETCH(qreal, startExtent); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("snapToRow.qml"))); canvas->show(); qApp->processEvents(); - QSGGridView *gridview = findItem<QSGGridView>(canvas->rootObject(), "grid"); + QQuickGridView *gridview = findItem<QQuickGridView>(canvas->rootObject(), "grid"); QTRY_VERIFY(gridview != 0); gridview->setFlow(flow); gridview->setLayoutDirection(layoutDirection); - gridview->setHighlightRangeMode(QSGItemView::HighlightRangeMode(highlightRangeMode)); + gridview->setHighlightRangeMode(QQuickItemView::HighlightRangeMode(highlightRangeMode)); - QSGItem *contentItem = gridview->contentItem(); + QQuickItem *contentItem = gridview->contentItem(); QTRY_VERIFY(contentItem != 0); // confirm that a flick hits an item boundary flick(canvas, flickStart, flickEnd, 180); QTRY_VERIFY(gridview->isMoving() == false); // wait until it stops - if (flow == QSGGridView::LeftToRight) + if (flow == QQuickGridView::LeftToRight) QCOMPARE(qreal(fmod(gridview->contentY(),80.0)), snapAlignment); else QCOMPARE(qreal(fmod(gridview->contentX(),80.0)), snapAlignment); @@ -3226,11 +3226,11 @@ void tst_QSGGridView::snapToRow() do { flick(canvas, flickStart, flickEnd, 180); QTRY_VERIFY(gridview->isMoving() == false); // wait until it stops - } while (flow == QSGGridView::LeftToRight + } while (flow == QQuickGridView::LeftToRight ? !gridview->isAtYEnd() : layoutDirection == Qt::LeftToRight ? !gridview->isAtXEnd() : !gridview->isAtXBeginning()); - if (flow == QSGGridView::LeftToRight) + if (flow == QQuickGridView::LeftToRight) QCOMPARE(gridview->contentY(), endExtent); else QCOMPARE(gridview->contentX(), endExtent); @@ -3239,11 +3239,11 @@ void tst_QSGGridView::snapToRow() do { flick(canvas, flickEnd, flickStart, 180); QTRY_VERIFY(gridview->isMoving() == false); // wait until it stops - } while (flow == QSGGridView::LeftToRight + } while (flow == QQuickGridView::LeftToRight ? !gridview->isAtYBeginning() : layoutDirection == Qt::LeftToRight ? !gridview->isAtXBeginning() : !gridview->isAtXEnd()); - if (flow == QSGGridView::LeftToRight) + if (flow == QQuickGridView::LeftToRight) QCOMPARE(gridview->contentY(), startExtent); else QCOMPARE(gridview->contentX(), startExtent); @@ -3252,15 +3252,15 @@ void tst_QSGGridView::snapToRow() } -QSGView *tst_QSGGridView::createView() +QQuickView *tst_QQuickGridView::createView() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); return canvas; } -void tst_QSGGridView::flick(QSGView *canvas, const QPoint &from, const QPoint &to, int duration) +void tst_QQuickGridView::flick(QQuickView *canvas, const QPoint &from, const QPoint &to, int duration) { const int pointCount = 5; QPoint diff = to - from; @@ -3283,12 +3283,12 @@ void tst_QSGGridView::flick(QSGView *canvas, const QPoint &from, const QPoint &t item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_QSGGridView::findItem(QSGItem *parent, const QString &objectName, int index) +T *tst_QQuickGridView::findItem(QQuickItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -3313,13 +3313,13 @@ T *tst_QSGGridView::findItem(QSGItem *parent, const QString &objectName, int ind } template<typename T> -QList<T*> tst_QSGGridView::findItems(QSGItem *parent, const QString &objectName) +QList<T*> tst_QQuickGridView::findItems(QQuickItem *parent, const QString &objectName) { QList<T*> items; const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -3333,11 +3333,11 @@ QList<T*> tst_QSGGridView::findItems(QSGItem *parent, const QString &objectName) return items; } -void tst_QSGGridView::dumpTree(QSGItem *parent, int depth) +void tst_QQuickGridView::dumpTree(QQuickItem *parent, int depth) { static QString padding(" "); for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; QDeclarativeContext *context = QDeclarativeEngine::contextForObject(item); @@ -3347,7 +3347,7 @@ void tst_QSGGridView::dumpTree(QSGItem *parent, int depth) } -QTEST_MAIN(tst_QSGGridView) +QTEST_MAIN(tst_QQuickGridView) -#include "tst_qsggridview.moc" +#include "tst_qquickgridview.moc" diff --git a/tests/auto/declarative/qsgimage/data/aspectratio.qml b/tests/auto/declarative/qquickimage/data/aspectratio.qml index b26f0e1f04..b26f0e1f04 100644 --- a/tests/auto/declarative/qsgimage/data/aspectratio.qml +++ b/tests/auto/declarative/qquickimage/data/aspectratio.qml diff --git a/tests/auto/declarative/qsgimage/data/big.jpeg b/tests/auto/declarative/qquickimage/data/big.jpeg Binary files differindex bed7bd65c3..bed7bd65c3 100644 --- a/tests/auto/declarative/qsgimage/data/big.jpeg +++ b/tests/auto/declarative/qquickimage/data/big.jpeg diff --git a/tests/auto/declarative/qsgimage/data/big256.png b/tests/auto/declarative/qquickimage/data/big256.png Binary files differindex 1dc1596d03..1dc1596d03 100644 --- a/tests/auto/declarative/qsgimage/data/big256.png +++ b/tests/auto/declarative/qquickimage/data/big256.png diff --git a/tests/auto/declarative/qsgimage/data/colors.png b/tests/auto/declarative/qquickimage/data/colors.png Binary files differindex dfb62f3d64..dfb62f3d64 100644 --- a/tests/auto/declarative/qsgimage/data/colors.png +++ b/tests/auto/declarative/qquickimage/data/colors.png diff --git a/tests/auto/declarative/qsgimage/data/colors1.png b/tests/auto/declarative/qquickimage/data/colors1.png Binary files differindex dfb62f3d64..dfb62f3d64 100644 --- a/tests/auto/declarative/qsgimage/data/colors1.png +++ b/tests/auto/declarative/qquickimage/data/colors1.png diff --git a/tests/auto/declarative/qsgimage/data/green.png b/tests/auto/declarative/qquickimage/data/green.png Binary files differindex 0a2e153ba1..0a2e153ba1 100644 --- a/tests/auto/declarative/qsgimage/data/green.png +++ b/tests/auto/declarative/qquickimage/data/green.png diff --git a/tests/auto/declarative/qsgimage/data/heart-win32.png b/tests/auto/declarative/qquickimage/data/heart-win32.png Binary files differindex 351da13772..351da13772 100644 --- a/tests/auto/declarative/qsgimage/data/heart-win32.png +++ b/tests/auto/declarative/qquickimage/data/heart-win32.png diff --git a/tests/auto/declarative/qsgimage/data/heart.png b/tests/auto/declarative/qquickimage/data/heart.png Binary files differindex abe97fee4b..abe97fee4b 100644 --- a/tests/auto/declarative/qsgimage/data/heart.png +++ b/tests/auto/declarative/qquickimage/data/heart.png diff --git a/tests/auto/declarative/qsgimage/data/heart.svg b/tests/auto/declarative/qquickimage/data/heart.svg index 8c982cd93c..8c982cd93c 100644 --- a/tests/auto/declarative/qsgimage/data/heart.svg +++ b/tests/auto/declarative/qquickimage/data/heart.svg diff --git a/tests/auto/declarative/qsgimage/data/heart200-win32.png b/tests/auto/declarative/qquickimage/data/heart200-win32.png Binary files differindex 4976ff98ba..4976ff98ba 100644 --- a/tests/auto/declarative/qsgimage/data/heart200-win32.png +++ b/tests/auto/declarative/qquickimage/data/heart200-win32.png diff --git a/tests/auto/declarative/qsgimage/data/heart200.png b/tests/auto/declarative/qquickimage/data/heart200.png Binary files differindex 7fbb13c5bb..7fbb13c5bb 100644 --- a/tests/auto/declarative/qsgimage/data/heart200.png +++ b/tests/auto/declarative/qquickimage/data/heart200.png diff --git a/tests/auto/declarative/qsgimage/data/htiling.qml b/tests/auto/declarative/qquickimage/data/htiling.qml index f192f931c9..f192f931c9 100644 --- a/tests/auto/declarative/qsgimage/data/htiling.qml +++ b/tests/auto/declarative/qquickimage/data/htiling.qml diff --git a/tests/auto/declarative/qsgimage/data/mirror.qml b/tests/auto/declarative/qquickimage/data/mirror.qml index 98fddf083e..98fddf083e 100644 --- a/tests/auto/declarative/qsgimage/data/mirror.qml +++ b/tests/auto/declarative/qquickimage/data/mirror.qml diff --git a/tests/auto/declarative/qsgimage/data/nullpixmap.qml b/tests/auto/declarative/qquickimage/data/nullpixmap.qml index d52f41f164..d52f41f164 100644 --- a/tests/auto/declarative/qsgimage/data/nullpixmap.qml +++ b/tests/auto/declarative/qquickimage/data/nullpixmap.qml diff --git a/tests/auto/declarative/qsgimage/data/pattern.png b/tests/auto/declarative/qquickimage/data/pattern.png Binary files differindex d3d5e1e007..d3d5e1e007 100644 --- a/tests/auto/declarative/qsgimage/data/pattern.png +++ b/tests/auto/declarative/qquickimage/data/pattern.png diff --git a/tests/auto/declarative/qsgimage/data/qtbug_16389.qml b/tests/auto/declarative/qquickimage/data/qtbug_16389.qml index 7b8adecb11..7b8adecb11 100644 --- a/tests/auto/declarative/qsgimage/data/qtbug_16389.qml +++ b/tests/auto/declarative/qquickimage/data/qtbug_16389.qml diff --git a/tests/auto/declarative/qsgimage/data/rect.png b/tests/auto/declarative/qquickimage/data/rect.png Binary files differindex d564a2d5a5..d564a2d5a5 100644 --- a/tests/auto/declarative/qsgimage/data/rect.png +++ b/tests/auto/declarative/qquickimage/data/rect.png diff --git a/tests/auto/declarative/qsgimage/data/vtiling.qml b/tests/auto/declarative/qquickimage/data/vtiling.qml index f730f6e050..f730f6e050 100644 --- a/tests/auto/declarative/qsgimage/data/vtiling.qml +++ b/tests/auto/declarative/qquickimage/data/vtiling.qml diff --git a/tests/auto/declarative/qsgimage/qsgimage.pro b/tests/auto/declarative/qquickimage/qquickimage.pro index 11abb9fa18..46cbdb49aa 100644 --- a/tests/auto/declarative/qsgimage/qsgimage.pro +++ b/tests/auto/declarative/qquickimage/qquickimage.pro @@ -1,9 +1,9 @@ CONFIG += testcase -TARGET = tst_qsgimage +TARGET = tst_qquickimage macx:CONFIG -= app_bundle HEADERS += ../shared/testhttpserver.h -SOURCES += tst_qsgimage.cpp ../shared/testhttpserver.cpp +SOURCES += tst_qquickimage.cpp ../shared/testhttpserver.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgimage/tst_qsgimage.cpp b/tests/auto/declarative/qquickimage/tst_qquickimage.cpp index d0125e6582..3d7ee07d56 100644 --- a/tests/auto/declarative/qsgimage/tst_qsgimage.cpp +++ b/tests/auto/declarative/qquickimage/tst_qquickimage.cpp @@ -46,10 +46,10 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsgimage_p.h> -#include <private/qsgimagebase_p.h> -#include <private/qsgloader_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquickimage_p.h> +#include <private/qquickimagebase_p.h> +#include <private/qquickloader_p.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeexpression.h> #include <QtTest/QSignalSpy> @@ -62,11 +62,11 @@ #define SERVER_PORT 14451 #define SERVER_ADDR "http://127.0.0.1:14451" -class tst_qsgimage : public QObject +class tst_qquickimage : public QObject { Q_OBJECT public: - tst_qsgimage(); + tst_qquickimage(); private slots: void noSource(); @@ -91,33 +91,33 @@ private slots: private: template<typename T> - T *findItem(QSGItem *parent, const QString &id, int index=-1); + T *findItem(QQuickItem *parent, const QString &id, int index=-1); QDeclarativeEngine engine; }; -tst_qsgimage::tst_qsgimage() +tst_qquickimage::tst_qquickimage() { } -void tst_qsgimage::noSource() +void tst_qquickimage::noSource() { QString componentStr = "import QtQuick 2.0\nImage { source: \"\" }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->source(), QUrl()); - QVERIFY(obj->status() == QSGImage::Null); + QVERIFY(obj->status() == QQuickImage::Null); QCOMPARE(obj->width(), 0.); QCOMPARE(obj->height(), 0.); - QCOMPARE(obj->fillMode(), QSGImage::Stretch); + QCOMPARE(obj->fillMode(), QQuickImage::Stretch); QCOMPARE(obj->progress(), 0.0); delete obj; } -void tst_qsgimage::imageSource_data() +void tst_qquickimage::imageSource_data() { QTest::addColumn<QString>("source"); QTest::addColumn<double>("width"); @@ -144,7 +144,7 @@ void tst_qsgimage::imageSource_data() } -void tst_qsgimage::imageSource() +void tst_qquickimage::imageSource() { QFETCH(QString, source); QFETCH(double, width); @@ -169,7 +169,7 @@ void tst_qsgimage::imageSource() + (cache ? QLatin1String("true") : QLatin1String("false")) + " }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); if (async) @@ -183,40 +183,40 @@ void tst_qsgimage::imageSource() QVERIFY(obj->cache() == false); if (remote || async) - QTRY_VERIFY(obj->status() == QSGImage::Loading); + QTRY_VERIFY(obj->status() == QQuickImage::Loading); QCOMPARE(obj->source(), remote ? source : QUrl(source)); if (error.isEmpty()) { - QTRY_VERIFY(obj->status() == QSGImage::Ready); + QTRY_VERIFY(obj->status() == QQuickImage::Ready); QCOMPARE(obj->width(), qreal(width)); QCOMPARE(obj->height(), qreal(height)); - QCOMPARE(obj->fillMode(), QSGImage::Stretch); + QCOMPARE(obj->fillMode(), QQuickImage::Stretch); QCOMPARE(obj->progress(), 1.0); } else { - QTRY_VERIFY(obj->status() == QSGImage::Error); + QTRY_VERIFY(obj->status() == QQuickImage::Error); } delete obj; } -void tst_qsgimage::clearSource() +void tst_qquickimage::clearSource() { QString componentStr = "import QtQuick 2.0\nImage { source: srcImage }"; QDeclarativeContext *ctxt = engine.rootContext(); ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(TESTDATA("colors.png"))); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); - QVERIFY(obj->status() == QSGImage::Ready); + QVERIFY(obj->status() == QQuickImage::Ready); QCOMPARE(obj->width(), 120.); QCOMPARE(obj->height(), 120.); QCOMPARE(obj->progress(), 1.0); ctxt->setContextProperty("srcImage", ""); QVERIFY(obj->source().isEmpty()); - QVERIFY(obj->status() == QSGImage::Null); + QVERIFY(obj->status() == QQuickImage::Null); QCOMPARE(obj->width(), 0.); QCOMPARE(obj->height(), 0.); QCOMPARE(obj->progress(), 0.0); @@ -224,34 +224,34 @@ void tst_qsgimage::clearSource() delete obj; } -void tst_qsgimage::resized() +void tst_qquickimage::resized() { QString componentStr = "import QtQuick 2.0\nImage { source: \"" + TESTDATA("colors.png") + "\"; width: 300; height: 300 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); - QCOMPARE(obj->fillMode(), QSGImage::Stretch); + QCOMPARE(obj->fillMode(), QQuickImage::Stretch); delete obj; } -void tst_qsgimage::preserveAspectRatio() +void tst_qquickimage::preserveAspectRatio() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->show(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("aspectratio.qml"))); - QSGImage *image = qobject_cast<QSGImage*>(canvas->rootObject()); + QQuickImage *image = qobject_cast<QQuickImage*>(canvas->rootObject()); QVERIFY(image != 0); image->setWidth(80.0); QCOMPARE(image->width(), 80.); QCOMPARE(image->height(), 80.); canvas->setSource(QUrl::fromLocalFile(TESTDATA("aspectratio.qml"))); - image = qobject_cast<QSGImage*>(canvas->rootObject()); + image = qobject_cast<QQuickImage*>(canvas->rootObject()); image->setHeight(60.0); QVERIFY(image != 0); QCOMPARE(image->height(), 60.); @@ -259,36 +259,36 @@ void tst_qsgimage::preserveAspectRatio() delete canvas; } -void tst_qsgimage::smooth() +void tst_qquickimage::smooth() { QString componentStr = "import QtQuick 2.0\nImage { source: \"" + TESTDATA("colors.png") + "\"; smooth: true; width: 300; height: 300 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 300.); QCOMPARE(obj->height(), 300.); QCOMPARE(obj->smooth(), true); - QCOMPARE(obj->fillMode(), QSGImage::Stretch); + QCOMPARE(obj->fillMode(), QQuickImage::Stretch); delete obj; } -void tst_qsgimage::mirror() +void tst_qquickimage::mirror() { - QMap<QSGImage::FillMode, QImage> screenshots; - QList<QSGImage::FillMode> fillModes; - fillModes << QSGImage::Stretch << QSGImage::PreserveAspectFit << QSGImage::PreserveAspectCrop - << QSGImage::Tile << QSGImage::TileVertically << QSGImage::TileHorizontally; + QMap<QQuickImage::FillMode, QImage> screenshots; + QList<QQuickImage::FillMode> fillModes; + fillModes << QQuickImage::Stretch << QQuickImage::PreserveAspectFit << QQuickImage::PreserveAspectCrop + << QQuickImage::Tile << QQuickImage::TileVertically << QQuickImage::TileHorizontally; qreal width = 300; qreal height = 250; - foreach (QSGImage::FillMode fillMode, fillModes) { - QSGView *canvas = new QSGView; + foreach (QQuickImage::FillMode fillMode, fillModes) { + QQuickView *canvas = new QQuickView; canvas->setSource(QUrl::fromLocalFile(TESTDATA("mirror.qml"))); - QSGImage *obj = canvas->rootObject()->findChild<QSGImage*>("image"); + QQuickImage *obj = canvas->rootObject()->findChild<QQuickImage*>("image"); QVERIFY(obj != 0); obj->setFillMode(fillMode); @@ -300,7 +300,7 @@ void tst_qsgimage::mirror() delete canvas; } - foreach (QSGImage::FillMode fillMode, fillModes) { + foreach (QQuickImage::FillMode fillMode, fillModes) { QPixmap srcPixmap; QVERIFY(srcPixmap.load(TESTDATA("pattern.png"))); @@ -312,13 +312,13 @@ void tst_qsgimage::mirror() p_e.setTransform(transform); switch (fillMode) { - case QSGImage::Stretch: + case QQuickImage::Stretch: p_e.drawPixmap(QRect(0, 0, width, height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height())); break; - case QSGImage::PreserveAspectFit: + case QQuickImage::PreserveAspectFit: p_e.drawPixmap(QRect(25, 0, height, height), srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height())); break; - case QSGImage::PreserveAspectCrop: + case QQuickImage::PreserveAspectCrop: { qreal ratio = width/srcPixmap.width(); // width is the longer side QRect rect(0, 0, srcPixmap.width()*ratio, srcPixmap.height()*ratio); @@ -326,15 +326,15 @@ void tst_qsgimage::mirror() p_e.drawPixmap(rect, srcPixmap, QRect(0, 0, srcPixmap.width(), srcPixmap.height())); break; } - case QSGImage::Tile: + case QQuickImage::Tile: p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap); break; - case QSGImage::TileVertically: + case QQuickImage::TileVertically: transform.scale(width / srcPixmap.width(), 1.0); p_e.setTransform(transform); p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap); break; - case QSGImage::TileHorizontally: + case QQuickImage::TileHorizontally: transform.scale(1.0, height / srcPixmap.height()); p_e.setTransform(transform); p_e.drawTiledPixmap(QRect(0, 0, width, height), srcPixmap); @@ -349,7 +349,7 @@ void tst_qsgimage::mirror() } } -void tst_qsgimage::svg() +void tst_qquickimage::svg() { if (!QImageReader::supportedImageFormats().contains("svg")) QSKIP("svg support not available"); @@ -358,7 +358,7 @@ void tst_qsgimage::svg() QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 300.0); QCOMPARE(obj->height(), 300.0); @@ -369,7 +369,7 @@ void tst_qsgimage::svg() delete obj; } -void tst_qsgimage::geometry_data() +void tst_qquickimage::geometry_data() { QTest::addColumn<QString>("fillMode"); QTest::addColumn<bool>("explicitWidth"); @@ -406,7 +406,7 @@ void tst_qsgimage::geometry_data() } } -void tst_qsgimage::geometry() +void tst_qquickimage::geometry() { QFETCH(QString, fillMode); QFETCH(bool, explicitWidth); @@ -428,7 +428,7 @@ void tst_qsgimage::geometry() componentStr.append("}"); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), itemWidth); @@ -441,7 +441,7 @@ void tst_qsgimage::geometry() delete obj; } -void tst_qsgimage::big() +void tst_qquickimage::big() { // If the JPEG loader does not implement scaling efficiently, it would // have to build a 400 MB image. That would be a bug in the JPEG loader. @@ -451,7 +451,7 @@ void tst_qsgimage::big() QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 100.0); QCOMPARE(obj->height(), 256.0); @@ -459,16 +459,16 @@ void tst_qsgimage::big() delete obj; } -void tst_qsgimage::tiling_QTBUG_6716() +void tst_qquickimage::tiling_QTBUG_6716() { QFETCH(QString, source); - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA(source))); canvas->show(); qApp->processEvents(); - QSGImage *tiling = findItem<QSGImage>(canvas->rootObject(), "tiling"); + QQuickImage *tiling = findItem<QQuickImage>(canvas->rootObject(), "tiling"); QVERIFY(tiling != 0); QImage img = canvas->grabFrameBuffer(); @@ -481,14 +481,14 @@ void tst_qsgimage::tiling_QTBUG_6716() delete canvas; } -void tst_qsgimage::tiling_QTBUG_6716_data() +void tst_qquickimage::tiling_QTBUG_6716_data() { QTest::addColumn<QString>("source"); QTest::newRow("vertical_tiling") << "vtiling.qml"; QTest::newRow("horizontal_tiling") << "htiling.qml"; } -void tst_qsgimage::noLoading() +void tst_qquickimage::noLoading() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); @@ -500,17 +500,17 @@ void tst_qsgimage::noLoading() ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(TESTDATA("heart.png"))); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); - QVERIFY(obj->status() == QSGImage::Ready); + QVERIFY(obj->status() == QQuickImage::Ready); QSignalSpy sourceSpy(obj, SIGNAL(sourceChanged(const QUrl &))); QSignalSpy progressSpy(obj, SIGNAL(progressChanged(qreal))); - QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QSGImageBase::Status))); + QSignalSpy statusSpy(obj, SIGNAL(statusChanged(QQuickImageBase::Status))); // Loading local file ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(TESTDATA("green.png"))); - QTRY_VERIFY(obj->status() == QSGImage::Ready); + QTRY_VERIFY(obj->status() == QQuickImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 1); QTRY_COMPARE(progressSpy.count(), 0); @@ -518,9 +518,9 @@ void tst_qsgimage::noLoading() // Loading remote file ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/rect.png"); - QTRY_VERIFY(obj->status() == QSGImage::Loading); + QTRY_VERIFY(obj->status() == QQuickImage::Loading); QTRY_VERIFY(obj->progress() == 0.0); - QTRY_VERIFY(obj->status() == QSGImage::Ready); + QTRY_VERIFY(obj->status() == QQuickImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 2); QTRY_COMPARE(progressSpy.count(), 2); @@ -529,7 +529,7 @@ void tst_qsgimage::noLoading() // Loading remote file again - should not go through 'Loading' state. ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(TESTDATA("green.png"))); ctxt->setContextProperty("srcImage", QString(SERVER_ADDR) + "/rect.png"); - QTRY_VERIFY(obj->status() == QSGImage::Ready); + QTRY_VERIFY(obj->status() == QQuickImage::Ready); QTRY_VERIFY(obj->progress() == 1.0); QTRY_COMPARE(sourceSpy.count(), 4); QTRY_COMPARE(progressSpy.count(), 2); @@ -538,7 +538,7 @@ void tst_qsgimage::noLoading() delete obj; } -void tst_qsgimage::paintedWidthHeight() +void tst_qquickimage::paintedWidthHeight() { { QString src = QUrl::fromLocalFile(TESTDATA("heart.png")).toString(); @@ -546,7 +546,7 @@ void tst_qsgimage::paintedWidthHeight() QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 200.0); QCOMPARE(obj->height(), 25.0); @@ -561,7 +561,7 @@ void tst_qsgimage::paintedWidthHeight() QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; width: 26; height: 175; fillMode: Image.PreserveAspectFit }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QVERIFY(obj != 0); QCOMPARE(obj->width(), 26.0); QCOMPARE(obj->height(), 175.0); @@ -572,19 +572,19 @@ void tst_qsgimage::paintedWidthHeight() } } -void tst_qsgimage::sourceSize_QTBUG_14303() +void tst_qquickimage::sourceSize_QTBUG_14303() { QString componentStr = "import QtQuick 2.0\nImage { source: srcImage }"; QDeclarativeContext *ctxt = engine.rootContext(); ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(TESTDATA("heart200.png"))); QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGImage *obj = qobject_cast<QSGImage*>(component.create()); + QQuickImage *obj = qobject_cast<QQuickImage*>(component.create()); QSignalSpy sourceSizeSpy(obj, SIGNAL(sourceSizeChanged())); QTRY_VERIFY(obj != 0); - QTRY_VERIFY(obj->status() == QSGImage::Ready); + QTRY_VERIFY(obj->status() == QQuickImage::Ready); QTRY_COMPARE(obj->sourceSize().width(), 200); QTRY_COMPARE(obj->sourceSize().height(), 200); @@ -603,15 +603,15 @@ void tst_qsgimage::sourceSize_QTBUG_14303() delete obj; } -void tst_qsgimage::sourceSize_QTBUG_16389() +void tst_qquickimage::sourceSize_QTBUG_16389() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("qtbug_16389.qml"))); canvas->show(); qApp->processEvents(); - QSGImage *image = findItem<QSGImage>(canvas->rootObject(), "iconImage"); - QSGItem *handle = findItem<QSGItem>(canvas->rootObject(), "blueHandle"); + QQuickImage *image = findItem<QQuickImage>(canvas->rootObject(), "iconImage"); + QQuickItem *handle = findItem<QQuickItem>(canvas->rootObject(), "blueHandle"); QCOMPARE(image->sourceSize().width(), 200); QCOMPARE(image->sourceSize().height(), 200); @@ -634,13 +634,13 @@ static void checkWarnings(QtMsgType, const char *msg) } // QTBUG-15690 -void tst_qsgimage::nullPixmapPaint() +void tst_qquickimage::nullPixmapPaint() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("nullpixmap.qml"))); canvas->show(); - QSGImage *image = qobject_cast<QSGImage*>(canvas->rootObject()); + QQuickImage *image = qobject_cast<QQuickImage*>(canvas->rootObject()); QTRY_VERIFY(image != 0); image->setSource(SERVER_ADDR + QString("/no-such-file.png")); @@ -658,12 +658,12 @@ void tst_qsgimage::nullPixmapPaint() item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_qsgimage::findItem(QSGItem *parent, const QString &objectName, int index) +T *tst_qquickimage::findItem(QQuickItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -684,6 +684,6 @@ T *tst_qsgimage::findItem(QSGItem *parent, const QString &objectName, int index) return 0; } -QTEST_MAIN(tst_qsgimage) +QTEST_MAIN(tst_qquickimage) -#include "tst_qsgimage.moc" +#include "tst_qquickimage.moc" diff --git a/tests/auto/declarative/qsgitem/qsgitem.pro b/tests/auto/declarative/qquickitem/qquickitem.pro index 76d6547da7..c1c7b825f9 100644 --- a/tests/auto/declarative/qsgitem/qsgitem.pro +++ b/tests/auto/declarative/qquickitem/qquickitem.pro @@ -1,6 +1,6 @@ CONFIG += testcase -TARGET = tst_qsgitem -SOURCES += tst_qsgitem.cpp +TARGET = tst_qquickitem +SOURCES += tst_qquickitem.cpp macx:CONFIG -= app_bundle diff --git a/tests/auto/declarative/qsgitem/tst_qsgitem.cpp b/tests/auto/declarative/qquickitem/tst_qquickitem.cpp index 84c52bdde8..694fdc0b0c 100644 --- a/tests/auto/declarative/qsgitem/tst_qsgitem.cpp +++ b/tests/auto/declarative/qquickitem/tst_qquickitem.cpp @@ -41,18 +41,18 @@ #include <qtest.h> -#include "qsgitem.h" -#include "qsgcanvas.h" +#include "qquickitem.h" +#include "qquickcanvas.h" #include <QtWidgets/QGraphicsSceneMouseEvent> -#include "private/qsgfocusscope_p.h" +#include "private/qquickfocusscope_p.h" #include <QDebug> #include <QTimer> -class TestItem : public QSGItem +class TestItem : public QQuickItem { Q_OBJECT public: - TestItem(QSGItem *parent = 0) : QSGItem(parent), focused(false), pressCount(0), releaseCount(0), wheelCount(0) {} + TestItem(QQuickItem *parent = 0) : QQuickItem(parent), focused(false), pressCount(0), releaseCount(0), wheelCount(0) {} bool focused; int pressCount; @@ -66,12 +66,12 @@ protected: virtual void wheelEvent(QWheelEvent *event) { event->accept(); ++wheelCount; } }; -class TestPolishItem : public QSGItem +class TestPolishItem : public QQuickItem { Q_OBJECT public: - TestPolishItem(QSGItem *parent) - : QSGItem(parent), wasPolished(false) { + TestPolishItem(QQuickItem *parent) + : QQuickItem(parent), wasPolished(false) { QTimer::singleShot(10, this, SLOT(doPolish())); } @@ -88,11 +88,11 @@ public slots: } }; -class TestFocusScope : public QSGFocusScope +class TestFocusScope : public QQuickFocusScope { Q_OBJECT public: - TestFocusScope(QSGItem *parent = 0) : QSGFocusScope(parent), focused(false) {} + TestFocusScope(QQuickItem *parent = 0) : QQuickFocusScope(parent), focused(false) {} bool focused; protected: @@ -100,11 +100,11 @@ protected: virtual void focusOutEvent(QFocusEvent *) { Q_ASSERT(focused); focused = false; } }; -class tst_qsgitem : public QObject +class tst_qquickitem : public QObject { Q_OBJECT public: - tst_qsgitem(); + tst_qquickitem(); private slots: void initTestCase(); @@ -145,26 +145,26 @@ private: } }; -tst_qsgitem::tst_qsgitem() +tst_qquickitem::tst_qquickitem() { } -void tst_qsgitem::initTestCase() +void tst_qquickitem::initTestCase() { } -void tst_qsgitem::cleanupTestCase() +void tst_qquickitem::cleanupTestCase() { } // Focus has no effect when outside a canvas -void tst_qsgitem::noCanvas() +void tst_qquickitem::noCanvas() { - QSGItem *root = new TestItem; - QSGItem *child = new TestItem(root); - QSGItem *scope = new TestItem(root); - QSGFocusScope *scopedChild = new TestFocusScope(scope); - QSGFocusScope *scopedChild2 = new TestFocusScope(scope); + QQuickItem *root = new TestItem; + QQuickItem *child = new TestItem(root); + QQuickItem *scope = new TestItem(root); + QQuickFocusScope *scopedChild = new TestFocusScope(scope); + QQuickFocusScope *scopedChild2 = new TestFocusScope(scope); QCOMPARE(root->hasFocus(), false); QCOMPARE(child->hasFocus(), false); @@ -201,18 +201,18 @@ struct FocusData { bool focus; bool activeFocus; }; -struct FocusState : public QHash<QSGItem *, FocusData> +struct FocusState : public QHash<QQuickItem *, FocusData> { FocusState() : activeFocusItem(0) {} - FocusState &operator<<(QSGItem *item) { + FocusState &operator<<(QQuickItem *item) { insert(item, FocusData()); return *this; } - void active(QSGItem *i) { + void active(QQuickItem *i) { activeFocusItem = i; } - QSGItem *activeFocusItem; + QQuickItem *activeFocusItem; }; #define FVERIFY() \ @@ -226,7 +226,7 @@ struct FocusState : public QHash<QSGItem *, FocusData> } else { \ QCOMPARE(canvas.activeFocusItem(), canvas.rootItem()); \ } \ - for (QHash<QSGItem *, FocusData>::Iterator iter = focusState.begin(); \ + for (QHash<QQuickItem *, FocusData>::Iterator iter = focusState.begin(); \ iter != focusState.end(); \ iter++) { \ QCOMPARE(iter.key()->hasFocus(), iter.value().focus); \ @@ -235,18 +235,18 @@ struct FocusState : public QHash<QSGItem *, FocusData> } while (false) // Tests a simple set of top-level scoped items -void tst_qsgitem::simpleFocus() +void tst_qquickitem::simpleFocus() { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *l1c1 = new TestItem(canvas.rootItem()); - QSGItem *l1c2 = new TestItem(canvas.rootItem()); - QSGItem *l1c3 = new TestItem(canvas.rootItem()); + QQuickItem *l1c1 = new TestItem(canvas.rootItem()); + QQuickItem *l1c2 = new TestItem(canvas.rootItem()); + QQuickItem *l1c3 = new TestItem(canvas.rootItem()); - QSGItem *l2c1 = new TestItem(l1c1); - QSGItem *l2c2 = new TestItem(l1c1); - QSGItem *l2c3 = new TestItem(l1c3); + QQuickItem *l2c1 = new TestItem(l1c1); + QQuickItem *l2c2 = new TestItem(l1c1); + QQuickItem *l2c3 = new TestItem(l1c3); FocusState focusState; focusState << l1c1 << l1c2 << l1c3 @@ -285,24 +285,24 @@ void tst_qsgitem::simpleFocus() } // Items with a focus scope -void tst_qsgitem::scopedFocus() +void tst_qquickitem::scopedFocus() { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *l1c1 = new TestItem(canvas.rootItem()); - QSGItem *l1c2 = new TestItem(canvas.rootItem()); - QSGItem *l1c3 = new TestItem(canvas.rootItem()); + QQuickItem *l1c1 = new TestItem(canvas.rootItem()); + QQuickItem *l1c2 = new TestItem(canvas.rootItem()); + QQuickItem *l1c3 = new TestItem(canvas.rootItem()); - QSGItem *l2c1 = new TestItem(l1c1); - QSGItem *l2c2 = new TestItem(l1c1); - QSGItem *l2c3 = new TestFocusScope(l1c3); + QQuickItem *l2c1 = new TestItem(l1c1); + QQuickItem *l2c2 = new TestItem(l1c1); + QQuickItem *l2c3 = new TestFocusScope(l1c3); - QSGItem *l3c1 = new TestItem(l2c3); - QSGItem *l3c2 = new TestFocusScope(l2c3); + QQuickItem *l3c1 = new TestItem(l2c3); + QQuickItem *l3c2 = new TestFocusScope(l2c3); - QSGItem *l4c1 = new TestItem(l3c2); - QSGItem *l4c2 = new TestItem(l3c2); + QQuickItem *l4c1 = new TestItem(l3c2); + QQuickItem *l4c2 = new TestItem(l3c2); FocusState focusState; focusState << l1c1 << l1c2 << l1c3 @@ -363,13 +363,13 @@ void tst_qsgitem::scopedFocus() } // Tests focus corrects itself when a tree is added to a canvas for the first time -void tst_qsgitem::addedToCanvas() +void tst_qquickitem::addedToCanvas() { { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *item = new TestItem; + QQuickItem *item = new TestItem; FocusState focusState; focusState << item; @@ -385,14 +385,14 @@ void tst_qsgitem::addedToCanvas() } { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *item = new TestItem(canvas.rootItem()); + QQuickItem *item = new TestItem(canvas.rootItem()); - QSGItem *tree = new TestItem; - QSGItem *c1 = new TestItem(tree); - QSGItem *c2 = new TestItem(tree); + QQuickItem *tree = new TestItem; + QQuickItem *c1 = new TestItem(tree); + QQuickItem *c2 = new TestItem(tree); FocusState focusState; focusState << item << tree << c1 << c2; @@ -413,12 +413,12 @@ void tst_qsgitem::addedToCanvas() } { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *tree = new TestItem; - QSGItem *c1 = new TestItem(tree); - QSGItem *c2 = new TestItem(tree); + QQuickItem *tree = new TestItem; + QQuickItem *c1 = new TestItem(tree); + QQuickItem *c2 = new TestItem(tree); FocusState focusState; focusState << tree << c1 << c2; @@ -436,11 +436,11 @@ void tst_qsgitem::addedToCanvas() } { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *tree = new TestFocusScope; - QSGItem *c1 = new TestItem(tree); - QSGItem *c2 = new TestItem(tree); + QQuickItem *tree = new TestFocusScope; + QQuickItem *c1 = new TestItem(tree); + QQuickItem *c2 = new TestItem(tree); FocusState focusState; focusState << tree << c1 << c2; @@ -463,11 +463,11 @@ void tst_qsgitem::addedToCanvas() } { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *tree = new TestFocusScope; - QSGItem *c1 = new TestItem(tree); - QSGItem *c2 = new TestItem(tree); + QQuickItem *tree = new TestFocusScope; + QQuickItem *c1 = new TestItem(tree); + QQuickItem *c2 = new TestItem(tree); FocusState focusState; focusState << tree << c1 << c2; @@ -488,12 +488,12 @@ void tst_qsgitem::addedToCanvas() } { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *child = new TestItem(canvas.rootItem()); - QSGItem *tree = new TestFocusScope; - QSGItem *c1 = new TestItem(tree); - QSGItem *c2 = new TestItem(tree); + QQuickItem *child = new TestItem(canvas.rootItem()); + QQuickItem *tree = new TestFocusScope; + QQuickItem *c1 = new TestItem(tree); + QQuickItem *c2 = new TestItem(tree); FocusState focusState; focusState << child << tree << c1 << c2; @@ -523,13 +523,13 @@ void tst_qsgitem::addedToCanvas() } } -void tst_qsgitem::changeParent() +void tst_qquickitem::changeParent() { // Parent to no parent { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *child = new TestItem(canvas.rootItem()); + QQuickItem *child = new TestItem(canvas.rootItem()); FocusState focusState; focusState << child; @@ -548,10 +548,10 @@ void tst_qsgitem::changeParent() // Different parent, same focus scope { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *child = new TestItem(canvas.rootItem()); - QSGItem *child2 = new TestItem(canvas.rootItem()); + QQuickItem *child = new TestItem(canvas.rootItem()); + QQuickItem *child2 = new TestItem(canvas.rootItem()); FocusState focusState; focusState << child << child2; @@ -568,11 +568,11 @@ void tst_qsgitem::changeParent() // Different parent, different focus scope { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *child = new TestItem(canvas.rootItem()); - QSGItem *child2 = new TestFocusScope(canvas.rootItem()); - QSGItem *item = new TestItem(child); + QQuickItem *child = new TestItem(canvas.rootItem()); + QQuickItem *child2 = new TestFocusScope(canvas.rootItem()); + QQuickItem *item = new TestItem(child); FocusState focusState; focusState << child << child2 << item; @@ -589,11 +589,11 @@ void tst_qsgitem::changeParent() FVERIFY(); } { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *child = new TestItem(canvas.rootItem()); - QSGItem *child2 = new TestFocusScope(canvas.rootItem()); - QSGItem *item = new TestItem(child2); + QQuickItem *child = new TestItem(canvas.rootItem()); + QQuickItem *child2 = new TestFocusScope(canvas.rootItem()); + QQuickItem *item = new TestItem(child2); FocusState focusState; focusState << child << child2 << item; @@ -610,11 +610,11 @@ void tst_qsgitem::changeParent() FVERIFY(); } { - QSGCanvas canvas; + QQuickCanvas canvas; ensureFocus(&canvas); - QSGItem *child = new TestItem(canvas.rootItem()); - QSGItem *child2 = new TestFocusScope(canvas.rootItem()); - QSGItem *item = new TestItem(child2); + QQuickItem *child = new TestItem(canvas.rootItem()); + QQuickItem *child2 = new TestFocusScope(canvas.rootItem()); + QQuickItem *item = new TestItem(child2); FocusState focusState; focusState << child << child2 << item; @@ -634,19 +634,19 @@ void tst_qsgitem::changeParent() } -void tst_qsgitem::constructor() +void tst_qquickitem::constructor() { - QSGItem *root = new QSGItem; + QQuickItem *root = new QQuickItem; QVERIFY(root->parent() == 0); QVERIFY(root->parentItem() == 0); - QSGItem *child1 = new QSGItem(root); + QQuickItem *child1 = new QQuickItem(root); QVERIFY(child1->parent() == root); QVERIFY(child1->parentItem() == root); QCOMPARE(root->childItems().count(), 1); QCOMPARE(root->childItems().at(0), child1); - QSGItem *child2 = new QSGItem(root); + QQuickItem *child2 = new QQuickItem(root); QVERIFY(child2->parent() == root); QVERIFY(child2->parentItem() == root); QCOMPARE(root->childItems().count(), 2); @@ -656,13 +656,13 @@ void tst_qsgitem::constructor() delete root; } -void tst_qsgitem::setParentItem() +void tst_qquickitem::setParentItem() { - QSGItem *root = new QSGItem; + QQuickItem *root = new QQuickItem; QVERIFY(root->parent() == 0); QVERIFY(root->parentItem() == 0); - QSGItem *child1 = new QSGItem; + QQuickItem *child1 = new QQuickItem; QVERIFY(child1->parent() == 0); QVERIFY(child1->parentItem() == 0); @@ -672,7 +672,7 @@ void tst_qsgitem::setParentItem() QCOMPARE(root->childItems().count(), 1); QCOMPARE(root->childItems().at(0), child1); - QSGItem *child2 = new QSGItem; + QQuickItem *child2 = new QQuickItem; QVERIFY(child2->parent() == 0); QVERIFY(child2->parentItem() == 0); child2->setParentItem(root); @@ -699,14 +699,14 @@ void tst_qsgitem::setParentItem() delete child2; } -void tst_qsgitem::visible() +void tst_qquickitem::visible() { - QSGItem *root = new QSGItem; + QQuickItem *root = new QQuickItem; - QSGItem *child1 = new QSGItem; + QQuickItem *child1 = new QQuickItem; child1->setParentItem(root); - QSGItem *child2 = new QSGItem; + QQuickItem *child2 = new QQuickItem; child2->setParentItem(root); QVERIFY(child1->isVisible()); @@ -737,14 +737,14 @@ void tst_qsgitem::visible() delete child2; } -void tst_qsgitem::enabled() +void tst_qquickitem::enabled() { - QSGItem *root = new QSGItem; + QQuickItem *root = new QQuickItem; - QSGItem *child1 = new QSGItem; + QQuickItem *child1 = new QQuickItem; child1->setParentItem(root); - QSGItem *child2 = new QSGItem; + QQuickItem *child2 = new QQuickItem; child2->setParentItem(root); QVERIFY(child1->isEnabled()); @@ -775,9 +775,9 @@ void tst_qsgitem::enabled() delete child2; } -void tst_qsgitem::mouseGrab() +void tst_qquickitem::mouseGrab() { - QSGCanvas *canvas = new QSGCanvas; + QQuickCanvas *canvas = new QQuickCanvas; canvas->resize(200, 200); canvas->show(); @@ -852,9 +852,9 @@ void tst_qsgitem::mouseGrab() delete canvas; } -void tst_qsgitem::polishOutsideAnimation() +void tst_qquickitem::polishOutsideAnimation() { - QSGCanvas *canvas = new QSGCanvas; + QQuickCanvas *canvas = new QQuickCanvas; canvas->resize(200, 200); canvas->show(); @@ -867,7 +867,7 @@ void tst_qsgitem::polishOutsideAnimation() delete canvas; } -void tst_qsgitem::wheelEvent_data() +void tst_qquickitem::wheelEvent_data() { QTest::addColumn<bool>("visible"); QTest::addColumn<bool>("enabled"); @@ -878,14 +878,14 @@ void tst_qsgitem::wheelEvent_data() QTest::newRow("invisible and disabled") << false << false; } -void tst_qsgitem::wheelEvent() +void tst_qquickitem::wheelEvent() { QFETCH(bool, visible); QFETCH(bool, enabled); const bool shouldReceiveWheelEvents = visible && enabled; - QSGCanvas *canvas = new QSGCanvas; + QQuickCanvas *canvas = new QQuickCanvas; canvas->resize(200, 200); canvas->show(); @@ -911,12 +911,12 @@ void tst_qsgitem::wheelEvent() delete canvas; } -class HoverItem : public QSGItem +class HoverItem : public QQuickItem { Q_OBJECT public: - HoverItem(QSGItem *parent = 0) - : QSGItem(parent), hoverEnterCount(0), hoverMoveCount(0), hoverLeaveCount(0) + HoverItem(QQuickItem *parent = 0) + : QQuickItem(parent), hoverEnterCount(0), hoverMoveCount(0), hoverLeaveCount(0) { } void resetCounters() { hoverEnterCount = 0; @@ -941,7 +941,7 @@ protected: } }; -void tst_qsgitem::hoverEvent_data() +void tst_qquickitem::hoverEvent_data() { QTest::addColumn<bool>("visible"); QTest::addColumn<bool>("enabled"); @@ -965,13 +965,13 @@ static void sendMouseMove(QObject *object, const QPoint &position) QApplication::sendEvent(object, &moveEvent); } -void tst_qsgitem::hoverEvent() +void tst_qquickitem::hoverEvent() { QFETCH(bool, visible); QFETCH(bool, enabled); QFETCH(bool, acceptHoverEvents); - QSGCanvas *canvas = new QSGCanvas(); + QQuickCanvas *canvas = new QQuickCanvas(); canvas->resize(200, 200); canvas->show(); @@ -1010,9 +1010,9 @@ void tst_qsgitem::hoverEvent() delete canvas; } -void tst_qsgitem::hoverEventInParent() +void tst_qquickitem::hoverEventInParent() { - QSGCanvas *canvas = new QSGCanvas(); + QQuickCanvas *canvas = new QQuickCanvas(); canvas->resize(200, 200); canvas->show(); @@ -1056,6 +1056,6 @@ void tst_qsgitem::hoverEventInParent() delete canvas; } -QTEST_MAIN(tst_qsgitem) +QTEST_MAIN(tst_qquickitem) -#include "tst_qsgitem.moc" +#include "tst_qquickitem.moc" diff --git a/tests/auto/declarative/qsgitem2/data/childrenProperty.qml b/tests/auto/declarative/qquickitem2/data/childrenProperty.qml index 85ddbc1446..85ddbc1446 100644 --- a/tests/auto/declarative/qsgitem2/data/childrenProperty.qml +++ b/tests/auto/declarative/qquickitem2/data/childrenProperty.qml diff --git a/tests/auto/declarative/qsgitem2/data/childrenRect.qml b/tests/auto/declarative/qquickitem2/data/childrenRect.qml index ebc57aefbe..ebc57aefbe 100644 --- a/tests/auto/declarative/qsgitem2/data/childrenRect.qml +++ b/tests/auto/declarative/qquickitem2/data/childrenRect.qml diff --git a/tests/auto/declarative/qsgitem2/data/childrenRectBug.qml b/tests/auto/declarative/qquickitem2/data/childrenRectBug.qml index 86a4f19c5c..86a4f19c5c 100644 --- a/tests/auto/declarative/qsgitem2/data/childrenRectBug.qml +++ b/tests/auto/declarative/qquickitem2/data/childrenRectBug.qml diff --git a/tests/auto/declarative/qsgitem2/data/childrenRectBug2.qml b/tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml index 6e80ed28af..6e80ed28af 100644 --- a/tests/auto/declarative/qsgitem2/data/childrenRectBug2.qml +++ b/tests/auto/declarative/qquickitem2/data/childrenRectBug2.qml diff --git a/tests/auto/declarative/qsgitem2/data/childrenRectBug3.qml b/tests/auto/declarative/qquickitem2/data/childrenRectBug3.qml index 518e76509e..518e76509e 100644 --- a/tests/auto/declarative/qsgitem2/data/childrenRectBug3.qml +++ b/tests/auto/declarative/qquickitem2/data/childrenRectBug3.qml diff --git a/tests/auto/declarative/qsgitem2/data/implicitsize.qml b/tests/auto/declarative/qquickitem2/data/implicitsize.qml index cc6aaf7d60..cc6aaf7d60 100644 --- a/tests/auto/declarative/qsgitem2/data/implicitsize.qml +++ b/tests/auto/declarative/qquickitem2/data/implicitsize.qml diff --git a/tests/auto/declarative/qsgitem2/data/keynavigationtest.qml b/tests/auto/declarative/qquickitem2/data/keynavigationtest.qml index aacb621fb0..aacb621fb0 100644 --- a/tests/auto/declarative/qsgitem2/data/keynavigationtest.qml +++ b/tests/auto/declarative/qquickitem2/data/keynavigationtest.qml diff --git a/tests/auto/declarative/qsgitem2/data/keynavigationtest_implicit.qml b/tests/auto/declarative/qquickitem2/data/keynavigationtest_implicit.qml index 92d4ae23de..92d4ae23de 100644 --- a/tests/auto/declarative/qsgitem2/data/keynavigationtest_implicit.qml +++ b/tests/auto/declarative/qquickitem2/data/keynavigationtest_implicit.qml diff --git a/tests/auto/declarative/qsgitem2/data/keyspriority.qml b/tests/auto/declarative/qquickitem2/data/keyspriority.qml index 114cf0488a..114cf0488a 100644 --- a/tests/auto/declarative/qsgitem2/data/keyspriority.qml +++ b/tests/auto/declarative/qquickitem2/data/keyspriority.qml diff --git a/tests/auto/declarative/qsgitem2/data/keystest.qml b/tests/auto/declarative/qquickitem2/data/keystest.qml index c70e0061f5..c70e0061f5 100644 --- a/tests/auto/declarative/qsgitem2/data/keystest.qml +++ b/tests/auto/declarative/qquickitem2/data/keystest.qml diff --git a/tests/auto/declarative/qsgitem2/data/layoutmirroring.qml b/tests/auto/declarative/qquickitem2/data/layoutmirroring.qml index 036819740c..036819740c 100644 --- a/tests/auto/declarative/qsgitem2/data/layoutmirroring.qml +++ b/tests/auto/declarative/qquickitem2/data/layoutmirroring.qml diff --git a/tests/auto/declarative/qsgitem2/data/mapCoordinates.qml b/tests/auto/declarative/qquickitem2/data/mapCoordinates.qml index 566cb220ff..566cb220ff 100644 --- a/tests/auto/declarative/qsgitem2/data/mapCoordinates.qml +++ b/tests/auto/declarative/qquickitem2/data/mapCoordinates.qml diff --git a/tests/auto/declarative/qsgitem2/data/propertychanges.qml b/tests/auto/declarative/qquickitem2/data/propertychanges.qml index 3fa5ea9c23..3fa5ea9c23 100644 --- a/tests/auto/declarative/qsgitem2/data/propertychanges.qml +++ b/tests/auto/declarative/qquickitem2/data/propertychanges.qml diff --git a/tests/auto/declarative/qsgitem2/data/qtbug_16871.qml b/tests/auto/declarative/qquickitem2/data/qtbug_16871.qml index f1e7377730..f1e7377730 100644 --- a/tests/auto/declarative/qsgitem2/data/qtbug_16871.qml +++ b/tests/auto/declarative/qquickitem2/data/qtbug_16871.qml diff --git a/tests/auto/declarative/qsgitem2/data/resourcesProperty.qml b/tests/auto/declarative/qquickitem2/data/resourcesProperty.qml index b8f18bb375..b8f18bb375 100644 --- a/tests/auto/declarative/qsgitem2/data/resourcesProperty.qml +++ b/tests/auto/declarative/qquickitem2/data/resourcesProperty.qml diff --git a/tests/auto/declarative/qsgitem2/data/transformCrash.qml b/tests/auto/declarative/qquickitem2/data/transformCrash.qml index 284e85f0e0..284e85f0e0 100644 --- a/tests/auto/declarative/qsgitem2/data/transformCrash.qml +++ b/tests/auto/declarative/qquickitem2/data/transformCrash.qml diff --git a/tests/auto/declarative/qsgitem2/qsgitem2.pro b/tests/auto/declarative/qquickitem2/qquickitem2.pro index 517e67619b..47b31d98e9 100644 --- a/tests/auto/declarative/qsgitem2/qsgitem2.pro +++ b/tests/auto/declarative/qquickitem2/qquickitem2.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgitem +TARGET = tst_qquickitem macx:CONFIG -= app_bundle -SOURCES += tst_qsgitem.cpp +SOURCES += tst_qquickitem.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgitem2/tst_qsgitem.cpp b/tests/auto/declarative/qquickitem2/tst_qquickitem.cpp index fe29de1aad..711ca17ae1 100644 --- a/tests/auto/declarative/qsgitem2/tst_qsgitem.cpp +++ b/tests/auto/declarative/qquickitem2/tst_qquickitem.cpp @@ -43,16 +43,16 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsgrectangle_p.h> -#include <private/qsgitem_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquickrectangle_p.h> +#include <private/qquickitem_p.h> #include "../shared/util.h" -class tst_QSGItem : public QObject +class tst_QQuickItem : public QObject { Q_OBJECT public: - tst_QSGItem(); + tst_QQuickItem(); private slots: void initTestCase(); @@ -87,15 +87,15 @@ private: }; template<typename T> -T *findItem(QSGItem *parent, const QString &objectName) +T *findItem(QQuickItem *parent, const QString &objectName) { if (!parent) return 0; const QMetaObject &mo = T::staticMetaObject; - //qDebug() << parent->QSGItem::children().count() << "children"; + //qDebug() << parent->QQuickItem::children().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -161,11 +161,11 @@ public: private: }; -class KeyTestItem : public QSGItem +class KeyTestItem : public QQuickItem { Q_OBJECT public: - KeyTestItem(QSGItem *parent=0) : QSGItem(parent), mKey(0) {} + KeyTestItem(QQuickItem *parent=0) : QQuickItem(parent), mKey(0) {} protected: void keyPressEvent(QKeyEvent *e) { @@ -191,18 +191,18 @@ public: QML_DECLARE_TYPE(KeyTestItem); -tst_QSGItem::tst_QSGItem() +tst_QQuickItem::tst_QQuickItem() { } -void tst_QSGItem::initTestCase() +void tst_QQuickItem::initTestCase() { qmlRegisterType<KeyTestItem>("Test",1,0,"KeyTestItem"); } -void tst_QSGItem::keys() +void tst_QQuickItem::keys() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(240,320)); KeysTestObject *testObject = new KeysTestObject; @@ -324,9 +324,9 @@ void tst_QSGItem::keys() delete testObject; } -void tst_QSGItem::keysProcessingOrder() +void tst_QQuickItem::keysProcessingOrder() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(240,320)); KeysTestObject *testObject = new KeysTestObject; @@ -380,35 +380,35 @@ void tst_QSGItem::keysProcessingOrder() delete testObject; } -QSGItemPrivate *childPrivate(QSGItem *rootItem, const char * itemString) +QQuickItemPrivate *childPrivate(QQuickItem *rootItem, const char * itemString) { - QSGItem *item = findItem<QSGItem>(rootItem, QString(QLatin1String(itemString))); - QSGItemPrivate* itemPrivate = QSGItemPrivate::get(item); + QQuickItem *item = findItem<QQuickItem>(rootItem, QString(QLatin1String(itemString))); + QQuickItemPrivate* itemPrivate = QQuickItemPrivate::get(item); return itemPrivate; } -QVariant childProperty(QSGItem *rootItem, const char * itemString, const char * property) +QVariant childProperty(QQuickItem *rootItem, const char * itemString, const char * property) { - QSGItem *item = findItem<QSGItem>(rootItem, QString(QLatin1String(itemString))); + QQuickItem *item = findItem<QQuickItem>(rootItem, QString(QLatin1String(itemString))); return item->property(property); } -bool anchorsMirrored(QSGItem *rootItem, const char * itemString) +bool anchorsMirrored(QQuickItem *rootItem, const char * itemString) { - QSGItem *item = findItem<QSGItem>(rootItem, QString(QLatin1String(itemString))); - QSGItemPrivate* itemPrivate = QSGItemPrivate::get(item); + QQuickItem *item = findItem<QQuickItem>(rootItem, QString(QLatin1String(itemString))); + QQuickItemPrivate* itemPrivate = QQuickItemPrivate::get(item); return itemPrivate->anchors()->mirrored(); } -void tst_QSGItem::layoutMirroring() +void tst_QQuickItem::layoutMirroring() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("layoutmirroring.qml"))); canvas->show(); - QSGItem *rootItem = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(rootItem); - QSGItemPrivate *rootPrivate = QSGItemPrivate::get(rootItem); + QQuickItemPrivate *rootPrivate = QQuickItemPrivate::get(rootItem); QVERIFY(rootPrivate); QCOMPARE(childPrivate(rootItem, "mirrored1")->effectiveLayoutMirror, true); @@ -499,38 +499,38 @@ void tst_QSGItem::layoutMirroring() // // dynamic parenting // - QSGItem *parentItem1 = new QSGItem(); - QSGItemPrivate::get(parentItem1)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true - QSGItemPrivate::get(parentItem1)->isMirrorImplicit = false; - QSGItemPrivate::get(parentItem1)->inheritMirrorFromItem = true; // LayoutMirroring.childrenInherit: true - QSGItemPrivate::get(parentItem1)->resolveLayoutMirror(); + QQuickItem *parentItem1 = new QQuickItem(); + QQuickItemPrivate::get(parentItem1)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true + QQuickItemPrivate::get(parentItem1)->isMirrorImplicit = false; + QQuickItemPrivate::get(parentItem1)->inheritMirrorFromItem = true; // LayoutMirroring.childrenInherit: true + QQuickItemPrivate::get(parentItem1)->resolveLayoutMirror(); // inherit in constructor - QSGItem *childItem1 = new QSGItem(parentItem1); - QCOMPARE(QSGItemPrivate::get(childItem1)->effectiveLayoutMirror, true); - QCOMPARE(QSGItemPrivate::get(childItem1)->inheritMirrorFromParent, true); + QQuickItem *childItem1 = new QQuickItem(parentItem1); + QCOMPARE(QQuickItemPrivate::get(childItem1)->effectiveLayoutMirror, true); + QCOMPARE(QQuickItemPrivate::get(childItem1)->inheritMirrorFromParent, true); // inherit through a parent change - QSGItem *childItem2 = new QSGItem(); - QCOMPARE(QSGItemPrivate::get(childItem2)->effectiveLayoutMirror, false); - QCOMPARE(QSGItemPrivate::get(childItem2)->inheritMirrorFromParent, false); + QQuickItem *childItem2 = new QQuickItem(); + QCOMPARE(QQuickItemPrivate::get(childItem2)->effectiveLayoutMirror, false); + QCOMPARE(QQuickItemPrivate::get(childItem2)->inheritMirrorFromParent, false); childItem2->setParentItem(parentItem1); - QCOMPARE(QSGItemPrivate::get(childItem2)->effectiveLayoutMirror, true); - QCOMPARE(QSGItemPrivate::get(childItem2)->inheritMirrorFromParent, true); + QCOMPARE(QQuickItemPrivate::get(childItem2)->effectiveLayoutMirror, true); + QCOMPARE(QQuickItemPrivate::get(childItem2)->inheritMirrorFromParent, true); // stop inherting through a parent change - QSGItem *parentItem2 = new QSGItem(); - QSGItemPrivate::get(parentItem2)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true - QSGItemPrivate::get(parentItem2)->resolveLayoutMirror(); + QQuickItem *parentItem2 = new QQuickItem(); + QQuickItemPrivate::get(parentItem2)->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true + QQuickItemPrivate::get(parentItem2)->resolveLayoutMirror(); childItem2->setParentItem(parentItem2); - QCOMPARE(QSGItemPrivate::get(childItem2)->effectiveLayoutMirror, false); - QCOMPARE(QSGItemPrivate::get(childItem2)->inheritMirrorFromParent, false); + QCOMPARE(QQuickItemPrivate::get(childItem2)->effectiveLayoutMirror, false); + QCOMPARE(QQuickItemPrivate::get(childItem2)->inheritMirrorFromParent, false); delete parentItem1; delete parentItem2; } -void tst_QSGItem::layoutMirroringIllegalParent() +void tst_QQuickItem::layoutMirroringIllegalParent() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; QtObject { LayoutMirroring.enabled: true; LayoutMirroring.childrenInherit: true }", QUrl::fromLocalFile("")); @@ -539,9 +539,9 @@ void tst_QSGItem::layoutMirroringIllegalParent() QVERIFY(object != 0); } -void tst_QSGItem::keyNavigation() +void tst_QQuickItem::keyNavigation() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(240,320)); canvas->setSource(QUrl::fromLocalFile(TESTDATA("keynavigationtest.qml"))); @@ -553,7 +553,7 @@ void tst_QSGItem::keyNavigation() QFocusEvent fe(QEvent::FocusIn); QApplication::sendEvent(canvas, &fe); - QSGItem *item = findItem<QSGItem>(canvas->rootObject(), "item1"); + QQuickItem *item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -567,7 +567,7 @@ void tst_QSGItem::keyNavigation() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item2"); + item = findItem<QQuickItem>(canvas->rootObject(), "item2"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -576,7 +576,7 @@ void tst_QSGItem::keyNavigation() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item4"); + item = findItem<QQuickItem>(canvas->rootObject(), "item4"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -585,7 +585,7 @@ void tst_QSGItem::keyNavigation() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item3"); + item = findItem<QQuickItem>(canvas->rootObject(), "item3"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -594,7 +594,7 @@ void tst_QSGItem::keyNavigation() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item1"); + item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -603,7 +603,7 @@ void tst_QSGItem::keyNavigation() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item2"); + item = findItem<QQuickItem>(canvas->rootObject(), "item2"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -612,25 +612,25 @@ void tst_QSGItem::keyNavigation() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item1"); + item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); delete canvas; } -void tst_QSGItem::keyNavigation_RightToLeft() +void tst_QQuickItem::keyNavigation_RightToLeft() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(240,320)); canvas->setSource(QUrl::fromLocalFile(TESTDATA("keynavigationtest.qml"))); canvas->show(); qApp->processEvents(); - QSGItem *rootItem = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(rootItem); - QSGItemPrivate* rootItemPrivate = QSGItemPrivate::get(rootItem); + QQuickItemPrivate* rootItemPrivate = QQuickItemPrivate::get(rootItem); rootItemPrivate->effectiveLayoutMirror = true; // LayoutMirroring.mirror: true rootItemPrivate->isMirrorImplicit = false; @@ -642,7 +642,7 @@ void tst_QSGItem::keyNavigation_RightToLeft() QFocusEvent fe(QEvent::FocusIn); QApplication::sendEvent(canvas, &fe); - QSGItem *item = findItem<QSGItem>(canvas->rootObject(), "item1"); + QQuickItem *item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -656,7 +656,7 @@ void tst_QSGItem::keyNavigation_RightToLeft() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item2"); + item = findItem<QQuickItem>(canvas->rootObject(), "item2"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -665,16 +665,16 @@ void tst_QSGItem::keyNavigation_RightToLeft() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item1"); + item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); delete canvas; } -void tst_QSGItem::keyNavigation_skipNotVisible() +void tst_QQuickItem::keyNavigation_skipNotVisible() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(240,320)); canvas->setSource(QUrl::fromLocalFile(TESTDATA("keynavigationtest.qml"))); @@ -686,12 +686,12 @@ void tst_QSGItem::keyNavigation_skipNotVisible() QFocusEvent fe(QEvent::FocusIn); QApplication::sendEvent(canvas, &fe); - QSGItem *item = findItem<QSGItem>(canvas->rootObject(), "item1"); + QQuickItem *item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); // Set item 2 to not visible - item = findItem<QSGItem>(canvas->rootObject(), "item2"); + item = findItem<QQuickItem>(canvas->rootObject(), "item2"); QVERIFY(item); item->setVisible(false); QVERIFY(!item->isVisible()); @@ -701,7 +701,7 @@ void tst_QSGItem::keyNavigation_skipNotVisible() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item1"); + item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -710,7 +710,7 @@ void tst_QSGItem::keyNavigation_skipNotVisible() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item3"); + item = findItem<QQuickItem>(canvas->rootObject(), "item3"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -719,12 +719,12 @@ void tst_QSGItem::keyNavigation_skipNotVisible() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item1"); + item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); //Set item 3 to not visible - item = findItem<QSGItem>(canvas->rootObject(), "item3"); + item = findItem<QQuickItem>(canvas->rootObject(), "item3"); QVERIFY(item); item->setVisible(false); QVERIFY(!item->isVisible()); @@ -734,7 +734,7 @@ void tst_QSGItem::keyNavigation_skipNotVisible() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item4"); + item = findItem<QQuickItem>(canvas->rootObject(), "item4"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -743,16 +743,16 @@ void tst_QSGItem::keyNavigation_skipNotVisible() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item1"); + item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); delete canvas; } -void tst_QSGItem::keyNavigation_implicitSetting() +void tst_QQuickItem::keyNavigation_implicitSetting() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(240,320)); canvas->setSource(QUrl::fromLocalFile(TESTDATA("keynavigationtest_implicit.qml"))); @@ -764,7 +764,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QFocusEvent fe(QEvent::FocusIn); QApplication::sendEvent(canvas, &fe); - QSGItem *item = findItem<QSGItem>(canvas->rootObject(), "item1"); + QQuickItem *item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -778,7 +778,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item2"); + item = findItem<QQuickItem>(canvas->rootObject(), "item2"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -787,7 +787,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item1"); + item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -796,7 +796,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item3"); + item = findItem<QQuickItem>(canvas->rootObject(), "item3"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -805,7 +805,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item4"); + item = findItem<QQuickItem>(canvas->rootObject(), "item4"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -814,7 +814,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item3"); + item = findItem<QQuickItem>(canvas->rootObject(), "item3"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -823,7 +823,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item4"); + item = findItem<QQuickItem>(canvas->rootObject(), "item4"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -832,7 +832,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item2"); + item = findItem<QQuickItem>(canvas->rootObject(), "item2"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -841,7 +841,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item4"); + item = findItem<QQuickItem>(canvas->rootObject(), "item4"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -850,7 +850,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item1"); + item = findItem<QQuickItem>(canvas->rootObject(), "item1"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -859,7 +859,7 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item4"); + item = findItem<QQuickItem>(canvas->rootObject(), "item4"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); @@ -868,18 +868,18 @@ void tst_QSGItem::keyNavigation_implicitSetting() QApplication::sendEvent(canvas, &key); QVERIFY(key.isAccepted()); - item = findItem<QSGItem>(canvas->rootObject(), "item3"); + item = findItem<QQuickItem>(canvas->rootObject(), "item3"); QVERIFY(item); QVERIFY(item->hasActiveFocus()); delete canvas; } -void tst_QSGItem::smooth() +void tst_QQuickItem::smooth() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0; Item { smooth: false; }", QUrl::fromLocalFile("")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QSignalSpy spy(item, SIGNAL(smoothChanged(bool))); QVERIFY(item); @@ -904,11 +904,11 @@ void tst_QSGItem::smooth() delete item; } -void tst_QSGItem::clip() +void tst_QQuickItem::clip() { QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0\nItem { clip: false\n }", QUrl::fromLocalFile("")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QSignalSpy spy(item, SIGNAL(clipChanged(bool))); QVERIFY(item); @@ -934,41 +934,41 @@ void tst_QSGItem::clip() delete item; } -void tst_QSGItem::mapCoordinates() +void tst_QQuickItem::mapCoordinates() { QFETCH(int, x); QFETCH(int, y); - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(300, 300)); canvas->setSource(QUrl::fromLocalFile(TESTDATA("mapCoordinates.qml"))); canvas->show(); qApp->processEvents(); - QSGItem *root = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *root = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(root != 0); - QSGItem *a = findItem<QSGItem>(canvas->rootObject(), "itemA"); + QQuickItem *a = findItem<QQuickItem>(canvas->rootObject(), "itemA"); QVERIFY(a != 0); - QSGItem *b = findItem<QSGItem>(canvas->rootObject(), "itemB"); + QQuickItem *b = findItem<QQuickItem>(canvas->rootObject(), "itemB"); QVERIFY(b != 0); QVariant result; QVERIFY(QMetaObject::invokeMethod(root, "mapAToB", Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); - QCOMPARE(result.value<QPointF>(), qobject_cast<QSGItem*>(a)->mapToItem(b, QPointF(x, y))); + QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapToItem(b, QPointF(x, y))); QVERIFY(QMetaObject::invokeMethod(root, "mapAFromB", Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); - QCOMPARE(result.value<QPointF>(), qobject_cast<QSGItem*>(a)->mapFromItem(b, QPointF(x, y))); + QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapFromItem(b, QPointF(x, y))); QVERIFY(QMetaObject::invokeMethod(root, "mapAToNull", Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); - QCOMPARE(result.value<QPointF>(), qobject_cast<QSGItem*>(a)->mapToScene(QPointF(x, y))); + QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapToScene(QPointF(x, y))); QVERIFY(QMetaObject::invokeMethod(root, "mapAFromNull", Q_RETURN_ARG(QVariant, result), Q_ARG(QVariant, x), Q_ARG(QVariant, y))); - QCOMPARE(result.value<QPointF>(), qobject_cast<QSGItem*>(a)->mapFromScene(QPointF(x, y))); + QCOMPARE(result.value<QPointF>(), qobject_cast<QQuickItem*>(a)->mapFromScene(QPointF(x, y))); QString warning1 = QUrl::fromLocalFile(TESTDATA("mapCoordinates.qml")).toString() + ":48:5: QML Item: mapToItem() given argument \"1122\" which is neither null nor an Item"; QString warning2 = QUrl::fromLocalFile(TESTDATA("mapCoordinates.qml")).toString() + ":48:5: QML Item: mapFromItem() given argument \"1122\" which is neither null nor an Item"; @@ -986,7 +986,7 @@ void tst_QSGItem::mapCoordinates() delete canvas; } -void tst_QSGItem::mapCoordinates_data() +void tst_QQuickItem::mapCoordinates_data() { QTest::addColumn<int>("x"); QTest::addColumn<int>("y"); @@ -995,7 +995,7 @@ void tst_QSGItem::mapCoordinates_data() QTest::newRow(QTest::toString(i)) << i << i; } -void tst_QSGItem::transforms_data() +void tst_QQuickItem::transforms_data() { QTest::addColumn<QByteArray>("qml"); QTest::addColumn<QTransform>("transform"); @@ -1009,18 +1009,18 @@ void tst_QSGItem::transforms_data() << QTransform(1,0,0,0,1,0,10,20,1) * QTransform(1.5,0,0,0,-2,0,0,0,1); } -void tst_QSGItem::transforms() +void tst_QQuickItem::transforms() { QFETCH(QByteArray, qml); QFETCH(QTransform, transform); QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0\nItem { transform: "+qml+"}", QUrl::fromLocalFile("")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(item->itemTransform(0,0), transform); } -void tst_QSGItem::childrenProperty() +void tst_QQuickItem::childrenProperty() { QDeclarativeComponent component(&engine, TESTDATA("childrenProperty.qml")); @@ -1035,7 +1035,7 @@ void tst_QSGItem::childrenProperty() delete o; } -void tst_QSGItem::resourcesProperty() +void tst_QQuickItem::resourcesProperty() { QDeclarativeComponent component(&engine, TESTDATA("resourcesProperty.qml")); @@ -1050,22 +1050,22 @@ void tst_QSGItem::resourcesProperty() delete o; } -void tst_QSGItem::propertyChanges() +void tst_QQuickItem::propertyChanges() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(300, 300)); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychanges.qml"))); canvas->show(); QTest::qWaitForWindowShown(canvas); - QSGItem *item = findItem<QSGItem>(canvas->rootObject(), "item"); - QSGItem *parentItem = findItem<QSGItem>(canvas->rootObject(), "parentItem"); + QQuickItem *item = findItem<QQuickItem>(canvas->rootObject(), "item"); + QQuickItem *parentItem = findItem<QQuickItem>(canvas->rootObject(), "parentItem"); QVERIFY(item); QVERIFY(parentItem); - QSignalSpy parentSpy(item, SIGNAL(parentChanged(QSGItem *))); + QSignalSpy parentSpy(item, SIGNAL(parentChanged(QQuickItem *))); QSignalSpy widthSpy(item, SIGNAL(widthChanged())); QSignalSpy heightSpy(item, SIGNAL(heightChanged())); QSignalSpy baselineOffsetSpy(item, SIGNAL(baselineOffsetChanged(qreal))); @@ -1086,7 +1086,7 @@ void tst_QSGItem::propertyChanges() QCOMPARE(parentSpy.count(),1); QList<QVariant> parentArguments = parentSpy.first(); QVERIFY(parentArguments.count() == 1); - QCOMPARE(item->parentItem(), qvariant_cast<QSGItem *>(parentArguments.at(0))); + QCOMPARE(item->parentItem(), qvariant_cast<QQuickItem *>(parentArguments.at(0))); QCOMPARE(childrenChangedSpy.count(),1); item->setParentItem(parentItem); @@ -1131,15 +1131,15 @@ void tst_QSGItem::propertyChanges() delete canvas; } -void tst_QSGItem::childrenRect() +void tst_QQuickItem::childrenRect() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("childrenRect.qml"))); canvas->setBaseSize(QSize(240,320)); canvas->show(); - QSGItem *o = canvas->rootObject(); - QSGItem *item = o->findChild<QSGItem*>("testItem"); + QQuickItem *o = canvas->rootObject(); + QQuickItem *item = o->findChild<QQuickItem*>("testItem"); QCOMPARE(item->width(), qreal(0)); QCOMPARE(item->height(), qreal(0)); @@ -1160,14 +1160,14 @@ void tst_QSGItem::childrenRect() } // QTBUG-11383 -void tst_QSGItem::childrenRectBug() +void tst_QQuickItem::childrenRectBug() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("childrenRectBug.qml"))); canvas->show(); - QSGItem *o = canvas->rootObject(); - QSGItem *item = o->findChild<QSGItem*>("theItem"); + QQuickItem *o = canvas->rootObject(); + QQuickItem *item = o->findChild<QQuickItem*>("theItem"); QCOMPARE(item->width(), qreal(200)); QCOMPARE(item->height(), qreal(100)); QCOMPARE(item->x(), qreal(100)); @@ -1176,20 +1176,20 @@ void tst_QSGItem::childrenRectBug() } // QTBUG-11465 -void tst_QSGItem::childrenRectBug2() +void tst_QQuickItem::childrenRectBug2() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("childrenRectBug2.qml"))); canvas->show(); - QSGRectangle *rect = qobject_cast<QSGRectangle*>(canvas->rootObject()); + QQuickRectangle *rect = qobject_cast<QQuickRectangle*>(canvas->rootObject()); QVERIFY(rect); - QSGItem *item = rect->findChild<QSGItem*>("theItem"); + QQuickItem *item = rect->findChild<QQuickItem*>("theItem"); QCOMPARE(item->width(), qreal(100)); QCOMPARE(item->height(), qreal(110)); QCOMPARE(item->x(), qreal(130)); - QSGItemPrivate *rectPrivate = QSGItemPrivate::get(rect); + QQuickItemPrivate *rectPrivate = QQuickItemPrivate::get(rect); rectPrivate->setState("row"); QCOMPARE(item->width(), qreal(210)); QCOMPARE(item->height(), qreal(50)); @@ -1199,9 +1199,9 @@ void tst_QSGItem::childrenRectBug2() } // QTBUG-12722 -void tst_QSGItem::childrenRectBug3() +void tst_QQuickItem::childrenRectBug3() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("childrenRectBug3.qml"))); canvas->show(); @@ -1210,22 +1210,22 @@ void tst_QSGItem::childrenRectBug3() } // QTBUG-13893 -void tst_QSGItem::transformCrash() +void tst_QQuickItem::transformCrash() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("transformCrash.qml"))); canvas->show(); delete canvas; } -void tst_QSGItem::implicitSize() +void tst_QQuickItem::implicitSize() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("implicitsize.qml"))); canvas->show(); - QSGItem *item = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *item = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(item); QCOMPARE(item->width(), qreal(80)); QCOMPARE(item->height(), qreal(60)); @@ -1248,7 +1248,7 @@ void tst_QSGItem::implicitSize() delete canvas; } -void tst_QSGItem::qtbug_16871() +void tst_QQuickItem::qtbug_16871() { QDeclarativeComponent component(&engine, TESTDATA("qtbug_16871.qml")); QObject *o = component.create(); @@ -1256,6 +1256,6 @@ void tst_QSGItem::qtbug_16871() delete o; } -QTEST_MAIN(tst_QSGItem) +QTEST_MAIN(tst_QQuickItem) -#include "tst_qsgitem.moc" +#include "tst_qquickitem.moc" diff --git a/tests/auto/declarative/qsglistview/data/ComponentView.qml b/tests/auto/declarative/qquicklistview/data/ComponentView.qml index 3e87be8799..3e87be8799 100644 --- a/tests/auto/declarative/qsglistview/data/ComponentView.qml +++ b/tests/auto/declarative/qquicklistview/data/ComponentView.qml diff --git a/tests/auto/declarative/qsglistview/data/attachedSignals.qml b/tests/auto/declarative/qquicklistview/data/attachedSignals.qml index 2c3c0bbada..2c3c0bbada 100644 --- a/tests/auto/declarative/qsglistview/data/attachedSignals.qml +++ b/tests/auto/declarative/qquicklistview/data/attachedSignals.qml diff --git a/tests/auto/declarative/qsglistview/data/creationContext.qml b/tests/auto/declarative/qquicklistview/data/creationContext.qml index 79a682788b..79a682788b 100644 --- a/tests/auto/declarative/qsglistview/data/creationContext.qml +++ b/tests/auto/declarative/qquicklistview/data/creationContext.qml diff --git a/tests/auto/declarative/qsglistview/data/displaylist.qml b/tests/auto/declarative/qquicklistview/data/displaylist.qml index 4e8fd32f6a..4e8fd32f6a 100644 --- a/tests/auto/declarative/qsglistview/data/displaylist.qml +++ b/tests/auto/declarative/qquicklistview/data/displaylist.qml diff --git a/tests/auto/declarative/qsglistview/data/fillModelOnComponentCompleted.qml b/tests/auto/declarative/qquicklistview/data/fillModelOnComponentCompleted.qml index 906e6adb6b..906e6adb6b 100644 --- a/tests/auto/declarative/qsglistview/data/fillModelOnComponentCompleted.qml +++ b/tests/auto/declarative/qquicklistview/data/fillModelOnComponentCompleted.qml diff --git a/tests/auto/declarative/qsglistview/data/footer.qml b/tests/auto/declarative/qquicklistview/data/footer.qml index 2a5619999e..2a5619999e 100644 --- a/tests/auto/declarative/qsglistview/data/footer.qml +++ b/tests/auto/declarative/qquicklistview/data/footer.qml diff --git a/tests/auto/declarative/qsglistview/data/header.qml b/tests/auto/declarative/qquicklistview/data/header.qml index bf70310630..bf70310630 100644 --- a/tests/auto/declarative/qsglistview/data/header.qml +++ b/tests/auto/declarative/qquicklistview/data/header.qml diff --git a/tests/auto/declarative/qsglistview/data/headerfooter.qml b/tests/auto/declarative/qquicklistview/data/headerfooter.qml index 8e8463d645..8e8463d645 100644 --- a/tests/auto/declarative/qsglistview/data/headerfooter.qml +++ b/tests/auto/declarative/qquicklistview/data/headerfooter.qml diff --git a/tests/auto/declarative/qsglistview/data/itemlist.qml b/tests/auto/declarative/qquicklistview/data/itemlist.qml index 90dd59795b..90dd59795b 100644 --- a/tests/auto/declarative/qsglistview/data/itemlist.qml +++ b/tests/auto/declarative/qquicklistview/data/itemlist.qml diff --git a/tests/auto/declarative/qsglistview/data/listview-enforcerange-nohighlight.qml b/tests/auto/declarative/qquicklistview/data/listview-enforcerange-nohighlight.qml index 1db1096499..1db1096499 100644 --- a/tests/auto/declarative/qsglistview/data/listview-enforcerange-nohighlight.qml +++ b/tests/auto/declarative/qquicklistview/data/listview-enforcerange-nohighlight.qml diff --git a/tests/auto/declarative/qsglistview/data/listview-enforcerange.qml b/tests/auto/declarative/qquicklistview/data/listview-enforcerange.qml index f1bf6c2b57..f1bf6c2b57 100644 --- a/tests/auto/declarative/qsglistview/data/listview-enforcerange.qml +++ b/tests/auto/declarative/qquicklistview/data/listview-enforcerange.qml diff --git a/tests/auto/declarative/qsglistview/data/listview-initCurrent.qml b/tests/auto/declarative/qquicklistview/data/listview-initCurrent.qml index c4f1860eda..c4f1860eda 100644 --- a/tests/auto/declarative/qsglistview/data/listview-initCurrent.qml +++ b/tests/auto/declarative/qquicklistview/data/listview-initCurrent.qml diff --git a/tests/auto/declarative/qsglistview/data/listview-noCurrent.qml b/tests/auto/declarative/qquicklistview/data/listview-noCurrent.qml index 079966d8e4..079966d8e4 100644 --- a/tests/auto/declarative/qsglistview/data/listview-noCurrent.qml +++ b/tests/auto/declarative/qquicklistview/data/listview-noCurrent.qml diff --git a/tests/auto/declarative/qsglistview/data/listview-sections.qml b/tests/auto/declarative/qquicklistview/data/listview-sections.qml index d5b8a4400d..d5b8a4400d 100644 --- a/tests/auto/declarative/qsglistview/data/listview-sections.qml +++ b/tests/auto/declarative/qquicklistview/data/listview-sections.qml diff --git a/tests/auto/declarative/qsglistview/data/listview-sections_delegate.qml b/tests/auto/declarative/qquicklistview/data/listview-sections_delegate.qml index 496d8d7784..496d8d7784 100644 --- a/tests/auto/declarative/qsglistview/data/listview-sections_delegate.qml +++ b/tests/auto/declarative/qquicklistview/data/listview-sections_delegate.qml diff --git a/tests/auto/declarative/qsglistview/data/listviewtest.qml b/tests/auto/declarative/qquicklistview/data/listviewtest.qml index 0202de1546..0202de1546 100644 --- a/tests/auto/declarative/qsglistview/data/listviewtest.qml +++ b/tests/auto/declarative/qquicklistview/data/listviewtest.qml diff --git a/tests/auto/declarative/qsglistview/data/manual-highlight.qml b/tests/auto/declarative/qquicklistview/data/manual-highlight.qml index aac4599f01..aac4599f01 100644 --- a/tests/auto/declarative/qsglistview/data/manual-highlight.qml +++ b/tests/auto/declarative/qquicklistview/data/manual-highlight.qml diff --git a/tests/auto/declarative/qsglistview/data/margins.qml b/tests/auto/declarative/qquicklistview/data/margins.qml index 19bbef500f..19bbef500f 100644 --- a/tests/auto/declarative/qsglistview/data/margins.qml +++ b/tests/auto/declarative/qquicklistview/data/margins.qml diff --git a/tests/auto/declarative/qsglistview/data/propertychangestest.qml b/tests/auto/declarative/qquicklistview/data/propertychangestest.qml index 146f3f13b0..146f3f13b0 100644 --- a/tests/auto/declarative/qsglistview/data/propertychangestest.qml +++ b/tests/auto/declarative/qquicklistview/data/propertychangestest.qml diff --git a/tests/auto/declarative/qsglistview/data/qtbug-21742.qml b/tests/auto/declarative/qquicklistview/data/qtbug-21742.qml index 774f9041fb..774f9041fb 100644 --- a/tests/auto/declarative/qsglistview/data/qtbug-21742.qml +++ b/tests/auto/declarative/qquicklistview/data/qtbug-21742.qml diff --git a/tests/auto/declarative/qsglistview/data/qtbug14821.qml b/tests/auto/declarative/qquicklistview/data/qtbug14821.qml index 0a5e0acbb4..0a5e0acbb4 100644 --- a/tests/auto/declarative/qsglistview/data/qtbug14821.qml +++ b/tests/auto/declarative/qquicklistview/data/qtbug14821.qml diff --git a/tests/auto/declarative/qsglistview/data/qtbug16037.qml b/tests/auto/declarative/qquicklistview/data/qtbug16037.qml index 21faeb3f32..21faeb3f32 100644 --- a/tests/auto/declarative/qsglistview/data/qtbug16037.qml +++ b/tests/auto/declarative/qquicklistview/data/qtbug16037.qml diff --git a/tests/auto/declarative/qsglistview/data/resizeview.qml b/tests/auto/declarative/qquicklistview/data/resizeview.qml index 071cdedf2e..071cdedf2e 100644 --- a/tests/auto/declarative/qsglistview/data/resizeview.qml +++ b/tests/auto/declarative/qquicklistview/data/resizeview.qml diff --git a/tests/auto/declarative/qsglistview/data/rightToLeft.qml b/tests/auto/declarative/qquicklistview/data/rightToLeft.qml index 6d77de26f4..6d77de26f4 100644 --- a/tests/auto/declarative/qsglistview/data/rightToLeft.qml +++ b/tests/auto/declarative/qquicklistview/data/rightToLeft.qml diff --git a/tests/auto/declarative/qsglistview/data/sizelessthan1.qml b/tests/auto/declarative/qquicklistview/data/sizelessthan1.qml index aa9dc20ae9..aa9dc20ae9 100644 --- a/tests/auto/declarative/qsglistview/data/sizelessthan1.qml +++ b/tests/auto/declarative/qquicklistview/data/sizelessthan1.qml diff --git a/tests/auto/declarative/qsglistview/data/snapToItem.qml b/tests/auto/declarative/qquicklistview/data/snapToItem.qml index 6f201072f0..6f201072f0 100644 --- a/tests/auto/declarative/qsglistview/data/snapToItem.qml +++ b/tests/auto/declarative/qquicklistview/data/snapToItem.qml diff --git a/tests/auto/declarative/qsglistview/data/strictlyenforcerange.qml b/tests/auto/declarative/qquicklistview/data/strictlyenforcerange.qml index 7960ac4abb..7960ac4abb 100644 --- a/tests/auto/declarative/qsglistview/data/strictlyenforcerange.qml +++ b/tests/auto/declarative/qquicklistview/data/strictlyenforcerange.qml diff --git a/tests/auto/declarative/qsglistview/incrementalmodel.cpp b/tests/auto/declarative/qquicklistview/incrementalmodel.cpp index 53d30915f5..53d30915f5 100644 --- a/tests/auto/declarative/qsglistview/incrementalmodel.cpp +++ b/tests/auto/declarative/qquicklistview/incrementalmodel.cpp diff --git a/tests/auto/declarative/qsglistview/incrementalmodel.h b/tests/auto/declarative/qquicklistview/incrementalmodel.h index a6cddb6b07..a6cddb6b07 100644 --- a/tests/auto/declarative/qsglistview/incrementalmodel.h +++ b/tests/auto/declarative/qquicklistview/incrementalmodel.h diff --git a/tests/auto/declarative/qsglistview/qsglistview.pro b/tests/auto/declarative/qquicklistview/qquicklistview.pro index 3322f30dd9..a047651d39 100644 --- a/tests/auto/declarative/qsglistview/qsglistview.pro +++ b/tests/auto/declarative/qquicklistview/qquicklistview.pro @@ -1,9 +1,9 @@ CONFIG += testcase -TARGET = tst_qsglistview +TARGET = tst_qquicklistview macx:CONFIG -= app_bundle HEADERS += incrementalmodel.h -SOURCES += tst_qsglistview.cpp incrementalmodel.cpp +SOURCES += tst_qquicklistview.cpp incrementalmodel.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp b/tests/auto/declarative/qquicklistview/tst_qquicklistview.cpp index 8e2375d6b5..ae37724492 100644 --- a/tests/auto/declarative/qsglistview/tst_qsglistview.cpp +++ b/tests/auto/declarative/qquicklistview/tst_qquicklistview.cpp @@ -41,14 +41,14 @@ #include <QtTest/QtTest> #include <QtWidgets/QStringListModel> -#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/private/qsgitem_p.h> -#include <QtDeclarative/private/qsglistview_p.h> -#include <QtDeclarative/private/qsgtext_p.h> -#include <QtDeclarative/private/qsgvisualitemmodel_p.h> +#include <QtDeclarative/private/qquickitem_p.h> +#include <QtDeclarative/private/qquicklistview_p.h> +#include <QtDeclarative/private/qquicktext_p.h> +#include <QtDeclarative/private/qquickvisualitemmodel_p.h> #include <QtDeclarative/private/qdeclarativelistmodel_p.h> #include <QtDeclarative/private/qlistmodelinterface_p.h> #include <QtDeclarative/private/qdeclarativechangeset_p.h> @@ -57,13 +57,13 @@ #include <math.h> Q_DECLARE_METATYPE(Qt::LayoutDirection) -Q_DECLARE_METATYPE(QSGListView::Orientation) +Q_DECLARE_METATYPE(QQuickListView::Orientation) -class tst_QSGListView : public QObject +class tst_QQuickListView : public QObject { Q_OBJECT public: - tst_QSGListView(); + tst_QQuickListView(); private slots: void initTestCase(); @@ -153,24 +153,24 @@ private: template <class T> void removed(bool animated); template <class T> void moved(); template <class T> void clear(); - QSGView *createView(); - void flick(QSGView *canvas, const QPoint &from, const QPoint &to, int duration); - QSGItem *findVisibleChild(QSGItem *parent, const QString &objectName); + QQuickView *createView(); + void flick(QQuickView *canvas, const QPoint &from, const QPoint &to, int duration); + QQuickItem *findVisibleChild(QQuickItem *parent, const QString &objectName); template<typename T> - T *findItem(QSGItem *parent, const QString &id, int index=-1); + T *findItem(QQuickItem *parent, const QString &id, int index=-1); template<typename T> - QList<T*> findItems(QSGItem *parent, const QString &objectName); - void dumpTree(QSGItem *parent, int depth = 0); + QList<T*> findItems(QQuickItem *parent, const QString &objectName); + void dumpTree(QQuickItem *parent, int depth = 0); void inserted_more_data(); void moved_data(); }; -void tst_QSGListView::initTestCase() +void tst_QQuickListView::initTestCase() { } -void tst_QSGListView::cleanupTestCase() +void tst_QQuickListView::cleanupTestCase() { } @@ -214,7 +214,7 @@ public: }; template<typename T> -void tst_qsglistview_move(int from, int to, int n, T *items) +void tst_qquicklistview_move(int from, int to, int n, T *items) { if (from > to) { // Only move forwards - flip if backwards moving @@ -332,7 +332,7 @@ public: } void moveItems(int from, int to, int count) { - tst_qsglistview_move(from, to, count, &list); + tst_qquicklistview_move(from, to, count, &list); emit itemsMoved(from, to, count); } @@ -426,7 +426,7 @@ public: void moveItems(int from, int to, int count) { emit beginMoveRows(QModelIndex(), from, from+count-1, QModelIndex(), to > from ? to+count : to); - tst_qsglistview_move(from, to, count, &list); + tst_qquicklistview_move(from, to, count, &list); emit endMoveRows(); } @@ -446,14 +446,14 @@ private: QList<QPair<QString,QString> > list; }; -tst_QSGListView::tst_QSGListView() +tst_QQuickListView::tst_QQuickListView() { } template <class T> -void tst_QSGListView::items() +void tst_QQuickListView::items() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); T model; model.addItem("Fred", "12345"); @@ -469,10 +469,10 @@ void tst_QSGListView::items() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties"); @@ -484,13 +484,13 @@ void tst_QSGListView::items() QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item // current item should be first item - QTRY_COMPARE(listview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 0)); + QTRY_COMPARE(listview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 0)); for (int i = 0; i < model.count(); ++i) { - QSGText *name = findItem<QSGText>(contentItem, "textName", i); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", i); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", i); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", i); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -519,7 +519,7 @@ void tst_QSGListView::items() T model2; ctxt->setContextProperty("testModel", &model2); - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); QTRY_VERIFY(itemCount == 0); QTRY_COMPARE(listview->highlightResizeSpeed(), 1000.0); @@ -531,9 +531,9 @@ void tst_QSGListView::items() template <class T> -void tst_QSGListView::changed() +void tst_QQuickListView::changed() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); T model; model.addItem("Fred", "12345"); @@ -549,17 +549,17 @@ void tst_QSGListView::changed() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGFlickable *listview = findItem<QSGFlickable>(canvas->rootObject(), "list"); + QQuickFlickable *listview = findItem<QQuickFlickable>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); model.modifyItem(1, "Will", "9876"); - QSGText *name = findItem<QSGText>(contentItem, "textName", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 1); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(1)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 1); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 1); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(1)); @@ -568,9 +568,9 @@ void tst_QSGListView::changed() } template <class T> -void tst_QSGListView::inserted() +void tst_QQuickListView::inserted() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); T model; @@ -587,10 +587,10 @@ void tst_QSGListView::inserted() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); model.insertItem(1, "Will", "9876"); @@ -598,16 +598,16 @@ void tst_QSGListView::inserted() QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - QSGText *name = findItem<QSGText>(contentItem, "textName", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 1); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(1)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 1); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 1); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(1)); // Confirm items positioned correctly for (int i = 0; i < model.count(); ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QTRY_COMPARE(item->y(), i*20.0); } @@ -616,10 +616,10 @@ void tst_QSGListView::inserted() QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); QTRY_COMPARE(contentItem->childItems().count(), model.count()+1); // assumes all are visible, +1 for the (default) highlight item - name = findItem<QSGText>(contentItem, "textName", 0); + name = findItem<QQuickText>(contentItem, "textName", 0); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(0)); - number = findItem<QSGText>(contentItem, "textNumber", 0); + number = findItem<QQuickText>(contentItem, "textNumber", 0); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(0)); @@ -627,7 +627,7 @@ void tst_QSGListView::inserted() // Confirm items positioned correctly for (int i = 0; i < model.count(); ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QTRY_COMPARE(item->y(), i*20.0); } @@ -643,7 +643,7 @@ void tst_QSGListView::inserted() // Confirm items positioned correctly for (int i = 5; i < 5+15; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.0 - 20.0); @@ -656,7 +656,7 @@ void tst_QSGListView::inserted() model.insertItem(0, "Hello", "1234"); QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->y(), 0.); QVERIFY(listview->contentY() == 0); @@ -666,16 +666,16 @@ void tst_QSGListView::inserted() } template <class T> -void tst_QSGListView::inserted_more() +void tst_QQuickListView::inserted_more() { QFETCH(qreal, contentY); QFETCH(int, insertIndex); QFETCH(int, insertCount); QFETCH(qreal, itemsOffsetAfterMove); - QSGText *name; - QSGText *number; - QSGView *canvas = createView(); + QQuickText *name; + QQuickText *number; + QQuickView *canvas = createView(); canvas->show(); T model; @@ -691,9 +691,9 @@ void tst_QSGListView::inserted_more() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); listview->setContentY(contentY); @@ -705,11 +705,11 @@ void tst_QSGListView::inserted_more() QTRY_COMPARE(listview->property("count").toInt(), model.count()); // check visibleItems.first() is in correct position - QSGItem *item0 = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item0 = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item0); QCOMPARE(item0->y(), itemsOffsetAfterMove); - QList<QSGItem*> items = findItems<QSGItem>(contentItem, "wrapper"); + QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper"); int firstVisibleIndex = -1; for (int i=0; i<items.count(); i++) { if (items[i]->y() >= contentY) { @@ -721,15 +721,15 @@ void tst_QSGListView::inserted_more() QVERIFY2(firstVisibleIndex >= 0, QTest::toString(firstVisibleIndex)); // Confirm items positioned correctly and indexes correct - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = firstVisibleIndex; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); QTRY_COMPARE(item->y(), i*20.0 + itemsOffsetAfterMove); - name = findItem<QSGText>(contentItem, "textName", i); + name = findItem<QQuickText>(contentItem, "textName", i); QVERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - number = findItem<QSGText>(contentItem, "textNumber", i); + number = findItem<QQuickText>(contentItem, "textNumber", i); QVERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -738,7 +738,7 @@ void tst_QSGListView::inserted_more() delete testObject; } -void tst_QSGListView::inserted_more_data() +void tst_QQuickListView::inserted_more_data() { QTest::addColumn<qreal>("contentY"); QTest::addColumn<int>("insertIndex"); @@ -819,9 +819,9 @@ void tst_QSGListView::inserted_more_data() } template <class T> -void tst_QSGListView::removed(bool animated) +void tst_QQuickListView::removed(bool animated) { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); T model; for (int i = 0; i < 50; i++) @@ -837,26 +837,26 @@ void tst_QSGListView::removed(bool animated) canvas->show(); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); model.removeItem(1); QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); - QSGText *name = findItem<QSGText>(contentItem, "textName", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 1); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(1)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 1); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 1); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(1)); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_VERIFY(item->y() == i*20); @@ -866,17 +866,17 @@ void tst_QSGListView::removed(bool animated) model.removeItem(0); // post: top item starts at 20 QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); - name = findItem<QSGText>(contentItem, "textName", 0); + name = findItem<QQuickText>(contentItem, "textName", 0); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(0)); - number = findItem<QSGText>(contentItem, "textNumber", 0); + number = findItem<QQuickText>(contentItem, "textNumber", 0); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(0)); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(),i*20.0 + 20.0); @@ -887,9 +887,9 @@ void tst_QSGListView::removed(bool animated) QTRY_COMPARE(canvas->rootObject()->property("count").toInt(), model.count()); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(),i*20.0+20.0); @@ -904,7 +904,7 @@ void tst_QSGListView::removed(bool animated) // Confirm items positioned correctly for (int i = 2; i < 18; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(),40+i*20.0); @@ -912,7 +912,7 @@ void tst_QSGListView::removed(bool animated) // Remove current index QTRY_VERIFY(listview->currentIndex() == 9); - QSGItem *oldCurrent = listview->currentItem(); + QQuickItem *oldCurrent = listview->currentItem(); model.removeItem(9); QTRY_COMPARE(listview->currentIndex(), 9); @@ -923,9 +923,9 @@ void tst_QSGListView::removed(bool animated) QTest::qWait(300); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(),40+i*20.0); @@ -955,9 +955,9 @@ void tst_QSGListView::removed(bool animated) QTRY_COMPARE(listview->count() , model.count()); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i+2); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i+2); if (!item) qWarning() << "Item" << i+2 << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(),80+i*20.0); @@ -972,7 +972,7 @@ void tst_QSGListView::removed(bool animated) model.addItem("New", "1"); QTRY_COMPARE(listview->count() , model.count()); - QTRY_VERIFY(name = findItem<QSGText>(contentItem, "textName", model.count()-1)); + QTRY_VERIFY(name = findItem<QQuickText>(contentItem, "textName", model.count()-1)); QCOMPARE(name->text(), QString("New")); // Add some more items so that we don't run out @@ -984,22 +984,22 @@ void tst_QSGListView::removed(bool animated) listview->setCurrentIndex(0); listview->setContentY(30); model.removeItem(0); - QTRY_VERIFY(name = findItem<QSGText>(contentItem, "textName", 0)); + QTRY_VERIFY(name = findItem<QQuickText>(contentItem, "textName", 0)); // QTBUG-19198 move to end and remove all visible items one at a time. listview->positionViewAtEnd(); for (int i = 0; i < 18; ++i) model.removeItems(model.count() - 1, 1); - QTRY_VERIFY(findItems<QSGItem>(contentItem, "wrapper").count() > 16); + QTRY_VERIFY(findItems<QQuickItem>(contentItem, "wrapper").count() > 16); delete canvas; delete testObject; } template <class T> -void tst_QSGListView::clear() +void tst_QQuickListView::clear() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); T model; for (int i = 0; i < 30; i++) @@ -1014,10 +1014,10 @@ void tst_QSGListView::clear() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); model.clear(); @@ -1038,7 +1038,7 @@ void tst_QSGListView::clear() } template <class T> -void tst_QSGListView::moved() +void tst_QQuickListView::moved() { QFETCH(qreal, contentY); QFETCH(int, from); @@ -1046,9 +1046,9 @@ void tst_QSGListView::moved() QFETCH(int, count); QFETCH(qreal, itemsOffsetAfterMove); - QSGText *name; - QSGText *number; - QSGView *canvas = createView(); + QQuickText *name; + QQuickText *number; + QQuickView *canvas = createView(); canvas->show(); T model; @@ -1064,13 +1064,13 @@ void tst_QSGListView::moved() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGItem *currentItem = listview->currentItem(); + QQuickItem *currentItem = listview->currentItem(); QTRY_VERIFY(currentItem != 0); listview->setContentY(contentY); @@ -1079,7 +1079,7 @@ void tst_QSGListView::moved() // wait for items to move QTest::qWait(100); - QList<QSGItem*> items = findItems<QSGItem>(contentItem, "wrapper"); + QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "wrapper"); int firstVisibleIndex = -1; for (int i=0; i<items.count(); i++) { if (items[i]->y() >= contentY) { @@ -1091,17 +1091,17 @@ void tst_QSGListView::moved() QVERIFY2(firstVisibleIndex >= 0, QTest::toString(firstVisibleIndex)); // Confirm items positioned correctly and indexes correct - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = firstVisibleIndex; i < model.count() && i < itemCount; ++i) { if (i >= firstVisibleIndex + 16) // index has moved out of view continue; - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); QTRY_COMPARE(item->y(), i*20.0 + itemsOffsetAfterMove); - name = findItem<QSGText>(contentItem, "textName", i); + name = findItem<QQuickText>(contentItem, "textName", i); QVERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - number = findItem<QSGText>(contentItem, "textNumber", i); + number = findItem<QQuickText>(contentItem, "textNumber", i); QVERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); @@ -1114,7 +1114,7 @@ void tst_QSGListView::moved() delete testObject; } -void tst_QSGListView::moved_data() +void tst_QQuickListView::moved_data() { QTest::addColumn<qreal>("contentY"); QTest::addColumn<int>("from"); @@ -1254,14 +1254,14 @@ struct ListChange { }; Q_DECLARE_METATYPE(QList<ListChange>) -void tst_QSGListView::multipleChanges() +void tst_QQuickListView::multipleChanges() { QFETCH(int, startCount); QFETCH(QList<ListChange>, changes); QFETCH(int, newCount); QFETCH(int, newCurrentIndex); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -1277,7 +1277,7 @@ void tst_QSGListView::multipleChanges() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); for (int i=0; i<changes.count(); i++) { @@ -1306,18 +1306,18 @@ void tst_QSGListView::multipleChanges() QCOMPARE(listview->count(), model.count()); QTRY_COMPARE(listview->currentIndex(), newCurrentIndex); - QSGText *name; - QSGText *number; - QSGItem *contentItem = listview->contentItem(); + QQuickText *name; + QQuickText *number; + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i=0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY2(item, QTest::toString(QString("Item %1 not found").arg(i))); - name = findItem<QSGText>(contentItem, "textName", i); + name = findItem<QQuickText>(contentItem, "textName", i); QVERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(i)); - number = findItem<QSGText>(contentItem, "textNumber", i); + number = findItem<QQuickText>(contentItem, "textNumber", i); QVERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(i)); } @@ -1326,7 +1326,7 @@ void tst_QSGListView::multipleChanges() delete canvas; } -void tst_QSGListView::multipleChanges_data() +void tst_QQuickListView::multipleChanges_data() { QTest::addColumn<int>("startCount"); QTest::addColumn<QList<ListChange> >("changes"); @@ -1476,9 +1476,9 @@ void tst_QSGListView::multipleChanges_data() ) << 5 << -1; } -void tst_QSGListView::swapWithFirstItem() +void tst_QQuickListView::swapWithFirstItem() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -1494,7 +1494,7 @@ void tst_QSGListView::swapWithFirstItem() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); // ensure content position is stable @@ -1506,9 +1506,9 @@ void tst_QSGListView::swapWithFirstItem() delete canvas; } -void tst_QSGListView::enforceRange() +void tst_QQuickListView::enforceRange() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -1520,25 +1520,25 @@ void tst_QSGListView::enforceRange() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listview-enforcerange.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); QTRY_COMPARE(listview->preferredHighlightBegin(), 100.0); QTRY_COMPARE(listview->preferredHighlightEnd(), 100.0); - QTRY_COMPARE(listview->highlightRangeMode(), QSGListView::StrictlyEnforceRange); + QTRY_COMPARE(listview->highlightRangeMode(), QQuickListView::StrictlyEnforceRange); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // view should be positioned at the top of the range. - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QTRY_VERIFY(item); QTRY_COMPARE(listview->contentY(), -100.0); - QSGText *name = findItem<QSGText>(contentItem, "textName", 0); + QQuickText *name = findItem<QQuickText>(contentItem, "textName", 0); QTRY_VERIFY(name != 0); QTRY_COMPARE(name->text(), model.name(0)); - QSGText *number = findItem<QSGText>(contentItem, "textNumber", 0); + QQuickText *number = findItem<QQuickText>(contentItem, "textNumber", 0); QTRY_VERIFY(number != 0); QTRY_COMPARE(number->text(), model.number(0)); @@ -1558,14 +1558,14 @@ void tst_QSGListView::enforceRange() delete canvas; } -void tst_QSGListView::enforceRange_withoutHighlight() +void tst_QQuickListView::enforceRange_withoutHighlight() { // QTBUG-20287 // If no highlight is set but StrictlyEnforceRange is used, the content should still move // to the correct position (i.e. to the next/previous item, not next/previous section) // when moving up/down via incrementCurrentIndex() and decrementCurrentIndex() - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); QTest::qWait(200); @@ -1581,7 +1581,7 @@ void tst_QSGListView::enforceRange_withoutHighlight() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listview-enforcerange-nohighlight.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); qreal expectedPos = -100.0; @@ -1605,9 +1605,9 @@ void tst_QSGListView::enforceRange_withoutHighlight() delete canvas; } -void tst_QSGListView::spacing() +void tst_QQuickListView::spacing() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -1623,16 +1623,16 @@ void tst_QSGListView::spacing() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_VERIFY(item->y() == i*20); @@ -1642,9 +1642,9 @@ void tst_QSGListView::spacing() QTRY_VERIFY(listview->spacing() == 10); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_VERIFY(item->y() == i*30); @@ -1653,9 +1653,9 @@ void tst_QSGListView::spacing() listview->setSpacing(0); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.0); @@ -1665,9 +1665,9 @@ void tst_QSGListView::spacing() delete testObject; } -void tst_QSGListView::sections() +void tst_QQuickListView::sections() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -1680,19 +1680,19 @@ void tst_QSGListView::sections() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listview-sections.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QTRY_VERIFY(item); QTRY_COMPARE(item->y(), qreal(i*20 + ((i+4)/5) * 20)); - QSGText *next = findItem<QSGText>(item, "nextSection"); + QQuickText *next = findItem<QQuickText>(item, "nextSection"); QCOMPARE(next->text().toInt(), (i+1)/5); } @@ -1703,7 +1703,7 @@ void tst_QSGListView::sections() QTRY_COMPARE(listview->count(), model.count()); // New section header created - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 5); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 5); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 40.0); @@ -1711,11 +1711,11 @@ void tst_QSGListView::sections() QTRY_COMPARE(listview->count(), model.count()); // Section header moved - item = findItem<QSGItem>(contentItem, "wrapper", 5); + item = findItem<QQuickItem>(contentItem, "wrapper", 5); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 20.0); - item = findItem<QSGItem>(contentItem, "wrapper", 6); + item = findItem<QQuickItem>(contentItem, "wrapper", 6); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 40.0); @@ -1723,11 +1723,11 @@ void tst_QSGListView::sections() model.insertItem(6, "Replace header", "1"); QTRY_COMPARE(listview->count(), model.count()); - item = findItem<QSGItem>(contentItem, "wrapper", 6); + item = findItem<QQuickItem>(contentItem, "wrapper", 6); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 40.0); - item = findItem<QSGItem>(contentItem, "wrapper", 7); + item = findItem<QQuickItem>(contentItem, "wrapper", 7); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 20.0); @@ -1743,7 +1743,7 @@ void tst_QSGListView::sections() QTRY_COMPARE(currentSectionChangedSpy.count(), 2); - item = findItem<QSGItem>(contentItem, "wrapper", 1); + item = findItem<QQuickItem>(contentItem, "wrapper", 1); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 20.0); @@ -1752,16 +1752,16 @@ void tst_QSGListView::sections() model.modifyItem(0, "changed", "2"); QTest::qWait(300); - item = findItem<QSGItem>(contentItem, "wrapper", 1); + item = findItem<QQuickItem>(contentItem, "wrapper", 1); QTRY_VERIFY(item); QTRY_COMPARE(item->height(), 40.0); delete canvas; } -void tst_QSGListView::sectionsDelegate() +void tst_QQuickListView::sectionsDelegate() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -1774,24 +1774,24 @@ void tst_QSGListView::sectionsDelegate() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listview-sections_delegate.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QTRY_VERIFY(item); QTRY_COMPARE(item->y(), qreal(i*20 + ((i+5)/5) * 20)); - QSGText *next = findItem<QSGText>(item, "nextSection"); + QQuickText *next = findItem<QQuickText>(item, "nextSection"); QCOMPARE(next->text().toInt(), (i+1)/5); } for (int i = 0; i < 3; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "sect_" + QString::number(i)); + QQuickItem *item = findItem<QQuickItem>(contentItem, "sect_" + QString::number(i)); QVERIFY(item); QTRY_COMPARE(item->y(), qreal(i*20*6)); } @@ -1804,7 +1804,7 @@ void tst_QSGListView::sectionsDelegate() QTest::qWait(300); for (int i = 0; i < 3; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, + QQuickItem *item = findItem<QQuickItem>(contentItem, "sect_" + (i == 0 ? QString("aaa") : QString::number(i))); QVERIFY(item); QTRY_COMPARE(item->y(), qreal(i*20*6)); @@ -1814,13 +1814,13 @@ void tst_QSGListView::sectionsDelegate() model.removeItem(5); QTRY_COMPARE(listview->count(), model.count()); for (int i = 0; i < 3; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, + QQuickItem *item = findItem<QQuickItem>(contentItem, "sect_" + (i == 0 ? QString("aaa") : QString::number(i))); QVERIFY(item); } // QTBUG-17606 - QList<QSGItem*> items = findItems<QSGItem>(contentItem, "sect_1"); + QList<QQuickItem*> items = findItems<QQuickItem>(contentItem, "sect_1"); QCOMPARE(items.count(), 1); // QTBUG-17759 @@ -1836,12 +1836,12 @@ void tst_QSGListView::sectionsDelegate() model.modifyItem(9, "Two", "aaa"); model.modifyItem(10, "Two", "aaa"); model.modifyItem(11, "Two", "aaa"); - QTRY_COMPARE(findItems<QSGItem>(contentItem, "sect_aaa").count(), 1); + QTRY_COMPARE(findItems<QQuickItem>(contentItem, "sect_aaa").count(), 1); canvas->rootObject()->setProperty("sectionProperty", "name"); // ensure view has settled. - QTRY_COMPARE(findItems<QSGItem>(contentItem, "sect_Four").count(), 1); + QTRY_COMPARE(findItems<QQuickItem>(contentItem, "sect_Four").count(), 1); for (int i = 0; i < 4; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, + QQuickItem *item = findItem<QQuickItem>(contentItem, "sect_" + model.name(i*3)); QVERIFY(item); QTRY_COMPARE(item->y(), qreal(i*20*4)); @@ -1850,7 +1850,7 @@ void tst_QSGListView::sectionsDelegate() // QTBUG-17769 model.removeItems(10, 20); // ensure view has settled. - QTRY_COMPARE(findItems<QSGItem>(contentItem, "wrapper").count(), 10); + QTRY_COMPARE(findItems<QQuickItem>(contentItem, "wrapper").count(), 10); // Drag view up beyond bounds QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(20,20)); { @@ -1872,9 +1872,9 @@ void tst_QSGListView::sectionsDelegate() delete canvas; } -void tst_QSGListView::sectionsPositioning() +void tst_QQuickListView::sectionsPositioning() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -1886,25 +1886,25 @@ void tst_QSGListView::sectionsPositioning() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listview-sections_delegate.qml"))); qApp->processEvents(); - canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QSGViewSection::InlineLabels | QSGViewSection::CurrentLabelAtStart | QSGViewSection::NextLabelAtEnd))); + canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QQuickViewSection::InlineLabels | QQuickViewSection::CurrentLabelAtStart | QQuickViewSection::NextLabelAtEnd))); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); for (int i = 0; i < 3; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "sect_" + QString::number(i)); + QQuickItem *item = findItem<QQuickItem>(contentItem, "sect_" + QString::number(i)); QVERIFY(item); QTRY_COMPARE(item->y(), qreal(i*20*6)); } - QSGItem *topItem = findVisibleChild(contentItem, "sect_0"); // section header + QQuickItem *topItem = findVisibleChild(contentItem, "sect_0"); // section header QVERIFY(topItem); QCOMPARE(topItem->y(), 0.); - QSGItem *bottomItem = findVisibleChild(contentItem, "sect_3"); // section footer + QQuickItem *bottomItem = findVisibleChild(contentItem, "sect_3"); // section footer QVERIFY(bottomItem); QCOMPARE(bottomItem->y(), 300.); @@ -1918,7 +1918,7 @@ void tst_QSGListView::sectionsPositioning() QVERIFY(topItem); QCOMPARE(topItem->y(), 100.); - QSGItem *item = findVisibleChild(contentItem, "sect_1"); + QQuickItem *item = findVisibleChild(contentItem, "sect_1"); QVERIFY(item); QCOMPARE(item->y(), 120.); @@ -1949,7 +1949,7 @@ void tst_QSGListView::sectionsPositioning() QTRY_COMPARE(listview->currentSection(), QString("aaa")); for (int i = 0; i < 3; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, + QQuickItem *item = findItem<QQuickItem>(contentItem, "sect_" + (i == 0 ? QString("aaa") : QString::number(i))); QVERIFY(item); QTRY_COMPARE(item->y(), qreal(i*20*6)); @@ -1964,7 +1964,7 @@ void tst_QSGListView::sectionsPositioning() model.removeItem(5); QTRY_COMPARE(listview->count(), model.count()); for (int i = 0; i < 3; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, + QQuickItem *item = findItem<QQuickItem>(contentItem, "sect_" + (i == 0 ? QString("aaa") : QString::number(i))); QVERIFY(item); QTRY_COMPARE(item->y(), qreal(i*20*6)); @@ -1988,24 +1988,24 @@ void tst_QSGListView::sectionsPositioning() // Turn sticky footer off listview->setContentY(50); - canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QSGViewSection::InlineLabels | QSGViewSection::CurrentLabelAtStart))); + canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QQuickViewSection::InlineLabels | QQuickViewSection::CurrentLabelAtStart))); item = findVisibleChild(contentItem, "sect_new"); // inline label restored QCOMPARE(item->y(), 360.); // Turn sticky header off listview->setContentY(50); - canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QSGViewSection::InlineLabels))); + canvas->rootObject()->setProperty("sectionPositioning", QVariant(int(QQuickViewSection::InlineLabels))); item = findVisibleChild(contentItem, "sect_aaa"); // inline label restored QCOMPARE(item->y(), 20.); delete canvas; } -void tst_QSGListView::currentIndex_delayedItemCreation() +void tst_QQuickListView::currentIndex_delayedItemCreation() { QFETCH(bool, setCurrentToZero); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; @@ -2016,10 +2016,10 @@ void tst_QSGListView::currentIndex_delayedItemCreation() canvas->setSource(QUrl::fromLocalFile(TESTDATA("fillModelOnComponentCompleted.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QSignalSpy spy(listview, SIGNAL(currentIndexChanged())); @@ -2029,7 +2029,7 @@ void tst_QSGListView::currentIndex_delayedItemCreation() delete canvas; } -void tst_QSGListView::currentIndex_delayedItemCreation_data() +void tst_QQuickListView::currentIndex_delayedItemCreation_data() { QTest::addColumn<bool>("setCurrentToZero"); @@ -2037,13 +2037,13 @@ void tst_QSGListView::currentIndex_delayedItemCreation_data() QTest::newRow("don't set to 0") << false; } -void tst_QSGListView::currentIndex() +void tst_QQuickListView::currentIndex() { TestModel model; for (int i = 0; i < 30; i++) model.addItem("Item" + QString::number(i), QString::number(i)); - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); QDeclarativeContext *ctxt = canvas->rootContext(); @@ -2055,17 +2055,17 @@ void tst_QSGListView::currentIndex() qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // current item should be 20th item at startup // and current item should be in view QCOMPARE(listview->currentIndex(), 20); QCOMPARE(listview->contentY(), 100.0); - QCOMPARE(listview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 20)); + QCOMPARE(listview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 20)); QCOMPARE(listview->highlightItem()->y(), listview->currentItem()->y()); // no wrap @@ -2174,13 +2174,13 @@ void tst_QSGListView::currentIndex() delete canvas; } -void tst_QSGListView::noCurrentIndex() +void tst_QQuickListView::noCurrentIndex() { TestModel model; for (int i = 0; i < 30; i++) model.addItem("Item" + QString::number(i), QString::number(i)); - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); QDeclarativeContext *ctxt = canvas->rootContext(); @@ -2191,10 +2191,10 @@ void tst_QSGListView::noCurrentIndex() qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // current index should be -1 at startup @@ -2212,50 +2212,50 @@ void tst_QSGListView::noCurrentIndex() delete canvas; } -void tst_QSGListView::itemList() +void tst_QQuickListView::itemList() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("itemlist.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "view"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "view"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGVisualItemModel *model = canvas->rootObject()->findChild<QSGVisualItemModel*>("itemModel"); + QQuickVisualItemModel *model = canvas->rootObject()->findChild<QQuickVisualItemModel*>("itemModel"); QTRY_VERIFY(model != 0); QTRY_VERIFY(model->count() == 3); QTRY_COMPARE(listview->currentIndex(), 0); - QSGItem *item = findItem<QSGItem>(contentItem, "item1"); + QQuickItem *item = findItem<QQuickItem>(contentItem, "item1"); QTRY_VERIFY(item); QTRY_COMPARE(item->x(), 0.0); QCOMPARE(item->height(), listview->height()); - QSGText *text = findItem<QSGText>(contentItem, "text1"); + QQuickText *text = findItem<QQuickText>(contentItem, "text1"); QTRY_VERIFY(text); QTRY_COMPARE(text->text(), QLatin1String("index: 0")); listview->setCurrentIndex(2); - item = findItem<QSGItem>(contentItem, "item3"); + item = findItem<QQuickItem>(contentItem, "item3"); QTRY_VERIFY(item); QTRY_COMPARE(item->x(), 480.0); - text = findItem<QSGText>(contentItem, "text3"); + text = findItem<QQuickText>(contentItem, "text3"); QTRY_VERIFY(text); QTRY_COMPARE(text->text(), QLatin1String("index: 2")); delete canvas; } -void tst_QSGListView::cacheBuffer() +void tst_QQuickListView::cacheBuffer() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -2270,19 +2270,19 @@ void tst_QSGListView::cacheBuffer() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_VERIFY(listview->delegate() != 0); QTRY_VERIFY(listview->model() != 0); QTRY_VERIFY(listview->highlight() != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_VERIFY(item->y() == i*20); @@ -2291,12 +2291,12 @@ void tst_QSGListView::cacheBuffer() testObject->setCacheBuffer(400); QTRY_VERIFY(listview->cacheBuffer() == 400); - int newItemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int newItemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); QTRY_VERIFY(newItemCount > itemCount); // Confirm items positioned correctly for (int i = 0; i < model.count() && i < newItemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_VERIFY(item->y() == i*20); @@ -2306,9 +2306,9 @@ void tst_QSGListView::cacheBuffer() delete testObject; } -void tst_QSGListView::positionViewAtIndex() +void tst_QQuickListView::positionViewAtIndex() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 40; i++) @@ -2323,125 +2323,125 @@ void tst_QSGListView::positionViewAtIndex() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.); } // Position on a currently visible item - listview->positionViewAtIndex(3, QSGListView::Beginning); + listview->positionViewAtIndex(3, QQuickListView::Beginning); QTRY_COMPARE(listview->contentY(), 60.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 3; i < model.count() && i < itemCount-3-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.); } // Position on an item beyond the visible items - listview->positionViewAtIndex(22, QSGListView::Beginning); + listview->positionViewAtIndex(22, QQuickListView::Beginning); QTRY_COMPARE(listview->contentY(), 440.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 22; i < model.count() && i < itemCount-22-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.); } // Position on an item that would leave empty space if positioned at the top - listview->positionViewAtIndex(28, QSGListView::Beginning); + listview->positionViewAtIndex(28, QQuickListView::Beginning); QTRY_COMPARE(listview->contentY(), 480.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 24; i < model.count() && i < itemCount-24-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.); } // Position at the beginning again - listview->positionViewAtIndex(0, QSGListView::Beginning); + listview->positionViewAtIndex(0, QQuickListView::Beginning); QTRY_COMPARE(listview->contentY(), 0.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount-1; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.); } // Position at End using last index - listview->positionViewAtIndex(model.count()-1, QSGListView::End); + listview->positionViewAtIndex(model.count()-1, QQuickListView::End); QTRY_COMPARE(listview->contentY(), 480.); // Confirm items positioned correctly - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 24; i < model.count(); ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.); } // Position at End - listview->positionViewAtIndex(20, QSGListView::End); + listview->positionViewAtIndex(20, QQuickListView::End); QTRY_COMPARE(listview->contentY(), 100.); // Position in Center - listview->positionViewAtIndex(15, QSGListView::Center); + listview->positionViewAtIndex(15, QQuickListView::Center); QTRY_COMPARE(listview->contentY(), 150.); // Ensure at least partially visible - listview->positionViewAtIndex(15, QSGListView::Visible); + listview->positionViewAtIndex(15, QQuickListView::Visible); QTRY_COMPARE(listview->contentY(), 150.); listview->setContentY(302); - listview->positionViewAtIndex(15, QSGListView::Visible); + listview->positionViewAtIndex(15, QQuickListView::Visible); QTRY_COMPARE(listview->contentY(), 302.); listview->setContentY(320); - listview->positionViewAtIndex(15, QSGListView::Visible); + listview->positionViewAtIndex(15, QQuickListView::Visible); QTRY_COMPARE(listview->contentY(), 300.); listview->setContentY(85); - listview->positionViewAtIndex(20, QSGListView::Visible); + listview->positionViewAtIndex(20, QQuickListView::Visible); QTRY_COMPARE(listview->contentY(), 85.); listview->setContentY(75); - listview->positionViewAtIndex(20, QSGListView::Visible); + listview->positionViewAtIndex(20, QQuickListView::Visible); QTRY_COMPARE(listview->contentY(), 100.); // Ensure completely visible listview->setContentY(120); - listview->positionViewAtIndex(20, QSGListView::Contain); + listview->positionViewAtIndex(20, QQuickListView::Contain); QTRY_COMPARE(listview->contentY(), 120.); listview->setContentY(302); - listview->positionViewAtIndex(15, QSGListView::Contain); + listview->positionViewAtIndex(15, QQuickListView::Contain); QTRY_COMPARE(listview->contentY(), 300.); listview->setContentY(85); - listview->positionViewAtIndex(20, QSGListView::Contain); + listview->positionViewAtIndex(20, QQuickListView::Contain); QTRY_COMPARE(listview->contentY(), 100.); // positionAtBeginnging @@ -2474,9 +2474,9 @@ void tst_QSGListView::positionViewAtIndex() delete testObject; } -void tst_QSGListView::resetModel() +void tst_QQuickListView::resetModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QStringList strings; strings << "one" << "two" << "three"; @@ -2488,16 +2488,16 @@ void tst_QSGListView::resetModel() canvas->setSource(QUrl::fromLocalFile(TESTDATA("displaylist.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_COMPARE(listview->count(), model.rowCount()); for (int i = 0; i < model.rowCount(); ++i) { - QSGText *display = findItem<QSGText>(contentItem, "displayText", i); + QQuickText *display = findItem<QQuickText>(contentItem, "displayText", i); QTRY_VERIFY(display != 0); QTRY_COMPARE(display->text(), strings.at(i)); } @@ -2509,7 +2509,7 @@ void tst_QSGListView::resetModel() QTRY_COMPARE(listview->count(), model.rowCount()); for (int i = 0; i < model.rowCount(); ++i) { - QSGText *display = findItem<QSGText>(contentItem, "displayText", i); + QQuickText *display = findItem<QQuickText>(contentItem, "displayText", i); QTRY_VERIFY(display != 0); QTRY_COMPARE(display->text(), strings.at(i)); } @@ -2517,13 +2517,13 @@ void tst_QSGListView::resetModel() delete canvas; } -void tst_QSGListView::propertyChanges() +void tst_QQuickListView::propertyChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QTRY_VERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychangestest.qml"))); - QSGListView *listView = canvas->rootObject()->findChild<QSGListView*>("listView"); + QQuickListView *listView = canvas->rootObject()->findChild<QQuickListView*>("listView"); QTRY_VERIFY(listView); QSignalSpy highlightFollowsCurrentItemSpy(listView, SIGNAL(highlightFollowsCurrentItemChanged())); @@ -2537,26 +2537,26 @@ void tst_QSGListView::propertyChanges() QTRY_COMPARE(listView->highlightFollowsCurrentItem(), true); QTRY_COMPARE(listView->preferredHighlightBegin(), 0.0); QTRY_COMPARE(listView->preferredHighlightEnd(), 0.0); - QTRY_COMPARE(listView->highlightRangeMode(), QSGListView::ApplyRange); + QTRY_COMPARE(listView->highlightRangeMode(), QQuickListView::ApplyRange); QTRY_COMPARE(listView->isWrapEnabled(), true); QTRY_COMPARE(listView->cacheBuffer(), 10); - QTRY_COMPARE(listView->snapMode(), QSGListView::SnapToItem); + QTRY_COMPARE(listView->snapMode(), QQuickListView::SnapToItem); listView->setHighlightFollowsCurrentItem(false); listView->setPreferredHighlightBegin(1.0); listView->setPreferredHighlightEnd(1.0); - listView->setHighlightRangeMode(QSGListView::StrictlyEnforceRange); + listView->setHighlightRangeMode(QQuickListView::StrictlyEnforceRange); listView->setWrapEnabled(false); listView->setCacheBuffer(3); - listView->setSnapMode(QSGListView::SnapOneItem); + listView->setSnapMode(QQuickListView::SnapOneItem); QTRY_COMPARE(listView->highlightFollowsCurrentItem(), false); QTRY_COMPARE(listView->preferredHighlightBegin(), 1.0); QTRY_COMPARE(listView->preferredHighlightEnd(), 1.0); - QTRY_COMPARE(listView->highlightRangeMode(), QSGListView::StrictlyEnforceRange); + QTRY_COMPARE(listView->highlightRangeMode(), QQuickListView::StrictlyEnforceRange); QTRY_COMPARE(listView->isWrapEnabled(), false); QTRY_COMPARE(listView->cacheBuffer(), 3); - QTRY_COMPARE(listView->snapMode(), QSGListView::SnapOneItem); + QTRY_COMPARE(listView->snapMode(), QQuickListView::SnapOneItem); QTRY_COMPARE(highlightFollowsCurrentItemSpy.count(),1); QTRY_COMPARE(preferredHighlightBeginSpy.count(),1); @@ -2569,10 +2569,10 @@ void tst_QSGListView::propertyChanges() listView->setHighlightFollowsCurrentItem(false); listView->setPreferredHighlightBegin(1.0); listView->setPreferredHighlightEnd(1.0); - listView->setHighlightRangeMode(QSGListView::StrictlyEnforceRange); + listView->setHighlightRangeMode(QQuickListView::StrictlyEnforceRange); listView->setWrapEnabled(false); listView->setCacheBuffer(3); - listView->setSnapMode(QSGListView::SnapOneItem); + listView->setSnapMode(QQuickListView::SnapOneItem); QTRY_COMPARE(highlightFollowsCurrentItemSpy.count(),1); QTRY_COMPARE(preferredHighlightBeginSpy.count(),1); @@ -2585,13 +2585,13 @@ void tst_QSGListView::propertyChanges() delete canvas; } -void tst_QSGListView::componentChanges() +void tst_QQuickListView::componentChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QTRY_VERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychangestest.qml"))); - QSGListView *listView = canvas->rootObject()->findChild<QSGListView*>("listView"); + QQuickListView *listView = canvas->rootObject()->findChild<QQuickListView*>("listView"); QTRY_VERIFY(listView); QDeclarativeComponent component(canvas->engine()); @@ -2633,13 +2633,13 @@ void tst_QSGListView::componentChanges() delete canvas; } -void tst_QSGListView::modelChanges() +void tst_QQuickListView::modelChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QTRY_VERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychangestest.qml"))); - QSGListView *listView = canvas->rootObject()->findChild<QSGListView*>("listView"); + QQuickListView *listView = canvas->rootObject()->findChild<QQuickListView*>("listView"); QTRY_VERIFY(listView); QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel"); @@ -2660,17 +2660,17 @@ void tst_QSGListView::modelChanges() delete canvas; } -void tst_QSGListView::QTBUG_9791() +void tst_QQuickListView::QTBUG_9791() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("strictlyenforcerange.qml"))); qApp->processEvents(); - QSGListView *listview = qobject_cast<QSGListView*>(canvas->rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(canvas->rootObject()); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_VERIFY(listview->delegate() != 0); QTRY_VERIFY(listview->model() != 0); @@ -2679,11 +2679,11 @@ void tst_QSGListView::QTBUG_9791() qApp->processEvents(); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); QCOMPARE(itemCount, 3); for (int i = 0; i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->x(), i*300.0); @@ -2695,9 +2695,9 @@ void tst_QSGListView::QTBUG_9791() delete canvas; } -void tst_QSGListView::manualHighlight() +void tst_QQuickListView::manualHighlight() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); QString filename(TESTDATA("manual-highlight.qml")); @@ -2705,35 +2705,35 @@ void tst_QSGListView::manualHighlight() qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_COMPARE(listview->currentIndex(), 0); - QTRY_COMPARE(listview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 0)); + QTRY_COMPARE(listview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 0)); QTRY_COMPARE(listview->highlightItem()->y() - 5, listview->currentItem()->y()); listview->setCurrentIndex(2); QTRY_COMPARE(listview->currentIndex(), 2); - QTRY_COMPARE(listview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 2)); + QTRY_COMPARE(listview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 2)); QTRY_COMPARE(listview->highlightItem()->y() - 5, listview->currentItem()->y()); // QTBUG-15972 - listview->positionViewAtIndex(3, QSGListView::Contain); + listview->positionViewAtIndex(3, QQuickListView::Contain); QTRY_COMPARE(listview->currentIndex(), 2); - QTRY_COMPARE(listview->currentItem(), findItem<QSGItem>(contentItem, "wrapper", 2)); + QTRY_COMPARE(listview->currentItem(), findItem<QQuickItem>(contentItem, "wrapper", 2)); QTRY_COMPARE(listview->highlightItem()->y() - 5, listview->currentItem()->y()); delete canvas; } -void tst_QSGListView::QTBUG_11105() +void tst_QQuickListView::QTBUG_11105() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -2748,22 +2748,22 @@ void tst_QSGListView::QTBUG_11105() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_VERIFY(item->y() == i*20); } - listview->positionViewAtIndex(20, QSGListView::Beginning); + listview->positionViewAtIndex(20, QQuickListView::Beginning); QCOMPARE(listview->contentY(), 280.); TestModel model2; @@ -2772,16 +2772,16 @@ void tst_QSGListView::QTBUG_11105() ctxt->setContextProperty("testModel", &model2); - itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); QCOMPARE(itemCount, 5); delete canvas; delete testObject; } -void tst_QSGListView::header() +void tst_QQuickListView::header() { - QFETCH(QSGListView::Orientation, orientation); + QFETCH(QQuickListView::Orientation, orientation); QFETCH(Qt::LayoutDirection, layoutDirection); QFETCH(QPointF, initialHeaderPos); QFETCH(QPointF, firstDelegatePos); @@ -2794,21 +2794,21 @@ void tst_QSGListView::header() for (int i = 0; i < 30; i++) model.addItem("Item" + QString::number(i), ""); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->rootContext()->setContextProperty("testModel", &model); canvas->rootContext()->setContextProperty("initialViewWidth", 240); canvas->rootContext()->setContextProperty("initialViewHeight", 320); canvas->setSource(QUrl::fromLocalFile(TESTDATA("header.qml"))); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); listview->setOrientation(orientation); listview->setLayoutDirection(layoutDirection); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGText *header = findItem<QSGText>(contentItem, "header"); + QQuickText *header = findItem<QQuickText>(contentItem, "header"); QVERIFY(header); QVERIFY(header == listview->headerItem()); @@ -2818,7 +2818,7 @@ void tst_QSGListView::header() QCOMPARE(header->pos(), initialHeaderPos); QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos); - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -2833,9 +2833,9 @@ void tst_QSGListView::header() QCOMPARE(headerItemSpy.count(), 1); - header = findItem<QSGText>(contentItem, "header"); + header = findItem<QQuickText>(contentItem, "header"); QVERIFY(!header); - header = findItem<QSGText>(contentItem, "header2"); + header = findItem<QQuickText>(contentItem, "header2"); QVERIFY(header); QVERIFY(header == listview->headerItem()); @@ -2857,7 +2857,7 @@ void tst_QSGListView::header() canvas->rootContext()->setContextProperty("initialViewHeight", 0.0); canvas->setSource(QUrl::fromLocalFile(TESTDATA("header.qml"))); - listview = findItem<QSGListView>(canvas->rootObject(), "list"); + listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); listview->setOrientation(orientation); listview->setLayoutDirection(layoutDirection); @@ -2871,9 +2871,9 @@ void tst_QSGListView::header() delete canvas; } -void tst_QSGListView::header_data() +void tst_QQuickListView::header_data() { - QTest::addColumn<QSGListView::Orientation>("orientation"); + QTest::addColumn<QQuickListView::Orientation>("orientation"); QTest::addColumn<Qt::LayoutDirection>("layoutDirection"); QTest::addColumn<QPointF>("initialHeaderPos"); QTest::addColumn<QPointF>("changedHeaderPos"); @@ -2888,7 +2888,7 @@ void tst_QSGListView::header_data() // view width = 240 // header above items, top left - QTest::newRow("vertical, left to right") << QSGListView::Vertical << Qt::LeftToRight + QTest::newRow("vertical, left to right") << QQuickListView::Vertical << Qt::LeftToRight << QPointF(0, -30) << QPointF(0, -20) << QPointF(0, -30) @@ -2897,7 +2897,7 @@ void tst_QSGListView::header_data() << QPointF(0, -10); // header above items, top right - QTest::newRow("vertical, layout right to left") << QSGListView::Vertical << Qt::RightToLeft + QTest::newRow("vertical, layout right to left") << QQuickListView::Vertical << Qt::RightToLeft << QPointF(0, -30) << QPointF(0, -20) << QPointF(0, -30) @@ -2906,7 +2906,7 @@ void tst_QSGListView::header_data() << QPointF(0, -10); // header to left of items - QTest::newRow("horizontal, layout left to right") << QSGListView::Horizontal << Qt::LeftToRight + QTest::newRow("horizontal, layout left to right") << QQuickListView::Horizontal << Qt::LeftToRight << QPointF(-100, 0) << QPointF(-50, 0) << QPointF(-100, 0) @@ -2915,7 +2915,7 @@ void tst_QSGListView::header_data() << QPointF(-40, 0); // header to right of items - QTest::newRow("horizontal, layout right to left") << QSGListView::Horizontal << Qt::RightToLeft + QTest::newRow("horizontal, layout right to left") << QQuickListView::Horizontal << Qt::RightToLeft << QPointF(0, 0) << QPointF(0, 0) << QPointF(-240 + 100, 0) @@ -2924,9 +2924,9 @@ void tst_QSGListView::header_data() << QPointF(-240 + 40, 0); } -void tst_QSGListView::header_delayItemCreation() +void tst_QQuickListView::header_delayItemCreation() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; @@ -2934,13 +2934,13 @@ void tst_QSGListView::header_delayItemCreation() canvas->setSource(QUrl::fromLocalFile(TESTDATA("fillModelOnComponentCompleted.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGText *header = findItem<QSGText>(contentItem, "header"); + QQuickText *header = findItem<QQuickText>(contentItem, "header"); QVERIFY(header); QCOMPARE(header->y(), -header->height()); @@ -2952,9 +2952,9 @@ void tst_QSGListView::header_delayItemCreation() delete canvas; } -void tst_QSGListView::footer() +void tst_QQuickListView::footer() { - QFETCH(QSGListView::Orientation, orientation); + QFETCH(QQuickListView::Orientation, orientation); QFETCH(Qt::LayoutDirection, layoutDirection); QFETCH(QPointF, initialFooterPos); QFETCH(QPointF, firstDelegatePos); @@ -2963,7 +2963,7 @@ void tst_QSGListView::footer() QFETCH(QPointF, changedContentPos); QFETCH(QPointF, resizeContentPos); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 3; i++) @@ -2976,15 +2976,15 @@ void tst_QSGListView::footer() canvas->show(); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); listview->setOrientation(orientation); listview->setLayoutDirection(layoutDirection); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGText *footer = findItem<QSGText>(contentItem, "footer"); + QQuickText *footer = findItem<QQuickText>(contentItem, "footer"); QVERIFY(footer); QVERIFY(footer == listview->footerItem()); @@ -2994,14 +2994,14 @@ void tst_QSGListView::footer() QCOMPARE(footer->height(), 30.); QCOMPARE(QPointF(listview->contentX(), listview->contentY()), initialContentPos); - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); // remove one item model.removeItem(1); - if (orientation == QSGListView::Vertical) { + if (orientation == QQuickListView::Vertical) { QTRY_COMPARE(footer->y(), initialFooterPos.y() - 20); // delegate height = 20 } else { QTRY_COMPARE(footer->x(), layoutDirection == Qt::LeftToRight ? @@ -3012,7 +3012,7 @@ void tst_QSGListView::footer() model.clear(); QPointF posWhenNoItems(0, 0); - if (orientation == QSGListView::Horizontal && layoutDirection == Qt::RightToLeft) + if (orientation == QQuickListView::Horizontal && layoutDirection == Qt::RightToLeft) posWhenNoItems.setX(-100); QTRY_COMPARE(footer->pos(), posWhenNoItems); @@ -3030,9 +3030,9 @@ void tst_QSGListView::footer() QCOMPARE(footerItemSpy.count(), 1); - footer = findItem<QSGText>(contentItem, "footer"); + footer = findItem<QQuickText>(contentItem, "footer"); QVERIFY(!footer); - footer = findItem<QSGText>(contentItem, "footer2"); + footer = findItem<QQuickText>(contentItem, "footer2"); QVERIFY(footer); QVERIFY(footer == listview->footerItem()); @@ -3042,7 +3042,7 @@ void tst_QSGListView::footer() QCOMPARE(footer->height(), 20.); QTRY_COMPARE(QPointF(listview->contentX(), listview->contentY()), changedContentPos); - item = findItem<QSGItem>(contentItem, "wrapper", 0); + item = findItem<QQuickItem>(contentItem, "wrapper", 0); QVERIFY(item); QCOMPARE(item->pos(), firstDelegatePos); @@ -3054,9 +3054,9 @@ void tst_QSGListView::footer() delete canvas; } -void tst_QSGListView::footer_data() +void tst_QQuickListView::footer_data() { - QTest::addColumn<QSGListView::Orientation>("orientation"); + QTest::addColumn<QQuickListView::Orientation>("orientation"); QTest::addColumn<Qt::LayoutDirection>("layoutDirection"); QTest::addColumn<QPointF>("initialFooterPos"); QTest::addColumn<QPointF>("changedFooterPos"); @@ -3072,7 +3072,7 @@ void tst_QSGListView::footer_data() // view height = 320 // footer below items, bottom left - QTest::newRow("vertical, layout left to right") << QSGListView::Vertical << Qt::LeftToRight + QTest::newRow("vertical, layout left to right") << QQuickListView::Vertical << Qt::LeftToRight << QPointF(0, 3 * 20) << QPointF(0, 30 * 20) // added 30 items << QPointF(0, 0) @@ -3081,7 +3081,7 @@ void tst_QSGListView::footer_data() << QPointF(0, 30 * 20 - 320 + 10); // footer below items, bottom right - QTest::newRow("vertical, layout right to left") << QSGListView::Vertical << Qt::RightToLeft + QTest::newRow("vertical, layout right to left") << QQuickListView::Vertical << Qt::RightToLeft << QPointF(0, 3 * 20) << QPointF(0, 30 * 20) << QPointF(0, 0) @@ -3090,7 +3090,7 @@ void tst_QSGListView::footer_data() << QPointF(0, 30 * 20 - 320 + 10); // footer to right of items - QTest::newRow("horizontal, layout left to right") << QSGListView::Horizontal << Qt::LeftToRight + QTest::newRow("horizontal, layout left to right") << QQuickListView::Horizontal << Qt::LeftToRight << QPointF(40 * 3, 0) << QPointF(40 * 30, 0) << QPointF(0, 0) @@ -3099,7 +3099,7 @@ void tst_QSGListView::footer_data() << QPointF(40 * 30 - 240 + 40, 0); // footer to left of items - QTest::newRow("horizontal, layout right to left") << QSGListView::Horizontal << Qt::RightToLeft + QTest::newRow("horizontal, layout right to left") << QQuickListView::Horizontal << Qt::RightToLeft << QPointF(-(40 * 3) - 100, 0) << QPointF(-(40 * 30) - 50, 0) // 50 = new footer width << QPointF(-240, 0) @@ -3108,7 +3108,7 @@ void tst_QSGListView::footer_data() << QPointF(-(40 * 30) - 40, 0); } -class LVAccessor : public QSGListView +class LVAccessor : public QQuickListView { public: qreal minY() const { return minYExtent(); } @@ -3117,11 +3117,11 @@ public: qreal maxX() const { return maxXExtent(); } }; -void tst_QSGListView::headerFooter() +void tst_QQuickListView::headerFooter() { { // Vertical - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; QDeclarativeContext *ctxt = canvas->rootContext(); @@ -3130,17 +3130,17 @@ void tst_QSGListView::headerFooter() canvas->setSource(QUrl::fromLocalFile(TESTDATA("headerfooter.qml"))); qApp->processEvents(); - QSGListView *listview = qobject_cast<QSGListView*>(canvas->rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(canvas->rootObject()); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGItem *header = findItem<QSGItem>(contentItem, "header"); + QQuickItem *header = findItem<QQuickItem>(contentItem, "header"); QVERIFY(header); QCOMPARE(header->y(), -header->height()); - QSGItem *footer = findItem<QSGItem>(contentItem, "footer"); + QQuickItem *footer = findItem<QQuickItem>(contentItem, "footer"); QVERIFY(footer); QCOMPARE(footer->y(), 0.); @@ -3151,7 +3151,7 @@ void tst_QSGListView::headerFooter() } { // Horizontal - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; QDeclarativeContext *ctxt = canvas->rootContext(); @@ -3161,17 +3161,17 @@ void tst_QSGListView::headerFooter() canvas->rootObject()->setProperty("horizontal", true); qApp->processEvents(); - QSGListView *listview = qobject_cast<QSGListView*>(canvas->rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(canvas->rootObject()); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGItem *header = findItem<QSGItem>(contentItem, "header"); + QQuickItem *header = findItem<QQuickItem>(contentItem, "header"); QVERIFY(header); QCOMPARE(header->x(), -header->width()); - QSGItem *footer = findItem<QSGItem>(contentItem, "footer"); + QQuickItem *footer = findItem<QQuickItem>(contentItem, "footer"); QVERIFY(footer); QCOMPARE(footer->x(), 0.); @@ -3182,7 +3182,7 @@ void tst_QSGListView::headerFooter() } { // Horizontal RTL - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; QDeclarativeContext *ctxt = canvas->rootContext(); @@ -3193,17 +3193,17 @@ void tst_QSGListView::headerFooter() canvas->rootObject()->setProperty("rtl", true); qApp->processEvents(); - QSGListView *listview = qobject_cast<QSGListView*>(canvas->rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(canvas->rootObject()); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGItem *header = findItem<QSGItem>(contentItem, "header"); + QQuickItem *header = findItem<QQuickItem>(contentItem, "header"); QVERIFY(header); QCOMPARE(header->x(), 0.); - QSGItem *footer = findItem<QSGItem>(contentItem, "footer"); + QQuickItem *footer = findItem<QQuickItem>(contentItem, "footer"); QVERIFY(footer); QCOMPARE(footer->x(), -footer->width()); @@ -3214,9 +3214,9 @@ void tst_QSGListView::headerFooter() } } -void tst_QSGListView::resizeView() +void tst_QQuickListView::resizeView() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 40; i++) @@ -3231,16 +3231,16 @@ void tst_QSGListView::resizeView() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*20.); @@ -3259,9 +3259,9 @@ void tst_QSGListView::resizeView() delete testObject; } -void tst_QSGListView::resizeViewAndRepaint() +void tst_QQuickListView::resizeViewAndRepaint() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -3275,26 +3275,26 @@ void tst_QSGListView::resizeViewAndRepaint() canvas->setSource(QUrl::fromLocalFile(TESTDATA("resizeview.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // item at index 10 should not be currently visible - QVERIFY(!findItem<QSGItem>(contentItem, "wrapper", 10)); + QVERIFY(!findItem<QQuickItem>(contentItem, "wrapper", 10)); listview->setHeight(320); - QTRY_VERIFY(findItem<QSGItem>(contentItem, "wrapper", 10)); + QTRY_VERIFY(findItem<QQuickItem>(contentItem, "wrapper", 10)); listview->setHeight(100); - QTRY_VERIFY(!findItem<QSGItem>(contentItem, "wrapper", 10)); + QTRY_VERIFY(!findItem<QQuickItem>(contentItem, "wrapper", 10)); delete canvas; } -void tst_QSGListView::sizeLessThan1() +void tst_QQuickListView::sizeLessThan1() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -3309,16 +3309,16 @@ void tst_QSGListView::sizeLessThan1() canvas->setSource(QUrl::fromLocalFile(TESTDATA("sizelessthan1.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // Confirm items positioned correctly - int itemCount = findItems<QSGItem>(contentItem, "wrapper").count(); + int itemCount = findItems<QQuickItem>(contentItem, "wrapper").count(); for (int i = 0; i < model.count() && i < itemCount; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); if (!item) qWarning() << "Item" << i << "not found"; QTRY_VERIFY(item); QTRY_COMPARE(item->y(), i*0.5); @@ -3328,17 +3328,17 @@ void tst_QSGListView::sizeLessThan1() delete testObject; } -void tst_QSGListView::QTBUG_14821() +void tst_QQuickListView::QTBUG_14821() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("qtbug14821.qml"))); qApp->processEvents(); - QSGListView *listview = qobject_cast<QSGListView*>(canvas->rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(canvas->rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); listview->decrementCurrentIndex(); @@ -3350,9 +3350,9 @@ void tst_QSGListView::QTBUG_14821() delete canvas; } -void tst_QSGListView::resizeDelegate() +void tst_QQuickListView::resizeDelegate() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); QStringList strings; @@ -3366,10 +3366,10 @@ void tst_QSGListView::resizeDelegate() canvas->setSource(QUrl::fromLocalFile(TESTDATA("displaylist.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); QCOMPARE(listview->count(), model.rowCount()); @@ -3379,7 +3379,7 @@ void tst_QSGListView::resizeDelegate() QTest::qWait(300); for (int i = 0; i < 16; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY(item != 0); QCOMPARE(item->y(), i*20.0); } @@ -3391,7 +3391,7 @@ void tst_QSGListView::resizeDelegate() QTest::qWait(300); for (int i = 0; i < 11; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY(item != 0); QTRY_COMPARE(item->y(), i*30.0); } @@ -3400,11 +3400,11 @@ void tst_QSGListView::resizeDelegate() QTRY_COMPARE(listview->highlightItem()->y(), 750.0); listview->setCurrentIndex(1); - listview->positionViewAtIndex(25, QSGListView::Beginning); - listview->positionViewAtIndex(5, QSGListView::Beginning); + listview->positionViewAtIndex(25, QQuickListView::Beginning); + listview->positionViewAtIndex(5, QQuickListView::Beginning); for (int i = 5; i < 16; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY(item != 0); QCOMPARE(item->y(), i*30.0); } @@ -3416,7 +3416,7 @@ void tst_QSGListView::resizeDelegate() QTest::qWait(300); for (int i = 5; i < 11; ++i) { - QSGItem *item = findItem<QSGItem>(contentItem, "wrapper", i); + QQuickItem *item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY(item != 0); QTRY_COMPARE(item->y(), 150 + (i-5)*20.0); } @@ -3427,12 +3427,12 @@ void tst_QSGListView::resizeDelegate() delete canvas; } -void tst_QSGListView::resizeFirstDelegate() +void tst_QQuickListView::resizeFirstDelegate() { // QTBUG-20712: Content Y jumps constantly if first delegate height == 0 // and other delegates have height > 0 - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); // bug only occurs when all items in the model are visible @@ -3449,20 +3449,20 @@ void tst_QSGListView::resizeFirstDelegate() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGItem *item = 0; + QQuickItem *item = 0; for (int i = 0; i < model.count(); ++i) { - item = findItem<QSGItem>(contentItem, "wrapper", i); + item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY(item != 0); QCOMPARE(item->y(), i*20.0); } - item = findItem<QSGItem>(contentItem, "wrapper", 0); + item = findItem<QQuickItem>(contentItem, "wrapper", 0); item->setHeight(0); // check the content y has not jumped up and down @@ -3472,7 +3472,7 @@ void tst_QSGListView::resizeFirstDelegate() QCOMPARE(spy.count(), 0); for (int i = 1; i < model.count(); ++i) { - item = findItem<QSGItem>(contentItem, "wrapper", i); + item = findItem<QQuickItem>(contentItem, "wrapper", i); QVERIFY(item != 0); QTRY_COMPARE(item->y(), (i-1)*20.0); } @@ -3481,15 +3481,15 @@ void tst_QSGListView::resizeFirstDelegate() delete canvas; } -void tst_QSGListView::QTBUG_16037() +void tst_QQuickListView::QTBUG_16037() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("qtbug16037.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "listview"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "listview"); QTRY_VERIFY(listview != 0); QVERIFY(listview->contentHeight() <= 0.0); @@ -3501,9 +3501,9 @@ void tst_QSGListView::QTBUG_16037() delete canvas; } -void tst_QSGListView::indexAt() +void tst_QQuickListView::indexAt() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; for (int i = 0; i < 30; i++) @@ -3518,10 +3518,10 @@ void tst_QSGListView::indexAt() canvas->setSource(QUrl::fromLocalFile(TESTDATA("listviewtest.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QCOMPARE(listview->indexAt(0,0), 0); @@ -3534,9 +3534,9 @@ void tst_QSGListView::indexAt() delete testObject; } -void tst_QSGListView::incrementalModel() +void tst_QQuickListView::incrementalModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); IncrementalModel model; QDeclarativeContext *ctxt = canvas->rootContext(); @@ -3545,22 +3545,22 @@ void tst_QSGListView::incrementalModel() canvas->setSource(QUrl::fromLocalFile(TESTDATA("displaylist.qml"))); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QTRY_COMPARE(listview->count(), 20); - listview->positionViewAtIndex(10, QSGListView::Beginning); + listview->positionViewAtIndex(10, QQuickListView::Beginning); QTRY_COMPARE(listview->count(), 25); delete canvas; } -void tst_QSGListView::onAdd() +void tst_QQuickListView::onAdd() { QFETCH(int, initialItemCount); QFETCH(int, itemsToAdd); @@ -3572,7 +3572,7 @@ void tst_QSGListView::onAdd() for (int i=0; i<initialItemCount; i++) model.addItem("dummy value", "dummy value"); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setGeometry(0,0,200, delegateHeight * (initialItemCount + itemsToAdd)); QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); @@ -3598,7 +3598,7 @@ void tst_QSGListView::onAdd() delete canvas; } -void tst_QSGListView::onAdd_data() +void tst_QQuickListView::onAdd_data() { QTest::addColumn<int>("initialItemCount"); QTest::addColumn<int>("itemsToAdd"); @@ -3616,7 +3616,7 @@ void tst_QSGListView::onAdd_data() QTest::newRow("5, add 10") << 5 << 10; } -void tst_QSGListView::onRemove() +void tst_QQuickListView::onRemove() { QFETCH(int, initialItemCount); QFETCH(int, indexToRemove); @@ -3627,7 +3627,7 @@ void tst_QSGListView::onRemove() for (int i=0; i<initialItemCount; i++) model.addItem(QString("value %1").arg(i), "dummy value"); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testModel", &model); ctxt->setContextProperty("delegateHeight", delegateHeight); @@ -3642,7 +3642,7 @@ void tst_QSGListView::onRemove() delete canvas; } -void tst_QSGListView::onRemove_data() +void tst_QQuickListView::onRemove_data() { QTest::addColumn<int>("initialItemCount"); QTest::addColumn<int>("indexToRemove"); @@ -3665,21 +3665,21 @@ void tst_QSGListView::onRemove_data() QTest::newRow("ten items, remove 4-10") << 10 << 4 << 6; } -void tst_QSGListView::rightToLeft() +void tst_QQuickListView::rightToLeft() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setGeometry(0,0,640,320); canvas->setSource(QUrl::fromLocalFile(TESTDATA("rightToLeft.qml"))); qApp->processEvents(); QVERIFY(canvas->rootObject() != 0); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "view"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "view"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); - QSGVisualItemModel *model = canvas->rootObject()->findChild<QSGVisualItemModel*>("itemModel"); + QQuickVisualItemModel *model = canvas->rootObject()->findChild<QQuickVisualItemModel*>("itemModel"); QTRY_VERIFY(model != 0); QTRY_VERIFY(model->count() == 3); @@ -3688,44 +3688,44 @@ void tst_QSGListView::rightToLeft() // initial position at first item, right edge aligned QCOMPARE(listview->contentX(), -640.); - QSGItem *item = findItem<QSGItem>(contentItem, "item1"); + QQuickItem *item = findItem<QQuickItem>(contentItem, "item1"); QTRY_VERIFY(item); QTRY_COMPARE(item->x(), -100.0); QCOMPARE(item->height(), listview->height()); - QSGText *text = findItem<QSGText>(contentItem, "text1"); + QQuickText *text = findItem<QQuickText>(contentItem, "text1"); QTRY_VERIFY(text); QTRY_COMPARE(text->text(), QLatin1String("index: 0")); listview->setCurrentIndex(2); - item = findItem<QSGItem>(contentItem, "item3"); + item = findItem<QQuickItem>(contentItem, "item3"); QTRY_VERIFY(item); QTRY_COMPARE(item->x(), -540.0); - text = findItem<QSGText>(contentItem, "text3"); + text = findItem<QQuickText>(contentItem, "text3"); QTRY_VERIFY(text); QTRY_COMPARE(text->text(), QLatin1String("index: 2")); QCOMPARE(listview->contentX(), -640.); // Ensure resizing maintains position relative to right edge - qobject_cast<QSGItem*>(canvas->rootObject())->setWidth(600); + qobject_cast<QQuickItem*>(canvas->rootObject())->setWidth(600); QTRY_COMPARE(listview->contentX(), -600.); delete canvas; } -void tst_QSGListView::test_mirroring() +void tst_QQuickListView::test_mirroring() { - QSGView *canvasA = createView(); + QQuickView *canvasA = createView(); canvasA->setSource(QUrl::fromLocalFile(TESTDATA("rightToLeft.qml"))); - QSGListView *listviewA = findItem<QSGListView>(canvasA->rootObject(), "view"); + QQuickListView *listviewA = findItem<QQuickListView>(canvasA->rootObject(), "view"); QTRY_VERIFY(listviewA != 0); - QSGView *canvasB = createView(); + QQuickView *canvasB = createView(); canvasB->setSource(QUrl::fromLocalFile(TESTDATA("rightToLeft.qml"))); - QSGListView *listviewB = findItem<QSGListView>(canvasB->rootObject(), "view"); + QQuickListView *listviewB = findItem<QQuickListView>(canvasB->rootObject(), "view"); QTRY_VERIFY(listviewA != 0); qApp->processEvents(); @@ -3738,48 +3738,48 @@ void tst_QSGListView::test_mirroring() // LTR != RTL foreach (const QString objectName, objectNames) - QVERIFY(findItem<QSGItem>(listviewA, objectName)->x() != findItem<QSGItem>(listviewB, objectName)->x()); + QVERIFY(findItem<QQuickItem>(listviewA, objectName)->x() != findItem<QQuickItem>(listviewB, objectName)->x()); listviewA->setProperty("layoutDirection", Qt::LeftToRight); listviewB->setProperty("layoutDirection", Qt::LeftToRight); // LTR == LTR foreach (const QString objectName, objectNames) - QCOMPARE(findItem<QSGItem>(listviewA, objectName)->x(), findItem<QSGItem>(listviewB, objectName)->x()); + QCOMPARE(findItem<QQuickItem>(listviewA, objectName)->x(), findItem<QQuickItem>(listviewB, objectName)->x()); QVERIFY(listviewB->layoutDirection() == listviewB->effectiveLayoutDirection()); - QSGItemPrivate::get(listviewB)->setLayoutMirror(true); + QQuickItemPrivate::get(listviewB)->setLayoutMirror(true); QVERIFY(listviewB->layoutDirection() != listviewB->effectiveLayoutDirection()); // LTR != LTR+mirror foreach (const QString objectName, objectNames) - QVERIFY(findItem<QSGItem>(listviewA, objectName)->x() != findItem<QSGItem>(listviewB, objectName)->x()); + QVERIFY(findItem<QQuickItem>(listviewA, objectName)->x() != findItem<QQuickItem>(listviewB, objectName)->x()); listviewA->setProperty("layoutDirection", Qt::RightToLeft); // RTL == LTR+mirror foreach (const QString objectName, objectNames) - QCOMPARE(findItem<QSGItem>(listviewA, objectName)->x(), findItem<QSGItem>(listviewB, objectName)->x()); + QCOMPARE(findItem<QQuickItem>(listviewA, objectName)->x(), findItem<QQuickItem>(listviewB, objectName)->x()); listviewB->setProperty("layoutDirection", Qt::RightToLeft); // RTL != RTL+mirror foreach (const QString objectName, objectNames) - QVERIFY(findItem<QSGItem>(listviewA, objectName)->x() != findItem<QSGItem>(listviewB, objectName)->x()); + QVERIFY(findItem<QQuickItem>(listviewA, objectName)->x() != findItem<QQuickItem>(listviewB, objectName)->x()); listviewA->setProperty("layoutDirection", Qt::LeftToRight); // LTR == RTL+mirror foreach (const QString objectName, objectNames) - QCOMPARE(findItem<QSGItem>(listviewA, objectName)->x(), findItem<QSGItem>(listviewB, objectName)->x()); + QCOMPARE(findItem<QQuickItem>(listviewA, objectName)->x(), findItem<QQuickItem>(listviewB, objectName)->x()); delete canvasA; delete canvasB; } -void tst_QSGListView::margins() +void tst_QQuickListView::margins() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel2 model; for (int i = 0; i < 50; i++) @@ -3792,10 +3792,10 @@ void tst_QSGListView::margins() canvas->show(); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); QCOMPARE(listview->contentY(), -30.); @@ -3839,9 +3839,9 @@ void tst_QSGListView::margins() delete canvas; } -void tst_QSGListView::snapToItem_data() +void tst_QQuickListView::snapToItem_data() { - QTest::addColumn<QSGListView::Orientation>("orientation"); + QTest::addColumn<QQuickListView::Orientation>("orientation"); QTest::addColumn<Qt::LayoutDirection>("layoutDirection"); QTest::addColumn<int>("highlightRangeMode"); QTest::addColumn<QPoint>("flickStart"); @@ -3850,28 +3850,28 @@ void tst_QSGListView::snapToItem_data() QTest::addColumn<qreal>("endExtent"); QTest::addColumn<qreal>("startExtent"); - QTest::newRow("vertical, left to right") << QSGListView::Vertical << Qt::LeftToRight << int(QSGItemView::NoHighlightRange) + QTest::newRow("vertical, left to right") << QQuickListView::Vertical << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0; - QTest::newRow("horizontal, left to right") << QSGListView::Horizontal << Qt::LeftToRight << int(QSGItemView::NoHighlightRange) + QTest::newRow("horizontal, left to right") << QQuickListView::Horizontal << Qt::LeftToRight << int(QQuickItemView::NoHighlightRange) << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1200.0 << 0.0; - QTest::newRow("horizontal, right to left") << QSGListView::Horizontal << Qt::RightToLeft << int(QSGItemView::NoHighlightRange) + QTest::newRow("horizontal, right to left") << QQuickListView::Horizontal << Qt::RightToLeft << int(QQuickItemView::NoHighlightRange) << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 << -240.0; - QTest::newRow("vertical, left to right, enforce range") << QSGListView::Vertical << Qt::LeftToRight << int(QSGItemView::StrictlyEnforceRange) + QTest::newRow("vertical, left to right, enforce range") << QQuickListView::Vertical << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) << QPoint(20, 200) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0; - QTest::newRow("horizontal, left to right, enforce range") << QSGListView::Horizontal << Qt::LeftToRight << int(QSGItemView::StrictlyEnforceRange) + QTest::newRow("horizontal, left to right, enforce range") << QQuickListView::Horizontal << Qt::LeftToRight << int(QQuickItemView::StrictlyEnforceRange) << QPoint(200, 20) << QPoint(20, 20) << 60.0 << 1340.0 << -20.0; - QTest::newRow("horizontal, right to left, enforce range") << QSGListView::Horizontal << Qt::RightToLeft << int(QSGItemView::StrictlyEnforceRange) + QTest::newRow("horizontal, right to left, enforce range") << QQuickListView::Horizontal << Qt::RightToLeft << int(QQuickItemView::StrictlyEnforceRange) << QPoint(20, 20) << QPoint(200, 20) << -60.0 << -1200.0 - 240.0 - 140.0 << -220.0; } -void tst_QSGListView::snapToItem() +void tst_QQuickListView::snapToItem() { - QFETCH(QSGListView::Orientation, orientation); + QFETCH(QQuickListView::Orientation, orientation); QFETCH(Qt::LayoutDirection, layoutDirection); QFETCH(int, highlightRangeMode); QFETCH(QPoint, flickStart); @@ -3880,26 +3880,26 @@ void tst_QSGListView::snapToItem() QFETCH(qreal, endExtent); QFETCH(qreal, startExtent); - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("snapToItem.qml"))); canvas->show(); qApp->processEvents(); - QSGListView *listview = findItem<QSGListView>(canvas->rootObject(), "list"); + QQuickListView *listview = findItem<QQuickListView>(canvas->rootObject(), "list"); QTRY_VERIFY(listview != 0); listview->setOrientation(orientation); listview->setLayoutDirection(layoutDirection); - listview->setHighlightRangeMode(QSGItemView::HighlightRangeMode(highlightRangeMode)); + listview->setHighlightRangeMode(QQuickItemView::HighlightRangeMode(highlightRangeMode)); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QTRY_VERIFY(contentItem != 0); // confirm that a flick hits an item boundary flick(canvas, flickStart, flickEnd, 180); QTRY_VERIFY(listview->isMoving() == false); // wait until it stops - if (orientation == QSGListView::Vertical) + if (orientation == QQuickListView::Vertical) QCOMPARE(qreal(fmod(listview->contentY(),80.0)), snapAlignment); else QCOMPARE(qreal(fmod(listview->contentX(),80.0)), snapAlignment); @@ -3908,11 +3908,11 @@ void tst_QSGListView::snapToItem() do { flick(canvas, flickStart, flickEnd, 180); QTRY_VERIFY(listview->isMoving() == false); // wait until it stops - } while (orientation == QSGListView::Vertical + } while (orientation == QQuickListView::Vertical ? !listview->isAtYEnd() : layoutDirection == Qt::LeftToRight ? !listview->isAtXEnd() : !listview->isAtXBeginning()); - if (orientation == QSGListView::Vertical) + if (orientation == QQuickListView::Vertical) QCOMPARE(listview->contentY(), endExtent); else QCOMPARE(listview->contentX(), endExtent); @@ -3921,11 +3921,11 @@ void tst_QSGListView::snapToItem() do { flick(canvas, flickEnd, flickStart, 180); QTRY_VERIFY(listview->isMoving() == false); // wait until it stops - } while (orientation == QSGListView::Vertical + } while (orientation == QQuickListView::Vertical ? !listview->isAtYBeginning() : layoutDirection == Qt::LeftToRight ? !listview->isAtXBeginning() : !listview->isAtXEnd()); - if (orientation == QSGListView::Vertical) + if (orientation == QQuickListView::Vertical) QCOMPARE(listview->contentY(), startExtent); else QCOMPARE(listview->contentX(), startExtent); @@ -3933,141 +3933,141 @@ void tst_QSGListView::snapToItem() delete canvas; } -void tst_QSGListView::qListModelInterface_items() +void tst_QQuickListView::qListModelInterface_items() { items<TestModel>(); } -void tst_QSGListView::qAbstractItemModel_items() +void tst_QQuickListView::qAbstractItemModel_items() { items<TestModel2>(); } -void tst_QSGListView::qListModelInterface_changed() +void tst_QQuickListView::qListModelInterface_changed() { changed<TestModel>(); } -void tst_QSGListView::qAbstractItemModel_changed() +void tst_QQuickListView::qAbstractItemModel_changed() { changed<TestModel2>(); } -void tst_QSGListView::qListModelInterface_inserted() +void tst_QQuickListView::qListModelInterface_inserted() { inserted<TestModel>(); } -void tst_QSGListView::qListModelInterface_inserted_more() +void tst_QQuickListView::qListModelInterface_inserted_more() { inserted_more<TestModel>(); } -void tst_QSGListView::qListModelInterface_inserted_more_data() +void tst_QQuickListView::qListModelInterface_inserted_more_data() { inserted_more_data(); } -void tst_QSGListView::qAbstractItemModel_inserted() +void tst_QQuickListView::qAbstractItemModel_inserted() { inserted<TestModel2>(); } -void tst_QSGListView::qAbstractItemModel_inserted_more() +void tst_QQuickListView::qAbstractItemModel_inserted_more() { inserted_more<TestModel2>(); } -void tst_QSGListView::qAbstractItemModel_inserted_more_data() +void tst_QQuickListView::qAbstractItemModel_inserted_more_data() { inserted_more_data(); } -void tst_QSGListView::qListModelInterface_removed() +void tst_QQuickListView::qListModelInterface_removed() { removed<TestModel>(false); removed<TestModel>(true); } -void tst_QSGListView::qAbstractItemModel_removed() +void tst_QQuickListView::qAbstractItemModel_removed() { removed<TestModel2>(false); removed<TestModel2>(true); } -void tst_QSGListView::qListModelInterface_moved() +void tst_QQuickListView::qListModelInterface_moved() { moved<TestModel>(); } -void tst_QSGListView::qListModelInterface_moved_data() +void tst_QQuickListView::qListModelInterface_moved_data() { moved_data(); } -void tst_QSGListView::qAbstractItemModel_moved() +void tst_QQuickListView::qAbstractItemModel_moved() { moved<TestModel2>(); } -void tst_QSGListView::qAbstractItemModel_moved_data() +void tst_QQuickListView::qAbstractItemModel_moved_data() { moved_data(); } -void tst_QSGListView::qListModelInterface_clear() +void tst_QQuickListView::qListModelInterface_clear() { clear<TestModel>(); } -void tst_QSGListView::qAbstractItemModel_clear() +void tst_QQuickListView::qAbstractItemModel_clear() { clear<TestModel2>(); } -void tst_QSGListView::creationContext() +void tst_QQuickListView::creationContext() { - QSGView canvas; + QQuickView canvas; canvas.setGeometry(0,0,240,320); canvas.setSource(QUrl::fromLocalFile(TESTDATA("creationContext.qml"))); qApp->processEvents(); - QSGItem *rootItem = qobject_cast<QSGItem *>(canvas.rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem *>(canvas.rootObject()); QVERIFY(rootItem); QVERIFY(rootItem->property("count").toInt() > 0); - QSGItem *item; - QVERIFY(item = rootItem->findChild<QSGItem *>("listItem")); + QQuickItem *item; + QVERIFY(item = rootItem->findChild<QQuickItem *>("listItem")); QCOMPARE(item->property("text").toString(), QString("Hello!")); - QVERIFY(item = rootItem->findChild<QSGItem *>("header")); + QVERIFY(item = rootItem->findChild<QQuickItem *>("header")); QCOMPARE(item->property("text").toString(), QString("Hello!")); - QVERIFY(item = rootItem->findChild<QSGItem *>("footer")); + QVERIFY(item = rootItem->findChild<QQuickItem *>("footer")); QCOMPARE(item->property("text").toString(), QString("Hello!")); - QVERIFY(item = rootItem->findChild<QSGItem *>("section")); + QVERIFY(item = rootItem->findChild<QQuickItem *>("section")); QCOMPARE(item->property("text").toString(), QString("Hello!")); } -void tst_QSGListView::QTBUG_21742() +void tst_QQuickListView::QTBUG_21742() { - QSGView canvas; + QQuickView canvas; canvas.setGeometry(0,0,200,200); canvas.setSource(QUrl::fromLocalFile(TESTDATA("qtbug-21742.qml"))); qApp->processEvents(); - QSGItem *rootItem = qobject_cast<QSGItem *>(canvas.rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem *>(canvas.rootObject()); QVERIFY(rootItem); QCOMPARE(rootItem->property("count").toInt(), 1); } -QSGView *tst_QSGListView::createView() +QQuickView *tst_QQuickListView::createView() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); return canvas; } -void tst_QSGListView::flick(QSGView *canvas, const QPoint &from, const QPoint &to, int duration) +void tst_QQuickListView::flick(QQuickView *canvas, const QPoint &from, const QPoint &to, int duration) { const int pointCount = 5; QPoint diff = to - from; @@ -4086,10 +4086,10 @@ void tst_QSGListView::flick(QSGView *canvas, const QPoint &from, const QPoint &t } -QSGItem *tst_QSGListView::findVisibleChild(QSGItem *parent, const QString &objectName) +QQuickItem *tst_QQuickListView::findVisibleChild(QQuickItem *parent, const QString &objectName) { - QSGItem *item = 0; - QList<QSGItem*> items = parent->findChildren<QSGItem*>(objectName); + QQuickItem *item = 0; + QList<QQuickItem*> items = parent->findChildren<QQuickItem*>(objectName); for (int i = 0; i < items.count(); ++i) { if (items.at(i)->isVisible()) { item = items.at(i); @@ -4103,12 +4103,12 @@ QSGItem *tst_QSGListView::findVisibleChild(QSGItem *parent, const QString &objec item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_QSGListView::findItem(QSGItem *parent, const QString &objectName, int index) +T *tst_QQuickListView::findItem(QQuickItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -4130,13 +4130,13 @@ T *tst_QSGListView::findItem(QSGItem *parent, const QString &objectName, int ind } template<typename T> -QList<T*> tst_QSGListView::findItems(QSGItem *parent, const QString &objectName) +QList<T*> tst_QQuickListView::findItems(QQuickItem *parent, const QString &objectName) { QList<T*> items; const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item || !item->isVisible()) continue; //qDebug() << "try" << item; @@ -4148,11 +4148,11 @@ QList<T*> tst_QSGListView::findItems(QSGItem *parent, const QString &objectName) return items; } -void tst_QSGListView::dumpTree(QSGItem *parent, int depth) +void tst_QQuickListView::dumpTree(QQuickItem *parent, int depth) { static QString padding(" "); for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; qDebug() << padding.left(depth*2) << item; @@ -4160,7 +4160,7 @@ void tst_QSGListView::dumpTree(QSGItem *parent, int depth) } } -QTEST_MAIN(tst_QSGListView) +QTEST_MAIN(tst_QQuickListView) -#include "tst_qsglistview.moc" +#include "tst_qquicklistview.moc" diff --git a/tests/auto/declarative/qsgloader/data/ActiveComponent.qml b/tests/auto/declarative/qquickloader/data/ActiveComponent.qml index 24c6f7ad91..24c6f7ad91 100644 --- a/tests/auto/declarative/qsgloader/data/ActiveComponent.qml +++ b/tests/auto/declarative/qquickloader/data/ActiveComponent.qml diff --git a/tests/auto/declarative/qsgloader/data/AnchoredLoader.qml b/tests/auto/declarative/qquickloader/data/AnchoredLoader.qml index 1a2a620d7f..1a2a620d7f 100644 --- a/tests/auto/declarative/qsgloader/data/AnchoredLoader.qml +++ b/tests/auto/declarative/qquickloader/data/AnchoredLoader.qml diff --git a/tests/auto/declarative/qsgloader/data/BigComponent.qml b/tests/auto/declarative/qquickloader/data/BigComponent.qml index df92532c43..df92532c43 100644 --- a/tests/auto/declarative/qsgloader/data/BigComponent.qml +++ b/tests/auto/declarative/qquickloader/data/BigComponent.qml diff --git a/tests/auto/declarative/qsgloader/data/BlueRect.qml b/tests/auto/declarative/qquickloader/data/BlueRect.qml index e96ac00f21..e96ac00f21 100644 --- a/tests/auto/declarative/qsgloader/data/BlueRect.qml +++ b/tests/auto/declarative/qquickloader/data/BlueRect.qml diff --git a/tests/auto/declarative/qsgloader/data/CreationContextLoader.qml b/tests/auto/declarative/qquickloader/data/CreationContextLoader.qml index 4dd73e797c..4dd73e797c 100644 --- a/tests/auto/declarative/qsgloader/data/CreationContextLoader.qml +++ b/tests/auto/declarative/qquickloader/data/CreationContextLoader.qml diff --git a/tests/auto/declarative/qsgloader/data/GraphicsWidget250x250.qml b/tests/auto/declarative/qquickloader/data/GraphicsWidget250x250.qml index dae8e3fbbb..dae8e3fbbb 100644 --- a/tests/auto/declarative/qsgloader/data/GraphicsWidget250x250.qml +++ b/tests/auto/declarative/qquickloader/data/GraphicsWidget250x250.qml diff --git a/tests/auto/declarative/qsgloader/data/GreenRect.qml b/tests/auto/declarative/qquickloader/data/GreenRect.qml index 99cefaf176..99cefaf176 100644 --- a/tests/auto/declarative/qsgloader/data/GreenRect.qml +++ b/tests/auto/declarative/qquickloader/data/GreenRect.qml diff --git a/tests/auto/declarative/qsgloader/data/InitialPropertyValuesComponent.qml b/tests/auto/declarative/qquickloader/data/InitialPropertyValuesComponent.qml index 24c6f7ad91..24c6f7ad91 100644 --- a/tests/auto/declarative/qsgloader/data/InitialPropertyValuesComponent.qml +++ b/tests/auto/declarative/qquickloader/data/InitialPropertyValuesComponent.qml diff --git a/tests/auto/declarative/qsgloader/data/InvalidSourceComponent.qml b/tests/auto/declarative/qquickloader/data/InvalidSourceComponent.qml index 7efa4a5f61..7efa4a5f61 100644 --- a/tests/auto/declarative/qsgloader/data/InvalidSourceComponent.qml +++ b/tests/auto/declarative/qquickloader/data/InvalidSourceComponent.qml diff --git a/tests/auto/declarative/qsgloader/data/NoResize.qml b/tests/auto/declarative/qquickloader/data/NoResize.qml index 9b3ea6410b..9b3ea6410b 100644 --- a/tests/auto/declarative/qsgloader/data/NoResize.qml +++ b/tests/auto/declarative/qquickloader/data/NoResize.qml diff --git a/tests/auto/declarative/qsgloader/data/NoResizeGraphicsWidget.qml b/tests/auto/declarative/qquickloader/data/NoResizeGraphicsWidget.qml index c0f51d8c35..c0f51d8c35 100644 --- a/tests/auto/declarative/qsgloader/data/NoResizeGraphicsWidget.qml +++ b/tests/auto/declarative/qquickloader/data/NoResizeGraphicsWidget.qml diff --git a/tests/auto/declarative/qsgloader/data/QTBUG_16928.qml b/tests/auto/declarative/qquickloader/data/QTBUG_16928.qml index 903d7f0812..903d7f0812 100644 --- a/tests/auto/declarative/qsgloader/data/QTBUG_16928.qml +++ b/tests/auto/declarative/qquickloader/data/QTBUG_16928.qml diff --git a/tests/auto/declarative/qsgloader/data/QTBUG_17114.qml b/tests/auto/declarative/qquickloader/data/QTBUG_17114.qml index 7402037553..7402037553 100644 --- a/tests/auto/declarative/qsgloader/data/QTBUG_17114.qml +++ b/tests/auto/declarative/qquickloader/data/QTBUG_17114.qml diff --git a/tests/auto/declarative/qsgloader/data/Rect120x60.qml b/tests/auto/declarative/qquickloader/data/Rect120x60.qml index fc9e447e69..fc9e447e69 100644 --- a/tests/auto/declarative/qsgloader/data/Rect120x60.qml +++ b/tests/auto/declarative/qquickloader/data/Rect120x60.qml diff --git a/tests/auto/declarative/qsgloader/data/SetSourceComponent.qml b/tests/auto/declarative/qquickloader/data/SetSourceComponent.qml index 83cc358f7d..83cc358f7d 100644 --- a/tests/auto/declarative/qsgloader/data/SetSourceComponent.qml +++ b/tests/auto/declarative/qquickloader/data/SetSourceComponent.qml diff --git a/tests/auto/declarative/qsgloader/data/SizeGraphicsWidgetToLoader.qml b/tests/auto/declarative/qquickloader/data/SizeGraphicsWidgetToLoader.qml index 2a63b4d34f..2a63b4d34f 100644 --- a/tests/auto/declarative/qsgloader/data/SizeGraphicsWidgetToLoader.qml +++ b/tests/auto/declarative/qquickloader/data/SizeGraphicsWidgetToLoader.qml diff --git a/tests/auto/declarative/qsgloader/data/SizeLoaderToGraphicsWidget.qml b/tests/auto/declarative/qquickloader/data/SizeLoaderToGraphicsWidget.qml index a9875d8e21..a9875d8e21 100644 --- a/tests/auto/declarative/qsgloader/data/SizeLoaderToGraphicsWidget.qml +++ b/tests/auto/declarative/qquickloader/data/SizeLoaderToGraphicsWidget.qml diff --git a/tests/auto/declarative/qsgloader/data/SizeToItem.qml b/tests/auto/declarative/qquickloader/data/SizeToItem.qml index 866365754f..866365754f 100644 --- a/tests/auto/declarative/qsgloader/data/SizeToItem.qml +++ b/tests/auto/declarative/qquickloader/data/SizeToItem.qml diff --git a/tests/auto/declarative/qsgloader/data/SizeToLoader.qml b/tests/auto/declarative/qquickloader/data/SizeToLoader.qml index dad18c6939..dad18c6939 100644 --- a/tests/auto/declarative/qsgloader/data/SizeToLoader.qml +++ b/tests/auto/declarative/qquickloader/data/SizeToLoader.qml diff --git a/tests/auto/declarative/qsgloader/data/VmeError.qml b/tests/auto/declarative/qquickloader/data/VmeError.qml index 0443aa9054..0443aa9054 100644 --- a/tests/auto/declarative/qsgloader/data/VmeError.qml +++ b/tests/auto/declarative/qquickloader/data/VmeError.qml diff --git a/tests/auto/declarative/qsgloader/data/active.1.qml b/tests/auto/declarative/qquickloader/data/active.1.qml index 2dbd1a0887..2dbd1a0887 100644 --- a/tests/auto/declarative/qsgloader/data/active.1.qml +++ b/tests/auto/declarative/qquickloader/data/active.1.qml diff --git a/tests/auto/declarative/qsgloader/data/active.2.qml b/tests/auto/declarative/qquickloader/data/active.2.qml index e561744c63..e561744c63 100644 --- a/tests/auto/declarative/qsgloader/data/active.2.qml +++ b/tests/auto/declarative/qquickloader/data/active.2.qml diff --git a/tests/auto/declarative/qsgloader/data/active.3.qml b/tests/auto/declarative/qquickloader/data/active.3.qml index 0fbba959bb..0fbba959bb 100644 --- a/tests/auto/declarative/qsgloader/data/active.3.qml +++ b/tests/auto/declarative/qquickloader/data/active.3.qml diff --git a/tests/auto/declarative/qsgloader/data/active.4.qml b/tests/auto/declarative/qquickloader/data/active.4.qml index 63fd46e2da..63fd46e2da 100644 --- a/tests/auto/declarative/qsgloader/data/active.4.qml +++ b/tests/auto/declarative/qquickloader/data/active.4.qml diff --git a/tests/auto/declarative/qsgloader/data/active.5.qml b/tests/auto/declarative/qquickloader/data/active.5.qml index 903f458a41..903f458a41 100644 --- a/tests/auto/declarative/qsgloader/data/active.5.qml +++ b/tests/auto/declarative/qquickloader/data/active.5.qml diff --git a/tests/auto/declarative/qsgloader/data/active.6.qml b/tests/auto/declarative/qquickloader/data/active.6.qml index f769a4e184..f769a4e184 100644 --- a/tests/auto/declarative/qsgloader/data/active.6.qml +++ b/tests/auto/declarative/qquickloader/data/active.6.qml diff --git a/tests/auto/declarative/qsgloader/data/active.7.qml b/tests/auto/declarative/qquickloader/data/active.7.qml index a29e932f5e..a29e932f5e 100644 --- a/tests/auto/declarative/qsgloader/data/active.7.qml +++ b/tests/auto/declarative/qquickloader/data/active.7.qml diff --git a/tests/auto/declarative/qsgloader/data/active.8.qml b/tests/auto/declarative/qquickloader/data/active.8.qml index 3a66d3e99a..3a66d3e99a 100644 --- a/tests/auto/declarative/qsgloader/data/active.8.qml +++ b/tests/auto/declarative/qquickloader/data/active.8.qml diff --git a/tests/auto/declarative/qsgloader/data/asynchronous.qml b/tests/auto/declarative/qquickloader/data/asynchronous.qml index 29570525ad..29570525ad 100644 --- a/tests/auto/declarative/qsgloader/data/asynchronous.qml +++ b/tests/auto/declarative/qquickloader/data/asynchronous.qml diff --git a/tests/auto/declarative/qsgloader/data/crash.qml b/tests/auto/declarative/qquickloader/data/crash.qml index e6ddc33a10..e6ddc33a10 100644 --- a/tests/auto/declarative/qsgloader/data/crash.qml +++ b/tests/auto/declarative/qquickloader/data/crash.qml diff --git a/tests/auto/declarative/qsgloader/data/creationContext.qml b/tests/auto/declarative/qquickloader/data/creationContext.qml index 17a596cc74..17a596cc74 100644 --- a/tests/auto/declarative/qsgloader/data/creationContext.qml +++ b/tests/auto/declarative/qquickloader/data/creationContext.qml diff --git a/tests/auto/declarative/qsgloader/data/differentorigin.qml b/tests/auto/declarative/qquickloader/data/differentorigin.qml index 56a3034fe0..56a3034fe0 100644 --- a/tests/auto/declarative/qsgloader/data/differentorigin.qml +++ b/tests/auto/declarative/qquickloader/data/differentorigin.qml diff --git a/tests/auto/declarative/qsgloader/data/implicitSize.qml b/tests/auto/declarative/qquickloader/data/implicitSize.qml index 5c8c8348ed..5c8c8348ed 100644 --- a/tests/auto/declarative/qsgloader/data/implicitSize.qml +++ b/tests/auto/declarative/qquickloader/data/implicitSize.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.1.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.1.qml index ae371797ce..ae371797ce 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.1.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.1.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.2.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.2.qml index 76c7bc2fd6..76c7bc2fd6 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.2.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.2.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.3.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.3.qml index 3b08e6ee42..3b08e6ee42 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.3.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.3.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.4.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.4.qml index e8310044e8..e8310044e8 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.4.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.4.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.5.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.5.qml index 03ee599aba..03ee599aba 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.5.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.5.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.6.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.6.qml index 66452b512b..66452b512b 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.6.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.6.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.7.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.7.qml index 02349f7ddf..02349f7ddf 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.7.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.7.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.8.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.8.qml index 79e9264d4a..79e9264d4a 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.8.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.8.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.binding.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.binding.qml index e0df50a74a..e0df50a74a 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.binding.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.binding.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.error.1.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.error.1.qml index f324dbddac..f324dbddac 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.error.1.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.error.1.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.error.2.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.error.2.qml index 89aba313c7..89aba313c7 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.error.2.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.error.2.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.error.3.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.error.3.qml index c862007402..c862007402 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.error.3.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.error.3.qml diff --git a/tests/auto/declarative/qsgloader/data/initialPropertyValues.error.4.qml b/tests/auto/declarative/qquickloader/data/initialPropertyValues.error.4.qml index 9a80b2156d..9a80b2156d 100644 --- a/tests/auto/declarative/qsgloader/data/initialPropertyValues.error.4.qml +++ b/tests/auto/declarative/qquickloader/data/initialPropertyValues.error.4.qml diff --git a/tests/auto/declarative/qsgloader/data/nonItem.qml b/tests/auto/declarative/qquickloader/data/nonItem.qml index 8cfa0d8efb..8cfa0d8efb 100644 --- a/tests/auto/declarative/qsgloader/data/nonItem.qml +++ b/tests/auto/declarative/qquickloader/data/nonItem.qml diff --git a/tests/auto/declarative/qsgloader/data/qmldir b/tests/auto/declarative/qquickloader/data/qmldir index bf42b507c0..bf42b507c0 100644 --- a/tests/auto/declarative/qsgloader/data/qmldir +++ b/tests/auto/declarative/qquickloader/data/qmldir diff --git a/tests/auto/declarative/qsgloader/data/sameorigin-load.qml b/tests/auto/declarative/qquickloader/data/sameorigin-load.qml index 3332500be6..3332500be6 100644 --- a/tests/auto/declarative/qsgloader/data/sameorigin-load.qml +++ b/tests/auto/declarative/qquickloader/data/sameorigin-load.qml diff --git a/tests/auto/declarative/qsgloader/data/sameorigin.qml b/tests/auto/declarative/qquickloader/data/sameorigin.qml index 84846b6aba..84846b6aba 100644 --- a/tests/auto/declarative/qsgloader/data/sameorigin.qml +++ b/tests/auto/declarative/qquickloader/data/sameorigin.qml diff --git a/tests/auto/declarative/qsgloader/data/vmeErrors.qml b/tests/auto/declarative/qquickloader/data/vmeErrors.qml index 8e6c89dc8e..8e6c89dc8e 100644 --- a/tests/auto/declarative/qsgloader/data/vmeErrors.qml +++ b/tests/auto/declarative/qquickloader/data/vmeErrors.qml diff --git a/tests/auto/declarative/qsgloader/qsgloader.pro b/tests/auto/declarative/qquickloader/qquickloader.pro index 01e942e926..9ccecce478 100644 --- a/tests/auto/declarative/qsgloader/qsgloader.pro +++ b/tests/auto/declarative/qquickloader/qquickloader.pro @@ -1,10 +1,10 @@ CONFIG += testcase -TARGET = tst_qsgloader +TARGET = tst_qquickloader macx:CONFIG -= app_bundle INCLUDEPATH += ../shared/ HEADERS += ../shared/testhttpserver.h -SOURCES += tst_qsgloader.cpp \ +SOURCES += tst_qquickloader.cpp \ ../shared/testhttpserver.cpp testDataFiles.files = data diff --git a/tests/auto/declarative/qsgloader/tst_qsgloader.cpp b/tests/auto/declarative/qquickloader/tst_qquickloader.cpp index 3968a92ac0..0096bc39b6 100644 --- a/tests/auto/declarative/qsgloader/tst_qsgloader.cpp +++ b/tests/auto/declarative/qquickloader/tst_qquickloader.cpp @@ -45,7 +45,7 @@ #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativeincubator.h> -#include <private/qsgloader_p.h> +#include <private/qquickloader_p.h> #include "testhttpserver.h" #include "../shared/util.h" @@ -70,12 +70,12 @@ protected: } }; -class tst_QSGLoader : public QObject +class tst_QQuickLoader : public QObject { Q_OBJECT public: - tst_QSGLoader(); + tst_QQuickLoader(); private slots: void sourceOrComponent(); @@ -113,11 +113,11 @@ private: }; -tst_QSGLoader::tst_QSGLoader() +tst_QQuickLoader::tst_QQuickLoader() { } -void tst_QSGLoader::sourceOrComponent() +void tst_QQuickLoader::sourceOrComponent() { QFETCH(QString, sourceOrComponent); QFETCH(QString, sourceDefinition); @@ -149,14 +149,14 @@ void tst_QSGLoader::sourceOrComponent() "}") , TEST_FILE("")); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QVERIFY(loader != 0); QCOMPARE(loader->item() == 0, error); QCOMPARE(loader->source(), sourceUrl); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(loader->status(), error ? QSGLoader::Error : QSGLoader::Ready); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), error ? 0: 1); + QCOMPARE(loader->status(), error ? QQuickLoader::Error : QQuickLoader::Ready); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), error ? 0: 1); if (!error) { bool sourceComponentIsChildOfLoader = false; @@ -185,7 +185,7 @@ void tst_QSGLoader::sourceOrComponent() delete loader; } -void tst_QSGLoader::sourceOrComponent_data() +void tst_QQuickLoader::sourceOrComponent_data() { QTest::addColumn<QString>("sourceOrComponent"); QTest::addColumn<QString>("sourceDefinition"); @@ -198,7 +198,7 @@ void tst_QSGLoader::sourceOrComponent_data() << QString(QUrl::fromLocalFile(TESTDATA("IDontExist.qml")).toString() + ": File not found"); } -void tst_QSGLoader::clear() +void tst_QQuickLoader::clear() { { QDeclarativeComponent component(&engine); @@ -209,62 +209,62 @@ void tst_QSGLoader::clear() " Timer { interval: 200; running: true; onTriggered: loader.source = '' }\n" " }") , TEST_FILE("")); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QVERIFY(loader != 0); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); QTRY_VERIFY(loader->item() == 0); QCOMPARE(loader->progress(), 0.0); - QCOMPARE(loader->status(), QSGLoader::Null); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 0); + QCOMPARE(loader->status(), QQuickLoader::Null); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 0); delete loader; } { QDeclarativeComponent component(&engine, TEST_FILE("/SetSourceComponent.qml")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); - QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::childItems().at(0)); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(item->QQuickItem::childItems().at(0)); QVERIFY(loader); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); loader->setSourceComponent(0); QVERIFY(loader->item() == 0); QCOMPARE(loader->progress(), 0.0); - QCOMPARE(loader->status(), QSGLoader::Null); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 0); + QCOMPARE(loader->status(), QQuickLoader::Null); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 0); delete item; } { QDeclarativeComponent component(&engine, TEST_FILE("/SetSourceComponent.qml")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); - QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::childItems().at(0)); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(item->QQuickItem::childItems().at(0)); QVERIFY(loader); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); QMetaObject::invokeMethod(item, "clear"); QVERIFY(loader->item() == 0); QCOMPARE(loader->progress(), 0.0); - QCOMPARE(loader->status(), QSGLoader::Null); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 0); + QCOMPARE(loader->status(), QQuickLoader::Null); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 0); delete item; } } -void tst_QSGLoader::urlToComponent() +void tst_QQuickLoader::urlToComponent() { QDeclarativeComponent component(&engine); component.setData(QByteArray("import QtQuick 2.0\n" @@ -275,47 +275,47 @@ void tst_QSGLoader::urlToComponent() " Timer { interval: 100; running: true; onTriggered: loader.sourceComponent = myComp }\n" "}" ) , TEST_FILE("")); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QTest::qWait(200); QTRY_VERIFY(loader != 0); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); QCOMPARE(loader->width(), 10.0); QCOMPARE(loader->height(), 10.0); delete loader; } -void tst_QSGLoader::componentToUrl() +void tst_QQuickLoader::componentToUrl() { QDeclarativeComponent component(&engine, TEST_FILE("/SetSourceComponent.qml")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); - QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::childItems().at(0)); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(item->QQuickItem::childItems().at(0)); QVERIFY(loader); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); loader->setSource(TEST_FILE("/Rect120x60.qml")); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); QCOMPARE(loader->width(), 120.0); QCOMPARE(loader->height(), 60.0); delete item; } -void tst_QSGLoader::anchoredLoader() +void tst_QQuickLoader::anchoredLoader() { QDeclarativeComponent component(&engine, TEST_FILE("/AnchoredLoader.qml")); - QSGItem *rootItem = qobject_cast<QSGItem*>(component.create()); + QQuickItem *rootItem = qobject_cast<QQuickItem*>(component.create()); QVERIFY(rootItem != 0); - QSGItem *loader = rootItem->findChild<QSGItem*>("loader"); - QSGItem *sourceElement = rootItem->findChild<QSGItem*>("sourceElement"); + QQuickItem *loader = rootItem->findChild<QQuickItem*>("loader"); + QQuickItem *sourceElement = rootItem->findChild<QQuickItem*>("sourceElement"); QVERIFY(loader != 0); QVERIFY(sourceElement != 0); @@ -330,16 +330,16 @@ void tst_QSGLoader::anchoredLoader() QCOMPARE(sourceElement->height(), 200.0); } -void tst_QSGLoader::sizeLoaderToItem() +void tst_QQuickLoader::sizeLoaderToItem() { QDeclarativeComponent component(&engine, TEST_FILE("/SizeToItem.qml")); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QVERIFY(loader != 0); QCOMPARE(loader->width(), 120.0); QCOMPARE(loader->height(), 60.0); // Check resize - QSGItem *rect = qobject_cast<QSGItem*>(loader->item()); + QQuickItem *rect = qobject_cast<QQuickItem*>(loader->item()); QVERIFY(rect); rect->setWidth(150); rect->setHeight(45); @@ -371,15 +371,15 @@ void tst_QSGLoader::sizeLoaderToItem() delete loader; } -void tst_QSGLoader::sizeItemToLoader() +void tst_QQuickLoader::sizeItemToLoader() { QDeclarativeComponent component(&engine, TEST_FILE("/SizeToLoader.qml")); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QVERIFY(loader != 0); QCOMPARE(loader->width(), 200.0); QCOMPARE(loader->height(), 80.0); - QSGItem *rect = qobject_cast<QSGItem*>(loader->item()); + QQuickItem *rect = qobject_cast<QQuickItem*>(loader->item()); QVERIFY(rect); QCOMPARE(rect->width(), 200.0); QCOMPARE(rect->height(), 80.0); @@ -401,10 +401,10 @@ void tst_QSGLoader::sizeItemToLoader() delete loader; } -void tst_QSGLoader::noResize() +void tst_QQuickLoader::noResize() { QDeclarativeComponent component(&engine, TEST_FILE("/NoResize.qml")); - QSGItem* item = qobject_cast<QSGItem*>(component.create()); + QQuickItem* item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item != 0); QCOMPARE(item->width(), 200.0); QCOMPARE(item->height(), 80.0); @@ -412,7 +412,7 @@ void tst_QSGLoader::noResize() delete item; } -void tst_QSGLoader::networkRequestUrl() +void tst_QQuickLoader::networkRequestUrl() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); @@ -422,21 +422,21 @@ void tst_QSGLoader::networkRequestUrl() component.setData(QByteArray("import QtQuick 2.0\nLoader { property int signalCount : 0; source: \"http://127.0.0.1:14450/Rect120x60.qml\"; onLoaded: signalCount += 1 }"), QUrl::fromLocalFile(TESTDATA("../dummy.qml"))); if (component.isError()) qDebug() << component.errors(); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QVERIFY(loader != 0); - QTRY_VERIFY(loader->status() == QSGLoader::Ready); + QTRY_VERIFY(loader->status() == QQuickLoader::Ready); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); QCOMPARE(loader->property("signalCount").toInt(), 1); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); delete loader; } /* XXX Component waits until all dependencies are loaded. Is this actually possible? -void tst_QSGLoader::networkComponent() +void tst_QQuickLoader::networkComponent() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); @@ -451,23 +451,23 @@ void tst_QSGLoader::networkComponent() " Loader { sourceComponent: comp } }") , TEST_FILE("")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); - QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::children().at(1)); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(item->QQuickItem::children().at(1)); QVERIFY(loader); - QTRY_VERIFY(loader->status() == QSGLoader::Ready); + QTRY_VERIFY(loader->status() == QQuickLoader::Ready); QVERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(loader->status(), QSGLoader::Ready); - QCOMPARE(static_cast<QSGItem*>(loader)->children().count(), 1); + QCOMPARE(loader->status(), QQuickLoader::Ready); + QCOMPARE(static_cast<QQuickItem*>(loader)->children().count(), 1); delete loader; } */ -void tst_QSGLoader::failNetworkRequest() +void tst_QQuickLoader::failNetworkRequest() { TestHTTPServer server(SERVER_PORT); QVERIFY(server.isValid()); @@ -477,27 +477,27 @@ void tst_QSGLoader::failNetworkRequest() QDeclarativeComponent component(&engine); component.setData(QByteArray("import QtQuick 2.0\nLoader { property int did_load: 123; source: \"http://127.0.0.1:14450/IDontExist.qml\"; onLoaded: did_load=456 }"), QUrl::fromLocalFile("http://127.0.0.1:14450/dummy.qml")); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QVERIFY(loader != 0); - QTRY_VERIFY(loader->status() == QSGLoader::Error); + QTRY_VERIFY(loader->status() == QQuickLoader::Error); QVERIFY(loader->item() == 0); QCOMPARE(loader->progress(), 0.0); QCOMPARE(loader->property("did_load").toInt(), 123); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 0); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 0); delete loader; } -void tst_QSGLoader::active() +void tst_QQuickLoader::active() { // check that the item isn't instantiated until active is set to true { QDeclarativeComponent component(&engine, TEST_FILE("active.1.qml")); QObject *object = component.create(); QVERIFY(object != 0); - QSGLoader *loader = object->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = object->findChild<QQuickLoader*>("loader"); QVERIFY(loader->active() == false); // set manually to false QVERIFY(loader->item() == 0); @@ -516,13 +516,13 @@ void tst_QSGLoader::active() QDeclarativeComponent component(&engine, TEST_FILE("active.2.qml")); QObject *object = component.create(); QVERIFY(object != 0); - QSGLoader *loader = object->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = object->findChild<QQuickLoader*>("loader"); QVERIFY(loader->active() == true); // active is true by default - QCOMPARE(loader->status(), QSGLoader::Ready); + QCOMPARE(loader->status(), QQuickLoader::Ready); int currStatusChangedCount = loader->property("statusChangedCount").toInt(); QMetaObject::invokeMethod(object, "doSetInactive"); - QCOMPARE(loader->status(), QSGLoader::Null); + QCOMPARE(loader->status(), QQuickLoader::Null); QCOMPARE(loader->property("statusChangedCount").toInt(), (currStatusChangedCount+1)); delete object; @@ -533,7 +533,7 @@ void tst_QSGLoader::active() QDeclarativeComponent component(&engine, TEST_FILE("active.3.qml")); QObject *object = component.create(); QVERIFY(object != 0); - QSGLoader *loader = object->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = object->findChild<QQuickLoader*>("loader"); QVERIFY(loader->active() == true); // active is true by default QVERIFY(!loader->source().isEmpty()); @@ -550,7 +550,7 @@ void tst_QSGLoader::active() QDeclarativeComponent component(&engine, TEST_FILE("active.4.qml")); QObject *object = component.create(); QVERIFY(object != 0); - QSGLoader *loader = object->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = object->findChild<QQuickLoader*>("loader"); QVERIFY(loader->active() == true); // active is true by default QVERIFY(loader->sourceComponent() != 0); @@ -567,7 +567,7 @@ void tst_QSGLoader::active() QDeclarativeComponent component(&engine, TEST_FILE("active.5.qml")); QObject *object = component.create(); QVERIFY(object != 0); - QSGLoader *loader = object->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = object->findChild<QQuickLoader*>("loader"); QVERIFY(loader->active() == true); // active is true by default QVERIFY(loader->item() != 0); @@ -584,7 +584,7 @@ void tst_QSGLoader::active() QDeclarativeComponent component(&engine, TEST_FILE("active.6.qml")); QObject *object = component.create(); QVERIFY(object != 0); - QSGLoader *loader = object->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = object->findChild<QQuickLoader*>("loader"); QVERIFY(loader->active() == true); // active is true by default loader->setActive(true); // no effect @@ -628,7 +628,7 @@ void tst_QSGLoader::active() } } -void tst_QSGLoader::initialPropertyValues_data() +void tst_QQuickLoader::initialPropertyValues_data() { QTest::addColumn<QUrl>("qmlFile"); QTest::addColumn<QStringList>("expectedWarnings"); @@ -676,7 +676,7 @@ void tst_QSGLoader::initialPropertyValues_data() << (QVariantList() << 6); } -void tst_QSGLoader::initialPropertyValues() +void tst_QQuickLoader::initialPropertyValues() { QFETCH(QUrl, qmlFile); QFETCH(QStringList, expectedWarnings); @@ -702,7 +702,7 @@ void tst_QSGLoader::initialPropertyValues() delete object; } -void tst_QSGLoader::initialPropertyValuesBinding() +void tst_QQuickLoader::initialPropertyValuesBinding() { QDeclarativeComponent component(&engine, TEST_FILE("initialPropertyValues.binding.qml")); QObject *object = component.create(); @@ -714,7 +714,7 @@ void tst_QSGLoader::initialPropertyValuesBinding() delete object; } -void tst_QSGLoader::initialPropertyValuesError_data() +void tst_QQuickLoader::initialPropertyValuesError_data() { QTest::addColumn<QUrl>("qmlFile"); QTest::addColumn<QStringList>("expectedWarnings"); @@ -733,7 +733,7 @@ void tst_QSGLoader::initialPropertyValuesError_data() << QString(TEST_FILE("initialPropertyValues.error.4.qml").toString() + ":5: TypeError: Cannot read property 'canary' of null")); } -void tst_QSGLoader::initialPropertyValuesError() +void tst_QQuickLoader::initialPropertyValuesError() { QFETCH(QUrl, qmlFile); QFETCH(QStringList, expectedWarnings); @@ -744,53 +744,53 @@ void tst_QSGLoader::initialPropertyValuesError() QDeclarativeComponent component(&engine, qmlFile); QObject *object = component.create(); QVERIFY(object != 0); - QSGLoader *loader = object->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = object->findChild<QQuickLoader*>("loader"); QVERIFY(loader != 0); QVERIFY(loader->item() == 0); delete object; } // QTBUG-9241 -void tst_QSGLoader::deleteComponentCrash() +void tst_QQuickLoader::deleteComponentCrash() { QDeclarativeComponent component(&engine, TEST_FILE("crash.qml")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); item->metaObject()->invokeMethod(item, "setLoaderSource"); - QSGLoader *loader = qobject_cast<QSGLoader*>(item->QSGItem::childItems().at(0)); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(item->QQuickItem::childItems().at(0)); QVERIFY(loader); QVERIFY(loader->item()); QCOMPARE(loader->item()->objectName(), QLatin1String("blue")); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(loader->status(), QSGLoader::Ready); + QCOMPARE(loader->status(), QQuickLoader::Ready); qApp->processEvents(QEventLoop::DeferredDeletion); - QTRY_COMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QTRY_COMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); QVERIFY(loader->source() == QUrl::fromLocalFile(TESTDATA("BlueRect.qml"))); delete item; } -void tst_QSGLoader::nonItem() +void tst_QQuickLoader::nonItem() { QDeclarativeComponent component(&engine, TEST_FILE("nonItem.qml")); QString err = QUrl::fromLocalFile(TESTDATA("nonItem.qml")).toString() + ":3:1: QML Loader: Loader does not support loading non-visual elements."; QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData()); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QVERIFY(loader); QVERIFY(loader->item() == 0); delete loader; } -void tst_QSGLoader::vmeErrors() +void tst_QQuickLoader::vmeErrors() { QDeclarativeComponent component(&engine, TEST_FILE("vmeErrors.qml")); QString err = QUrl::fromLocalFile(TESTDATA("VmeError.qml")).toString() + ":6: Cannot assign object type QObject with no default method"; QTest::ignoreMessage(QtWarningMsg, err.toLatin1().constData()); - QSGLoader *loader = qobject_cast<QSGLoader*>(component.create()); + QQuickLoader *loader = qobject_cast<QQuickLoader*>(component.create()); QVERIFY(loader); QVERIFY(loader->item() == 0); @@ -798,7 +798,7 @@ void tst_QSGLoader::vmeErrors() } // QTBUG-13481 -void tst_QSGLoader::creationContext() +void tst_QQuickLoader::creationContext() { QDeclarativeComponent component(&engine, TEST_FILE("creationContext.qml")); @@ -810,10 +810,10 @@ void tst_QSGLoader::creationContext() delete o; } -void tst_QSGLoader::QTBUG_16928() +void tst_QQuickLoader::QTBUG_16928() { QDeclarativeComponent component(&engine, TEST_FILE("QTBUG_16928.qml")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(item->width(), 250.); @@ -822,10 +822,10 @@ void tst_QSGLoader::QTBUG_16928() delete item; } -void tst_QSGLoader::implicitSize() +void tst_QQuickLoader::implicitSize() { QDeclarativeComponent component(&engine, TEST_FILE("implicitSize.qml")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(item->width(), 150.); @@ -837,10 +837,10 @@ void tst_QSGLoader::implicitSize() delete item; } -void tst_QSGLoader::QTBUG_17114() +void tst_QQuickLoader::QTBUG_17114() { QDeclarativeComponent component(&engine, TEST_FILE("QTBUG_17114.qml")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(item->property("loaderWidth").toReal(), 32.); @@ -849,7 +849,7 @@ void tst_QSGLoader::QTBUG_17114() delete item; } -void tst_QSGLoader::asynchronous_data() +void tst_QQuickLoader::asynchronous_data() { QTest::addColumn<QUrl>("qmlFile"); QTest::addColumn<QStringList>("expectedWarnings"); @@ -864,7 +864,7 @@ void tst_QSGLoader::asynchronous_data() << (QStringList() << QString(TEST_FILE("InvalidSourceComponent.qml").toString() + ":5:1: Syntax error")); } -void tst_QSGLoader::asynchronous() +void tst_QQuickLoader::asynchronous() { QFETCH(QUrl, qmlFile); QFETCH(QStringList, expectedWarnings); @@ -872,10 +872,10 @@ void tst_QSGLoader::asynchronous() if (!engine.incubationController()) engine.setIncubationController(new PeriodicIncubationController); QDeclarativeComponent component(&engine, TEST_FILE("asynchronous.qml")); - QSGItem *root = qobject_cast<QSGItem*>(component.create()); + QQuickItem *root = qobject_cast<QQuickItem*>(component.create()); QVERIFY(root); - QSGLoader *loader = root->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = root->findChild<QQuickLoader*>("loader"); QVERIFY(loader); foreach (const QString &warning, expectedWarnings) @@ -887,29 +887,29 @@ void tst_QSGLoader::asynchronous() QVERIFY(!loader->item()); if (expectedWarnings.isEmpty()) { - QCOMPARE(loader->status(), QSGLoader::Loading); + QCOMPARE(loader->status(), QQuickLoader::Loading); QCOMPARE(engine.incubationController()->incubatingObjectCount(), 1); QTRY_VERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(loader->status(), QSGLoader::Ready); + QCOMPARE(loader->status(), QQuickLoader::Ready); } else { QCOMPARE(loader->progress(), 1.0); - QTRY_COMPARE(loader->status(), QSGLoader::Error); + QTRY_COMPARE(loader->status(), QQuickLoader::Error); } delete root; } -void tst_QSGLoader::asynchronous_clear() +void tst_QQuickLoader::asynchronous_clear() { if (!engine.incubationController()) engine.setIncubationController(new PeriodicIncubationController); QDeclarativeComponent component(&engine, TEST_FILE("asynchronous.qml")); - QSGItem *root = qobject_cast<QSGItem*>(component.create()); + QQuickItem *root = qobject_cast<QQuickItem*>(component.create()); QVERIFY(root); - QSGLoader *loader = root->findChild<QSGLoader*>("loader"); + QQuickLoader *loader = root->findChild<QQuickLoader*>("loader"); QVERIFY(loader); QVERIFY(!loader->item()); @@ -917,7 +917,7 @@ void tst_QSGLoader::asynchronous_clear() QMetaObject::invokeMethod(root, "loadComponent"); QVERIFY(!loader->item()); - QCOMPARE(loader->status(), QSGLoader::Loading); + QCOMPARE(loader->status(), QQuickLoader::Loading); QCOMPARE(engine.incubationController()->incubatingObjectCount(), 1); // clear before component created @@ -927,24 +927,24 @@ void tst_QSGLoader::asynchronous_clear() QCOMPARE(engine.incubationController()->incubatingObjectCount(), 0); QCOMPARE(loader->progress(), 0.0); - QCOMPARE(loader->status(), QSGLoader::Null); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 0); + QCOMPARE(loader->status(), QQuickLoader::Null); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 0); // check loading component root->setProperty("comp", "Rect120x60.qml"); QMetaObject::invokeMethod(root, "loadComponent"); QVERIFY(!loader->item()); - QCOMPARE(loader->status(), QSGLoader::Loading); + QCOMPARE(loader->status(), QQuickLoader::Loading); QCOMPARE(engine.incubationController()->incubatingObjectCount(), 1); QTRY_VERIFY(loader->item()); QCOMPARE(loader->progress(), 1.0); - QCOMPARE(loader->status(), QSGLoader::Ready); - QCOMPARE(static_cast<QSGItem*>(loader)->childItems().count(), 1); + QCOMPARE(loader->status(), QQuickLoader::Ready); + QCOMPARE(static_cast<QQuickItem*>(loader)->childItems().count(), 1); } -QTEST_MAIN(tst_QSGLoader) +QTEST_MAIN(tst_QQuickLoader) -#include "tst_qsgloader.moc" +#include "tst_qquickloader.moc" diff --git a/tests/auto/declarative/qsgmousearea/data/clickThrough.qml b/tests/auto/declarative/qquickmousearea/data/clickThrough.qml index 0d954f8511..0d954f8511 100644 --- a/tests/auto/declarative/qsgmousearea/data/clickThrough.qml +++ b/tests/auto/declarative/qquickmousearea/data/clickThrough.qml diff --git a/tests/auto/declarative/qsgmousearea/data/clickThrough2.qml b/tests/auto/declarative/qquickmousearea/data/clickThrough2.qml index bc73a1bf8a..bc73a1bf8a 100644 --- a/tests/auto/declarative/qsgmousearea/data/clickThrough2.qml +++ b/tests/auto/declarative/qquickmousearea/data/clickThrough2.qml diff --git a/tests/auto/declarative/qsgmousearea/data/clickandhold.qml b/tests/auto/declarative/qquickmousearea/data/clickandhold.qml index 5e4e48f6db..5e4e48f6db 100644 --- a/tests/auto/declarative/qsgmousearea/data/clickandhold.qml +++ b/tests/auto/declarative/qquickmousearea/data/clickandhold.qml diff --git a/tests/auto/declarative/qsgmousearea/data/clicktwice.qml b/tests/auto/declarative/qquickmousearea/data/clicktwice.qml index 002d1b9047..002d1b9047 100644 --- a/tests/auto/declarative/qsgmousearea/data/clicktwice.qml +++ b/tests/auto/declarative/qquickmousearea/data/clicktwice.qml diff --git a/tests/auto/declarative/qsgmousearea/data/doubleclick.qml b/tests/auto/declarative/qquickmousearea/data/doubleclick.qml index 1030d0c33e..1030d0c33e 100644 --- a/tests/auto/declarative/qsgmousearea/data/doubleclick.qml +++ b/tests/auto/declarative/qquickmousearea/data/doubleclick.qml diff --git a/tests/auto/declarative/qsgmousearea/data/dragging.qml b/tests/auto/declarative/qquickmousearea/data/dragging.qml index d9b6ac4083..d9b6ac4083 100644 --- a/tests/auto/declarative/qsgmousearea/data/dragging.qml +++ b/tests/auto/declarative/qquickmousearea/data/dragging.qml diff --git a/tests/auto/declarative/qsgmousearea/data/dragproperties.qml b/tests/auto/declarative/qquickmousearea/data/dragproperties.qml index 421dfe26b7..421dfe26b7 100644 --- a/tests/auto/declarative/qsgmousearea/data/dragproperties.qml +++ b/tests/auto/declarative/qquickmousearea/data/dragproperties.qml diff --git a/tests/auto/declarative/qsgmousearea/data/dragreset.qml b/tests/auto/declarative/qquickmousearea/data/dragreset.qml index d7949f9139..d7949f9139 100644 --- a/tests/auto/declarative/qsgmousearea/data/dragreset.qml +++ b/tests/auto/declarative/qquickmousearea/data/dragreset.qml diff --git a/tests/auto/declarative/qsgmousearea/data/hoverPosition.qml b/tests/auto/declarative/qquickmousearea/data/hoverPosition.qml index 834f91ff29..834f91ff29 100644 --- a/tests/auto/declarative/qsgmousearea/data/hoverPosition.qml +++ b/tests/auto/declarative/qquickmousearea/data/hoverPosition.qml diff --git a/tests/auto/declarative/qsgmousearea/data/hoverPropagation.qml b/tests/auto/declarative/qquickmousearea/data/hoverPropagation.qml index c47c794132..c47c794132 100644 --- a/tests/auto/declarative/qsgmousearea/data/hoverPropagation.qml +++ b/tests/auto/declarative/qquickmousearea/data/hoverPropagation.qml diff --git a/tests/auto/declarative/qsgmousearea/data/noclickandhold.qml b/tests/auto/declarative/qquickmousearea/data/noclickandhold.qml index 6647de001d..6647de001d 100644 --- a/tests/auto/declarative/qsgmousearea/data/noclickandhold.qml +++ b/tests/auto/declarative/qquickmousearea/data/noclickandhold.qml diff --git a/tests/auto/declarative/qsgmousearea/data/pressedCanceled.qml b/tests/auto/declarative/qquickmousearea/data/pressedCanceled.qml index 231436d0f2..231436d0f2 100644 --- a/tests/auto/declarative/qsgmousearea/data/pressedCanceled.qml +++ b/tests/auto/declarative/qquickmousearea/data/pressedCanceled.qml diff --git a/tests/auto/declarative/qsgmousearea/data/pressedOrdering.qml b/tests/auto/declarative/qquickmousearea/data/pressedOrdering.qml index 7aa3098100..7aa3098100 100644 --- a/tests/auto/declarative/qsgmousearea/data/pressedOrdering.qml +++ b/tests/auto/declarative/qquickmousearea/data/pressedOrdering.qml diff --git a/tests/auto/declarative/qsgmousearea/data/preventstealing.qml b/tests/auto/declarative/qquickmousearea/data/preventstealing.qml index fb0d6955c1..fb0d6955c1 100644 --- a/tests/auto/declarative/qsgmousearea/data/preventstealing.qml +++ b/tests/auto/declarative/qquickmousearea/data/preventstealing.qml diff --git a/tests/auto/declarative/qsgmousearea/data/rejectEvent.qml b/tests/auto/declarative/qquickmousearea/data/rejectEvent.qml index 816fc76fac..816fc76fac 100644 --- a/tests/auto/declarative/qsgmousearea/data/rejectEvent.qml +++ b/tests/auto/declarative/qquickmousearea/data/rejectEvent.qml diff --git a/tests/auto/declarative/qsgmousearea/data/updateMousePosOnClick.qml b/tests/auto/declarative/qquickmousearea/data/updateMousePosOnClick.qml index 7377a2e86c..7377a2e86c 100644 --- a/tests/auto/declarative/qsgmousearea/data/updateMousePosOnClick.qml +++ b/tests/auto/declarative/qquickmousearea/data/updateMousePosOnClick.qml diff --git a/tests/auto/declarative/qsgmousearea/data/updateMousePosOnResize.qml b/tests/auto/declarative/qquickmousearea/data/updateMousePosOnResize.qml index 55af864060..55af864060 100644 --- a/tests/auto/declarative/qsgmousearea/data/updateMousePosOnResize.qml +++ b/tests/auto/declarative/qquickmousearea/data/updateMousePosOnResize.qml diff --git a/tests/auto/declarative/qsgmousearea/qsgmousearea.pro b/tests/auto/declarative/qquickmousearea/qquickmousearea.pro index 39abd5a75d..3581a7b9c9 100644 --- a/tests/auto/declarative/qsgmousearea/qsgmousearea.pro +++ b/tests/auto/declarative/qquickmousearea/qquickmousearea.pro @@ -1,9 +1,9 @@ CONFIG += testcase -TARGET = tst_qsgmousearea +TARGET = tst_qquickmousearea macx:CONFIG -= app_bundle HEADERS += ../shared/testhttpserver.h -SOURCES += tst_qsgmousearea.cpp ../shared/testhttpserver.cpp +SOURCES += tst_qquickmousearea.cpp ../shared/testhttpserver.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp b/tests/auto/declarative/qquickmousearea/tst_qquickmousearea.cpp index be6a6017f0..af4dc610c7 100644 --- a/tests/auto/declarative/qsgmousearea/tst_qsgmousearea.cpp +++ b/tests/auto/declarative/qquickmousearea/tst_qquickmousearea.cpp @@ -41,10 +41,10 @@ #include <QtTest/QtTest> #include <QtTest/QSignalSpy> -#include <private/qsgmousearea_p.h> -#include <private/qsgrectangle_p.h> -#include <private/qsgflickable_p.h> -#include <QtDeclarative/qsgview.h> +#include <private/qquickmousearea_p.h> +#include <private/qquickrectangle_p.h> +#include <private/qquickflickable_p.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtOpenGL/QGLShaderProgram> @@ -52,7 +52,7 @@ //#define OLDWAY -class tst_QSGMouseArea: public QObject +class tst_QQuickMouseArea: public QObject { Q_OBJECT private slots: @@ -77,38 +77,38 @@ private slots: void hoverPropagation(); private: - QSGView *createView(); + QQuickView *createView(); }; -void tst_QSGMouseArea::initTestCase() +void tst_QQuickMouseArea::initTestCase() { } -void tst_QSGMouseArea::cleanupTestCase() +void tst_QQuickMouseArea::cleanupTestCase() { } -void tst_QSGMouseArea::dragProperties() +void tst_QQuickMouseArea::dragProperties() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("dragproperties.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGMouseArea *mouseRegion = canvas->rootObject()->findChild<QSGMouseArea*>("mouseregion"); - QSGDrag *drag = mouseRegion->drag(); + QQuickMouseArea *mouseRegion = canvas->rootObject()->findChild<QQuickMouseArea*>("mouseregion"); + QQuickDrag *drag = mouseRegion->drag(); QVERIFY(mouseRegion != 0); QVERIFY(drag != 0); // target - QSGItem *blackRect = canvas->rootObject()->findChild<QSGItem*>("blackrect"); + QQuickItem *blackRect = canvas->rootObject()->findChild<QQuickItem*>("blackrect"); QVERIFY(blackRect != 0); QVERIFY(blackRect == drag->target()); - QSGItem *rootItem = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(rootItem != 0); QSignalSpy targetSpy(drag, SIGNAL(targetChanged())); drag->setTarget(rootItem); @@ -117,12 +117,12 @@ void tst_QSGMouseArea::dragProperties() QCOMPARE(targetSpy.count(),1); // axis - QCOMPARE(drag->axis(), QSGDrag::XandYAxis); + QCOMPARE(drag->axis(), QQuickDrag::XandYAxis); QSignalSpy axisSpy(drag, SIGNAL(axisChanged())); - drag->setAxis(QSGDrag::XAxis); - QCOMPARE(drag->axis(), QSGDrag::XAxis); + drag->setAxis(QQuickDrag::XAxis); + QCOMPARE(drag->axis(), QQuickDrag::XAxis); QCOMPARE(axisSpy.count(),1); - drag->setAxis(QSGDrag::XAxis); + drag->setAxis(QQuickDrag::XAxis); QCOMPARE(axisSpy.count(),1); // minimum and maximum properties @@ -175,9 +175,9 @@ void tst_QSGMouseArea::dragProperties() delete canvas; } -void tst_QSGMouseArea::resetDrag() +void tst_QQuickMouseArea::resetDrag() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->rootContext()->setContextProperty("haveTarget", QVariant(true)); canvas->setSource(QUrl::fromLocalFile(TESTDATA("dragreset.qml"))); @@ -185,16 +185,16 @@ void tst_QSGMouseArea::resetDrag() canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGMouseArea *mouseRegion = canvas->rootObject()->findChild<QSGMouseArea*>("mouseregion"); - QSGDrag *drag = mouseRegion->drag(); + QQuickMouseArea *mouseRegion = canvas->rootObject()->findChild<QQuickMouseArea*>("mouseregion"); + QQuickDrag *drag = mouseRegion->drag(); QVERIFY(mouseRegion != 0); QVERIFY(drag != 0); // target - QSGItem *blackRect = canvas->rootObject()->findChild<QSGItem*>("blackrect"); + QQuickItem *blackRect = canvas->rootObject()->findChild<QQuickItem*>("blackrect"); QVERIFY(blackRect != 0); QVERIFY(blackRect == drag->target()); - QSGItem *rootItem = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(rootItem != 0); QSignalSpy targetSpy(drag, SIGNAL(targetChanged())); QVERIFY(drag->target() != 0); @@ -206,9 +206,9 @@ void tst_QSGMouseArea::resetDrag() } -void tst_QSGMouseArea::dragging() +void tst_QQuickMouseArea::dragging() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("dragging.qml"))); canvas->show(); @@ -216,13 +216,13 @@ void tst_QSGMouseArea::dragging() QTest::qWait(20); QVERIFY(canvas->rootObject() != 0); - QSGMouseArea *mouseRegion = canvas->rootObject()->findChild<QSGMouseArea*>("mouseregion"); - QSGDrag *drag = mouseRegion->drag(); + QQuickMouseArea *mouseRegion = canvas->rootObject()->findChild<QQuickMouseArea*>("mouseregion"); + QQuickDrag *drag = mouseRegion->drag(); QVERIFY(mouseRegion != 0); QVERIFY(drag != 0); // target - QSGItem *blackRect = canvas->rootObject()->findChild<QSGItem*>("blackrect"); + QQuickItem *blackRect = canvas->rootObject()->findChild<QQuickItem*>("blackrect"); QVERIFY(blackRect != 0); QVERIFY(blackRect == drag->target()); @@ -266,26 +266,26 @@ void tst_QSGMouseArea::dragging() delete canvas; } -QSGView *tst_QSGMouseArea::createView() +QQuickView *tst_QQuickMouseArea::createView() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setBaseSize(QSize(240,320)); return canvas; } -void tst_QSGMouseArea::updateMouseAreaPosOnClick() +void tst_QQuickMouseArea::updateMouseAreaPosOnClick() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("updateMousePosOnClick.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGMouseArea *mouseRegion = canvas->rootObject()->findChild<QSGMouseArea*>("mouseregion"); + QQuickMouseArea *mouseRegion = canvas->rootObject()->findChild<QQuickMouseArea*>("mouseregion"); QVERIFY(mouseRegion != 0); - QSGRectangle *rect = canvas->rootObject()->findChild<QSGRectangle*>("ball"); + QQuickRectangle *rect = canvas->rootObject()->findChild<QQuickRectangle*>("ball"); QVERIFY(rect != 0); QCOMPARE(mouseRegion->mouseX(), rect->x()); @@ -303,18 +303,18 @@ void tst_QSGMouseArea::updateMouseAreaPosOnClick() delete canvas; } -void tst_QSGMouseArea::updateMouseAreaPosOnResize() +void tst_QQuickMouseArea::updateMouseAreaPosOnResize() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("updateMousePosOnResize.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGMouseArea *mouseRegion = canvas->rootObject()->findChild<QSGMouseArea*>("mouseregion"); + QQuickMouseArea *mouseRegion = canvas->rootObject()->findChild<QQuickMouseArea*>("mouseregion"); QVERIFY(mouseRegion != 0); - QSGRectangle *rect = canvas->rootObject()->findChild<QSGRectangle*>("brother"); + QQuickRectangle *rect = canvas->rootObject()->findChild<QQuickRectangle*>("brother"); QVERIFY(rect != 0); QCOMPARE(mouseRegion->mouseX(), 0.0); @@ -339,11 +339,11 @@ void tst_QSGMouseArea::updateMouseAreaPosOnResize() delete canvas; } -void tst_QSGMouseArea::noOnClickedWithPressAndHold() +void tst_QQuickMouseArea::noOnClickedWithPressAndHold() { { // We handle onPressAndHold, therefore no onClicked - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("clickandhold.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -368,7 +368,7 @@ void tst_QSGMouseArea::noOnClickedWithPressAndHold() { // We do not handle onPressAndHold, therefore we get onClicked - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("noclickandhold.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -390,9 +390,9 @@ void tst_QSGMouseArea::noOnClickedWithPressAndHold() } } -void tst_QSGMouseArea::onMousePressRejected() +void tst_QQuickMouseArea::onMousePressRejected() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("rejectEvent.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -427,9 +427,9 @@ void tst_QSGMouseArea::onMousePressRejected() delete canvas; } -void tst_QSGMouseArea::pressedCanceledOnWindowDeactivate() +void tst_QQuickMouseArea::pressedCanceledOnWindowDeactivate() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pressedCanceled.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -472,9 +472,9 @@ void tst_QSGMouseArea::pressedCanceledOnWindowDeactivate() delete canvas; } -void tst_QSGMouseArea::doubleClick() +void tst_QQuickMouseArea::doubleClick() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("doubleclick.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -501,9 +501,9 @@ void tst_QSGMouseArea::doubleClick() } // QTBUG-14832 -void tst_QSGMouseArea::clickTwice() +void tst_QQuickMouseArea::clickTwice() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("clicktwice.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -532,9 +532,9 @@ void tst_QSGMouseArea::clickTwice() delete canvas; } -void tst_QSGMouseArea::pressedOrdering() +void tst_QQuickMouseArea::pressedOrdering() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pressedOrdering.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -559,22 +559,22 @@ void tst_QSGMouseArea::pressedOrdering() delete canvas; } -void tst_QSGMouseArea::preventStealing() +void tst_QQuickMouseArea::preventStealing() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("preventstealing.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGFlickable *flickable = qobject_cast<QSGFlickable*>(canvas->rootObject()); + QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(canvas->rootObject()); QVERIFY(flickable != 0); - QSGMouseArea *mouseArea = canvas->rootObject()->findChild<QSGMouseArea*>("mousearea"); + QQuickMouseArea *mouseArea = canvas->rootObject()->findChild<QQuickMouseArea*>("mousearea"); QVERIFY(mouseArea != 0); - QSignalSpy mousePositionSpy(mouseArea, SIGNAL(positionChanged(QSGMouseEvent*))); + QSignalSpy mousePositionSpy(mouseArea, SIGNAL(positionChanged(QQuickMouseEvent*))); QTest::mousePress(canvas, Qt::LeftButton, 0, QPoint(80, 80)); @@ -622,10 +622,10 @@ void tst_QSGMouseArea::preventStealing() delete canvas; } -void tst_QSGMouseArea::clickThrough() +void tst_QQuickMouseArea::clickThrough() { //With no handlers defined click, doubleClick and PressAndHold should propagate to those with handlers - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("clickThrough.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -719,7 +719,7 @@ void tst_QSGMouseArea::clickThrough() delete canvas; } -void tst_QSGMouseArea::testQtQuick11Attributes() +void tst_QQuickMouseArea::testQtQuick11Attributes() { QFETCH(QString, code); QFETCH(QString, warning); @@ -743,7 +743,7 @@ void tst_QSGMouseArea::testQtQuick11Attributes() delete obj; } -void tst_QSGMouseArea::testQtQuick11Attributes_data() +void tst_QQuickMouseArea::testQtQuick11Attributes_data() { QTest::addColumn<QString>("code"); QTest::addColumn<QString>("warning"); @@ -754,12 +754,12 @@ void tst_QSGMouseArea::testQtQuick11Attributes_data() << ":1 \"MouseArea.preventStealing\" is not available in QtQuick 1.0.\n"; } -void tst_QSGMouseArea::hoverPosition() +void tst_QQuickMouseArea::hoverPosition() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("hoverPosition.qml"))); - QSGItem *root = canvas->rootObject(); + QQuickItem *root = canvas->rootObject(); QVERIFY(root != 0); QCOMPARE(root->property("mouseX").toReal(), qreal(0)); @@ -774,13 +774,13 @@ void tst_QSGMouseArea::hoverPosition() delete canvas; } -void tst_QSGMouseArea::hoverPropagation() +void tst_QQuickMouseArea::hoverPropagation() { //QTBUG-18175, to behave like GV did. - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("hoverPropagation.qml"))); - QSGItem *root = canvas->rootObject(); + QQuickItem *root = canvas->rootObject(); QVERIFY(root != 0); QCOMPARE(root->property("point1").toBool(), false); @@ -800,6 +800,6 @@ void tst_QSGMouseArea::hoverPropagation() delete canvas; } -QTEST_MAIN(tst_QSGMouseArea) +QTEST_MAIN(tst_QQuickMouseArea) -#include "tst_qsgmousearea.moc" +#include "tst_qquickmousearea.moc" diff --git a/tests/auto/declarative/qsgpathview/data/ComponentView.qml b/tests/auto/declarative/qquickpathview/data/ComponentView.qml index b61033d375..b61033d375 100644 --- a/tests/auto/declarative/qsgpathview/data/ComponentView.qml +++ b/tests/auto/declarative/qquickpathview/data/ComponentView.qml diff --git a/tests/auto/declarative/qsgpathview/data/closedPath.qml b/tests/auto/declarative/qquickpathview/data/closedPath.qml index 3ca34056c8..3ca34056c8 100644 --- a/tests/auto/declarative/qsgpathview/data/closedPath.qml +++ b/tests/auto/declarative/qquickpathview/data/closedPath.qml diff --git a/tests/auto/declarative/qsgpathview/data/creationContext.qml b/tests/auto/declarative/qquickpathview/data/creationContext.qml index 79a682788b..79a682788b 100644 --- a/tests/auto/declarative/qsgpathview/data/creationContext.qml +++ b/tests/auto/declarative/qquickpathview/data/creationContext.qml diff --git a/tests/auto/declarative/qsgpathview/data/datamodel.qml b/tests/auto/declarative/qquickpathview/data/datamodel.qml index 44f2aecc0a..44f2aecc0a 100644 --- a/tests/auto/declarative/qsgpathview/data/datamodel.qml +++ b/tests/auto/declarative/qquickpathview/data/datamodel.qml diff --git a/tests/auto/declarative/qsgpathview/data/displaypath.qml b/tests/auto/declarative/qquickpathview/data/displaypath.qml index af0f381fc4..af0f381fc4 100644 --- a/tests/auto/declarative/qsgpathview/data/displaypath.qml +++ b/tests/auto/declarative/qquickpathview/data/displaypath.qml diff --git a/tests/auto/declarative/qsgpathview/data/dragpath.qml b/tests/auto/declarative/qquickpathview/data/dragpath.qml index f9c6615b04..f9c6615b04 100644 --- a/tests/auto/declarative/qsgpathview/data/dragpath.qml +++ b/tests/auto/declarative/qquickpathview/data/dragpath.qml diff --git a/tests/auto/declarative/qsgpathview/data/emptymodel.qml b/tests/auto/declarative/qquickpathview/data/emptymodel.qml index eb4d3006f4..eb4d3006f4 100644 --- a/tests/auto/declarative/qsgpathview/data/emptymodel.qml +++ b/tests/auto/declarative/qquickpathview/data/emptymodel.qml diff --git a/tests/auto/declarative/qsgpathview/data/missingPercent.qml b/tests/auto/declarative/qquickpathview/data/missingPercent.qml index 97af8e8982..97af8e8982 100644 --- a/tests/auto/declarative/qsgpathview/data/missingPercent.qml +++ b/tests/auto/declarative/qquickpathview/data/missingPercent.qml diff --git a/tests/auto/declarative/qsgpathview/data/openPath.qml b/tests/auto/declarative/qquickpathview/data/openPath.qml index 1bd8375d9e..1bd8375d9e 100644 --- a/tests/auto/declarative/qsgpathview/data/openPath.qml +++ b/tests/auto/declarative/qquickpathview/data/openPath.qml diff --git a/tests/auto/declarative/qsgpathview/data/pathUpdate.qml b/tests/auto/declarative/qquickpathview/data/pathUpdate.qml index e729291025..e729291025 100644 --- a/tests/auto/declarative/qsgpathview/data/pathUpdate.qml +++ b/tests/auto/declarative/qquickpathview/data/pathUpdate.qml diff --git a/tests/auto/declarative/qsgpathview/data/pathUpdateOnStartChanged.qml b/tests/auto/declarative/qquickpathview/data/pathUpdateOnStartChanged.qml index 89084b2a37..89084b2a37 100644 --- a/tests/auto/declarative/qsgpathview/data/pathUpdateOnStartChanged.qml +++ b/tests/auto/declarative/qquickpathview/data/pathUpdateOnStartChanged.qml diff --git a/tests/auto/declarative/qsgpathview/data/pathtest.qml b/tests/auto/declarative/qquickpathview/data/pathtest.qml index 736d58d2a9..736d58d2a9 100644 --- a/tests/auto/declarative/qsgpathview/data/pathtest.qml +++ b/tests/auto/declarative/qquickpathview/data/pathtest.qml diff --git a/tests/auto/declarative/qsgpathview/data/pathview0.qml b/tests/auto/declarative/qquickpathview/data/pathview0.qml index 8b9378163f..8b9378163f 100644 --- a/tests/auto/declarative/qsgpathview/data/pathview0.qml +++ b/tests/auto/declarative/qquickpathview/data/pathview0.qml diff --git a/tests/auto/declarative/qsgpathview/data/pathview1.qml b/tests/auto/declarative/qquickpathview/data/pathview1.qml index 53d375e596..53d375e596 100644 --- a/tests/auto/declarative/qsgpathview/data/pathview1.qml +++ b/tests/auto/declarative/qquickpathview/data/pathview1.qml diff --git a/tests/auto/declarative/qsgpathview/data/pathview2.qml b/tests/auto/declarative/qquickpathview/data/pathview2.qml index 1d279c42a0..1d279c42a0 100644 --- a/tests/auto/declarative/qsgpathview/data/pathview2.qml +++ b/tests/auto/declarative/qquickpathview/data/pathview2.qml diff --git a/tests/auto/declarative/qsgpathview/data/pathview3.qml b/tests/auto/declarative/qquickpathview/data/pathview3.qml index ded5a3911c..ded5a3911c 100644 --- a/tests/auto/declarative/qsgpathview/data/pathview3.qml +++ b/tests/auto/declarative/qquickpathview/data/pathview3.qml diff --git a/tests/auto/declarative/qsgpathview/data/pathview_package.qml b/tests/auto/declarative/qquickpathview/data/pathview_package.qml index 2af57e6bb1..2af57e6bb1 100644 --- a/tests/auto/declarative/qsgpathview/data/pathview_package.qml +++ b/tests/auto/declarative/qquickpathview/data/pathview_package.qml diff --git a/tests/auto/declarative/qsgpathview/data/propertychanges.qml b/tests/auto/declarative/qquickpathview/data/propertychanges.qml index 09b309f86f..09b309f86f 100644 --- a/tests/auto/declarative/qsgpathview/data/propertychanges.qml +++ b/tests/auto/declarative/qquickpathview/data/propertychanges.qml diff --git a/tests/auto/declarative/qsgpathview/data/treemodel.qml b/tests/auto/declarative/qquickpathview/data/treemodel.qml index fcf6922d00..fcf6922d00 100644 --- a/tests/auto/declarative/qsgpathview/data/treemodel.qml +++ b/tests/auto/declarative/qquickpathview/data/treemodel.qml diff --git a/tests/auto/declarative/qsgpathview/data/undefinedpath.qml b/tests/auto/declarative/qquickpathview/data/undefinedpath.qml index 674e7cca8d..674e7cca8d 100644 --- a/tests/auto/declarative/qsgpathview/data/undefinedpath.qml +++ b/tests/auto/declarative/qquickpathview/data/undefinedpath.qml diff --git a/tests/auto/declarative/qsgpathview/data/vdm.qml b/tests/auto/declarative/qquickpathview/data/vdm.qml index 839393d9bd..839393d9bd 100644 --- a/tests/auto/declarative/qsgpathview/data/vdm.qml +++ b/tests/auto/declarative/qquickpathview/data/vdm.qml diff --git a/tests/auto/declarative/qsgpathview/qsgpathview.pro b/tests/auto/declarative/qquickpathview/qquickpathview.pro index d4c237d168..d03cd4eec7 100644 --- a/tests/auto/declarative/qsgpathview/qsgpathview.pro +++ b/tests/auto/declarative/qquickpathview/qquickpathview.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgpathview +TARGET = tst_qquickpathview macx:CONFIG -= app_bundle -SOURCES += tst_qsgpathview.cpp +SOURCES += tst_qquickpathview.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp b/tests/auto/declarative/qquickpathview/tst_qquickpathview.cpp index c6440cf5ef..dc85f590e9 100644 --- a/tests/auto/declarative/qsgpathview/tst_qsgpathview.cpp +++ b/tests/auto/declarative/qquickpathview/tst_qquickpathview.cpp @@ -40,15 +40,15 @@ ****************************************************************************/ #include <QtTest/QtTest> -#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/private/qsgpathview_p.h> +#include <QtDeclarative/private/qquickpathview_p.h> #include <QtDeclarative/private/qdeclarativepath_p.h> -#include <QtDeclarative/private/qsgtext_p.h> -#include <QtDeclarative/private/qsgrectangle_p.h> +#include <QtDeclarative/private/qquicktext_p.h> +#include <QtDeclarative/private/qquickrectangle_p.h> #include <QtDeclarative/private/qdeclarativelistmodel_p.h> #include <QtDeclarative/private/qdeclarativevaluetype_p.h> #include <QAbstractListModel> @@ -77,11 +77,11 @@ static void initStandardTreeModel(QStandardItemModel *model) } -class tst_QSGPathView : public QObject +class tst_QQuickPathView : public QObject { Q_OBJECT public: - tst_QSGPathView(); + tst_QQuickPathView(); private slots: void initTestCase(); @@ -113,18 +113,18 @@ private slots: void creationContext(); private: - QSGView *createView(); + QQuickView *createView(); template<typename T> - T *findItem(QSGItem *parent, const QString &objectName, int index=-1); + T *findItem(QQuickItem *parent, const QString &objectName, int index=-1); template<typename T> - QList<T*> findItems(QSGItem *parent, const QString &objectName); + QList<T*> findItems(QQuickItem *parent, const QString &objectName); }; -void tst_QSGPathView::initTestCase() +void tst_QQuickPathView::initTestCase() { } -void tst_QSGPathView::cleanupTestCase() +void tst_QQuickPathView::cleanupTestCase() { } @@ -220,15 +220,15 @@ private: }; -tst_QSGPathView::tst_QSGPathView() +tst_QQuickPathView::tst_QQuickPathView() { } -void tst_QSGPathView::initValues() +void tst_QQuickPathView::initValues() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pathview1.qml"))); - QSGPathView *obj = qobject_cast<QSGPathView*>(c.create()); + QQuickPathView *obj = qobject_cast<QQuickPathView*>(c.create()); QVERIFY(obj != 0); QVERIFY(obj->path() == 0); @@ -242,9 +242,9 @@ void tst_QSGPathView::initValues() QCOMPARE(obj->pathItemCount(), -1); } -void tst_QSGPathView::items() +void tst_QQuickPathView::items() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); TestModel model; model.addItem("Fred", "12345"); @@ -258,7 +258,7 @@ void tst_QSGPathView::items() canvas->setSource(QUrl::fromLocalFile(TESTDATA("pathview0.qml"))); qApp->processEvents(); - QSGPathView *pathview = findItem<QSGPathView>(canvas->rootObject(), "view"); + QQuickPathView *pathview = findItem<QQuickPathView>(canvas->rootObject(), "view"); QVERIFY(pathview != 0); QCOMPARE(pathview->count(), model.count()); @@ -266,10 +266,10 @@ void tst_QSGPathView::items() QCOMPARE(pathview->childItems().count(), model.count()+1); // assumes all are visible, including highlight for (int i = 0; i < model.count(); ++i) { - QSGText *name = findItem<QSGText>(pathview, "textName", i); + QQuickText *name = findItem<QQuickText>(pathview, "textName", i); QVERIFY(name != 0); QCOMPARE(name->text(), model.name(i)); - QSGText *number = findItem<QSGText>(pathview, "textNumber", i); + QQuickText *number = findItem<QQuickText>(pathview, "textNumber", i); QVERIFY(number != 0); QCOMPARE(number->text(), model.number(i)); } @@ -287,11 +287,11 @@ void tst_QSGPathView::items() delete canvas; } -void tst_QSGPathView::pathview2() +void tst_QQuickPathView::pathview2() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pathview2.qml"))); - QSGPathView *obj = qobject_cast<QSGPathView*>(c.create()); + QQuickPathView *obj = qobject_cast<QQuickPathView*>(c.create()); QVERIFY(obj != 0); QVERIFY(obj->path() != 0); @@ -305,11 +305,11 @@ void tst_QSGPathView::pathview2() QCOMPARE(obj->pathItemCount(), 10); } -void tst_QSGPathView::pathview3() +void tst_QQuickPathView::pathview3() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pathview3.qml"))); - QSGPathView *obj = qobject_cast<QSGPathView*>(c.create()); + QQuickPathView *obj = qobject_cast<QQuickPathView*>(c.create()); QVERIFY(obj != 0); QVERIFY(obj->path() != 0); @@ -323,7 +323,7 @@ void tst_QSGPathView::pathview3() QCOMPARE(obj->pathItemCount(), 4); } -void tst_QSGPathView::path() +void tst_QQuickPathView::path() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("pathtest.qml"))); @@ -368,9 +368,9 @@ void tst_QSGPathView::path() QCOMPARE(cubic->control2Y(), 90.); } -void tst_QSGPathView::dataModel() +void tst_QQuickPathView::dataModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); QDeclarativeContext *ctxt = canvas->rootContext(); @@ -397,13 +397,13 @@ void tst_QSGPathView::dataModel() canvas->setSource(QUrl::fromLocalFile(TESTDATA("datamodel.qml"))); qApp->processEvents(); - QSGPathView *pathview = qobject_cast<QSGPathView*>(canvas->rootObject()); + QQuickPathView *pathview = qobject_cast<QQuickPathView*>(canvas->rootObject()); QVERIFY(pathview != 0); QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties"); QVERIFY(testObject->error() == false); - QSGItem *item = findItem<QSGItem>(pathview, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(pathview, "wrapper", 0); QVERIFY(item); QCOMPARE(item->x(), 110.0); QCOMPARE(item->y(), 10.0); @@ -412,67 +412,67 @@ void tst_QSGPathView::dataModel() QTest::qWait(100); QCOMPARE(canvas->rootObject()->property("viewCount").toInt(), model.count()); - QTRY_COMPARE(findItems<QSGItem>(pathview, "wrapper").count(), 14); + QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 14); QVERIFY(pathview->currentIndex() == 0); - QCOMPARE(pathview->currentItem(), findItem<QSGItem>(pathview, "wrapper", 0)); + QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 0)); - QSGText *text = findItem<QSGText>(pathview, "myText", 4); + QQuickText *text = findItem<QQuickText>(pathview, "myText", 4); QVERIFY(text); QCOMPARE(text->text(), model.name(4)); model.removeItem(2); QCOMPARE(canvas->rootObject()->property("viewCount").toInt(), model.count()); - text = findItem<QSGText>(pathview, "myText", 2); + text = findItem<QQuickText>(pathview, "myText", 2); QVERIFY(text); QCOMPARE(text->text(), model.name(2)); - QCOMPARE(pathview->currentItem(), findItem<QSGItem>(pathview, "wrapper", 0)); + QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 0)); testObject->setPathItemCount(5); QMetaObject::invokeMethod(canvas->rootObject(), "checkProperties"); QVERIFY(testObject->error() == false); - QTRY_COMPARE(findItems<QSGItem>(pathview, "wrapper").count(), 5); + QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5); - QSGRectangle *testItem = findItem<QSGRectangle>(pathview, "wrapper", 4); + QQuickRectangle *testItem = findItem<QQuickRectangle>(pathview, "wrapper", 4); QVERIFY(testItem != 0); - testItem = findItem<QSGRectangle>(pathview, "wrapper", 5); + testItem = findItem<QQuickRectangle>(pathview, "wrapper", 5); QVERIFY(testItem == 0); pathview->setCurrentIndex(1); - QCOMPARE(pathview->currentItem(), findItem<QSGItem>(pathview, "wrapper", 1)); + QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 1)); QTest::qWait(100); model.insertItem(2, "pink", "2"); QTest::qWait(100); - QTRY_COMPARE(findItems<QSGItem>(pathview, "wrapper").count(), 5); + QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5); QVERIFY(pathview->currentIndex() == 1); - QCOMPARE(pathview->currentItem(), findItem<QSGItem>(pathview, "wrapper", 1)); + QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 1)); - text = findItem<QSGText>(pathview, "myText", 2); + text = findItem<QQuickText>(pathview, "myText", 2); QVERIFY(text); QCOMPARE(text->text(), model.name(2)); model.removeItem(3); - QTRY_COMPARE(findItems<QSGItem>(pathview, "wrapper").count(), 5); - text = findItem<QSGText>(pathview, "myText", 3); + QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5); + text = findItem<QQuickText>(pathview, "myText", 3); QVERIFY(text); QCOMPARE(text->text(), model.name(3)); - QCOMPARE(pathview->currentItem(), findItem<QSGItem>(pathview, "wrapper", 1)); + QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 1)); model.moveItem(3, 5); - QTRY_COMPARE(findItems<QSGItem>(pathview, "wrapper").count(), 5); - QList<QSGItem*> items = findItems<QSGItem>(pathview, "wrapper"); - foreach (QSGItem *item, items) { + QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5); + QList<QQuickItem*> items = findItems<QQuickItem>(pathview, "wrapper"); + foreach (QQuickItem *item, items) { QVERIFY(item->property("onPath").toBool()); } - QCOMPARE(pathview->currentItem(), findItem<QSGItem>(pathview, "wrapper", 1)); + QCOMPARE(pathview->currentItem(), findItem<QQuickItem>(pathview, "wrapper", 1)); // QTBUG-14199 pathview->setOffset(7); pathview->setOffset(0); - QCOMPARE(findItems<QSGItem>(pathview, "wrapper").count(), 5); + QCOMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5); pathview->setCurrentIndex(model.count()-1); model.removeItem(model.count()-1); @@ -482,9 +482,9 @@ void tst_QSGPathView::dataModel() delete testObject; } -void tst_QSGPathView::pathMoved() +void tst_QQuickPathView::pathMoved() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -499,10 +499,10 @@ void tst_QSGPathView::pathMoved() canvas->setSource(QUrl::fromLocalFile(TESTDATA("pathview0.qml"))); qApp->processEvents(); - QSGPathView *pathview = findItem<QSGPathView>(canvas->rootObject(), "view"); + QQuickPathView *pathview = findItem<QQuickPathView>(canvas->rootObject(), "view"); QVERIFY(pathview != 0); - QSGRectangle *firstItem = findItem<QSGRectangle>(pathview, "wrapper", 0); + QQuickRectangle *firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0); QVERIFY(firstItem); QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path()); QVERIFY(path); @@ -514,7 +514,7 @@ void tst_QSGPathView::pathMoved() pathview->setOffset(1.0); for (int i=0; i<model.count(); i++) { - QSGRectangle *curItem = findItem<QSGRectangle>(pathview, "wrapper", i); + QQuickRectangle *curItem = findItem<QQuickRectangle>(pathview, "wrapper", i); QPointF itemPos(path->pointAt(0.25 + i*0.25)); QCOMPARE(curItem->pos() + offset, QPointF(qRound(itemPos.x()), qRound(itemPos.y()))); } @@ -539,9 +539,9 @@ void tst_QSGPathView::pathMoved() delete canvas; } -void tst_QSGPathView::setCurrentIndex() +void tst_QQuickPathView::setCurrentIndex() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); TestModel model; @@ -556,10 +556,10 @@ void tst_QSGPathView::setCurrentIndex() canvas->setSource(QUrl::fromLocalFile(TESTDATA("pathview0.qml"))); qApp->processEvents(); - QSGPathView *pathview = findItem<QSGPathView>(canvas->rootObject(), "view"); + QQuickPathView *pathview = findItem<QQuickPathView>(canvas->rootObject(), "view"); QVERIFY(pathview != 0); - QSGRectangle *firstItem = findItem<QSGRectangle>(pathview, "wrapper", 0); + QQuickRectangle *firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0); QVERIFY(firstItem); QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path()); QVERIFY(path); @@ -573,7 +573,7 @@ void tst_QSGPathView::setCurrentIndex() pathview->setCurrentIndex(2); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 2); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 2); QTRY_COMPARE(firstItem->pos() + offset, start); QCOMPARE(canvas->rootObject()->property("currentA").toInt(), 2); QCOMPARE(canvas->rootObject()->property("currentB").toInt(), 2); @@ -582,7 +582,7 @@ void tst_QSGPathView::setCurrentIndex() pathview->decrementCurrentIndex(); QTRY_COMPARE(pathview->currentIndex(), 1); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 1); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 1); QVERIFY(firstItem); QTRY_COMPARE(firstItem->pos() + offset, start); QCOMPARE(pathview->currentItem(), firstItem); @@ -590,7 +590,7 @@ void tst_QSGPathView::setCurrentIndex() pathview->decrementCurrentIndex(); QTRY_COMPARE(pathview->currentIndex(), 0); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 0); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0); QVERIFY(firstItem); QTRY_COMPARE(firstItem->pos() + offset, start); QCOMPARE(pathview->currentItem(), firstItem); @@ -598,7 +598,7 @@ void tst_QSGPathView::setCurrentIndex() pathview->decrementCurrentIndex(); QTRY_COMPARE(pathview->currentIndex(), 3); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 3); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 3); QVERIFY(firstItem); QTRY_COMPARE(firstItem->pos() + offset, start); QCOMPARE(pathview->currentItem(), firstItem); @@ -606,7 +606,7 @@ void tst_QSGPathView::setCurrentIndex() pathview->incrementCurrentIndex(); QTRY_COMPARE(pathview->currentIndex(), 0); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 0); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0); QVERIFY(firstItem); QTRY_COMPARE(firstItem->pos() + offset, start); QCOMPARE(pathview->currentItem(), firstItem); @@ -614,41 +614,41 @@ void tst_QSGPathView::setCurrentIndex() // Check the current item is still created when outside the bounds of pathItemCount. pathview->setPathItemCount(2); - pathview->setHighlightRangeMode(QSGPathView::NoHighlightRange); - QVERIFY(findItem<QSGRectangle>(pathview, "wrapper", 0)); - QVERIFY(findItem<QSGRectangle>(pathview, "wrapper", 1)); - QVERIFY(!findItem<QSGRectangle>(pathview, "wrapper", 2)); - QVERIFY(!findItem<QSGRectangle>(pathview, "wrapper", 3)); + pathview->setHighlightRangeMode(QQuickPathView::NoHighlightRange); + QVERIFY(findItem<QQuickRectangle>(pathview, "wrapper", 0)); + QVERIFY(findItem<QQuickRectangle>(pathview, "wrapper", 1)); + QVERIFY(!findItem<QQuickRectangle>(pathview, "wrapper", 2)); + QVERIFY(!findItem<QQuickRectangle>(pathview, "wrapper", 3)); pathview->setCurrentIndex(2); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 2); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 2); QCOMPARE(pathview->currentItem(), firstItem); QCOMPARE(firstItem->property("onPath"), QVariant(false)); pathview->decrementCurrentIndex(); QTRY_COMPARE(pathview->currentIndex(), 1); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 1); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 1); QVERIFY(firstItem); QCOMPARE(pathview->currentItem(), firstItem); QCOMPARE(firstItem->property("onPath"), QVariant(true)); pathview->decrementCurrentIndex(); QTRY_COMPARE(pathview->currentIndex(), 0); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 0); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0); QVERIFY(firstItem); QCOMPARE(pathview->currentItem(), firstItem); QCOMPARE(firstItem->property("onPath"), QVariant(true)); pathview->decrementCurrentIndex(); QTRY_COMPARE(pathview->currentIndex(), 3); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 3); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 3); QVERIFY(firstItem); QCOMPARE(pathview->currentItem(), firstItem); QCOMPARE(firstItem->property("onPath"), QVariant(false)); pathview->incrementCurrentIndex(); QTRY_COMPARE(pathview->currentIndex(), 0); - firstItem = findItem<QSGRectangle>(pathview, "wrapper", 0); + firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0); QVERIFY(firstItem); QCOMPARE(pathview->currentItem(), firstItem); QCOMPARE(firstItem->property("onPath"), QVariant(true)); @@ -656,9 +656,9 @@ void tst_QSGPathView::setCurrentIndex() delete canvas; } -void tst_QSGPathView::resetModel() +void tst_QQuickPathView::resetModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QStringList strings; strings << "one" << "two" << "three"; @@ -670,13 +670,13 @@ void tst_QSGPathView::resetModel() canvas->setSource(QUrl::fromLocalFile(TESTDATA("displaypath.qml"))); qApp->processEvents(); - QSGPathView *pathview = findItem<QSGPathView>(canvas->rootObject(), "view"); + QQuickPathView *pathview = findItem<QQuickPathView>(canvas->rootObject(), "view"); QVERIFY(pathview != 0); QCOMPARE(pathview->count(), model.rowCount()); for (int i = 0; i < model.rowCount(); ++i) { - QSGText *display = findItem<QSGText>(pathview, "displayText", i); + QQuickText *display = findItem<QQuickText>(pathview, "displayText", i); QVERIFY(display != 0); QCOMPARE(display->text(), strings.at(i)); } @@ -688,7 +688,7 @@ void tst_QSGPathView::resetModel() QCOMPARE(pathview->count(), model.rowCount()); for (int i = 0; i < model.rowCount(); ++i) { - QSGText *display = findItem<QSGText>(pathview, "displayText", i); + QQuickText *display = findItem<QQuickText>(pathview, "displayText", i); QVERIFY(display != 0); QCOMPARE(display->text(), strings.at(i)); } @@ -696,13 +696,13 @@ void tst_QSGPathView::resetModel() delete canvas; } -void tst_QSGPathView::propertyChanges() +void tst_QQuickPathView::propertyChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QVERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychanges.qml"))); - QSGPathView *pathView = canvas->rootObject()->findChild<QSGPathView*>("pathView"); + QQuickPathView *pathView = canvas->rootObject()->findChild<QQuickPathView*>("pathView"); QVERIFY(pathView); QSignalSpy snapPositionSpy(pathView, SIGNAL(preferredHighlightBeginChanged())); @@ -731,13 +731,13 @@ void tst_QSGPathView::propertyChanges() delete canvas; } -void tst_QSGPathView::pathChanges() +void tst_QQuickPathView::pathChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QVERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychanges.qml"))); - QSGPathView *pathView = canvas->rootObject()->findChild<QSGPathView*>("pathView"); + QQuickPathView *pathView = canvas->rootObject()->findChild<QQuickPathView*>("pathView"); QVERIFY(pathView); QDeclarativePath *path = canvas->rootObject()->findChild<QDeclarativePath*>("path"); @@ -793,13 +793,13 @@ void tst_QSGPathView::pathChanges() delete canvas; } -void tst_QSGPathView::componentChanges() +void tst_QQuickPathView::componentChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QVERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychanges.qml"))); - QSGPathView *pathView = canvas->rootObject()->findChild<QSGPathView*>("pathView"); + QQuickPathView *pathView = canvas->rootObject()->findChild<QQuickPathView*>("pathView"); QVERIFY(pathView); QDeclarativeComponent delegateComponent(canvas->engine()); @@ -816,13 +816,13 @@ void tst_QSGPathView::componentChanges() delete canvas; } -void tst_QSGPathView::modelChanges() +void tst_QQuickPathView::modelChanges() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QVERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychanges.qml"))); - QSGPathView *pathView = canvas->rootObject()->findChild<QSGPathView*>("pathView"); + QQuickPathView *pathView = canvas->rootObject()->findChild<QQuickPathView*>("pathView"); QVERIFY(pathView); QDeclarativeListModel *alternateModel = canvas->rootObject()->findChild<QDeclarativeListModel*>("alternateModel"); @@ -843,13 +843,13 @@ void tst_QSGPathView::modelChanges() delete canvas; } -void tst_QSGPathView::pathUpdateOnStartChanged() +void tst_QQuickPathView::pathUpdateOnStartChanged() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QVERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pathUpdateOnStartChanged.qml"))); - QSGPathView *pathView = canvas->rootObject()->findChild<QSGPathView*>("pathView"); + QQuickPathView *pathView = canvas->rootObject()->findChild<QQuickPathView*>("pathView"); QVERIFY(pathView); QDeclarativePath *path = canvas->rootObject()->findChild<QDeclarativePath*>("path"); @@ -857,7 +857,7 @@ void tst_QSGPathView::pathUpdateOnStartChanged() QCOMPARE(path->startX(), 400.0); QCOMPARE(path->startY(), 300.0); - QSGItem *item = findItem<QSGItem>(pathView, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(pathView, "wrapper", 0); QVERIFY(item); QCOMPARE(item->x(), path->startX() - item->width() / 2.0); QCOMPARE(item->y(), path->startY() - item->height() / 2.0); @@ -865,16 +865,16 @@ void tst_QSGPathView::pathUpdateOnStartChanged() delete canvas; } -void tst_QSGPathView::package() +void tst_QQuickPathView::package() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QVERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pathview_package.qml"))); - QSGPathView *pathView = canvas->rootObject()->findChild<QSGPathView*>("photoPathView"); + QQuickPathView *pathView = canvas->rootObject()->findChild<QQuickPathView*>("photoPathView"); QVERIFY(pathView); - QSGItem *item = findItem<QSGItem>(pathView, "pathItem"); + QQuickItem *item = findItem<QQuickItem>(pathView, "pathItem"); QVERIFY(item); QVERIFY(item->scale() != 1.0); @@ -882,9 +882,9 @@ void tst_QSGPathView::package() } //QTBUG-13017 -void tst_QSGPathView::emptyModel() +void tst_QQuickPathView::emptyModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QStringListModel model; @@ -894,7 +894,7 @@ void tst_QSGPathView::emptyModel() canvas->setSource(QUrl::fromLocalFile(TESTDATA("emptymodel.qml"))); qApp->processEvents(); - QSGPathView *pathview = qobject_cast<QSGPathView*>(canvas->rootObject()); + QQuickPathView *pathview = qobject_cast<QQuickPathView*>(canvas->rootObject()); QVERIFY(pathview != 0); QCOMPARE(pathview->offset(), qreal(0.0)); @@ -902,7 +902,7 @@ void tst_QSGPathView::emptyModel() delete canvas; } -void tst_QSGPathView::closed() +void tst_QQuickPathView::closed() { QDeclarativeEngine engine; @@ -924,28 +924,28 @@ void tst_QSGPathView::closed() } // QTBUG-14239 -void tst_QSGPathView::pathUpdate() +void tst_QQuickPathView::pathUpdate() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QVERIFY(canvas); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pathUpdate.qml"))); - QSGPathView *pathView = canvas->rootObject()->findChild<QSGPathView*>("pathView"); + QQuickPathView *pathView = canvas->rootObject()->findChild<QQuickPathView*>("pathView"); QVERIFY(pathView); - QSGItem *item = findItem<QSGItem>(pathView, "wrapper", 0); + QQuickItem *item = findItem<QQuickItem>(pathView, "wrapper", 0); QVERIFY(item); QCOMPARE(item->x(), 150.0); delete canvas; } -void tst_QSGPathView::visualDataModel() +void tst_QQuickPathView::visualDataModel() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("vdm.qml"))); - QSGPathView *obj = qobject_cast<QSGPathView*>(c.create()); + QQuickPathView *obj = qobject_cast<QQuickPathView*>(c.create()); QVERIFY(obj != 0); QCOMPARE(obj->count(), 3); @@ -953,12 +953,12 @@ void tst_QSGPathView::visualDataModel() delete obj; } -void tst_QSGPathView::undefinedPath() +void tst_QQuickPathView::undefinedPath() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("undefinedpath.qml"))); - QSGPathView *obj = qobject_cast<QSGPathView*>(c.create()); + QQuickPathView *obj = qobject_cast<QQuickPathView*>(c.create()); QVERIFY(obj != 0); QCOMPARE(obj->count(), 3); @@ -966,16 +966,16 @@ void tst_QSGPathView::undefinedPath() delete obj; } -void tst_QSGPathView::mouseDrag() +void tst_QQuickPathView::mouseDrag() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("dragpath.qml"))); canvas->show(); canvas->requestActivateWindow(); QTest::qWaitForWindowShown(canvas); QTRY_COMPARE(canvas, qGuiApp->focusWindow()); - QSGPathView *pathview = qobject_cast<QSGPathView*>(canvas->rootObject()); + QQuickPathView *pathview = qobject_cast<QQuickPathView*>(canvas->rootObject()); QVERIFY(pathview != 0); int current = pathview->currentIndex(); @@ -999,9 +999,9 @@ void tst_QSGPathView::mouseDrag() delete canvas; } -void tst_QSGPathView::treeModel() +void tst_QQuickPathView::treeModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->show(); QStandardItemModel model; @@ -1010,26 +1010,26 @@ void tst_QSGPathView::treeModel() canvas->setSource(QUrl::fromLocalFile(TESTDATA("treemodel.qml"))); - QSGPathView *pathview = qobject_cast<QSGPathView*>(canvas->rootObject()); + QQuickPathView *pathview = qobject_cast<QQuickPathView*>(canvas->rootObject()); QVERIFY(pathview != 0); QCOMPARE(pathview->count(), 3); - QSGText *item = findItem<QSGText>(pathview, "wrapper", 0); + QQuickText *item = findItem<QQuickText>(pathview, "wrapper", 0); QVERIFY(item); QCOMPARE(item->text(), QLatin1String("Row 1 Item")); QVERIFY(QMetaObject::invokeMethod(pathview, "setRoot", Q_ARG(QVariant, 1))); QCOMPARE(pathview->count(), 1); - QTRY_VERIFY(item = findItem<QSGText>(pathview, "wrapper", 0)); + QTRY_VERIFY(item = findItem<QQuickText>(pathview, "wrapper", 0)); QTRY_COMPARE(item->text(), QLatin1String("Row 2 Child Item")); delete canvas; } -void tst_QSGPathView::changePreferredHighlight() +void tst_QQuickPathView::changePreferredHighlight() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setGeometry(0,0,400,200); canvas->setSource(QUrl::fromLocalFile(TESTDATA("dragpath.qml"))); canvas->show(); @@ -1037,13 +1037,13 @@ void tst_QSGPathView::changePreferredHighlight() QTest::qWaitForWindowShown(canvas); QTRY_COMPARE(canvas, qGuiApp->focusWindow()); - QSGPathView *pathview = qobject_cast<QSGPathView*>(canvas->rootObject()); + QQuickPathView *pathview = qobject_cast<QQuickPathView*>(canvas->rootObject()); QVERIFY(pathview != 0); int current = pathview->currentIndex(); QCOMPARE(current, 0); - QSGRectangle *firstItem = findItem<QSGRectangle>(pathview, "wrapper", 0); + QQuickRectangle *firstItem = findItem<QQuickRectangle>(pathview, "wrapper", 0); QVERIFY(firstItem); QDeclarativePath *path = qobject_cast<QDeclarativePath*>(pathview->path()); QVERIFY(path); @@ -1066,24 +1066,24 @@ void tst_QSGPathView::changePreferredHighlight() delete canvas; } -void tst_QSGPathView::creationContext() +void tst_QQuickPathView::creationContext() { - QSGView canvas; + QQuickView canvas; canvas.setGeometry(0,0,240,320); canvas.setSource(QUrl::fromLocalFile(TESTDATA("creationContext.qml"))); - QSGItem *rootItem = qobject_cast<QSGItem *>(canvas.rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem *>(canvas.rootObject()); QVERIFY(rootItem); QVERIFY(rootItem->property("count").toInt() > 0); - QSGItem *item; - QVERIFY(item = findItem<QSGItem>(rootItem, "listItem", 0)); + QQuickItem *item; + QVERIFY(item = findItem<QQuickItem>(rootItem, "listItem", 0)); QCOMPARE(item->property("text").toString(), QString("Hello!")); } -QSGView *tst_QSGPathView::createView() +QQuickView *tst_QQuickPathView::createView() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); return canvas; @@ -1094,12 +1094,12 @@ QSGView *tst_QSGPathView::createView() item must also evaluate the {index} expression equal to index */ template<typename T> -T *tst_QSGPathView::findItem(QSGItem *parent, const QString &objectName, int index) +T *tst_QQuickPathView::findItem(QQuickItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -1121,13 +1121,13 @@ T *tst_QSGPathView::findItem(QSGItem *parent, const QString &objectName, int ind } template<typename T> -QList<T*> tst_QSGPathView::findItems(QSGItem *parent, const QString &objectName) +QList<T*> tst_QQuickPathView::findItems(QQuickItem *parent, const QString &objectName) { QList<T*> items; const QMetaObject &mo = T::staticMetaObject; - //qDebug() << parent->QSGItem::children().count() << "children"; + //qDebug() << parent->QQuickItem::children().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -1139,7 +1139,7 @@ QList<T*> tst_QSGPathView::findItems(QSGItem *parent, const QString &objectName) return items; } -void tst_QSGPathView::missingPercent() +void tst_QQuickPathView::missingPercent() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("missingPercent.qml"))); @@ -1150,6 +1150,6 @@ void tst_QSGPathView::missingPercent() } -QTEST_MAIN(tst_QSGPathView) +QTEST_MAIN(tst_QQuickPathView) -#include "tst_qsgpathview.moc" +#include "tst_qquickpathview.moc" diff --git a/tests/auto/declarative/qsgpincharea/data/pinchproperties.qml b/tests/auto/declarative/qquickpincharea/data/pinchproperties.qml index 44d116184e..44d116184e 100644 --- a/tests/auto/declarative/qsgpincharea/data/pinchproperties.qml +++ b/tests/auto/declarative/qquickpincharea/data/pinchproperties.qml diff --git a/tests/auto/declarative/qsgpincharea/qsgpincharea.pro b/tests/auto/declarative/qquickpincharea/qquickpincharea.pro index 628bbc7a88..df750fb2f6 100644 --- a/tests/auto/declarative/qsgpincharea/qsgpincharea.pro +++ b/tests/auto/declarative/qquickpincharea/qquickpincharea.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgpincharea +TARGET = tst_qquickpincharea macx:CONFIG -= app_bundle -SOURCES += tst_qsgpincharea.cpp +SOURCES += tst_qquickpincharea.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp b/tests/auto/declarative/qquickpincharea/tst_qquickpincharea.cpp index 24cdf90657..0d6126e671 100644 --- a/tests/auto/declarative/qsgpincharea/tst_qsgpincharea.cpp +++ b/tests/auto/declarative/qquickpincharea/tst_qquickpincharea.cpp @@ -41,13 +41,13 @@ #include <QtTest/QtTest> #include <QtTest/QSignalSpy> -#include <private/qsgpincharea_p.h> -#include <private/qsgrectangle_p.h> -#include <QtDeclarative/qsgview.h> +#include <private/qquickpincharea_p.h> +#include <private/qquickrectangle_p.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativecontext.h> #include "../shared/util.h" -class tst_QSGPinchArea: public QObject +class tst_QQuickPinchArea: public QObject { Q_OBJECT private slots: @@ -59,34 +59,34 @@ private slots: void retouch(); private: - QSGView *createView(); + QQuickView *createView(); }; -void tst_QSGPinchArea::initTestCase() +void tst_QQuickPinchArea::initTestCase() { } -void tst_QSGPinchArea::cleanupTestCase() +void tst_QQuickPinchArea::cleanupTestCase() { } -void tst_QSGPinchArea::pinchProperties() +void tst_QQuickPinchArea::pinchProperties() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pinchproperties.qml"))); canvas->show(); canvas->requestActivateWindow(); QVERIFY(canvas->rootObject() != 0); - QSGPinchArea *pinchArea = canvas->rootObject()->findChild<QSGPinchArea*>("pincharea"); - QSGPinch *pinch = pinchArea->pinch(); + QQuickPinchArea *pinchArea = canvas->rootObject()->findChild<QQuickPinchArea*>("pincharea"); + QQuickPinch *pinch = pinchArea->pinch(); QVERIFY(pinchArea != 0); QVERIFY(pinch != 0); // target - QSGItem *blackRect = canvas->rootObject()->findChild<QSGItem*>("blackrect"); + QQuickItem *blackRect = canvas->rootObject()->findChild<QQuickItem*>("blackrect"); QVERIFY(blackRect != 0); QVERIFY(blackRect == pinch->target()); - QSGItem *rootItem = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *rootItem = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(rootItem != 0); QSignalSpy targetSpy(pinch, SIGNAL(targetChanged())); pinch->setTarget(rootItem); @@ -95,12 +95,12 @@ void tst_QSGPinchArea::pinchProperties() QCOMPARE(targetSpy.count(),1); // axis - QCOMPARE(pinch->axis(), QSGPinch::XandYAxis); + QCOMPARE(pinch->axis(), QQuickPinch::XandYAxis); QSignalSpy axisSpy(pinch, SIGNAL(dragAxisChanged())); - pinch->setAxis(QSGPinch::XAxis); - QCOMPARE(pinch->axis(), QSGPinch::XAxis); + pinch->setAxis(QQuickPinch::XAxis); + QCOMPARE(pinch->axis(), QQuickPinch::XAxis); QCOMPARE(axisSpy.count(),1); - pinch->setAxis(QSGPinch::XAxis); + pinch->setAxis(QQuickPinch::XAxis); QCOMPARE(axisSpy.count(),1); // minimum and maximum drag properties @@ -186,7 +186,7 @@ void tst_QSGPinchArea::pinchProperties() delete canvas; } -QTouchEvent::TouchPoint makeTouchPoint(int id, QPoint p, QSGView *v, QSGItem *i) +QTouchEvent::TouchPoint makeTouchPoint(int id, QPoint p, QQuickView *v, QQuickItem *i) { QTouchEvent::TouchPoint touchPoint(id); touchPoint.setPos(i->mapFromScene(p)); @@ -195,9 +195,9 @@ QTouchEvent::TouchPoint makeTouchPoint(int id, QPoint p, QSGView *v, QSGItem *i) return touchPoint; } -void tst_QSGPinchArea::scale() +void tst_QQuickPinchArea::scale() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pinchproperties.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -205,16 +205,16 @@ void tst_QSGPinchArea::scale() QVERIFY(canvas->rootObject() != 0); qApp->processEvents(); - QSGPinchArea *pinchArea = canvas->rootObject()->findChild<QSGPinchArea*>("pincharea"); - QSGPinch *pinch = pinchArea->pinch(); + QQuickPinchArea *pinchArea = canvas->rootObject()->findChild<QQuickPinchArea*>("pincharea"); + QQuickPinch *pinch = pinchArea->pinch(); QVERIFY(pinchArea != 0); QVERIFY(pinch != 0); - QSGItem *root = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *root = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(root != 0); // target - QSGItem *blackRect = canvas->rootObject()->findChild<QSGItem*>("blackrect"); + QQuickItem *blackRect = canvas->rootObject()->findChild<QQuickItem*>("blackrect"); QVERIFY(blackRect != 0); QPoint p1(80, 80); @@ -248,9 +248,9 @@ void tst_QSGPinchArea::scale() delete canvas; } -void tst_QSGPinchArea::pan() +void tst_QQuickPinchArea::pan() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pinchproperties.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -258,16 +258,16 @@ void tst_QSGPinchArea::pan() QVERIFY(canvas->rootObject() != 0); qApp->processEvents(); - QSGPinchArea *pinchArea = canvas->rootObject()->findChild<QSGPinchArea*>("pincharea"); - QSGPinch *pinch = pinchArea->pinch(); + QQuickPinchArea *pinchArea = canvas->rootObject()->findChild<QQuickPinchArea*>("pincharea"); + QQuickPinch *pinch = pinchArea->pinch(); QVERIFY(pinchArea != 0); QVERIFY(pinch != 0); - QSGItem *root = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *root = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(root != 0); // target - QSGItem *blackRect = canvas->rootObject()->findChild<QSGItem*>("blackrect"); + QQuickItem *blackRect = canvas->rootObject()->findChild<QQuickItem*>("blackrect"); QVERIFY(blackRect != 0); QPoint p1(80, 80); @@ -304,9 +304,9 @@ void tst_QSGPinchArea::pan() } // test pinch, release one point, touch again to continue pinch -void tst_QSGPinchArea::retouch() +void tst_QQuickPinchArea::retouch() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); canvas->setSource(QUrl::fromLocalFile(TESTDATA("pinchproperties.qml"))); canvas->show(); canvas->requestActivateWindow(); @@ -314,19 +314,19 @@ void tst_QSGPinchArea::retouch() QVERIFY(canvas->rootObject() != 0); qApp->processEvents(); - QSGPinchArea *pinchArea = canvas->rootObject()->findChild<QSGPinchArea*>("pincharea"); - QSGPinch *pinch = pinchArea->pinch(); + QQuickPinchArea *pinchArea = canvas->rootObject()->findChild<QQuickPinchArea*>("pincharea"); + QQuickPinch *pinch = pinchArea->pinch(); QVERIFY(pinchArea != 0); QVERIFY(pinch != 0); - QSGItem *root = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *root = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(root != 0); - QSignalSpy startedSpy(pinchArea, SIGNAL(pinchStarted(QSGPinchEvent *))); - QSignalSpy finishedSpy(pinchArea, SIGNAL(pinchFinished(QSGPinchEvent *))); + QSignalSpy startedSpy(pinchArea, SIGNAL(pinchStarted(QQuickPinchEvent *))); + QSignalSpy finishedSpy(pinchArea, SIGNAL(pinchFinished(QQuickPinchEvent *))); // target - QSGItem *blackRect = canvas->rootObject()->findChild<QSGItem*>("blackrect"); + QQuickItem *blackRect = canvas->rootObject()->findChild<QQuickItem*>("blackrect"); QVERIFY(blackRect != 0); QPoint p1(80, 80); @@ -382,14 +382,14 @@ void tst_QSGPinchArea::retouch() } -QSGView *tst_QSGPinchArea::createView() +QQuickView *tst_QQuickPinchArea::createView() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); return canvas; } -QTEST_MAIN(tst_QSGPinchArea) +QTEST_MAIN(tst_QQuickPinchArea) -#include "tst_qsgpincharea.moc" +#include "tst_qquickpincharea.moc" diff --git a/tests/auto/declarative/qsgpositioners/data/allInvisible.qml b/tests/auto/declarative/qquickpositioners/data/allInvisible.qml index 5894171434..5894171434 100644 --- a/tests/auto/declarative/qsgpositioners/data/allInvisible.qml +++ b/tests/auto/declarative/qquickpositioners/data/allInvisible.qml diff --git a/tests/auto/declarative/qsgpositioners/data/attachedproperties-column.qml b/tests/auto/declarative/qquickpositioners/data/attachedproperties-column.qml index 4c667aa205..4c667aa205 100644 --- a/tests/auto/declarative/qsgpositioners/data/attachedproperties-column.qml +++ b/tests/auto/declarative/qquickpositioners/data/attachedproperties-column.qml diff --git a/tests/auto/declarative/qsgpositioners/data/attachedproperties-dynamic.qml b/tests/auto/declarative/qquickpositioners/data/attachedproperties-dynamic.qml index 894749dc16..894749dc16 100644 --- a/tests/auto/declarative/qsgpositioners/data/attachedproperties-dynamic.qml +++ b/tests/auto/declarative/qquickpositioners/data/attachedproperties-dynamic.qml diff --git a/tests/auto/declarative/qsgpositioners/data/attachedproperties-flow.qml b/tests/auto/declarative/qquickpositioners/data/attachedproperties-flow.qml index e7f9a63e2a..e7f9a63e2a 100644 --- a/tests/auto/declarative/qsgpositioners/data/attachedproperties-flow.qml +++ b/tests/auto/declarative/qquickpositioners/data/attachedproperties-flow.qml diff --git a/tests/auto/declarative/qsgpositioners/data/attachedproperties-grid.qml b/tests/auto/declarative/qquickpositioners/data/attachedproperties-grid.qml index 2094309b9f..2094309b9f 100644 --- a/tests/auto/declarative/qsgpositioners/data/attachedproperties-grid.qml +++ b/tests/auto/declarative/qquickpositioners/data/attachedproperties-grid.qml diff --git a/tests/auto/declarative/qsgpositioners/data/attachedproperties-row.qml b/tests/auto/declarative/qquickpositioners/data/attachedproperties-row.qml index 212a26b431..212a26b431 100644 --- a/tests/auto/declarative/qsgpositioners/data/attachedproperties-row.qml +++ b/tests/auto/declarative/qquickpositioners/data/attachedproperties-row.qml diff --git a/tests/auto/declarative/qsgpositioners/data/flow-testimplicitsize.qml b/tests/auto/declarative/qquickpositioners/data/flow-testimplicitsize.qml index c32b78676c..c32b78676c 100644 --- a/tests/auto/declarative/qsgpositioners/data/flow-testimplicitsize.qml +++ b/tests/auto/declarative/qquickpositioners/data/flow-testimplicitsize.qml diff --git a/tests/auto/declarative/qsgpositioners/data/flowtest-toptobottom.qml b/tests/auto/declarative/qquickpositioners/data/flowtest-toptobottom.qml index a7d3ee13c7..a7d3ee13c7 100644 --- a/tests/auto/declarative/qsgpositioners/data/flowtest-toptobottom.qml +++ b/tests/auto/declarative/qquickpositioners/data/flowtest-toptobottom.qml diff --git a/tests/auto/declarative/qsgpositioners/data/flowtest.qml b/tests/auto/declarative/qquickpositioners/data/flowtest.qml index 40b042dd79..40b042dd79 100644 --- a/tests/auto/declarative/qsgpositioners/data/flowtest.qml +++ b/tests/auto/declarative/qquickpositioners/data/flowtest.qml diff --git a/tests/auto/declarative/qsgpositioners/data/grid-animated.qml b/tests/auto/declarative/qquickpositioners/data/grid-animated.qml index b8ee8f9a52..b8ee8f9a52 100644 --- a/tests/auto/declarative/qsgpositioners/data/grid-animated.qml +++ b/tests/auto/declarative/qquickpositioners/data/grid-animated.qml diff --git a/tests/auto/declarative/qsgpositioners/data/grid-row-column-spacing.qml b/tests/auto/declarative/qquickpositioners/data/grid-row-column-spacing.qml index 49bbd337e7..49bbd337e7 100644 --- a/tests/auto/declarative/qsgpositioners/data/grid-row-column-spacing.qml +++ b/tests/auto/declarative/qquickpositioners/data/grid-row-column-spacing.qml diff --git a/tests/auto/declarative/qsgpositioners/data/grid-spacing.qml b/tests/auto/declarative/qquickpositioners/data/grid-spacing.qml index 535a39037f..535a39037f 100644 --- a/tests/auto/declarative/qsgpositioners/data/grid-spacing.qml +++ b/tests/auto/declarative/qquickpositioners/data/grid-spacing.qml diff --git a/tests/auto/declarative/qsgpositioners/data/grid-toptobottom.qml b/tests/auto/declarative/qquickpositioners/data/grid-toptobottom.qml index 45559aab5d..45559aab5d 100644 --- a/tests/auto/declarative/qsgpositioners/data/grid-toptobottom.qml +++ b/tests/auto/declarative/qquickpositioners/data/grid-toptobottom.qml diff --git a/tests/auto/declarative/qsgpositioners/data/gridtest.qml b/tests/auto/declarative/qquickpositioners/data/gridtest.qml index 50bec1377b..50bec1377b 100644 --- a/tests/auto/declarative/qsgpositioners/data/gridtest.qml +++ b/tests/auto/declarative/qquickpositioners/data/gridtest.qml diff --git a/tests/auto/declarative/qsgpositioners/data/gridzerocolumns.qml b/tests/auto/declarative/qquickpositioners/data/gridzerocolumns.qml index a252f279c3..a252f279c3 100644 --- a/tests/auto/declarative/qsgpositioners/data/gridzerocolumns.qml +++ b/tests/auto/declarative/qquickpositioners/data/gridzerocolumns.qml diff --git a/tests/auto/declarative/qsgpositioners/data/horizontal-animated-disabled.qml b/tests/auto/declarative/qquickpositioners/data/horizontal-animated-disabled.qml index 8723ffc78f..8723ffc78f 100644 --- a/tests/auto/declarative/qsgpositioners/data/horizontal-animated-disabled.qml +++ b/tests/auto/declarative/qquickpositioners/data/horizontal-animated-disabled.qml diff --git a/tests/auto/declarative/qsgpositioners/data/horizontal-animated.qml b/tests/auto/declarative/qquickpositioners/data/horizontal-animated.qml index a88c26b66c..a88c26b66c 100644 --- a/tests/auto/declarative/qsgpositioners/data/horizontal-animated.qml +++ b/tests/auto/declarative/qquickpositioners/data/horizontal-animated.qml diff --git a/tests/auto/declarative/qsgpositioners/data/horizontal-spacing.qml b/tests/auto/declarative/qquickpositioners/data/horizontal-spacing.qml index c6ff75ac6b..c6ff75ac6b 100644 --- a/tests/auto/declarative/qsgpositioners/data/horizontal-spacing.qml +++ b/tests/auto/declarative/qquickpositioners/data/horizontal-spacing.qml diff --git a/tests/auto/declarative/qsgpositioners/data/horizontal.qml b/tests/auto/declarative/qquickpositioners/data/horizontal.qml index 235ee78c9b..235ee78c9b 100644 --- a/tests/auto/declarative/qsgpositioners/data/horizontal.qml +++ b/tests/auto/declarative/qquickpositioners/data/horizontal.qml diff --git a/tests/auto/declarative/qsgpositioners/data/propertychangestest.qml b/tests/auto/declarative/qquickpositioners/data/propertychangestest.qml index c9fd62b012..c9fd62b012 100644 --- a/tests/auto/declarative/qsgpositioners/data/propertychangestest.qml +++ b/tests/auto/declarative/qquickpositioners/data/propertychangestest.qml diff --git a/tests/auto/declarative/qsgpositioners/data/rectangleComponent.qml b/tests/auto/declarative/qquickpositioners/data/rectangleComponent.qml index de1bb99593..de1bb99593 100644 --- a/tests/auto/declarative/qsgpositioners/data/rectangleComponent.qml +++ b/tests/auto/declarative/qquickpositioners/data/rectangleComponent.qml diff --git a/tests/auto/declarative/qsgpositioners/data/repeatertest.qml b/tests/auto/declarative/qquickpositioners/data/repeatertest.qml index d90e1cf160..d90e1cf160 100644 --- a/tests/auto/declarative/qsgpositioners/data/repeatertest.qml +++ b/tests/auto/declarative/qquickpositioners/data/repeatertest.qml diff --git a/tests/auto/declarative/qsgpositioners/data/vertical-animated.qml b/tests/auto/declarative/qquickpositioners/data/vertical-animated.qml index ecf593cd70..ecf593cd70 100644 --- a/tests/auto/declarative/qsgpositioners/data/vertical-animated.qml +++ b/tests/auto/declarative/qquickpositioners/data/vertical-animated.qml diff --git a/tests/auto/declarative/qsgpositioners/data/vertical-spacing.qml b/tests/auto/declarative/qquickpositioners/data/vertical-spacing.qml index 7087961651..7087961651 100644 --- a/tests/auto/declarative/qsgpositioners/data/vertical-spacing.qml +++ b/tests/auto/declarative/qquickpositioners/data/vertical-spacing.qml diff --git a/tests/auto/declarative/qsgpositioners/data/vertical.qml b/tests/auto/declarative/qquickpositioners/data/vertical.qml index 0c3a81f008..0c3a81f008 100644 --- a/tests/auto/declarative/qsgpositioners/data/vertical.qml +++ b/tests/auto/declarative/qquickpositioners/data/vertical.qml diff --git a/tests/auto/declarative/qsgpositioners/qsgpositioners.pro b/tests/auto/declarative/qquickpositioners/qquickpositioners.pro index d0ecbd677c..eee9eca97a 100644 --- a/tests/auto/declarative/qsgpositioners/qsgpositioners.pro +++ b/tests/auto/declarative/qquickpositioners/qquickpositioners.pro @@ -1,6 +1,6 @@ CONFIG += testcase -TARGET = tst_qsgpositioners -SOURCES += tst_qsgpositioners.cpp +TARGET = tst_qquickpositioners +SOURCES += tst_qquickpositioners.cpp macx:CONFIG -= app_bundle testDataFiles.files = data diff --git a/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp b/tests/auto/declarative/qquickpositioners/tst_qquickpositioners.cpp index 22a33869fc..1d3ccabbf5 100644 --- a/tests/auto/declarative/qsgpositioners/tst_qsgpositioners.cpp +++ b/tests/auto/declarative/qquickpositioners/tst_qquickpositioners.cpp @@ -40,20 +40,20 @@ ****************************************************************************/ #include <QtTest/QtTest> #include <private/qlistmodelinterface_p.h> -#include <qsgview.h> +#include <qquickview.h> #include <qdeclarativeengine.h> -#include <private/qsgrectangle_p.h> -#include <private/qsgpositioners_p.h> +#include <private/qquickrectangle_p.h> +#include <private/qquickpositioners_p.h> #include <private/qdeclarativetransition_p.h> -#include <private/qsgitem_p.h> +#include <private/qquickitem_p.h> #include <qdeclarativeexpression.h> #include "../shared/util.h" -class tst_qsgpositioners : public QObject +class tst_qquickpositioners : public QObject { Q_OBJECT public: - tst_qsgpositioners(); + tst_qquickpositioners(); private slots: void test_horizontal(); @@ -90,26 +90,26 @@ private slots: void test_attachedproperties_dynamic(); private: - QSGView *createView(const QString &filename, bool wait=true); + QQuickView *createView(const QString &filename, bool wait=true); }; -tst_qsgpositioners::tst_qsgpositioners() +tst_qquickpositioners::tst_qquickpositioners() { } -void tst_qsgpositioners::test_horizontal() +void tst_qquickpositioners::test_horizontal() { - QSGView *canvas = createView(TESTDATA("horizontal.qml")); + QQuickView *canvas = createView(TESTDATA("horizontal.qml")); canvas->rootObject()->setProperty("testRightToLeft", false); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -119,26 +119,26 @@ void tst_qsgpositioners::test_horizontal() QCOMPARE(three->x(), 70.0); QCOMPARE(three->y(), 0.0); - QSGItem *row = canvas->rootObject()->findChild<QSGItem*>("row"); + QQuickItem *row = canvas->rootObject()->findChild<QQuickItem*>("row"); QCOMPARE(row->width(), 110.0); QCOMPARE(row->height(), 50.0); delete canvas; } -void tst_qsgpositioners::test_horizontal_rtl() +void tst_qquickpositioners::test_horizontal_rtl() { - QSGView *canvas = createView(TESTDATA("horizontal.qml")); + QQuickView *canvas = createView(TESTDATA("horizontal.qml")); canvas->rootObject()->setProperty("testRightToLeft", true); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 60.0); @@ -148,7 +148,7 @@ void tst_qsgpositioners::test_horizontal_rtl() QCOMPARE(three->x(), 0.0); QCOMPARE(three->y(), 0.0); - QSGItem *row = canvas->rootObject()->findChild<QSGItem*>("row"); + QQuickItem *row = canvas->rootObject()->findChild<QQuickItem*>("row"); QCOMPARE(row->width(), 110.0); QCOMPARE(row->height(), 50.0); @@ -164,19 +164,19 @@ void tst_qsgpositioners::test_horizontal_rtl() delete canvas; } -void tst_qsgpositioners::test_horizontal_spacing() +void tst_qquickpositioners::test_horizontal_spacing() { - QSGView *canvas = createView(TESTDATA("horizontal-spacing.qml")); + QQuickView *canvas = createView(TESTDATA("horizontal-spacing.qml")); canvas->rootObject()->setProperty("testRightToLeft", false); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -186,26 +186,26 @@ void tst_qsgpositioners::test_horizontal_spacing() QCOMPARE(three->x(), 90.0); QCOMPARE(three->y(), 0.0); - QSGItem *row = canvas->rootObject()->findChild<QSGItem*>("row"); + QQuickItem *row = canvas->rootObject()->findChild<QQuickItem*>("row"); QCOMPARE(row->width(), 130.0); QCOMPARE(row->height(), 50.0); delete canvas; } -void tst_qsgpositioners::test_horizontal_spacing_rightToLeft() +void tst_qquickpositioners::test_horizontal_spacing_rightToLeft() { - QSGView *canvas = createView(TESTDATA("horizontal-spacing.qml")); + QQuickView *canvas = createView(TESTDATA("horizontal-spacing.qml")); canvas->rootObject()->setProperty("testRightToLeft", true); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 80.0); @@ -215,26 +215,26 @@ void tst_qsgpositioners::test_horizontal_spacing_rightToLeft() QCOMPARE(three->x(), 00.0); QCOMPARE(three->y(), 0.0); - QSGItem *row = canvas->rootObject()->findChild<QSGItem*>("row"); + QQuickItem *row = canvas->rootObject()->findChild<QQuickItem*>("row"); QCOMPARE(row->width(), 130.0); QCOMPARE(row->height(), 50.0); delete canvas; } -void tst_qsgpositioners::test_horizontal_animated() +void tst_qquickpositioners::test_horizontal_animated() { - QSGView *canvas = createView(TESTDATA("horizontal-animated.qml"), false); + QQuickView *canvas = createView(TESTDATA("horizontal-animated.qml"), false); canvas->rootObject()->setProperty("testRightToLeft", false); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); //Note that they animate in @@ -244,7 +244,7 @@ void tst_qsgpositioners::test_horizontal_animated() QTest::qWaitForWindowShown(canvas); //It may not relayout until the next frame, so it needs to be drawn - QSGItem *row = canvas->rootObject()->findChild<QSGItem*>("row"); + QQuickItem *row = canvas->rootObject()->findChild<QQuickItem*>("row"); QVERIFY(row); QCOMPARE(row->width(), 100.0); QCOMPARE(row->height(), 50.0); @@ -276,19 +276,19 @@ void tst_qsgpositioners::test_horizontal_animated() delete canvas; } -void tst_qsgpositioners::test_horizontal_animated_rightToLeft() +void tst_qquickpositioners::test_horizontal_animated_rightToLeft() { - QSGView *canvas = createView(TESTDATA("horizontal-animated.qml"), false); + QQuickView *canvas = createView(TESTDATA("horizontal-animated.qml"), false); canvas->rootObject()->setProperty("testRightToLeft", true); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); //Note that they animate in @@ -298,7 +298,7 @@ void tst_qsgpositioners::test_horizontal_animated_rightToLeft() QTest::qWaitForWindowShown(canvas); //It may not relayout until the next frame, so it needs to be drawn - QSGItem *row = canvas->rootObject()->findChild<QSGItem*>("row"); + QQuickItem *row = canvas->rootObject()->findChild<QQuickItem*>("row"); QVERIFY(row); QCOMPARE(row->width(), 100.0); QCOMPARE(row->height(), 50.0); @@ -332,20 +332,20 @@ void tst_qsgpositioners::test_horizontal_animated_rightToLeft() delete canvas; } -void tst_qsgpositioners::test_horizontal_animated_disabled() +void tst_qquickpositioners::test_horizontal_animated_disabled() { - QSGView *canvas = createView(TESTDATA("horizontal-animated-disabled.qml")); + QQuickView *canvas = createView(TESTDATA("horizontal-animated-disabled.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGItem *row = canvas->rootObject()->findChild<QSGItem*>("row"); + QQuickItem *row = canvas->rootObject()->findChild<QQuickItem*>("row"); QVERIFY(row); qApp->processEvents(); @@ -372,17 +372,17 @@ void tst_qsgpositioners::test_horizontal_animated_disabled() delete canvas; } -void tst_qsgpositioners::test_vertical() +void tst_qquickpositioners::test_vertical() { - QSGView *canvas = createView(TESTDATA("vertical.qml")); + QQuickView *canvas = createView(TESTDATA("vertical.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -392,7 +392,7 @@ void tst_qsgpositioners::test_vertical() QCOMPARE(three->x(), 0.0); QCOMPARE(three->y(), 60.0); - QSGItem *column = canvas->rootObject()->findChild<QSGItem*>("column"); + QQuickItem *column = canvas->rootObject()->findChild<QQuickItem*>("column"); QVERIFY(column); QCOMPARE(column->height(), 80.0); QCOMPARE(column->width(), 50.0); @@ -400,17 +400,17 @@ void tst_qsgpositioners::test_vertical() delete canvas; } -void tst_qsgpositioners::test_vertical_spacing() +void tst_qquickpositioners::test_vertical_spacing() { - QSGView *canvas = createView(TESTDATA("vertical-spacing.qml")); + QQuickView *canvas = createView(TESTDATA("vertical-spacing.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -420,33 +420,33 @@ void tst_qsgpositioners::test_vertical_spacing() QCOMPARE(three->x(), 0.0); QCOMPARE(three->y(), 80.0); - QSGItem *column = canvas->rootObject()->findChild<QSGItem*>("column"); + QQuickItem *column = canvas->rootObject()->findChild<QQuickItem*>("column"); QCOMPARE(column->height(), 100.0); QCOMPARE(column->width(), 50.0); delete canvas; } -void tst_qsgpositioners::test_vertical_animated() +void tst_qquickpositioners::test_vertical_animated() { - QSGView *canvas = createView(TESTDATA("vertical-animated.qml"), false); + QQuickView *canvas = createView(TESTDATA("vertical-animated.qml"), false); //Note that they animate in - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); QCOMPARE(one->y(), -100.0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); QCOMPARE(two->y(), -100.0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(three->y(), -100.0); QTest::qWaitForWindowShown(canvas); //It may not relayout until the next frame, so it needs to be drawn - QSGItem *column = canvas->rootObject()->findChild<QSGItem*>("column"); + QQuickItem *column = canvas->rootObject()->findChild<QQuickItem*>("column"); QVERIFY(column); QCOMPARE(column->height(), 100.0); QCOMPARE(column->width(), 50.0); @@ -477,19 +477,19 @@ void tst_qsgpositioners::test_vertical_animated() delete canvas; } -void tst_qsgpositioners::test_grid() +void tst_qquickpositioners::test_grid() { - QSGView *canvas = createView(TESTDATA("gridtest.qml")); + QQuickView *canvas = createView(TESTDATA("gridtest.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -503,27 +503,27 @@ void tst_qsgpositioners::test_grid() QCOMPARE(five->x(), 50.0); QCOMPARE(five->y(), 50.0); - QSGGrid *grid = canvas->rootObject()->findChild<QSGGrid*>("grid"); - QCOMPARE(grid->flow(), QSGGrid::LeftToRight); + QQuickGrid *grid = canvas->rootObject()->findChild<QQuickGrid*>("grid"); + QCOMPARE(grid->flow(), QQuickGrid::LeftToRight); QCOMPARE(grid->width(), 100.0); QCOMPARE(grid->height(), 100.0); delete canvas; } -void tst_qsgpositioners::test_grid_topToBottom() +void tst_qquickpositioners::test_grid_topToBottom() { - QSGView *canvas = createView(TESTDATA("grid-toptobottom.qml")); + QQuickView *canvas = createView(TESTDATA("grid-toptobottom.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -537,29 +537,29 @@ void tst_qsgpositioners::test_grid_topToBottom() QCOMPARE(five->x(), 50.0); QCOMPARE(five->y(), 50.0); - QSGGrid *grid = canvas->rootObject()->findChild<QSGGrid*>("grid"); - QCOMPARE(grid->flow(), QSGGrid::TopToBottom); + QQuickGrid *grid = canvas->rootObject()->findChild<QQuickGrid*>("grid"); + QCOMPARE(grid->flow(), QQuickGrid::TopToBottom); QCOMPARE(grid->width(), 100.0); QCOMPARE(grid->height(), 120.0); delete canvas; } -void tst_qsgpositioners::test_grid_rightToLeft() +void tst_qquickpositioners::test_grid_rightToLeft() { - QSGView *canvas = createView(TESTDATA("gridtest.qml")); + QQuickView *canvas = createView(TESTDATA("gridtest.qml")); canvas->rootObject()->setProperty("testRightToLeft", true); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 50.0); @@ -573,7 +573,7 @@ void tst_qsgpositioners::test_grid_rightToLeft() QCOMPARE(five->x(), 40.0); QCOMPARE(five->y(), 50.0); - QSGGrid *grid = canvas->rootObject()->findChild<QSGGrid*>("grid"); + QQuickGrid *grid = canvas->rootObject()->findChild<QQuickGrid*>("grid"); QCOMPARE(grid->layoutDirection(), Qt::RightToLeft); QCOMPARE(grid->width(), 100.0); QCOMPARE(grid->height(), 100.0); @@ -594,19 +594,19 @@ void tst_qsgpositioners::test_grid_rightToLeft() delete canvas; } -void tst_qsgpositioners::test_grid_spacing() +void tst_qquickpositioners::test_grid_spacing() { - QSGView *canvas = createView(TESTDATA("grid-spacing.qml")); + QQuickView *canvas = createView(TESTDATA("grid-spacing.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -620,26 +620,26 @@ void tst_qsgpositioners::test_grid_spacing() QCOMPARE(five->x(), 54.0); QCOMPARE(five->y(), 54.0); - QSGItem *grid = canvas->rootObject()->findChild<QSGItem*>("grid"); + QQuickItem *grid = canvas->rootObject()->findChild<QQuickItem*>("grid"); QCOMPARE(grid->width(), 128.0); QCOMPARE(grid->height(), 104.0); delete canvas; } -void tst_qsgpositioners::test_grid_row_column_spacing() +void tst_qquickpositioners::test_grid_row_column_spacing() { - QSGView *canvas = createView(TESTDATA("grid-row-column-spacing.qml")); + QQuickView *canvas = createView(TESTDATA("grid-row-column-spacing.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -653,48 +653,48 @@ void tst_qsgpositioners::test_grid_row_column_spacing() QCOMPARE(five->x(), 61.0); QCOMPARE(five->y(), 57.0); - QSGItem *grid = canvas->rootObject()->findChild<QSGItem*>("grid"); + QQuickItem *grid = canvas->rootObject()->findChild<QQuickItem*>("grid"); QCOMPARE(grid->width(), 142.0); QCOMPARE(grid->height(), 107.0); delete canvas; } -void tst_qsgpositioners::test_grid_animated() +void tst_qquickpositioners::test_grid_animated() { - QSGView *canvas = createView(TESTDATA("grid-animated.qml"), false); + QQuickView *canvas = createView(TESTDATA("grid-animated.qml"), false); canvas->rootObject()->setProperty("testRightToLeft", false); //Note that all animate in - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); QCOMPARE(one->x(), -100.0); QCOMPARE(one->y(), -100.0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); QCOMPARE(two->x(), -100.0); QCOMPARE(two->y(), -100.0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(three->x(), -100.0); QCOMPARE(three->y(), -100.0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); QCOMPARE(four->x(), -100.0); QCOMPARE(four->y(), -100.0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(five->x(), -100.0); QCOMPARE(five->y(), -100.0); QTest::qWaitForWindowShown(canvas); //It may not relayout until the next frame, so it needs to be drawn - QSGItem *grid = canvas->rootObject()->findChild<QSGItem*>("grid"); + QQuickItem *grid = canvas->rootObject()->findChild<QQuickItem*>("grid"); QVERIFY(grid); QCOMPARE(grid->width(), 150.0); QCOMPARE(grid->height(), 100.0); @@ -745,41 +745,41 @@ void tst_qsgpositioners::test_grid_animated() delete canvas; } -void tst_qsgpositioners::test_grid_animated_rightToLeft() +void tst_qquickpositioners::test_grid_animated_rightToLeft() { - QSGView *canvas = createView(TESTDATA("grid-animated.qml"), false); + QQuickView *canvas = createView(TESTDATA("grid-animated.qml"), false); canvas->rootObject()->setProperty("testRightToLeft", true); //Note that all animate in - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); QCOMPARE(one->x(), -100.0); QCOMPARE(one->y(), -100.0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); QCOMPARE(two->x(), -100.0); QCOMPARE(two->y(), -100.0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(three->x(), -100.0); QCOMPARE(three->y(), -100.0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); QCOMPARE(four->x(), -100.0); QCOMPARE(four->y(), -100.0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(five->x(), -100.0); QCOMPARE(five->y(), -100.0); QTest::qWaitForWindowShown(canvas); //It may not relayout until the next frame, so it needs to be drawn - QSGItem *grid = canvas->rootObject()->findChild<QSGItem*>("grid"); + QQuickItem *grid = canvas->rootObject()->findChild<QQuickItem*>("grid"); QVERIFY(grid); QCOMPARE(grid->width(), 150.0); QCOMPARE(grid->height(), 100.0); @@ -830,19 +830,19 @@ void tst_qsgpositioners::test_grid_animated_rightToLeft() delete canvas; } -void tst_qsgpositioners::test_grid_zero_columns() +void tst_qquickpositioners::test_grid_zero_columns() { - QSGView *canvas = createView(TESTDATA("gridzerocolumns.qml")); + QQuickView *canvas = createView(TESTDATA("gridzerocolumns.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -856,18 +856,18 @@ void tst_qsgpositioners::test_grid_zero_columns() QCOMPARE(five->x(), 0.0); QCOMPARE(five->y(), 50.0); - QSGItem *grid = canvas->rootObject()->findChild<QSGItem*>("grid"); + QQuickItem *grid = canvas->rootObject()->findChild<QQuickItem*>("grid"); QCOMPARE(grid->width(), 170.0); QCOMPARE(grid->height(), 60.0); delete canvas; } -void tst_qsgpositioners::test_propertychanges() +void tst_qquickpositioners::test_propertychanges() { - QSGView *canvas = createView(TESTDATA("propertychangestest.qml")); + QQuickView *canvas = createView(TESTDATA("propertychangestest.qml")); - QSGGrid *grid = qobject_cast<QSGGrid*>(canvas->rootObject()); + QQuickGrid *grid = qobject_cast<QQuickGrid*>(canvas->rootObject()); QVERIFY(grid != 0); QDeclarativeTransition *rowTransition = canvas->rootObject()->findChild<QDeclarativeTransition*>("rowTransition"); QDeclarativeTransition *columnTransition = canvas->rootObject()->findChild<QDeclarativeTransition*>("columnTransition"); @@ -922,17 +922,17 @@ void tst_qsgpositioners::test_propertychanges() delete canvas; } -void tst_qsgpositioners::test_repeater() +void tst_qquickpositioners::test_repeater() { - QSGView *canvas = createView(TESTDATA("repeatertest.qml")); + QQuickView *canvas = createView(TESTDATA("repeatertest.qml")); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); QCOMPARE(one->x(), 0.0); @@ -945,21 +945,21 @@ void tst_qsgpositioners::test_repeater() delete canvas; } -void tst_qsgpositioners::test_flow() +void tst_qquickpositioners::test_flow() { - QSGView *canvas = createView(TESTDATA("flowtest.qml")); + QQuickView *canvas = createView(TESTDATA("flowtest.qml")); canvas->rootObject()->setProperty("testRightToLeft", false); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -973,7 +973,7 @@ void tst_qsgpositioners::test_flow() QCOMPARE(five->x(), 50.0); QCOMPARE(five->y(), 70.0); - QSGItem *flow = canvas->rootObject()->findChild<QSGItem*>("flow"); + QQuickItem *flow = canvas->rootObject()->findChild<QQuickItem*>("flow"); QVERIFY(flow); QCOMPARE(flow->width(), 90.0); QCOMPARE(flow->height(), 120.0); @@ -981,21 +981,21 @@ void tst_qsgpositioners::test_flow() delete canvas; } -void tst_qsgpositioners::test_flow_rightToLeft() +void tst_qquickpositioners::test_flow_rightToLeft() { - QSGView *canvas = createView(TESTDATA("flowtest.qml")); + QQuickView *canvas = createView(TESTDATA("flowtest.qml")); canvas->rootObject()->setProperty("testRightToLeft", true); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 40.0); @@ -1009,7 +1009,7 @@ void tst_qsgpositioners::test_flow_rightToLeft() QCOMPARE(five->x(), 30.0); QCOMPARE(five->y(), 70.0); - QSGItem *flow = canvas->rootObject()->findChild<QSGItem*>("flow"); + QQuickItem *flow = canvas->rootObject()->findChild<QQuickItem*>("flow"); QVERIFY(flow); QCOMPARE(flow->width(), 90.0); QCOMPARE(flow->height(), 120.0); @@ -1017,21 +1017,21 @@ void tst_qsgpositioners::test_flow_rightToLeft() delete canvas; } -void tst_qsgpositioners::test_flow_topToBottom() +void tst_qquickpositioners::test_flow_topToBottom() { - QSGView *canvas = createView(TESTDATA("flowtest-toptobottom.qml")); + QQuickView *canvas = createView(TESTDATA("flowtest-toptobottom.qml")); canvas->rootObject()->setProperty("testRightToLeft", false); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 0.0); @@ -1045,7 +1045,7 @@ void tst_qsgpositioners::test_flow_topToBottom() QCOMPARE(five->x(), 100.0); QCOMPARE(five->y(), 50.0); - QSGItem *flow = canvas->rootObject()->findChild<QSGItem*>("flow"); + QQuickItem *flow = canvas->rootObject()->findChild<QQuickItem*>("flow"); QVERIFY(flow); QCOMPARE(flow->height(), 90.0); QCOMPARE(flow->width(), 150.0); @@ -1070,24 +1070,24 @@ void tst_qsgpositioners::test_flow_topToBottom() delete canvas; } -void tst_qsgpositioners::test_flow_resize() +void tst_qquickpositioners::test_flow_resize() { - QSGView *canvas = createView(TESTDATA("flowtest.qml")); + QQuickView *canvas = createView(TESTDATA("flowtest.qml")); - QSGItem *root = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *root = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(root); root->setWidth(125); root->setProperty("testRightToLeft", false); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QVERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QTRY_COMPARE(one->x(), 0.0); @@ -1104,24 +1104,24 @@ void tst_qsgpositioners::test_flow_resize() delete canvas; } -void tst_qsgpositioners::test_flow_resize_rightToLeft() +void tst_qquickpositioners::test_flow_resize_rightToLeft() { - QSGView *canvas = createView(TESTDATA("flowtest.qml")); + QQuickView *canvas = createView(TESTDATA("flowtest.qml")); - QSGItem *root = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *root = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(root); root->setWidth(125); root->setProperty("testRightToLeft", true); - QSGRectangle *one = canvas->rootObject()->findChild<QSGRectangle*>("one"); + QQuickRectangle *one = canvas->rootObject()->findChild<QQuickRectangle*>("one"); QTRY_VERIFY(one != 0); - QSGRectangle *two = canvas->rootObject()->findChild<QSGRectangle*>("two"); + QQuickRectangle *two = canvas->rootObject()->findChild<QQuickRectangle*>("two"); QVERIFY(two != 0); - QSGRectangle *three = canvas->rootObject()->findChild<QSGRectangle*>("three"); + QQuickRectangle *three = canvas->rootObject()->findChild<QQuickRectangle*>("three"); QVERIFY(three != 0); - QSGRectangle *four = canvas->rootObject()->findChild<QSGRectangle*>("four"); + QQuickRectangle *four = canvas->rootObject()->findChild<QQuickRectangle*>("four"); QVERIFY(four != 0); - QSGRectangle *five = canvas->rootObject()->findChild<QSGRectangle*>("five"); + QQuickRectangle *five = canvas->rootObject()->findChild<QQuickRectangle*>("five"); QVERIFY(five != 0); QCOMPARE(one->x(), 75.0); @@ -1138,24 +1138,24 @@ void tst_qsgpositioners::test_flow_resize_rightToLeft() delete canvas; } -void tst_qsgpositioners::test_flow_implicit_resize() +void tst_qquickpositioners::test_flow_implicit_resize() { - QSGView *canvas = createView(TESTDATA("flow-testimplicitsize.qml")); + QQuickView *canvas = createView(TESTDATA("flow-testimplicitsize.qml")); QVERIFY(canvas->rootObject() != 0); - QSGFlow *flow = canvas->rootObject()->findChild<QSGFlow*>("flow"); + QQuickFlow *flow = canvas->rootObject()->findChild<QQuickFlow*>("flow"); QVERIFY(flow != 0); QCOMPARE(flow->width(), 100.0); QCOMPARE(flow->height(), 120.0); canvas->rootObject()->setProperty("flowLayout", 0); - QCOMPARE(flow->flow(), QSGFlow::LeftToRight); + QCOMPARE(flow->flow(), QQuickFlow::LeftToRight); QCOMPARE(flow->width(), 220.0); QCOMPARE(flow->height(), 50.0); canvas->rootObject()->setProperty("flowLayout", 1); - QCOMPARE(flow->flow(), QSGFlow::TopToBottom); + QCOMPARE(flow->flow(), QQuickFlow::TopToBottom); QCOMPARE(flow->width(), 100.0); QCOMPARE(flow->height(), 120.0); @@ -1175,107 +1175,107 @@ void interceptWarnings(QtMsgType type, const char *msg) warningMessage = msg; } -void tst_qsgpositioners::test_conflictinganchors() +void tst_qquickpositioners::test_conflictinganchors() { QtMsgHandler oldMsgHandler = qInstallMsgHandler(interceptWarnings); QDeclarativeEngine engine; QDeclarativeComponent component(&engine); component.setData("import QtQuick 2.0\nColumn { Item {} }", QUrl::fromLocalFile("")); - QSGItem *item = qobject_cast<QSGItem*>(component.create()); + QQuickItem *item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QVERIFY(warningMessage.isEmpty()); delete item; component.setData("import QtQuick 2.0\nRow { Item {} }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QVERIFY(warningMessage.isEmpty()); delete item; component.setData("import QtQuick 2.0\nGrid { Item {} }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QVERIFY(warningMessage.isEmpty()); delete item; component.setData("import QtQuick 2.0\nFlow { Item {} }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QVERIFY(warningMessage.isEmpty()); delete item; component.setData("import QtQuick 2.0\nColumn { Item { anchors.top: parent.top } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column")); warningMessage.clear(); delete item; component.setData("import QtQuick 2.0\nColumn { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(warningMessage, QString("file::2:1: QML Column: Cannot specify top, bottom, verticalCenter, fill or centerIn anchors for items inside Column")); warningMessage.clear(); delete item; component.setData("import QtQuick 2.0\nColumn { Item { anchors.left: parent.left } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QVERIFY(warningMessage.isEmpty()); warningMessage.clear(); delete item; component.setData("import QtQuick 2.0\nRow { Item { anchors.left: parent.left } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row")); warningMessage.clear(); delete item; component.setData("import QtQuick 2.0\nRow { Item { anchors.fill: parent } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(warningMessage, QString("file::2:1: QML Row: Cannot specify left, right, horizontalCenter, fill or centerIn anchors for items inside Row")); warningMessage.clear(); delete item; component.setData("import QtQuick 2.0\nRow { Item { anchors.top: parent.top } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QVERIFY(warningMessage.isEmpty()); warningMessage.clear(); delete item; component.setData("import QtQuick 2.0\nGrid { Item { anchors.horizontalCenter: parent.horizontalCenter } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid")); warningMessage.clear(); delete item; component.setData("import QtQuick 2.0\nGrid { Item { anchors.centerIn: parent } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(warningMessage, QString("file::2:1: QML Grid: Cannot specify anchors for items inside Grid")); warningMessage.clear(); delete item; component.setData("import QtQuick 2.0\nFlow { Item { anchors.verticalCenter: parent.verticalCenter } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow")); delete item; component.setData("import QtQuick 2.0\nFlow { Item { anchors.fill: parent } }", QUrl::fromLocalFile("")); - item = qobject_cast<QSGItem*>(component.create()); + item = qobject_cast<QQuickItem*>(component.create()); QVERIFY(item); QCOMPARE(warningMessage, QString("file::2:1: QML Flow: Cannot specify anchors for items inside Flow")); qInstallMsgHandler(oldMsgHandler); delete item; } -void tst_qsgpositioners::test_mirroring() +void tst_qquickpositioners::test_mirroring() { QList<QString> qmlFiles; qmlFiles << "horizontal.qml" << "gridtest.qml" << "flowtest.qml"; @@ -1283,11 +1283,11 @@ void tst_qsgpositioners::test_mirroring() objectNames << "one" << "two" << "three" << "four" << "five"; foreach (const QString qmlFile, qmlFiles) { - QSGView *canvasA = createView(TESTDATA(qmlFile)); - QSGItem *rootA = qobject_cast<QSGItem*>(canvasA->rootObject()); + QQuickView *canvasA = createView(TESTDATA(qmlFile)); + QQuickItem *rootA = qobject_cast<QQuickItem*>(canvasA->rootObject()); - QSGView *canvasB = createView(TESTDATA(qmlFile)); - QSGItem *rootB = qobject_cast<QSGItem*>(canvasB->rootObject()); + QQuickView *canvasB = createView(TESTDATA(qmlFile)); + QQuickItem *rootB = qobject_cast<QQuickItem*>(canvasB->rootObject()); rootA->setProperty("testRightToLeft", true); // layoutDirection: Qt.RightToLeft @@ -1296,12 +1296,12 @@ void tst_qsgpositioners::test_mirroring() // horizontal.qml only has three items if (qmlFile == QString("horizontal.qml") && objectName == QString("four")) break; - QSGItem *itemA = rootA->findChild<QSGItem*>(objectName); - QSGItem *itemB = rootB->findChild<QSGItem*>(objectName); + QQuickItem *itemA = rootA->findChild<QQuickItem*>(objectName); + QQuickItem *itemB = rootB->findChild<QQuickItem*>(objectName); QTRY_VERIFY(itemA->x() != itemB->x()); } - QSGItemPrivate* rootPrivateB = QSGItemPrivate::get(rootB); + QQuickItemPrivate* rootPrivateB = QQuickItemPrivate::get(rootB); rootPrivateB->effectiveLayoutMirror = true; // LayoutMirroring.enabled: true rootPrivateB->isMirrorImplicit = false; @@ -1313,8 +1313,8 @@ void tst_qsgpositioners::test_mirroring() // horizontal.qml only has three items if (qmlFile == QString("horizontal.qml") && objectName == QString("four")) break; - QSGItem *itemA = rootA->findChild<QSGItem*>(objectName); - QSGItem *itemB = rootB->findChild<QSGItem*>(objectName); + QQuickItem *itemA = rootA->findChild<QQuickItem*>(objectName); + QQuickItem *itemB = rootB->findChild<QQuickItem*>(objectName); QTRY_COMPARE(itemA->x(), itemB->x()); } @@ -1326,8 +1326,8 @@ void tst_qsgpositioners::test_mirroring() // horizontal.qml only has three items if (qmlFile == QString("horizontal.qml") && objectName == QString("four")) break; - QSGItem *itemA = rootA->findChild<QSGItem*>(objectName); - QSGItem *itemB = rootB->findChild<QSGItem*>(objectName); + QQuickItem *itemA = rootA->findChild<QQuickItem*>(objectName); + QQuickItem *itemB = rootB->findChild<QQuickItem*>(objectName); QTRY_COMPARE(itemA->x(), itemB->x()); } delete canvasA; @@ -1335,32 +1335,32 @@ void tst_qsgpositioners::test_mirroring() } } -void tst_qsgpositioners::test_allInvisible() +void tst_qquickpositioners::test_allInvisible() { //QTBUG-19361 - QSGView *canvas = createView(TESTDATA("allInvisible.qml")); + QQuickView *canvas = createView(TESTDATA("allInvisible.qml")); - QSGItem *root = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem *root = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(root); - QSGRow *row = canvas->rootObject()->findChild<QSGRow*>("row"); + QQuickRow *row = canvas->rootObject()->findChild<QQuickRow*>("row"); QVERIFY(row != 0); QVERIFY(row->width() == 0); QVERIFY(row->height() == 0); - QSGColumn *column = canvas->rootObject()->findChild<QSGColumn*>("column"); + QQuickColumn *column = canvas->rootObject()->findChild<QQuickColumn*>("column"); QVERIFY(column != 0); QVERIFY(column->width() == 0); QVERIFY(column->height() == 0); } -void tst_qsgpositioners::test_attachedproperties() +void tst_qquickpositioners::test_attachedproperties() { QFETCH(QString, filename); - QSGView *canvas = createView(filename); + QQuickView *canvas = createView(filename); QVERIFY(canvas->rootObject() != 0); - QSGRectangle *greenRect = canvas->rootObject()->findChild<QSGRectangle *>("greenRect"); + QQuickRectangle *greenRect = canvas->rootObject()->findChild<QQuickRectangle *>("greenRect"); QVERIFY(greenRect != 0); int posIndex = greenRect->property("posIndex").toInt(); @@ -1370,7 +1370,7 @@ void tst_qsgpositioners::test_attachedproperties() bool isLast = greenRect->property("isLastItem").toBool(); QVERIFY(isLast == false); - QSGRectangle *yellowRect = canvas->rootObject()->findChild<QSGRectangle *>("yellowRect"); + QQuickRectangle *yellowRect = canvas->rootObject()->findChild<QQuickRectangle *>("yellowRect"); QVERIFY(yellowRect != 0); posIndex = yellowRect->property("posIndex").toInt(); @@ -1392,7 +1392,7 @@ void tst_qsgpositioners::test_attachedproperties() delete canvas; } -void tst_qsgpositioners::test_attachedproperties_data() +void tst_qquickpositioners::test_attachedproperties_data() { QTest::addColumn<QString>("filename"); @@ -1402,16 +1402,16 @@ void tst_qsgpositioners::test_attachedproperties_data() QTest::newRow("flow") << TESTDATA("attachedproperties-flow.qml"); } -void tst_qsgpositioners::test_attachedproperties_dynamic() +void tst_qquickpositioners::test_attachedproperties_dynamic() { QSKIP("QTBUG-21995 - Test crashes on exit"); - QSGView *canvas = createView(TESTDATA("attachedproperties-dynamic.qml")); + QQuickView *canvas = createView(TESTDATA("attachedproperties-dynamic.qml")); QVERIFY(canvas->rootObject() != 0); - QSGRow *row = canvas->rootObject()->findChild<QSGRow *>("pos"); + QQuickRow *row = canvas->rootObject()->findChild<QQuickRow *>("pos"); QVERIFY(row != 0); - QSGRectangle *rect0 = canvas->rootObject()->findChild<QSGRectangle *>("rect0"); + QQuickRectangle *rect0 = canvas->rootObject()->findChild<QQuickRectangle *>("rect0"); QVERIFY(rect0 != 0); int posIndex = rect0->property("index").toInt(); @@ -1421,7 +1421,7 @@ void tst_qsgpositioners::test_attachedproperties_dynamic() bool isLast = rect0->property("lastItem").toBool(); QVERIFY(isLast == false); - QSGRectangle *rect1 = canvas->rootObject()->findChild<QSGRectangle *>("rect1"); + QQuickRectangle *rect1 = canvas->rootObject()->findChild<QQuickRectangle *>("rect1"); QVERIFY(rect1 != 0); posIndex = rect1->property("index").toInt(); @@ -1437,7 +1437,7 @@ void tst_qsgpositioners::test_attachedproperties_dynamic() QTRY_VERIFY(rect1->property("firstItem").toBool() == false); QTRY_VERIFY(rect1->property("lastItem").toBool() == false); - QSGRectangle *rect2 = canvas->rootObject()->findChild<QSGRectangle *>("rect2"); + QQuickRectangle *rect2 = canvas->rootObject()->findChild<QQuickRectangle *>("rect2"); QVERIFY(rect2 != 0); posIndex = rect2->property("index").toInt(); @@ -1458,9 +1458,9 @@ void tst_qsgpositioners::test_attachedproperties_dynamic() delete canvas; } -QSGView *tst_qsgpositioners::createView(const QString &filename, bool wait) +QQuickView *tst_qquickpositioners::createView(const QString &filename, bool wait) { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(filename)); canvas->show(); @@ -1471,6 +1471,6 @@ QSGView *tst_qsgpositioners::createView(const QString &filename, bool wait) } -QTEST_MAIN(tst_qsgpositioners) +QTEST_MAIN(tst_qquickpositioners) -#include "tst_qsgpositioners.moc" +#include "tst_qquickpositioners.moc" diff --git a/tests/auto/declarative/qsgrepeater/data/intmodel.qml b/tests/auto/declarative/qquickrepeater/data/intmodel.qml index 30a650dd52..30a650dd52 100644 --- a/tests/auto/declarative/qsgrepeater/data/intmodel.qml +++ b/tests/auto/declarative/qquickrepeater/data/intmodel.qml diff --git a/tests/auto/declarative/qsgrepeater/data/itemlist.qml b/tests/auto/declarative/qquickrepeater/data/itemlist.qml index 174bfd4d18..174bfd4d18 100644 --- a/tests/auto/declarative/qsgrepeater/data/itemlist.qml +++ b/tests/auto/declarative/qquickrepeater/data/itemlist.qml diff --git a/tests/auto/declarative/qsgrepeater/data/modelChanged.qml b/tests/auto/declarative/qquickrepeater/data/modelChanged.qml index 23af127e79..23af127e79 100644 --- a/tests/auto/declarative/qsgrepeater/data/modelChanged.qml +++ b/tests/auto/declarative/qquickrepeater/data/modelChanged.qml diff --git a/tests/auto/declarative/qsgrepeater/data/objlist.qml b/tests/auto/declarative/qquickrepeater/data/objlist.qml index c49d5926e5..c49d5926e5 100644 --- a/tests/auto/declarative/qsgrepeater/data/objlist.qml +++ b/tests/auto/declarative/qquickrepeater/data/objlist.qml diff --git a/tests/auto/declarative/qsgrepeater/data/properties.qml b/tests/auto/declarative/qquickrepeater/data/properties.qml index 035431c784..035431c784 100644 --- a/tests/auto/declarative/qsgrepeater/data/properties.qml +++ b/tests/auto/declarative/qquickrepeater/data/properties.qml diff --git a/tests/auto/declarative/qsgrepeater/data/repeater1.qml b/tests/auto/declarative/qquickrepeater/data/repeater1.qml index 596dc9131e..596dc9131e 100644 --- a/tests/auto/declarative/qsgrepeater/data/repeater1.qml +++ b/tests/auto/declarative/qquickrepeater/data/repeater1.qml diff --git a/tests/auto/declarative/qsgrepeater/data/repeater2.qml b/tests/auto/declarative/qquickrepeater/data/repeater2.qml index 691fbda1e5..691fbda1e5 100644 --- a/tests/auto/declarative/qsgrepeater/data/repeater2.qml +++ b/tests/auto/declarative/qquickrepeater/data/repeater2.qml diff --git a/tests/auto/declarative/qsgrepeater/qsgrepeater.pro b/tests/auto/declarative/qquickrepeater/qquickrepeater.pro index aa15c71f8c..9cdb9c2c53 100644 --- a/tests/auto/declarative/qsgrepeater/qsgrepeater.pro +++ b/tests/auto/declarative/qquickrepeater/qquickrepeater.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgrepeater +TARGET = tst_qquickrepeater macx:CONFIG -= app_bundle -SOURCES += tst_qsgrepeater.cpp +SOURCES += tst_qquickrepeater.cpp testFiles.files = data testFiles.path = . diff --git a/tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp b/tests/auto/declarative/qquickrepeater/tst_qquickrepeater.cpp index 40d7b77827..355dd0d0dc 100644 --- a/tests/auto/declarative/qsgrepeater/tst_qsgrepeater.cpp +++ b/tests/auto/declarative/qquickrepeater/tst_qquickrepeater.cpp @@ -43,11 +43,11 @@ #include <QtTest/QSignalSpy> #include <private/qlistmodelinterface_p.h> #include <QtDeclarative/qdeclarativeengine.h> -#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/qquickview.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeexpression.h> -#include <private/qsgrepeater_p.h> -#include <private/qsgtext_p.h> +#include <private/qquickrepeater_p.h> +#include <private/qquicktext_p.h> #include "../shared/util.h" @@ -56,11 +56,11 @@ inline QUrl TEST_FILE(const QString &filename) return QUrl::fromLocalFile(TESTDATA(filename)); } -class tst_QSGRepeater : public QObject +class tst_QQuickRepeater : public QObject { Q_OBJECT public: - tst_QSGRepeater(); + tst_QQuickRepeater(); private slots: void numberModel(); @@ -75,7 +75,7 @@ private slots: void properties(); private: - QSGView *createView(); + QQuickView *createView(); template<typename T> T *findItem(QObject *parent, const QString &objectName, int index); template<typename T> @@ -167,13 +167,13 @@ private: }; -tst_QSGRepeater::tst_QSGRepeater() +tst_QQuickRepeater::tst_QQuickRepeater() { } -void tst_QSGRepeater::numberModel() +void tst_QQuickRepeater::numberModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QDeclarativeContext *ctxt = canvas->rootContext(); ctxt->setContextProperty("testData", 5); @@ -183,7 +183,7 @@ void tst_QSGRepeater::numberModel() canvas->setSource(TEST_FILE("intmodel.qml")); qApp->processEvents(); - QSGRepeater *repeater = findItem<QSGRepeater>(canvas->rootObject(), "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); QCOMPARE(repeater->parentItem()->childItems().count(), 5+1); @@ -211,9 +211,9 @@ public: int m_idx; }; -void tst_QSGRepeater::objectList() +void tst_QQuickRepeater::objectList() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QObjectList data; for (int i=0; i<100; i++) data << new MyObject(i); @@ -224,7 +224,7 @@ void tst_QSGRepeater::objectList() canvas->setSource(TEST_FILE("objlist.qml")); qApp->processEvents(); - QSGRepeater *repeater = findItem<QSGRepeater>(canvas->rootObject(), "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); QCOMPARE(repeater->property("errors").toInt(), 0);//If this fails either they are out of order or can't find the object's data QCOMPARE(repeater->property("instantiated").toInt(), 100); @@ -234,8 +234,8 @@ void tst_QSGRepeater::objectList() QCOMPARE(repeater->itemAt(i), repeater->parentItem()->childItems().at(i)); QVERIFY(!repeater->itemAt(data.count())); - QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QSGItem*))); - QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QSGItem*))); + QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QQuickItem*))); + QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QQuickItem*))); ctxt->setContextProperty("testData", QVariant::fromValue(data)); QCOMPARE(addedSpy.count(), data.count()); QCOMPARE(removedSpy.count(), data.count()); @@ -249,9 +249,9 @@ The Repeater element creates children at its own position in its parent's stacking order. In this test we insert a repeater between two other Text elements to test this. */ -void tst_QSGRepeater::stringList() +void tst_QQuickRepeater::stringList() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QStringList data; data << "One"; @@ -265,10 +265,10 @@ void tst_QSGRepeater::stringList() canvas->setSource(TEST_FILE("repeater1.qml")); qApp->processEvents(); - QSGRepeater *repeater = findItem<QSGRepeater>(canvas->rootObject(), "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); - QSGItem *container = findItem<QSGItem>(canvas->rootObject(), "container"); + QQuickItem *container = findItem<QQuickItem>(canvas->rootObject(), "container"); QVERIFY(container != 0); QCOMPARE(container->childItems().count(), data.count() + 3); @@ -277,21 +277,21 @@ void tst_QSGRepeater::stringList() for (int i = 0; i < container->childItems().count(); ++i) { if (i == 0) { - QSGText *name = qobject_cast<QSGText*>(container->childItems().at(i)); + QQuickText *name = qobject_cast<QQuickText*>(container->childItems().at(i)); QVERIFY(name != 0); QCOMPARE(name->text(), QLatin1String("Zero")); } else if (i == container->childItems().count() - 2) { // The repeater itself - QSGRepeater *rep = qobject_cast<QSGRepeater*>(container->childItems().at(i)); + QQuickRepeater *rep = qobject_cast<QQuickRepeater*>(container->childItems().at(i)); QCOMPARE(rep, repeater); saw_repeater = true; continue; } else if (i == container->childItems().count() - 1) { - QSGText *name = qobject_cast<QSGText*>(container->childItems().at(i)); + QQuickText *name = qobject_cast<QQuickText*>(container->childItems().at(i)); QVERIFY(name != 0); QCOMPARE(name->text(), QLatin1String("Last")); } else { - QSGText *name = qobject_cast<QSGText*>(container->childItems().at(i)); + QQuickText *name = qobject_cast<QQuickText*>(container->childItems().at(i)); QVERIFY(name != 0); QCOMPARE(name->text(), data.at(i-1)); } @@ -301,9 +301,9 @@ void tst_QSGRepeater::stringList() delete canvas; } -void tst_QSGRepeater::dataModel_adding() +void tst_QQuickRepeater::dataModel_adding() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QDeclarativeContext *ctxt = canvas->rootContext(); TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); @@ -313,15 +313,15 @@ void tst_QSGRepeater::dataModel_adding() canvas->setSource(TEST_FILE("repeater2.qml")); qApp->processEvents(); - QSGRepeater *repeater = findItem<QSGRepeater>(canvas->rootObject(), "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); - QSGItem *container = findItem<QSGItem>(canvas->rootObject(), "container"); + QQuickItem *container = findItem<QQuickItem>(canvas->rootObject(), "container"); QVERIFY(container != 0); QVERIFY(!repeater->itemAt(0)); QSignalSpy countSpy(repeater, SIGNAL(countChanged())); - QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QSGItem*))); + QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QQuickItem*))); // add to empty model testModel.addItem("two", "2"); @@ -329,7 +329,7 @@ void tst_QSGRepeater::dataModel_adding() QCOMPARE(countSpy.count(), 1); countSpy.clear(); QCOMPARE(addedSpy.count(), 1); QCOMPARE(addedSpy.at(0).at(0).toInt(), 0); - QCOMPARE(addedSpy.at(0).at(1).value<QSGItem*>(), container->childItems().at(0)); + QCOMPARE(addedSpy.at(0).at(1).value<QQuickItem*>(), container->childItems().at(0)); addedSpy.clear(); // insert at start @@ -338,7 +338,7 @@ void tst_QSGRepeater::dataModel_adding() QCOMPARE(countSpy.count(), 1); countSpy.clear(); QCOMPARE(addedSpy.count(), 1); QCOMPARE(addedSpy.at(0).at(0).toInt(), 0); - QCOMPARE(addedSpy.at(0).at(1).value<QSGItem*>(), container->childItems().at(0)); + QCOMPARE(addedSpy.at(0).at(1).value<QQuickItem*>(), container->childItems().at(0)); addedSpy.clear(); // insert at end @@ -347,7 +347,7 @@ void tst_QSGRepeater::dataModel_adding() QCOMPARE(countSpy.count(), 1); countSpy.clear(); QCOMPARE(addedSpy.count(), 1); QCOMPARE(addedSpy.at(0).at(0).toInt(), 2); - QCOMPARE(addedSpy.at(0).at(1).value<QSGItem*>(), container->childItems().at(2)); + QCOMPARE(addedSpy.at(0).at(1).value<QQuickItem*>(), container->childItems().at(2)); addedSpy.clear(); // insert in middle @@ -356,7 +356,7 @@ void tst_QSGRepeater::dataModel_adding() QCOMPARE(countSpy.count(), 1); countSpy.clear(); QCOMPARE(addedSpy.count(), 1); QCOMPARE(addedSpy.at(0).at(0).toInt(), 2); - QCOMPARE(addedSpy.at(0).at(1).value<QSGItem*>(), container->childItems().at(2)); + QCOMPARE(addedSpy.at(0).at(1).value<QQuickItem*>(), container->childItems().at(2)); addedSpy.clear(); delete testObject; @@ -365,9 +365,9 @@ void tst_QSGRepeater::dataModel_adding() delete canvas; } -void tst_QSGRepeater::dataModel_removing() +void tst_QQuickRepeater::dataModel_removing() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QDeclarativeContext *ctxt = canvas->rootContext(); TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); @@ -383,17 +383,17 @@ void tst_QSGRepeater::dataModel_removing() canvas->setSource(TEST_FILE("repeater2.qml")); qApp->processEvents(); - QSGRepeater *repeater = findItem<QSGRepeater>(canvas->rootObject(), "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); - QSGItem *container = findItem<QSGItem>(canvas->rootObject(), "container"); + QQuickItem *container = findItem<QQuickItem>(canvas->rootObject(), "container"); QVERIFY(container != 0); QCOMPARE(container->childItems().count(), repeater->count()+1); QSignalSpy countSpy(repeater, SIGNAL(countChanged())); - QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QSGItem*))); + QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QQuickItem*))); // remove at start - QSGItem *item = repeater->itemAt(0); + QQuickItem *item = repeater->itemAt(0); QCOMPARE(item, container->childItems().at(0)); testModel.removeItem(0); @@ -401,7 +401,7 @@ void tst_QSGRepeater::dataModel_removing() QCOMPARE(countSpy.count(), 1); countSpy.clear(); QCOMPARE(removedSpy.count(), 1); QCOMPARE(removedSpy.at(0).at(0).toInt(), 0); - QCOMPARE(removedSpy.at(0).at(1).value<QSGItem*>(), item); + QCOMPARE(removedSpy.at(0).at(1).value<QQuickItem*>(), item); removedSpy.clear(); // remove at end @@ -414,7 +414,7 @@ void tst_QSGRepeater::dataModel_removing() QCOMPARE(countSpy.count(), 1); countSpy.clear(); QCOMPARE(removedSpy.count(), 1); QCOMPARE(removedSpy.at(0).at(0).toInt(), lastIndex); - QCOMPARE(removedSpy.at(0).at(1).value<QSGItem*>(), item); + QCOMPARE(removedSpy.at(0).at(1).value<QQuickItem*>(), item); removedSpy.clear(); // remove from middle @@ -426,16 +426,16 @@ void tst_QSGRepeater::dataModel_removing() QCOMPARE(countSpy.count(), 1); countSpy.clear(); QCOMPARE(removedSpy.count(), 1); QCOMPARE(removedSpy.at(0).at(0).toInt(), 1); - QCOMPARE(removedSpy.at(0).at(1).value<QSGItem*>(), item); + QCOMPARE(removedSpy.at(0).at(1).value<QQuickItem*>(), item); removedSpy.clear(); delete testObject; delete canvas; } -void tst_QSGRepeater::dataModel_changes() +void tst_QQuickRepeater::dataModel_changes() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QDeclarativeContext *ctxt = canvas->rootContext(); TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); @@ -449,23 +449,23 @@ void tst_QSGRepeater::dataModel_changes() canvas->setSource(TEST_FILE("repeater2.qml")); qApp->processEvents(); - QSGRepeater *repeater = findItem<QSGRepeater>(canvas->rootObject(), "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); - QSGItem *container = findItem<QSGItem>(canvas->rootObject(), "container"); + QQuickItem *container = findItem<QQuickItem>(canvas->rootObject(), "container"); QVERIFY(container != 0); QCOMPARE(container->childItems().count(), repeater->count()+1); // Check that model changes are propagated - QSGText *text = findItem<QSGText>(canvas->rootObject(), "myName", 1); + QQuickText *text = findItem<QQuickText>(canvas->rootObject(), "myName", 1); QVERIFY(text); QCOMPARE(text->text(), QString("two")); testModel.modifyItem(1, "Item two", "_2"); - text = findItem<QSGText>(canvas->rootObject(), "myName", 1); + text = findItem<QQuickText>(canvas->rootObject(), "myName", 1); QVERIFY(text); QCOMPARE(text->text(), QString("Item two")); - text = findItem<QSGText>(canvas->rootObject(), "myNumber", 1); + text = findItem<QQuickText>(canvas->rootObject(), "myNumber", 1); QVERIFY(text); QCOMPARE(text->text(), QString("_2")); @@ -473,9 +473,9 @@ void tst_QSGRepeater::dataModel_changes() delete canvas; } -void tst_QSGRepeater::itemModel() +void tst_QQuickRepeater::itemModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QDeclarativeContext *ctxt = canvas->rootContext(); TestObject *testObject = new TestObject; ctxt->setContextProperty("testObject", testObject); @@ -483,10 +483,10 @@ void tst_QSGRepeater::itemModel() canvas->setSource(TEST_FILE("itemlist.qml")); qApp->processEvents(); - QSGRepeater *repeater = findItem<QSGRepeater>(canvas->rootObject(), "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); - QSGItem *container = findItem<QSGItem>(canvas->rootObject(), "container"); + QQuickItem *container = findItem<QQuickItem>(canvas->rootObject(), "container"); QVERIFY(container != 0); QCOMPARE(container->childItems().count(), 1); @@ -514,9 +514,9 @@ void tst_QSGRepeater::itemModel() delete canvas; } -void tst_QSGRepeater::resetModel() +void tst_QQuickRepeater::resetModel() { - QSGView *canvas = createView(); + QQuickView *canvas = createView(); QStringList dataA; for (int i=0; i<10; i++) @@ -526,9 +526,9 @@ void tst_QSGRepeater::resetModel() ctxt->setContextProperty("testData", dataA); canvas->setSource(TEST_FILE("repeater1.qml")); qApp->processEvents(); - QSGRepeater *repeater = findItem<QSGRepeater>(canvas->rootObject(), "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(canvas->rootObject(), "repeater"); QVERIFY(repeater != 0); - QSGItem *container = findItem<QSGItem>(canvas->rootObject(), "container"); + QQuickItem *container = findItem<QQuickItem>(canvas->rootObject(), "container"); QVERIFY(container != 0); QCOMPARE(repeater->count(), dataA.count()); @@ -537,8 +537,8 @@ void tst_QSGRepeater::resetModel() QSignalSpy modelChangedSpy(repeater, SIGNAL(modelChanged())); QSignalSpy countSpy(repeater, SIGNAL(countChanged())); - QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QSGItem*))); - QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QSGItem*))); + QSignalSpy addedSpy(repeater, SIGNAL(itemAdded(int,QQuickItem*))); + QSignalSpy removedSpy(repeater, SIGNAL(itemRemoved(int,QQuickItem*))); QStringList dataB; for (int i=0; i<20; i++) @@ -554,7 +554,7 @@ void tst_QSGRepeater::resetModel() QCOMPARE(addedSpy.count(), dataB.count()); for (int i=0; i<dataB.count(); i++) { QCOMPARE(addedSpy.at(i).at(0).toInt(), i); - QCOMPARE(addedSpy.at(i).at(1).value<QSGItem*>(), repeater->itemAt(i)); + QCOMPARE(addedSpy.at(i).at(1).value<QQuickItem*>(), repeater->itemAt(i)); } modelChangedSpy.clear(); countSpy.clear(); @@ -571,7 +571,7 @@ void tst_QSGRepeater::resetModel() QCOMPARE(addedSpy.count(), dataA.count()); for (int i=0; i<dataA.count(); i++) { QCOMPARE(addedSpy.at(i).at(0).toInt(), i); - QCOMPARE(addedSpy.at(i).at(1).value<QSGItem*>(), repeater->itemAt(i)); + QCOMPARE(addedSpy.at(i).at(1).value<QQuickItem*>(), repeater->itemAt(i)); } modelChangedSpy.clear(); @@ -583,14 +583,14 @@ void tst_QSGRepeater::resetModel() } // QTBUG-17156 -void tst_QSGRepeater::modelChanged() +void tst_QQuickRepeater::modelChanged() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, TEST_FILE("modelChanged.qml")); - QSGItem *rootObject = qobject_cast<QSGItem*>(component.create()); + QQuickItem *rootObject = qobject_cast<QQuickItem*>(component.create()); QVERIFY(rootObject); - QSGRepeater *repeater = findItem<QSGRepeater>(rootObject, "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(rootObject, "repeater"); QVERIFY(repeater); repeater->setModel(4); @@ -606,15 +606,15 @@ void tst_QSGRepeater::modelChanged() delete rootObject; } -void tst_QSGRepeater::properties() +void tst_QQuickRepeater::properties() { QDeclarativeEngine engine; QDeclarativeComponent component(&engine, TEST_FILE("properties.qml")); - QSGItem *rootObject = qobject_cast<QSGItem*>(component.create()); + QQuickItem *rootObject = qobject_cast<QQuickItem*>(component.create()); QVERIFY(rootObject); - QSGRepeater *repeater = findItem<QSGRepeater>(rootObject, "repeater"); + QQuickRepeater *repeater = findItem<QQuickRepeater>(rootObject, "repeater"); QVERIFY(repeater); QSignalSpy modelSpy(repeater, SIGNAL(modelChanged())); @@ -636,21 +636,21 @@ void tst_QSGRepeater::properties() delete rootObject; } -QSGView *tst_QSGRepeater::createView() +QQuickView *tst_QQuickRepeater::createView() { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setGeometry(0,0,240,320); return canvas; } template<typename T> -T *tst_QSGRepeater::findItem(QObject *parent, const QString &objectName, int index) +T *tst_QQuickRepeater::findItem(QObject *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->children().count() << "children"; for (int i = 0; i < parent->children().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->children().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->children().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -672,16 +672,16 @@ T *tst_QSGRepeater::findItem(QObject *parent, const QString &objectName, int ind } template<typename T> -T *tst_QSGRepeater::findItem(QObject *parent, const QString &objectName) +T *tst_QQuickRepeater::findItem(QObject *parent, const QString &objectName) { const QMetaObject &mo = T::staticMetaObject; if (mo.cast(parent) && (objectName.isEmpty() || parent->objectName() == objectName)) return static_cast<T*>(parent); for (int i = 0; i < parent->children().count(); ++i) { - QSGItem *child = qobject_cast<QSGItem*>(parent->children().at(i)); + QQuickItem *child = qobject_cast<QQuickItem*>(parent->children().at(i)); if (!child) continue; - QSGItem *item = findItem<T>(child, objectName); + QQuickItem *item = findItem<T>(child, objectName); if (item) return static_cast<T*>(item); } @@ -689,6 +689,6 @@ T *tst_QSGRepeater::findItem(QObject *parent, const QString &objectName) return 0; } -QTEST_MAIN(tst_QSGRepeater) +QTEST_MAIN(tst_QQuickRepeater) -#include "tst_qsgrepeater.moc" +#include "tst_qquickrepeater.moc" diff --git a/tests/auto/declarative/qsgtext/data/alignments.qml b/tests/auto/declarative/qquicktext/data/alignments.qml index 9798d9c736..9798d9c736 100644 --- a/tests/auto/declarative/qsgtext/data/alignments.qml +++ b/tests/auto/declarative/qquicktext/data/alignments.qml diff --git a/tests/auto/declarative/qsgtext/data/alignments_cb.png b/tests/auto/declarative/qquicktext/data/alignments_cb.png Binary files differindex cf6199a418..cf6199a418 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_cb.png +++ b/tests/auto/declarative/qquicktext/data/alignments_cb.png diff --git a/tests/auto/declarative/qsgtext/data/alignments_cc.png b/tests/auto/declarative/qquicktext/data/alignments_cc.png Binary files differindex f81ccb4238..f81ccb4238 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_cc.png +++ b/tests/auto/declarative/qquicktext/data/alignments_cc.png diff --git a/tests/auto/declarative/qsgtext/data/alignments_ct.png b/tests/auto/declarative/qquicktext/data/alignments_ct.png Binary files differindex 9ba64125d5..9ba64125d5 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_ct.png +++ b/tests/auto/declarative/qquicktext/data/alignments_ct.png diff --git a/tests/auto/declarative/qsgtext/data/alignments_lb.png b/tests/auto/declarative/qquicktext/data/alignments_lb.png Binary files differindex 1b50a81f3d..1b50a81f3d 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_lb.png +++ b/tests/auto/declarative/qquicktext/data/alignments_lb.png diff --git a/tests/auto/declarative/qsgtext/data/alignments_lc.png b/tests/auto/declarative/qquicktext/data/alignments_lc.png Binary files differindex f041b868f8..f041b868f8 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_lc.png +++ b/tests/auto/declarative/qquicktext/data/alignments_lc.png diff --git a/tests/auto/declarative/qsgtext/data/alignments_lt.png b/tests/auto/declarative/qquicktext/data/alignments_lt.png Binary files differindex c75e0d158e..c75e0d158e 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_lt.png +++ b/tests/auto/declarative/qquicktext/data/alignments_lt.png diff --git a/tests/auto/declarative/qsgtext/data/alignments_rb.png b/tests/auto/declarative/qquicktext/data/alignments_rb.png Binary files differindex b06a5da715..b06a5da715 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_rb.png +++ b/tests/auto/declarative/qquicktext/data/alignments_rb.png diff --git a/tests/auto/declarative/qsgtext/data/alignments_rc.png b/tests/auto/declarative/qquicktext/data/alignments_rc.png Binary files differindex e468857cd0..e468857cd0 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_rc.png +++ b/tests/auto/declarative/qquicktext/data/alignments_rc.png diff --git a/tests/auto/declarative/qsgtext/data/alignments_rt.png b/tests/auto/declarative/qquicktext/data/alignments_rt.png Binary files differindex 576715ffce..576715ffce 100644 --- a/tests/auto/declarative/qsgtext/data/alignments_rt.png +++ b/tests/auto/declarative/qquicktext/data/alignments_rt.png diff --git a/tests/auto/declarative/qsgtext/data/embeddedImagesLocal.qml b/tests/auto/declarative/qquicktext/data/embeddedImagesLocal.qml index 74b2ab817a..74b2ab817a 100644 --- a/tests/auto/declarative/qsgtext/data/embeddedImagesLocal.qml +++ b/tests/auto/declarative/qquicktext/data/embeddedImagesLocal.qml diff --git a/tests/auto/declarative/qsgtext/data/embeddedImagesLocalError.qml b/tests/auto/declarative/qquicktext/data/embeddedImagesLocalError.qml index a2f7e0c89f..a2f7e0c89f 100644 --- a/tests/auto/declarative/qsgtext/data/embeddedImagesLocalError.qml +++ b/tests/auto/declarative/qquicktext/data/embeddedImagesLocalError.qml diff --git a/tests/auto/declarative/qsgtext/data/embeddedImagesRemote.qml b/tests/auto/declarative/qquicktext/data/embeddedImagesRemote.qml index 702633c538..702633c538 100644 --- a/tests/auto/declarative/qsgtext/data/embeddedImagesRemote.qml +++ b/tests/auto/declarative/qquicktext/data/embeddedImagesRemote.qml diff --git a/tests/auto/declarative/qsgtext/data/embeddedImagesRemoteError.qml b/tests/auto/declarative/qquicktext/data/embeddedImagesRemoteError.qml index 5762f3e47d..5762f3e47d 100644 --- a/tests/auto/declarative/qsgtext/data/embeddedImagesRemoteError.qml +++ b/tests/auto/declarative/qquicktext/data/embeddedImagesRemoteError.qml diff --git a/tests/auto/declarative/qsgtext/data/horizontalAlignment_RightToLeft.qml b/tests/auto/declarative/qquicktext/data/horizontalAlignment_RightToLeft.qml index 5ba4d35684..5ba4d35684 100644 --- a/tests/auto/declarative/qsgtext/data/horizontalAlignment_RightToLeft.qml +++ b/tests/auto/declarative/qquicktext/data/horizontalAlignment_RightToLeft.qml diff --git a/tests/auto/declarative/qsgtext/data/http/exists.png b/tests/auto/declarative/qquicktext/data/http/exists.png Binary files differindex 399bd0b1d9..399bd0b1d9 100644 --- a/tests/auto/declarative/qsgtext/data/http/exists.png +++ b/tests/auto/declarative/qquicktext/data/http/exists.png diff --git a/tests/auto/declarative/qsgtext/data/lineCount.qml b/tests/auto/declarative/qquicktext/data/lineCount.qml index b672863684..b672863684 100644 --- a/tests/auto/declarative/qsgtext/data/lineCount.qml +++ b/tests/auto/declarative/qquicktext/data/lineCount.qml diff --git a/tests/auto/declarative/qsgtext/data/lineHeight.qml b/tests/auto/declarative/qquicktext/data/lineHeight.qml index c1f337aa05..c1f337aa05 100644 --- a/tests/auto/declarative/qsgtext/data/lineHeight.qml +++ b/tests/auto/declarative/qquicktext/data/lineHeight.qml diff --git a/tests/auto/declarative/qsgtext/data/lineLayout.qml b/tests/auto/declarative/qquicktext/data/lineLayout.qml index cb2474791e..cb2474791e 100644 --- a/tests/auto/declarative/qsgtext/data/lineLayout.qml +++ b/tests/auto/declarative/qquicktext/data/lineLayout.qml diff --git a/tests/auto/declarative/qsgtext/data/qtbug_14734.qml b/tests/auto/declarative/qquicktext/data/qtbug_14734.qml index e71a798421..e71a798421 100644 --- a/tests/auto/declarative/qsgtext/data/qtbug_14734.qml +++ b/tests/auto/declarative/qquicktext/data/qtbug_14734.qml diff --git a/tests/auto/declarative/qsgtext/data/rotated.qml b/tests/auto/declarative/qquicktext/data/rotated.qml index fecf64b249..fecf64b249 100644 --- a/tests/auto/declarative/qsgtext/data/rotated.qml +++ b/tests/auto/declarative/qquicktext/data/rotated.qml diff --git a/tests/auto/declarative/qsgtext/qsgtext.pro b/tests/auto/declarative/qquicktext/qquicktext.pro index a04c079ef2..fe69f75746 100644 --- a/tests/auto/declarative/qsgtext/qsgtext.pro +++ b/tests/auto/declarative/qquicktext/qquicktext.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgtext +TARGET = tst_qquicktext macx:CONFIG -= app_bundle -SOURCES += tst_qsgtext.cpp +SOURCES += tst_qquicktext.cpp INCLUDEPATH += ../shared/ HEADERS += ../shared/testhttpserver.h diff --git a/tests/auto/declarative/qsgtext/tst_qsgtext.cpp b/tests/auto/declarative/qquicktext/tst_qquicktext.cpp index a46969e217..2fd4e236d3 100644 --- a/tests/auto/declarative/qsgtext/tst_qsgtext.cpp +++ b/tests/auto/declarative/qquicktext/tst_qquicktext.cpp @@ -42,14 +42,14 @@ #include <QTextDocument> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <private/qsgtext_p.h> -#include <private/qsgtext_p_p.h> +#include <private/qquicktext_p.h> +#include <private/qquicktext_p_p.h> #include <private/qdeclarativevaluetype_p.h> #include <private/qsgdistancefieldglyphcache_p.h> #include <QFontMetrics> #include <QGraphicsSceneMouseEvent> #include <qmath.h> -#include <QSGView> +#include <QQuickView> #include <private/qapplication_p.h> #include <limits.h> #include <QtGui/QMouseEvent> @@ -58,11 +58,11 @@ DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD) -class tst_qsgtext : public QObject +class tst_qquicktext : public QObject { Q_OBJECT public: - tst_qsgtext(); + tst_qquicktext(); private slots: void initTestCase(); @@ -119,23 +119,23 @@ private: QList<Qt::Alignment> horizontalAlignmentments; QStringList styleStrings; - QList<QSGText::TextStyle> styles; + QList<QQuickText::TextStyle> styles; QStringList colorStrings; QDeclarativeEngine engine; - QSGView *createView(const QString &filename); + QQuickView *createView(const QString &filename); }; -void tst_qsgtext::initTestCase() +void tst_qquicktext::initTestCase() { } -void tst_qsgtext::cleanupTestCase() +void tst_qquicktext::cleanupTestCase() { } -tst_qsgtext::tst_qsgtext() +tst_qquicktext::tst_qquicktext() { standard << "the quick brown fox jumped over the lazy dog" << "the quick brown fox\n jumped over the lazy dog"; @@ -164,10 +164,10 @@ tst_qsgtext::tst_qsgtext() << "Raised" << "Sunken"; - styles << QSGText::Normal - << QSGText::Outline - << QSGText::Raised - << QSGText::Sunken; + styles << QQuickText::Normal + << QQuickText::Outline + << QQuickText::Raised + << QQuickText::Sunken; colorStrings << "aliceblue" << "antiquewhite" @@ -188,20 +188,20 @@ tst_qsgtext::tst_qsgtext() // } -QSGView *tst_qsgtext::createView(const QString &filename) +QQuickView *tst_qquicktext::createView(const QString &filename) { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(filename)); return canvas; } -void tst_qsgtext::text() +void tst_qquicktext::text() { { QDeclarativeComponent textComponent(&engine); textComponent.setData("import QtQuick 2.0\nText { text: \"\" }", QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->text(), QString("")); @@ -216,7 +216,7 @@ void tst_qsgtext::text() QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->text(), standard.at(i)); @@ -230,7 +230,7 @@ void tst_qsgtext::text() QString componentStr = "import QtQuick 2.0\nText { text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QString expected = richText.at(i); @@ -241,13 +241,13 @@ void tst_qsgtext::text() } } -void tst_qsgtext::width() +void tst_qquicktext::width() { // uses Font metrics to find the width for standard and document to find the width for rich { QDeclarativeComponent textComponent(&engine); textComponent.setData("import QtQuick 2.0\nText { text: \"\" }", QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->width(), 0.); @@ -295,12 +295,12 @@ void tst_qsgtext::width() QString componentStr = "import QtQuick 2.0\nText { text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QVERIFY(textObject->boundingRect().width() > 0); QCOMPARE(textObject->width(), qreal(metricWidth)); - QVERIFY(textObject->textFormat() == QSGText::AutoText); // setting text doesn't change format + QVERIFY(textObject->textFormat() == QQuickText::AutoText); // setting text doesn't change format delete textObject; } @@ -312,34 +312,34 @@ void tst_qsgtext::width() QString componentStr = "import QtQuick 2.0\nText { text: \"" + richText.at(i) + "\"; textFormat: Text.RichText }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); - QSGTextPrivate *textPrivate = QSGTextPrivate::get(textObject); + QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(textObject); QVERIFY(textPrivate != 0); QTextDocument *doc = textPrivate->textDocument(); QVERIFY(doc != 0); QCOMPARE(int(textObject->width()), int(doc->idealWidth())); - QVERIFY(textObject->textFormat() == QSGText::RichText); + QVERIFY(textObject->textFormat() == QQuickText::RichText); delete textObject; } } -void tst_qsgtext::wrap() +void tst_qquicktext::wrap() { int textHeight = 0; // for specified width and wrap set true { QDeclarativeComponent textComponent(&engine); textComponent.setData("import QtQuick 2.0\nText { text: \"Hello\"; wrapMode: Text.WordWrap; width: 300 }", QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); textHeight = textObject->height(); QVERIFY(textObject != 0); - QVERIFY(textObject->wrapMode() == QSGText::WordWrap); + QVERIFY(textObject->wrapMode() == QQuickText::WordWrap); QCOMPARE(textObject->width(), 300.); delete textObject; @@ -350,7 +350,7 @@ void tst_qsgtext::wrap() QString componentStr = "import QtQuick 2.0\nText { wrapMode: Text.WordWrap; width: 30; text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->width(), 30.); @@ -368,7 +368,7 @@ void tst_qsgtext::wrap() QString componentStr = "import QtQuick 2.0\nText { wrapMode: Text.WordWrap; width: 30; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->width(), 30.); @@ -387,7 +387,7 @@ void tst_qsgtext::wrap() QString componentStr = "import QtQuick 2.0\nText { wrapMode: Text.WordWrap; width: 30; height: 50; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->width(), 30.); @@ -401,9 +401,9 @@ void tst_qsgtext::wrap() } } -void tst_qsgtext::elide() +void tst_qquicktext::elide() { - for (QSGText::TextElideMode m = QSGText::ElideLeft; m<=QSGText::ElideNone; m=QSGText::TextElideMode(int(m)+1)) { + for (QQuickText::TextElideMode m = QQuickText::ElideLeft; m<=QQuickText::ElideNone; m=QQuickText::TextElideMode(int(m)+1)) { const char* elidename[]={"ElideLeft", "ElideRight", "ElideMiddle", "ElideNone"}; QString elide = "elide: Text." + QString(elidename[int(m)]) + ";"; @@ -412,7 +412,7 @@ void tst_qsgtext::elide() { QDeclarativeComponent textComponent(&engine); textComponent.setData(("import QtQuick 2.0\nText { text: \"\"; "+elide+" width: 100 }").toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->elideMode(), m); QCOMPARE(textObject->width(), 100.); @@ -425,7 +425,7 @@ void tst_qsgtext::elide() QString componentStr = "import QtQuick 2.0\nText { "+elide+" width: 100; text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->elideMode(), m); QCOMPARE(textObject->width(), 100.); @@ -439,7 +439,7 @@ void tst_qsgtext::elide() QString componentStr = "import QtQuick 2.0\nText { "+elide+" width: 100; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->elideMode(), m); QCOMPARE(textObject->width(), 100.); @@ -449,17 +449,17 @@ void tst_qsgtext::elide() } } -void tst_qsgtext::textFormat() +void tst_qquicktext::textFormat() { { QDeclarativeComponent textComponent(&engine); textComponent.setData("import QtQuick 2.0\nText { text: \"Hello\"; textFormat: Text.RichText }", QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); - QVERIFY(textObject->textFormat() == QSGText::RichText); + QVERIFY(textObject->textFormat() == QQuickText::RichText); - QSGTextPrivate *textPrivate = QSGTextPrivate::get(textObject); + QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(textObject); QVERIFY(textPrivate != 0); QVERIFY(textPrivate->richText == true); @@ -468,12 +468,12 @@ void tst_qsgtext::textFormat() { QDeclarativeComponent textComponent(&engine); textComponent.setData("import QtQuick 2.0\nText { text: \"<b>Hello</b>\" }", QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); - QVERIFY(textObject->textFormat() == QSGText::AutoText); + QVERIFY(textObject->textFormat() == QQuickText::AutoText); - QSGTextPrivate *textPrivate = QSGTextPrivate::get(textObject); + QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(textObject); QVERIFY(textPrivate != 0); QVERIFY(textPrivate->styledText == true); @@ -482,17 +482,17 @@ void tst_qsgtext::textFormat() { QDeclarativeComponent textComponent(&engine); textComponent.setData("import QtQuick 2.0\nText { text: \"<b>Hello</b>\"; textFormat: Text.PlainText }", QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); - QVERIFY(textObject->textFormat() == QSGText::PlainText); + QVERIFY(textObject->textFormat() == QQuickText::PlainText); delete textObject; } } -void tst_qsgtext::alignments_data() +void tst_qquicktext::alignments_data() { QTest::addColumn<int>("hAlign"); QTest::addColumn<int>("vAlign"); @@ -512,7 +512,7 @@ void tst_qsgtext::alignments_data() } -void tst_qsgtext::alignments() +void tst_qquicktext::alignments() { QSKIP("Text alignment pixmap comparison tests will not work with scenegraph"); #if (0)// No widgets in scenegraph @@ -527,7 +527,7 @@ void tst_qsgtext::alignments() QApplication::setFont(fn); #endif - QSGView *canvas = createView(TESTDATA("alignments.qml")); + QQuickView *canvas = createView(TESTDATA("alignments.qml")); canvas->show(); canvas->requestActivateWindow(); @@ -558,7 +558,7 @@ void tst_qsgtext::alignments() } //the alignment tests may be trivial o.oa -void tst_qsgtext::horizontalAlignment() +void tst_qquicktext::horizontalAlignment() { //test one align each, and then test if two align fails. @@ -569,7 +569,7 @@ void tst_qsgtext::horizontalAlignment() QString componentStr = "import QtQuick 2.0\nText { horizontalAlignment: \"" + horizontalAlignmentmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE((int)textObject->hAlign(), (int)horizontalAlignmentments.at(j)); @@ -584,7 +584,7 @@ void tst_qsgtext::horizontalAlignment() QString componentStr = "import QtQuick 2.0\nText { horizontalAlignment: \"" + horizontalAlignmentmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE((int)textObject->hAlign(), (int)horizontalAlignmentments.at(j)); @@ -594,98 +594,98 @@ void tst_qsgtext::horizontalAlignment() } -void tst_qsgtext::horizontalAlignment_RightToLeft() +void tst_qquicktext::horizontalAlignment_RightToLeft() { - QSGView *canvas = createView(TESTDATA("horizontalAlignment_RightToLeft.qml")); - QSGText *text = canvas->rootObject()->findChild<QSGText*>("text"); + QQuickView *canvas = createView(TESTDATA("horizontalAlignment_RightToLeft.qml")); + QQuickText *text = canvas->rootObject()->findChild<QQuickText*>("text"); QVERIFY(text != 0); canvas->show(); - QSGTextPrivate *textPrivate = QSGTextPrivate::get(text); + QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(text); QVERIFY(textPrivate != 0); // implicit alignment should follow the reading direction of RTL text - QCOMPARE(text->hAlign(), QSGText::AlignRight); + QCOMPARE(text->hAlign(), QQuickText::AlignRight); QCOMPARE(text->effectiveHAlign(), text->hAlign()); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2); // explicitly left aligned text - text->setHAlign(QSGText::AlignLeft); - QCOMPARE(text->hAlign(), QSGText::AlignLeft); + text->setHAlign(QQuickText::AlignLeft); + QCOMPARE(text->hAlign(), QQuickText::AlignLeft); QCOMPARE(text->effectiveHAlign(), text->hAlign()); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2); // explicitly right aligned text - text->setHAlign(QSGText::AlignRight); - QCOMPARE(text->hAlign(), QSGText::AlignRight); + text->setHAlign(QQuickText::AlignRight); + QCOMPARE(text->hAlign(), QQuickText::AlignRight); QCOMPARE(text->effectiveHAlign(), text->hAlign()); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2); // change to rich text QString textString = text->text(); text->setText(QString("<i>") + textString + QString("</i>")); - text->setTextFormat(QSGText::RichText); + text->setTextFormat(QQuickText::RichText); text->resetHAlign(); // implicitly aligned rich text should follow the reading direction of text - QCOMPARE(text->hAlign(), QSGText::AlignRight); + QCOMPARE(text->hAlign(), QQuickText::AlignRight); QCOMPARE(text->effectiveHAlign(), text->hAlign()); QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft); // explicitly left aligned rich text - text->setHAlign(QSGText::AlignLeft); - QCOMPARE(text->hAlign(), QSGText::AlignLeft); + text->setHAlign(QQuickText::AlignLeft); + QCOMPARE(text->hAlign(), QQuickText::AlignLeft); QCOMPARE(text->effectiveHAlign(), text->hAlign()); QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignRight); // explicitly right aligned rich text - text->setHAlign(QSGText::AlignRight); - QCOMPARE(text->hAlign(), QSGText::AlignRight); + text->setHAlign(QQuickText::AlignRight); + QCOMPARE(text->hAlign(), QQuickText::AlignRight); QCOMPARE(text->effectiveHAlign(), text->hAlign()); QVERIFY(textPrivate->textDocument()->defaultTextOption().alignment() & Qt::AlignLeft); text->setText(textString); - text->setTextFormat(QSGText::PlainText); + text->setTextFormat(QQuickText::PlainText); // explicitly center aligned - text->setHAlign(QSGText::AlignHCenter); - QCOMPARE(text->hAlign(), QSGText::AlignHCenter); + text->setHAlign(QQuickText::AlignHCenter); + QCOMPARE(text->hAlign(), QQuickText::AlignHCenter); QCOMPARE(text->effectiveHAlign(), text->hAlign()); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().right() > canvas->width()/2); // reseted alignment should go back to following the text reading direction text->resetHAlign(); - QCOMPARE(text->hAlign(), QSGText::AlignRight); + QCOMPARE(text->hAlign(), QQuickText::AlignRight); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2); // mirror the text item - QSGItemPrivate::get(text)->setLayoutMirror(true); + QQuickItemPrivate::get(text)->setLayoutMirror(true); // mirrored implicit alignment should continue to follow the reading direction of the text - QCOMPARE(text->hAlign(), QSGText::AlignRight); - QCOMPARE(text->effectiveHAlign(), QSGText::AlignRight); + QCOMPARE(text->hAlign(), QQuickText::AlignRight); + QCOMPARE(text->effectiveHAlign(), QQuickText::AlignRight); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2); // mirrored explicitly right aligned behaves as left aligned - text->setHAlign(QSGText::AlignRight); - QCOMPARE(text->hAlign(), QSGText::AlignRight); - QCOMPARE(text->effectiveHAlign(), QSGText::AlignLeft); + text->setHAlign(QQuickText::AlignRight); + QCOMPARE(text->hAlign(), QQuickText::AlignRight); + QCOMPARE(text->effectiveHAlign(), QQuickText::AlignLeft); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2); // mirrored explicitly left aligned behaves as right aligned - text->setHAlign(QSGText::AlignLeft); - QCOMPARE(text->hAlign(), QSGText::AlignLeft); - QCOMPARE(text->effectiveHAlign(), QSGText::AlignRight); + text->setHAlign(QQuickText::AlignLeft); + QCOMPARE(text->hAlign(), QQuickText::AlignLeft); + QCOMPARE(text->effectiveHAlign(), QQuickText::AlignRight); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() > canvas->width()/2); // disable mirroring - QSGItemPrivate::get(text)->setLayoutMirror(false); + QQuickItemPrivate::get(text)->setLayoutMirror(false); text->resetHAlign(); // English text should be implicitly left aligned text->setText("Hello world!"); - QCOMPARE(text->hAlign(), QSGText::AlignLeft); + QCOMPARE(text->hAlign(), QQuickText::AlignLeft); QVERIFY(textPrivate->layout.lineAt(0).naturalTextRect().left() < canvas->width()/2); #ifndef Q_OS_MAC // QTBUG-18040 @@ -693,9 +693,9 @@ void tst_qsgtext::horizontalAlignment_RightToLeft() // keyboard input direction from QApplication::keyboardInputDirection text->setText(""); QCOMPARE(text->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? - QSGText::AlignLeft : QSGText::AlignRight); - text->setHAlign(QSGText::AlignRight); - QCOMPARE(text->hAlign(), QSGText::AlignRight); + QQuickText::AlignLeft : QQuickText::AlignRight); + text->setHAlign(QQuickText::AlignRight); + QCOMPARE(text->hAlign(), QQuickText::AlignRight); #endif delete canvas; @@ -705,14 +705,14 @@ void tst_qsgtext::horizontalAlignment_RightToLeft() QString componentStr = "import QtQuick 2.0\nText {}"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->hAlign(), QApplication::keyboardInputDirection() == Qt::LeftToRight ? - QSGText::AlignLeft : QSGText::AlignRight); + QQuickText::AlignLeft : QQuickText::AlignRight); delete textObject; #endif } -void tst_qsgtext::verticalAlignment() +void tst_qquicktext::verticalAlignment() { //test one align each, and then test if two align fails. @@ -723,7 +723,7 @@ void tst_qsgtext::verticalAlignment() QString componentStr = "import QtQuick 2.0\nText { verticalAlignment: \"" + verticalAlignmentmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->vAlign(), (int)verticalAlignmentments.at(j)); @@ -739,7 +739,7 @@ void tst_qsgtext::verticalAlignment() QString componentStr = "import QtQuick 2.0\nText { verticalAlignment: \"" + verticalAlignmentmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->vAlign(), (int)verticalAlignmentments.at(j)); @@ -750,14 +750,14 @@ void tst_qsgtext::verticalAlignment() } -void tst_qsgtext::font() +void tst_qquicktext::font() { //test size, then bold, then italic, then family { QString componentStr = "import QtQuick 2.0\nText { font.pointSize: 40; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->font().pointSize(), 40); QCOMPARE(textObject->font().bold(), false); @@ -770,7 +770,7 @@ void tst_qsgtext::font() QString componentStr = "import QtQuick 2.0\nText { font.pixelSize: 40; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->font().pixelSize(), 40); QCOMPARE(textObject->font().bold(), false); @@ -783,7 +783,7 @@ void tst_qsgtext::font() QString componentStr = "import QtQuick 2.0\nText { font.bold: true; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->font().bold(), true); QCOMPARE(textObject->font().italic(), false); @@ -795,7 +795,7 @@ void tst_qsgtext::font() QString componentStr = "import QtQuick 2.0\nText { font.italic: true; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->font().italic(), true); QCOMPARE(textObject->font().bold(), false); @@ -807,7 +807,7 @@ void tst_qsgtext::font() QString componentStr = "import QtQuick 2.0\nText { font.family: \"Helvetica\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->font().family(), QString("Helvetica")); QCOMPARE(textObject->font().bold(), false); @@ -820,7 +820,7 @@ void tst_qsgtext::font() QString componentStr = "import QtQuick 2.0\nText { font.family: \"\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->font().family(), QString("")); @@ -828,7 +828,7 @@ void tst_qsgtext::font() } } -void tst_qsgtext::style() +void tst_qquicktext::style() { //test style for (int i = 0; i < styles.size(); i++) @@ -836,7 +836,7 @@ void tst_qsgtext::style() QString componentStr = "import QtQuick 2.0\nText { style: \"" + styleStrings.at(i) + "\"; styleColor: \"white\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE((int)textObject->style(), (int)styles.at(i)); QCOMPARE(textObject->styleColor(), QColor("white")); @@ -846,10 +846,10 @@ void tst_qsgtext::style() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QRectF brPre = textObject->boundingRect(); - textObject->setStyle(QSGText::Outline); + textObject->setStyle(QQuickText::Outline); QRectF brPost = textObject->boundingRect(); QVERIFY(brPre.width() < brPost.width()); @@ -858,7 +858,7 @@ void tst_qsgtext::style() delete textObject; } -void tst_qsgtext::color() +void tst_qquicktext::color() { //test style for (int i = 0; i < colorStrings.size(); i++) @@ -866,7 +866,7 @@ void tst_qsgtext::color() QString componentStr = "import QtQuick 2.0\nText { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->color(), QColor(colorStrings.at(i))); QCOMPARE(textObject->styleColor(), QColor()); @@ -879,7 +879,7 @@ void tst_qsgtext::color() QString componentStr = "import QtQuick 2.0\nText { styleColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->styleColor(), QColor(colorStrings.at(i))); // default color to black? @@ -895,7 +895,7 @@ void tst_qsgtext::color() QString componentStr = "import QtQuick 2.0\nText { color: \"" + colorStrings.at(i) + "\"; styleColor: \"" + colorStrings.at(j) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->color(), QColor(colorStrings.at(i))); QCOMPARE(textObject->styleColor(), QColor(colorStrings.at(j))); @@ -911,7 +911,7 @@ void tst_qsgtext::color() QString componentStr = "import QtQuick 2.0\nText { color: \"" + colorStr + "\"; text: \"Hello World\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->color(), testColor); @@ -919,7 +919,7 @@ void tst_qsgtext::color() } } -void tst_qsgtext::smooth() +void tst_qquicktext::smooth() { for (int i = 0; i < standard.size(); i++) { @@ -927,7 +927,7 @@ void tst_qsgtext::smooth() QString componentStr = "import QtQuick 2.0\nText { smooth: true; text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->smooth(), true); delete textObject; @@ -936,7 +936,7 @@ void tst_qsgtext::smooth() QString componentStr = "import QtQuick 2.0\nText { text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->smooth(), false); delete textObject; @@ -948,7 +948,7 @@ void tst_qsgtext::smooth() QString componentStr = "import QtQuick 2.0\nText { smooth: true; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->smooth(), true); delete textObject; @@ -957,7 +957,7 @@ void tst_qsgtext::smooth() QString componentStr = "import QtQuick 2.0\nText { text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QCOMPARE(textObject->smooth(), false); delete textObject; @@ -965,13 +965,13 @@ void tst_qsgtext::smooth() } } -void tst_qsgtext::weight() +void tst_qquicktext::weight() { { QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->font().weight(), (int)QDeclarativeFontValueType::Normal); @@ -982,7 +982,7 @@ void tst_qsgtext::weight() QString componentStr = "import QtQuick 2.0\nText { font.weight: \"Bold\"; text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->font().weight(), (int)QDeclarativeFontValueType::Bold); @@ -991,13 +991,13 @@ void tst_qsgtext::weight() } } -void tst_qsgtext::underline() +void tst_qquicktext::underline() { { QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().underline(), false); @@ -1008,7 +1008,7 @@ void tst_qsgtext::underline() QString componentStr = "import QtQuick 2.0\nText { font.underline: true; text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().underline(), true); @@ -1017,13 +1017,13 @@ void tst_qsgtext::underline() } } -void tst_qsgtext::overline() +void tst_qquicktext::overline() { { QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().overline(), false); @@ -1034,7 +1034,7 @@ void tst_qsgtext::overline() QString componentStr = "import QtQuick 2.0\nText { font.overline: true; text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().overline(), true); @@ -1043,13 +1043,13 @@ void tst_qsgtext::overline() } } -void tst_qsgtext::strikeout() +void tst_qquicktext::strikeout() { { QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().strikeOut(), false); @@ -1060,7 +1060,7 @@ void tst_qsgtext::strikeout() QString componentStr = "import QtQuick 2.0\nText { font.strikeout: true; text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().strikeOut(), true); @@ -1069,13 +1069,13 @@ void tst_qsgtext::strikeout() } } -void tst_qsgtext::capitalization() +void tst_qquicktext::capitalization() { { QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::MixedCase); @@ -1086,7 +1086,7 @@ void tst_qsgtext::capitalization() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\"; font.capitalization: \"AllUppercase\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::AllUppercase); @@ -1097,7 +1097,7 @@ void tst_qsgtext::capitalization() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\"; font.capitalization: \"AllLowercase\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::AllLowercase); @@ -1108,7 +1108,7 @@ void tst_qsgtext::capitalization() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\"; font.capitalization: \"SmallCaps\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::SmallCaps); @@ -1119,7 +1119,7 @@ void tst_qsgtext::capitalization() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\"; font.capitalization: \"Capitalize\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE((int)textObject->font().capitalization(), (int)QDeclarativeFontValueType::Capitalize); @@ -1128,13 +1128,13 @@ void tst_qsgtext::capitalization() } } -void tst_qsgtext::letterSpacing() +void tst_qquicktext::letterSpacing() { { QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().letterSpacing(), 0.0); @@ -1145,7 +1145,7 @@ void tst_qsgtext::letterSpacing() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\"; font.letterSpacing: -2 }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().letterSpacing(), -2.); @@ -1156,7 +1156,7 @@ void tst_qsgtext::letterSpacing() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\"; font.letterSpacing: 3 }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().letterSpacing(), 3.); @@ -1165,13 +1165,13 @@ void tst_qsgtext::letterSpacing() } } -void tst_qsgtext::wordSpacing() +void tst_qquicktext::wordSpacing() { { QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().wordSpacing(), 0.0); @@ -1182,7 +1182,7 @@ void tst_qsgtext::wordSpacing() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\"; font.wordSpacing: -50 }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().wordSpacing(), -50.); @@ -1193,7 +1193,7 @@ void tst_qsgtext::wordSpacing() QString componentStr = "import QtQuick 2.0\nText { text: \"Hello world!\"; font.wordSpacing: 200 }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); QCOMPARE(textObject->font().wordSpacing(), 200.); @@ -1205,7 +1205,7 @@ void tst_qsgtext::wordSpacing() -class EventSender : public QSGItem +class EventSender : public QQuickItem { public: void sendEvent(QMouseEvent *event) { @@ -1230,13 +1230,13 @@ public slots: void linkClicked(QString l) { link = l; } }; -void tst_qsgtext::clickLink() +void tst_qquicktext::clickLink() { { QString componentStr = "import QtQuick 2.0\nText { text: \"<a href=\\\"http://qt.nokia.com\\\">Hello world!</a>\" }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); @@ -1245,13 +1245,13 @@ void tst_qsgtext::clickLink() { QMouseEvent me(QEvent::MouseButtonPress,QPointF(textObject->x()/2, textObject->y()/2), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); - static_cast<EventSender*>(static_cast<QSGItem*>(textObject))->sendEvent(&me); + static_cast<EventSender*>(static_cast<QQuickItem*>(textObject))->sendEvent(&me); } { QMouseEvent me(QEvent::MouseButtonRelease,QPointF(textObject->x()/2, textObject->y()/2), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); - static_cast<EventSender*>(static_cast<QSGItem*>(textObject))->sendEvent(&me); + static_cast<EventSender*>(static_cast<QQuickItem*>(textObject))->sendEvent(&me); } @@ -1262,7 +1262,7 @@ void tst_qsgtext::clickLink() } } -void tst_qsgtext::embeddedImages_data() +void tst_qquicktext::embeddedImages_data() { QTest::addColumn<QUrl>("qmlfile"); QTest::addColumn<QString>("error"); @@ -1274,7 +1274,7 @@ void tst_qsgtext::embeddedImages_data() << QUrl::fromLocalFile(TESTDATA("embeddedImagesRemoteError.qml")).toString()+":3:1: QML Text: Error downloading http://127.0.0.1:14453/notexists.png - server replied: Not found"; } -void tst_qsgtext::embeddedImages() +void tst_qquicktext::embeddedImages() { // Tests QTBUG-9900 @@ -1288,7 +1288,7 @@ void tst_qsgtext::embeddedImages() QTest::ignoreMessage(QtWarningMsg, error.toLatin1()); QDeclarativeComponent textComponent(&engine, qmlfile); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject != 0); @@ -1307,11 +1307,11 @@ void tst_qsgtext::embeddedImages() delete textObject; } -void tst_qsgtext::lineCount() +void tst_qquicktext::lineCount() { - QSGView *canvas = createView(TESTDATA("lineCount.qml")); + QQuickView *canvas = createView(TESTDATA("lineCount.qml")); - QSGText *myText = canvas->rootObject()->findChild<QSGText*>("myText"); + QQuickText *myText = canvas->rootObject()->findChild<QQuickText*>("myText"); QVERIFY(myText != 0); QVERIFY(myText->lineCount() > 1); @@ -1327,7 +1327,7 @@ void tst_qsgtext::lineCount() QCOMPARE(myText->maximumLineCount(), INT_MAX); QCOMPARE(myText->truncated(), false); - myText->setElideMode(QSGText::ElideRight); + myText->setElideMode(QQuickText::ElideRight); myText->setMaximumLineCount(2); QCOMPARE(myText->lineCount(), 2); QCOMPARE(myText->truncated(), true); @@ -1336,15 +1336,15 @@ void tst_qsgtext::lineCount() delete canvas; } -void tst_qsgtext::lineHeight() +void tst_qquicktext::lineHeight() { - QSGView *canvas = createView(TESTDATA("lineHeight.qml")); + QQuickView *canvas = createView(TESTDATA("lineHeight.qml")); - QSGText *myText = canvas->rootObject()->findChild<QSGText*>("myText"); + QQuickText *myText = canvas->rootObject()->findChild<QQuickText*>("myText"); QVERIFY(myText != 0); QVERIFY(myText->lineHeight() == 1); - QVERIFY(myText->lineHeightMode() == QSGText::ProportionalHeight); + QVERIFY(myText->lineHeightMode() == QQuickText::ProportionalHeight); qreal h = myText->height(); myText->setLineHeight(1.5); @@ -1353,26 +1353,26 @@ void tst_qsgtext::lineHeight() #endif QVERIFY(myText->height() == h * 1.5); - myText->setLineHeightMode(QSGText::FixedHeight); + myText->setLineHeightMode(QQuickText::FixedHeight); myText->setLineHeight(20); QCOMPARE(myText->height(), myText->lineCount() * 20.0); myText->setText("Lorem ipsum sit <b>amet</b>, consectetur adipiscing elit. Integer felis nisl, varius in pretium nec, venenatis non erat. Proin lobortis interdum dictum."); - myText->setLineHeightMode(QSGText::ProportionalHeight); + myText->setLineHeightMode(QQuickText::ProportionalHeight); myText->setLineHeight(1.0); qreal h2 = myText->height(); myText->setLineHeight(2.0); QVERIFY(myText->height() == h2 * 2.0); - myText->setLineHeightMode(QSGText::FixedHeight); + myText->setLineHeightMode(QQuickText::FixedHeight); myText->setLineHeight(10); QCOMPARE(myText->height(), myText->lineCount() * 10.0); delete canvas; } -void tst_qsgtext::implicitSize_data() +void tst_qquicktext::implicitSize_data() { QTest::addColumn<QString>("text"); QTest::addColumn<QString>("wrap"); @@ -1382,14 +1382,14 @@ void tst_qsgtext::implicitSize_data() QTest::newRow("richtext_wrap") << "<b>The quick red fox jumped over the lazy brown dog</b>" << "Text.Wrap"; } -void tst_qsgtext::implicitSize() +void tst_qquicktext::implicitSize() { QFETCH(QString, text); QFETCH(QString, wrap); QString componentStr = "import QtQuick 2.0\nText { text: \"" + text + "\"; width: 50; wrapMode: " + wrap + " }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGText *textObject = qobject_cast<QSGText*>(textComponent.create()); + QQuickText *textObject = qobject_cast<QQuickText*>(textComponent.create()); QVERIFY(textObject->width() < textObject->implicitWidth()); QVERIFY(textObject->height() == textObject->implicitHeight()); @@ -1401,14 +1401,14 @@ void tst_qsgtext::implicitSize() delete textObject; } -void tst_qsgtext::lineLaidOut() +void tst_qquicktext::lineLaidOut() { - QSGView *canvas = createView(TESTDATA("lineLayout.qml")); + QQuickView *canvas = createView(TESTDATA("lineLayout.qml")); - QSGText *myText = canvas->rootObject()->findChild<QSGText*>("myText"); + QQuickText *myText = canvas->rootObject()->findChild<QQuickText*>("myText"); QVERIFY(myText != 0); - QSGTextPrivate *textPrivate = QSGTextPrivate::get(myText); + QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(myText); QVERIFY(textPrivate != 0); QTextDocument *doc = textPrivate->textDocument(); @@ -1428,6 +1428,6 @@ void tst_qsgtext::lineLaidOut() } } -QTEST_MAIN(tst_qsgtext) +QTEST_MAIN(tst_qquicktext) -#include "tst_qsgtext.moc" +#include "tst_qquicktext.moc" diff --git a/tests/auto/declarative/qsgtextedit/data/CursorRect.qml b/tests/auto/declarative/qquicktextedit/data/CursorRect.qml index cae3e63b72..cae3e63b72 100644 --- a/tests/auto/declarative/qsgtextedit/data/CursorRect.qml +++ b/tests/auto/declarative/qquicktextedit/data/CursorRect.qml diff --git a/tests/auto/declarative/qsgtextedit/data/alignments.qml b/tests/auto/declarative/qquicktextedit/data/alignments.qml index 7d365da8cb..7d365da8cb 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments.qml +++ b/tests/auto/declarative/qquicktextedit/data/alignments.qml diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_cb.png b/tests/auto/declarative/qquicktextedit/data/alignments_cb.png Binary files differindex 99de2192de..99de2192de 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_cb.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_cb.png diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_cc.png b/tests/auto/declarative/qquicktextedit/data/alignments_cc.png Binary files differindex cb85251180..cb85251180 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_cc.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_cc.png diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_ct.png b/tests/auto/declarative/qquicktextedit/data/alignments_ct.png Binary files differindex ddca549c82..ddca549c82 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_ct.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_ct.png diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_lb.png b/tests/auto/declarative/qquicktextedit/data/alignments_lb.png Binary files differindex 1b50a81f3d..1b50a81f3d 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_lb.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_lb.png diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_lc.png b/tests/auto/declarative/qquicktextedit/data/alignments_lc.png Binary files differindex f041b868f8..f041b868f8 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_lc.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_lc.png diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_lt.png b/tests/auto/declarative/qquicktextedit/data/alignments_lt.png Binary files differindex c75e0d158e..c75e0d158e 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_lt.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_lt.png diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_rb.png b/tests/auto/declarative/qquicktextedit/data/alignments_rb.png Binary files differindex b06a5da715..b06a5da715 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_rb.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_rb.png diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_rc.png b/tests/auto/declarative/qquicktextedit/data/alignments_rc.png Binary files differindex e468857cd0..e468857cd0 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_rc.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_rc.png diff --git a/tests/auto/declarative/qsgtextedit/data/alignments_rt.png b/tests/auto/declarative/qquicktextedit/data/alignments_rt.png Binary files differindex 576715ffce..576715ffce 100644 --- a/tests/auto/declarative/qsgtextedit/data/alignments_rt.png +++ b/tests/auto/declarative/qquicktextedit/data/alignments_rt.png diff --git a/tests/auto/declarative/qsgtextedit/data/cursorTest.qml b/tests/auto/declarative/qquicktextedit/data/cursorTest.qml index 7bfc869403..7bfc869403 100644 --- a/tests/auto/declarative/qsgtextedit/data/cursorTest.qml +++ b/tests/auto/declarative/qquicktextedit/data/cursorTest.qml diff --git a/tests/auto/declarative/qsgtextedit/data/cursorVisible.qml b/tests/auto/declarative/qquicktextedit/data/cursorVisible.qml index 49e9386947..49e9386947 100644 --- a/tests/auto/declarative/qsgtextedit/data/cursorVisible.qml +++ b/tests/auto/declarative/qquicktextedit/data/cursorVisible.qml diff --git a/tests/auto/declarative/qsgtextedit/data/geometrySignals.qml b/tests/auto/declarative/qquicktextedit/data/geometrySignals.qml index 3dbe61c74b..3dbe61c74b 100644 --- a/tests/auto/declarative/qsgtextedit/data/geometrySignals.qml +++ b/tests/auto/declarative/qquicktextedit/data/geometrySignals.qml diff --git a/tests/auto/declarative/qsgtextedit/data/horizontalAlignment_RightToLeft.qml b/tests/auto/declarative/qquicktextedit/data/horizontalAlignment_RightToLeft.qml index 4cd92367ec..4cd92367ec 100644 --- a/tests/auto/declarative/qsgtextedit/data/horizontalAlignment_RightToLeft.qml +++ b/tests/auto/declarative/qquicktextedit/data/horizontalAlignment_RightToLeft.qml diff --git a/tests/auto/declarative/qsgtextedit/data/http/ErrItem.qml b/tests/auto/declarative/qquicktextedit/data/http/ErrItem.qml index 68c0e0c093..68c0e0c093 100644 --- a/tests/auto/declarative/qsgtextedit/data/http/ErrItem.qml +++ b/tests/auto/declarative/qquicktextedit/data/http/ErrItem.qml diff --git a/tests/auto/declarative/qsgtextedit/data/http/NormItem.qml b/tests/auto/declarative/qquicktextedit/data/http/NormItem.qml index 2e4c1ed440..2e4c1ed440 100644 --- a/tests/auto/declarative/qsgtextedit/data/http/NormItem.qml +++ b/tests/auto/declarative/qquicktextedit/data/http/NormItem.qml diff --git a/tests/auto/declarative/qsgtextedit/data/http/cursorHttpTest.qml b/tests/auto/declarative/qquicktextedit/data/http/cursorHttpTest.qml index be4526e22b..be4526e22b 100644 --- a/tests/auto/declarative/qsgtextedit/data/http/cursorHttpTest.qml +++ b/tests/auto/declarative/qquicktextedit/data/http/cursorHttpTest.qml diff --git a/tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestFail1.qml b/tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestFail1.qml index 1d7763f913..1d7763f913 100644 --- a/tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestFail1.qml +++ b/tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestFail1.qml diff --git a/tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestFail2.qml b/tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestFail2.qml index c82ec02e68..c82ec02e68 100644 --- a/tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestFail2.qml +++ b/tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestFail2.qml diff --git a/tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestPass.qml b/tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestPass.qml index 96d582c95d..96d582c95d 100644 --- a/tests/auto/declarative/qsgtextedit/data/http/cursorHttpTestPass.qml +++ b/tests/auto/declarative/qquicktextedit/data/http/cursorHttpTestPass.qml diff --git a/tests/auto/declarative/qsgtextedit/data/http/qmldir b/tests/auto/declarative/qquicktextedit/data/http/qmldir index 886e6ffec0..886e6ffec0 100644 --- a/tests/auto/declarative/qsgtextedit/data/http/qmldir +++ b/tests/auto/declarative/qquicktextedit/data/http/qmldir diff --git a/tests/auto/declarative/qsgtextedit/data/httpfail/FailItem.qml b/tests/auto/declarative/qquicktextedit/data/httpfail/FailItem.qml index 8161843479..8161843479 100644 --- a/tests/auto/declarative/qsgtextedit/data/httpfail/FailItem.qml +++ b/tests/auto/declarative/qquicktextedit/data/httpfail/FailItem.qml diff --git a/tests/auto/declarative/qsgtextedit/data/httpslow/WaitItem.qml b/tests/auto/declarative/qquicktextedit/data/httpslow/WaitItem.qml index 8161843479..8161843479 100644 --- a/tests/auto/declarative/qsgtextedit/data/httpslow/WaitItem.qml +++ b/tests/auto/declarative/qquicktextedit/data/httpslow/WaitItem.qml diff --git a/tests/auto/declarative/qsgtextedit/data/inputContext.qml b/tests/auto/declarative/qquicktextedit/data/inputContext.qml index a37c77e3bf..a37c77e3bf 100644 --- a/tests/auto/declarative/qsgtextedit/data/inputContext.qml +++ b/tests/auto/declarative/qquicktextedit/data/inputContext.qml diff --git a/tests/auto/declarative/qsgtextedit/data/inputMethodEvent.qml b/tests/auto/declarative/qquicktextedit/data/inputMethodEvent.qml index e3f629ce3e..e3f629ce3e 100644 --- a/tests/auto/declarative/qsgtextedit/data/inputMethodEvent.qml +++ b/tests/auto/declarative/qquicktextedit/data/inputMethodEvent.qml diff --git a/tests/auto/declarative/qsgtextedit/data/inputmethodhints.qml b/tests/auto/declarative/qquicktextedit/data/inputmethodhints.qml index dec3b978e7..dec3b978e7 100644 --- a/tests/auto/declarative/qsgtextedit/data/inputmethodhints.qml +++ b/tests/auto/declarative/qquicktextedit/data/inputmethodhints.qml diff --git a/tests/auto/declarative/qsgtextedit/data/mouseselection_default.qml b/tests/auto/declarative/qquicktextedit/data/mouseselection_default.qml index ac32f4ced7..ac32f4ced7 100644 --- a/tests/auto/declarative/qsgtextedit/data/mouseselection_default.qml +++ b/tests/auto/declarative/qquicktextedit/data/mouseselection_default.qml diff --git a/tests/auto/declarative/qsgtextedit/data/mouseselection_false.qml b/tests/auto/declarative/qquicktextedit/data/mouseselection_false.qml index ac32f4ced7..ac32f4ced7 100644 --- a/tests/auto/declarative/qsgtextedit/data/mouseselection_false.qml +++ b/tests/auto/declarative/qquicktextedit/data/mouseselection_false.qml diff --git a/tests/auto/declarative/qsgtextedit/data/mouseselection_false_words.qml b/tests/auto/declarative/qquicktextedit/data/mouseselection_false_words.qml index 86aea46a85..86aea46a85 100644 --- a/tests/auto/declarative/qsgtextedit/data/mouseselection_false_words.qml +++ b/tests/auto/declarative/qquicktextedit/data/mouseselection_false_words.qml diff --git a/tests/auto/declarative/qsgtextedit/data/mouseselection_true.qml b/tests/auto/declarative/qquicktextedit/data/mouseselection_true.qml index 7c7cb0b6fc..7c7cb0b6fc 100644 --- a/tests/auto/declarative/qsgtextedit/data/mouseselection_true.qml +++ b/tests/auto/declarative/qquicktextedit/data/mouseselection_true.qml diff --git a/tests/auto/declarative/qsgtextedit/data/mouseselection_true_words.qml b/tests/auto/declarative/qquicktextedit/data/mouseselection_true_words.qml index c356999220..c356999220 100644 --- a/tests/auto/declarative/qsgtextedit/data/mouseselection_true_words.qml +++ b/tests/auto/declarative/qquicktextedit/data/mouseselection_true_words.qml diff --git a/tests/auto/declarative/qsgtextedit/data/mouseselectionmode_characters.qml b/tests/auto/declarative/qquicktextedit/data/mouseselectionmode_characters.qml index c1fe42fd57..c1fe42fd57 100644 --- a/tests/auto/declarative/qsgtextedit/data/mouseselectionmode_characters.qml +++ b/tests/auto/declarative/qquicktextedit/data/mouseselectionmode_characters.qml diff --git a/tests/auto/declarative/qsgtextedit/data/mouseselectionmode_default.qml b/tests/auto/declarative/qquicktextedit/data/mouseselectionmode_default.qml index 7c7cb0b6fc..7c7cb0b6fc 100644 --- a/tests/auto/declarative/qsgtextedit/data/mouseselectionmode_default.qml +++ b/tests/auto/declarative/qquicktextedit/data/mouseselectionmode_default.qml diff --git a/tests/auto/declarative/qsgtextedit/data/mouseselectionmode_words.qml b/tests/auto/declarative/qquicktextedit/data/mouseselectionmode_words.qml index 0a372bbf83..0a372bbf83 100644 --- a/tests/auto/declarative/qsgtextedit/data/mouseselectionmode_words.qml +++ b/tests/auto/declarative/qquicktextedit/data/mouseselectionmode_words.qml diff --git a/tests/auto/declarative/qsgtextedit/data/navigation.qml b/tests/auto/declarative/qquicktextedit/data/navigation.qml index 0201c62b3c..0201c62b3c 100644 --- a/tests/auto/declarative/qsgtextedit/data/navigation.qml +++ b/tests/auto/declarative/qquicktextedit/data/navigation.qml diff --git a/tests/auto/declarative/qsgtextedit/data/openInputPanel.qml b/tests/auto/declarative/qquicktextedit/data/openInputPanel.qml index d3aecf21be..d3aecf21be 100644 --- a/tests/auto/declarative/qsgtextedit/data/openInputPanel.qml +++ b/tests/auto/declarative/qquicktextedit/data/openInputPanel.qml diff --git a/tests/auto/declarative/qsgtextedit/data/positionAt.qml b/tests/auto/declarative/qquicktextedit/data/positionAt.qml index 19093281fe..19093281fe 100644 --- a/tests/auto/declarative/qsgtextedit/data/positionAt.qml +++ b/tests/auto/declarative/qquicktextedit/data/positionAt.qml diff --git a/tests/auto/declarative/qsgtextedit/data/qtbug-22058.qml b/tests/auto/declarative/qquicktextedit/data/qtbug-22058.qml index 8ad1514fbf..8ad1514fbf 100644 --- a/tests/auto/declarative/qsgtextedit/data/qtbug-22058.qml +++ b/tests/auto/declarative/qquicktextedit/data/qtbug-22058.qml diff --git a/tests/auto/declarative/qsgtextedit/data/readOnly.qml b/tests/auto/declarative/qquicktextedit/data/readOnly.qml index 085adba5fb..085adba5fb 100644 --- a/tests/auto/declarative/qsgtextedit/data/readOnly.qml +++ b/tests/auto/declarative/qquicktextedit/data/readOnly.qml diff --git a/tests/auto/declarative/qsgtextedit/qsgtextedit.pro b/tests/auto/declarative/qquicktextedit/qquicktextedit.pro index 41c7b65b56..ae2233dafc 100644 --- a/tests/auto/declarative/qsgtextedit/qsgtextedit.pro +++ b/tests/auto/declarative/qquicktextedit/qquicktextedit.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgtextedit +TARGET = tst_qquicktextedit macx:CONFIG -= app_bundle -SOURCES += tst_qsgtextedit.cpp ../shared/testhttpserver.cpp +SOURCES += tst_qquicktextedit.cpp ../shared/testhttpserver.cpp HEADERS += ../shared/testhttpserver.h testDataFiles.files = data diff --git a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp b/tests/auto/declarative/qquicktextedit/tst_qquicktextedit.cpp index 9b48b5fbd4..a0d36d6e9d 100644 --- a/tests/auto/declarative/qsgtextedit/tst_qsgtextedit.cpp +++ b/tests/auto/declarative/qquicktextedit/tst_qquicktextedit.cpp @@ -49,11 +49,11 @@ #include <QtDeclarative/qdeclarativeexpression.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <QtGui/qguiapplication.h> -#include <private/qsgtextedit_p.h> -#include <private/qsgtextedit_p_p.h> +#include <private/qquicktextedit_p.h> +#include <private/qquicktextedit_p_p.h> #include <private/qsgdistancefieldglyphcache_p.h> #include <QFontMetrics> -#include <QSGView> +#include <QQuickView> #include <QDir> #include <QStyle> #include <QInputContext> @@ -70,7 +70,7 @@ #define QTBUG_21691 #define QTBUG_21691_MESSAGE "QTBUG-21691: The test needs to be rewritten to not use QInputContext" -Q_DECLARE_METATYPE(QSGTextEdit::SelectionMode) +Q_DECLARE_METATYPE(QQuickTextEdit::SelectionMode) DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD) QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& actual) @@ -90,12 +90,12 @@ QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& } -class tst_qsgtextedit : public QObject +class tst_qquicktextedit : public QObject { Q_OBJECT public: - tst_qsgtextedit(); + tst_qquicktextedit(); private slots: void initTestCase(); @@ -159,7 +159,7 @@ private slots: void emptytags_QTBUG_22058(); private: - void simulateKey(QSGView *, int key, Qt::KeyboardModifiers modifiers = 0); + void simulateKey(QQuickView *, int key, Qt::KeyboardModifiers modifiers = 0); QStringList standard; QStringList richText; @@ -174,15 +174,15 @@ private: QDeclarativeEngine engine; }; -void tst_qsgtextedit::initTestCase() +void tst_qquicktextedit::initTestCase() { } -void tst_qsgtextedit::cleanupTestCase() +void tst_qquicktextedit::cleanupTestCase() { } -tst_qsgtextedit::tst_qsgtextedit() +tst_qquicktextedit::tst_qquicktextedit() { standard << "the quick brown fox jumped over the lazy dog" << "the quick brown fox\n jumped over the lazy dog" @@ -227,12 +227,12 @@ tst_qsgtextedit::tst_qsgtextedit() // } -void tst_qsgtextedit::text() +void tst_qquicktextedit::text() { { QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData("import QtQuick 2.0\nTextEdit { text: \"\" }", QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->text(), QString("")); @@ -243,7 +243,7 @@ void tst_qsgtextedit::text() QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->text(), standard.at(i)); @@ -254,7 +254,7 @@ void tst_qsgtextedit::text() QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QString actual = textEditObject->text(); @@ -266,13 +266,13 @@ void tst_qsgtextedit::text() } } -void tst_qsgtextedit::width() +void tst_qquicktextedit::width() { // uses Font metrics to find the width for standard and document to find the width for rich { QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData("import QtQuick 2.0\nTextEdit { text: \"\" }", QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), 0.0); @@ -316,7 +316,7 @@ void tst_qsgtextedit::width() QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), qreal(metricWidth)); @@ -335,20 +335,20 @@ void tst_qsgtextedit::width() QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), qreal(documentWidth)); } } -void tst_qsgtextedit::wrap() +void tst_qquicktextedit::wrap() { // for specified width and wrap set true { QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData("import QtQuick 2.0\nTextEdit { text: \"\"; wrapMode: TextEdit.WordWrap; width: 300 }", QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), 300.); @@ -359,7 +359,7 @@ void tst_qsgtextedit::wrap() QString componentStr = "import QtQuick 2.0\nTextEdit { wrapMode: TextEdit.WordWrap; width: 300; text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), 300.); @@ -370,7 +370,7 @@ void tst_qsgtextedit::wrap() QString componentStr = "import QtQuick 2.0\nTextEdit { wrapMode: TextEdit.WordWrap; width: 300; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->width(), 300.); @@ -378,27 +378,27 @@ void tst_qsgtextedit::wrap() } -void tst_qsgtextedit::textFormat() +void tst_qquicktextedit::textFormat() { { QDeclarativeComponent textComponent(&engine); textComponent.setData("import QtQuick 2.0\nTextEdit { text: \"Hello\"; textFormat: Text.RichText }", QUrl::fromLocalFile("")); - QSGTextEdit *textObject = qobject_cast<QSGTextEdit*>(textComponent.create()); + QQuickTextEdit *textObject = qobject_cast<QQuickTextEdit*>(textComponent.create()); QVERIFY(textObject != 0); - QVERIFY(textObject->textFormat() == QSGTextEdit::RichText); + QVERIFY(textObject->textFormat() == QQuickTextEdit::RichText); } { QDeclarativeComponent textComponent(&engine); textComponent.setData("import QtQuick 2.0\nTextEdit { text: \"<b>Hello</b>\"; textFormat: Text.PlainText }", QUrl::fromLocalFile("")); - QSGTextEdit *textObject = qobject_cast<QSGTextEdit*>(textComponent.create()); + QQuickTextEdit *textObject = qobject_cast<QQuickTextEdit*>(textComponent.create()); QVERIFY(textObject != 0); - QVERIFY(textObject->textFormat() == QSGTextEdit::PlainText); + QVERIFY(textObject->textFormat() == QQuickTextEdit::PlainText); } } -void tst_qsgtextedit::alignments_data() +void tst_qquicktextedit::alignments_data() { QTest::addColumn<int>("hAlign"); QTest::addColumn<int>("vAlign"); @@ -418,7 +418,7 @@ void tst_qsgtextedit::alignments_data() } -void tst_qsgtextedit::alignments() +void tst_qquicktextedit::alignments() { QSKIP("Image comparison of text is almost guaranteed to fail during development"); @@ -426,7 +426,7 @@ void tst_qsgtextedit::alignments() QFETCH(int, vAlign); QFETCH(QString, expectfile); - QSGView canvas(QUrl::fromLocalFile(TESTDATA("alignments.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("alignments.qml"))); canvas.show(); canvas.requestActivateWindow(); @@ -449,7 +449,7 @@ void tst_qsgtextedit::alignments() //the alignment tests may be trivial o.oa -void tst_qsgtextedit::hAlign() +void tst_qquicktextedit::hAlign() { //test one align each, and then test if two align fails. @@ -460,7 +460,7 @@ void tst_qsgtextedit::hAlign() QString componentStr = "import QtQuick 2.0\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); @@ -474,7 +474,7 @@ void tst_qsgtextedit::hAlign() QString componentStr = "import QtQuick 2.0\nTextEdit { horizontalAlignment: \"" + hAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE((int)textEditObject->hAlign(), (int)hAlignments.at(j)); @@ -483,27 +483,27 @@ void tst_qsgtextedit::hAlign() } -void tst_qsgtextedit::hAlign_RightToLeft() +void tst_qquicktextedit::hAlign_RightToLeft() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("horizontalAlignment_RightToLeft.qml"))); - QSGTextEdit *textEdit = canvas.rootObject()->findChild<QSGTextEdit*>("text"); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("horizontalAlignment_RightToLeft.qml"))); + QQuickTextEdit *textEdit = canvas.rootObject()->findChild<QQuickTextEdit*>("text"); QVERIFY(textEdit != 0); canvas.show(); const QString rtlText = textEdit->text(); // implicit alignment should follow the reading direction of text - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); // explicitly left aligned - textEdit->setHAlign(QSGTextEdit::AlignLeft); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignLeft); + textEdit->setHAlign(QQuickTextEdit::AlignLeft); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignLeft); QVERIFY(textEdit->positionToRectangle(0).x() < canvas.width()/2); // explicitly right aligned - textEdit->setHAlign(QSGTextEdit::AlignRight); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); + textEdit->setHAlign(QQuickTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); QString textString = textEdit->text(); @@ -511,61 +511,61 @@ void tst_qsgtextedit::hAlign_RightToLeft() textEdit->resetHAlign(); // implicitly aligned rich text should follow the reading direction of RTL text - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign()); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); // explicitly left aligned rich text - textEdit->setHAlign(QSGTextEdit::AlignLeft); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignLeft); + textEdit->setHAlign(QQuickTextEdit::AlignLeft); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignLeft); QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign()); QVERIFY(textEdit->positionToRectangle(0).x() < canvas.width()/2); // explicitly right aligned rich text - textEdit->setHAlign(QSGTextEdit::AlignRight); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); + textEdit->setHAlign(QQuickTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); QCOMPARE(textEdit->effectiveHAlign(), textEdit->hAlign()); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); textEdit->setText(textString); // explicitly center aligned - textEdit->setHAlign(QSGTextEdit::AlignHCenter); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignHCenter); + textEdit->setHAlign(QQuickTextEdit::AlignHCenter); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignHCenter); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); // reseted alignment should go back to following the text reading direction textEdit->resetHAlign(); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); // mirror the text item - QSGItemPrivate::get(textEdit)->setLayoutMirror(true); + QQuickItemPrivate::get(textEdit)->setLayoutMirror(true); // mirrored implicit alignment should continue to follow the reading direction of the text - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); - QCOMPARE(textEdit->effectiveHAlign(), QSGTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); + QCOMPARE(textEdit->effectiveHAlign(), QQuickTextEdit::AlignRight); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); // mirrored explicitly right aligned behaves as left aligned - textEdit->setHAlign(QSGTextEdit::AlignRight); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); - QCOMPARE(textEdit->effectiveHAlign(), QSGTextEdit::AlignLeft); + textEdit->setHAlign(QQuickTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); + QCOMPARE(textEdit->effectiveHAlign(), QQuickTextEdit::AlignLeft); QVERIFY(textEdit->positionToRectangle(0).x() < canvas.width()/2); // mirrored explicitly left aligned behaves as right aligned - textEdit->setHAlign(QSGTextEdit::AlignLeft); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignLeft); - QCOMPARE(textEdit->effectiveHAlign(), QSGTextEdit::AlignRight); + textEdit->setHAlign(QQuickTextEdit::AlignLeft); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignLeft); + QCOMPARE(textEdit->effectiveHAlign(), QQuickTextEdit::AlignRight); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); // disable mirroring - QSGItemPrivate::get(textEdit)->setLayoutMirror(false); + QQuickItemPrivate::get(textEdit)->setLayoutMirror(false); textEdit->resetHAlign(); // English text should be implicitly left aligned textEdit->setText("Hello world!"); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignLeft); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignLeft); QVERIFY(textEdit->positionToRectangle(0).x() < canvas.width()/2); canvas.requestActivateWindow(); @@ -575,22 +575,22 @@ void tst_qsgtextedit::hAlign_RightToLeft() textEdit->setText(QString()); { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QGuiApplication::sendEvent(&canvas, &ev); } QEXPECT_FAIL("", "QTBUG-21691", Abort); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); { QInputMethodEvent ev("Hello world!", QList<QInputMethodEvent::Attribute>()); QGuiApplication::sendEvent(&canvas, &ev); } - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignLeft); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignLeft); #ifndef Q_OS_MAC // QTBUG-18040 // empty text with implicit alignment follows the system locale-based // keyboard input direction from QGuiApplication::keyboardInputDirection textEdit->setText(""); QCOMPARE(textEdit->hAlign(), QGuiApplication::keyboardInputDirection() == Qt::LeftToRight ? - QSGTextEdit::AlignLeft : QSGTextEdit::AlignRight); + QQuickTextEdit::AlignLeft : QQuickTextEdit::AlignRight); if (QGuiApplication::keyboardInputDirection() == Qt::LeftToRight) QVERIFY(textEdit->positionToRectangle(0).x() < canvas.width()/2); else QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); - textEdit->setHAlign(QSGTextEdit::AlignRight); - QCOMPARE(textEdit->hAlign(), QSGTextEdit::AlignRight); + textEdit->setHAlign(QQuickTextEdit::AlignRight); + QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignRight); QVERIFY(textEdit->positionToRectangle(0).x() > canvas.width()/2); #endif @@ -599,14 +599,14 @@ void tst_qsgtextedit::hAlign_RightToLeft() QString componentStr = "import QtQuick 2.0\nTextEdit {}"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGTextEdit *textObject = qobject_cast<QSGTextEdit*>(textComponent.create()); + QQuickTextEdit *textObject = qobject_cast<QQuickTextEdit*>(textComponent.create()); QCOMPARE(textObject->hAlign(), QGuiApplication::keyboardInputDirection() == Qt::LeftToRight ? - QSGTextEdit::AlignLeft : QSGTextEdit::AlignRight); + QQuickTextEdit::AlignLeft : QQuickTextEdit::AlignRight); delete textObject; #endif } -void tst_qsgtextedit::vAlign() +void tst_qquicktextedit::vAlign() { //test one align each, and then test if two align fails. @@ -617,7 +617,7 @@ void tst_qsgtextedit::vAlign() QString componentStr = "import QtQuick 2.0\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); @@ -631,7 +631,7 @@ void tst_qsgtextedit::vAlign() QString componentStr = "import QtQuick 2.0\nTextEdit { verticalAlignment: \"" + vAlignmentStrings.at(j) + "\"; text: \"" + richText.at(i) + "\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE((int)textEditObject->vAlign(), (int)vAlignments.at(j)); @@ -640,14 +640,14 @@ void tst_qsgtextedit::vAlign() } -void tst_qsgtextedit::font() +void tst_qquicktextedit::font() { //test size, then bold, then italic, then family { QString componentStr = "import QtQuick 2.0\nTextEdit { font.pointSize: 40; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().pointSize(), 40); @@ -659,7 +659,7 @@ void tst_qsgtextedit::font() QString componentStr = "import QtQuick 2.0\nTextEdit { font.bold: true; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().bold(), true); @@ -670,18 +670,18 @@ void tst_qsgtextedit::font() QString componentStr = "import QtQuick 2.0\nTextEdit { font.italic: true; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().italic(), true); QCOMPARE(textEditObject->font().bold(), false); } - + { QString componentStr = "import QtQuick 2.0\nTextEdit { font.family: \"Helvetica\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().family(), QString("Helvetica")); @@ -693,23 +693,23 @@ void tst_qsgtextedit::font() QString componentStr = "import QtQuick 2.0\nTextEdit { font.family: \"\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->font().family(), QString("")); } } -void tst_qsgtextedit::color() +void tst_qquicktextedit::color() { //test initial color { QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); - QSGTextEditPrivate *textEditPrivate = static_cast<QSGTextEditPrivate*>(QSGItemPrivate::get(textEditObject)); + QQuickTextEditPrivate *textEditPrivate = static_cast<QQuickTextEditPrivate*>(QQuickItemPrivate::get(textEditObject)); QVERIFY(textEditObject); QVERIFY(textEditPrivate); @@ -725,7 +725,7 @@ void tst_qsgtextedit::color() QString componentStr = "import QtQuick 2.0\nTextEdit { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); //qDebug() << "textEditObject: " << textEditObject->color() << "vs. " << QColor(colorStrings.at(i)); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->color(), QColor(colorStrings.at(i))); @@ -737,7 +737,7 @@ void tst_qsgtextedit::color() QString componentStr = "import QtQuick 2.0\nTextEdit { selectionColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->selectionColor(), QColor(colorStrings.at(i))); } @@ -748,7 +748,7 @@ void tst_qsgtextedit::color() QString componentStr = "import QtQuick 2.0\nTextEdit { selectedTextColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->selectedTextColor(), QColor(colorStrings.at(i))); } @@ -761,32 +761,32 @@ void tst_qsgtextedit::color() QString componentStr = "import QtQuick 2.0\nTextEdit { color: \"" + colorStr + "\"; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->color(), testColor); } } -void tst_qsgtextedit::textMargin() +void tst_qquicktextedit::textMargin() { for (qreal i=0; i<=10; i+=0.3) { QString componentStr = "import QtQuick 2.0\nTextEdit { textMargin: " + QString::number(i) + "; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->textMargin(), i); } } -void tst_qsgtextedit::persistentSelection() +void tst_qquicktextedit::persistentSelection() { { QString componentStr = "import QtQuick 2.0\nTextEdit { persistentSelection: true; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->persistentSelection(), true); } @@ -795,19 +795,19 @@ void tst_qsgtextedit::persistentSelection() QString componentStr = "import QtQuick 2.0\nTextEdit { persistentSelection: false; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->persistentSelection(), false); } } -void tst_qsgtextedit::focusOnPress() +void tst_qquicktextedit::focusOnPress() { { QString componentStr = "import QtQuick 2.0\nTextEdit { activeFocusOnPress: true; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->focusOnPress(), true); } @@ -816,19 +816,19 @@ void tst_qsgtextedit::focusOnPress() QString componentStr = "import QtQuick 2.0\nTextEdit { activeFocusOnPress: false; text: \"Hello World\" }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); QCOMPARE(textEditObject->focusOnPress(), false); } } -void tst_qsgtextedit::selection() +void tst_qquicktextedit::selection() { QString testStr = standard[0];//TODO: What should happen for multiline/rich text? QString componentStr = "import QtQuick 2.0\nTextEdit { text: \""+ testStr +"\"; }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(textEditObject != 0); @@ -906,7 +906,7 @@ void tst_qsgtextedit::selection() QVERIFY(textEditObject->selectedText().isNull()); } -void tst_qsgtextedit::isRightToLeft_data() +void tst_qquicktextedit::isRightToLeft_data() { QTest::addColumn<QString>("text"); QTest::addColumn<bool>("emptyString"); @@ -926,7 +926,7 @@ void tst_qsgtextedit::isRightToLeft_data() QTest::newRow("Bidi LTR + RTL + LTR") << QString("Hello world") + QString::fromUtf16(arabic_str, 11) + QString("Hello world") << false << false << false << true << false << false << false; } -void tst_qsgtextedit::isRightToLeft() +void tst_qquicktextedit::isRightToLeft() { QFETCH(QString, text); QFETCH(bool, emptyString); @@ -937,7 +937,7 @@ void tst_qsgtextedit::isRightToLeft() QFETCH(bool, midString); QFETCH(bool, endString); - QSGTextEdit textEdit; + QQuickTextEdit textEdit; textEdit.setText(text); // first test that the right string is delivered to the QString::isRightToLeft() @@ -963,9 +963,9 @@ void tst_qsgtextedit::isRightToLeft() QCOMPARE(textEdit.isRightToLeft(3*text.count()/4,text.count()-1), endString); } -void tst_qsgtextedit::keySelection() +void tst_qquicktextedit::keySelection() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("navigation.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("navigation.qml"))); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); @@ -974,7 +974,7 @@ void tst_qsgtextedit::keySelection() QVERIFY(canvas.rootObject() != 0); - QSGTextEdit *input = qobject_cast<QSGTextEdit *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); + QQuickTextEdit *input = qobject_cast<QQuickTextEdit *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); QVERIFY(input != 0); QTRY_VERIFY(input->hasActiveFocus() == true); @@ -1011,159 +1011,159 @@ void tst_qsgtextedit::keySelection() QCOMPARE(spy.count(), 4); } -void tst_qsgtextedit::moveCursorSelection_data() +void tst_qquicktextedit::moveCursorSelection_data() { QTest::addColumn<QString>("testStr"); QTest::addColumn<int>("cursorPosition"); QTest::addColumn<int>("movePosition"); - QTest::addColumn<QSGTextEdit::SelectionMode>("mode"); + QTest::addColumn<QQuickTextEdit::SelectionMode>("mode"); QTest::addColumn<int>("selectionStart"); QTest::addColumn<int>("selectionEnd"); QTest::addColumn<bool>("reversible"); QTest::newRow("(t)he|characters") - << standard[0] << 0 << 1 << QSGTextEdit::SelectCharacters << 0 << 1 << true; + << standard[0] << 0 << 1 << QQuickTextEdit::SelectCharacters << 0 << 1 << true; QTest::newRow("do(g)|characters") - << standard[0] << 43 << 44 << QSGTextEdit::SelectCharacters << 43 << 44 << true; + << standard[0] << 43 << 44 << QQuickTextEdit::SelectCharacters << 43 << 44 << true; QTest::newRow("jum(p)ed|characters") - << standard[0] << 23 << 24 << QSGTextEdit::SelectCharacters << 23 << 24 << true; + << standard[0] << 23 << 24 << QQuickTextEdit::SelectCharacters << 23 << 24 << true; QTest::newRow("jumped( )over|characters") - << standard[0] << 26 << 27 << QSGTextEdit::SelectCharacters << 26 << 27 << true; + << standard[0] << 26 << 27 << QQuickTextEdit::SelectCharacters << 26 << 27 << true; QTest::newRow("(the )|characters") - << standard[0] << 0 << 4 << QSGTextEdit::SelectCharacters << 0 << 4 << true; + << standard[0] << 0 << 4 << QQuickTextEdit::SelectCharacters << 0 << 4 << true; QTest::newRow("( dog)|characters") - << standard[0] << 40 << 44 << QSGTextEdit::SelectCharacters << 40 << 44 << true; + << standard[0] << 40 << 44 << QQuickTextEdit::SelectCharacters << 40 << 44 << true; QTest::newRow("( jumped )|characters") - << standard[0] << 19 << 27 << QSGTextEdit::SelectCharacters << 19 << 27 << true; + << standard[0] << 19 << 27 << QQuickTextEdit::SelectCharacters << 19 << 27 << true; QTest::newRow("th(e qu)ick|characters") - << standard[0] << 2 << 6 << QSGTextEdit::SelectCharacters << 2 << 6 << true; + << standard[0] << 2 << 6 << QQuickTextEdit::SelectCharacters << 2 << 6 << true; QTest::newRow("la(zy d)og|characters") - << standard[0] << 38 << 42 << QSGTextEdit::SelectCharacters << 38 << 42 << true; + << standard[0] << 38 << 42 << QQuickTextEdit::SelectCharacters << 38 << 42 << true; QTest::newRow("jum(ped ov)er|characters") - << standard[0] << 23 << 29 << QSGTextEdit::SelectCharacters << 23 << 29 << true; + << standard[0] << 23 << 29 << QQuickTextEdit::SelectCharacters << 23 << 29 << true; QTest::newRow("()the|characters") - << standard[0] << 0 << 0 << QSGTextEdit::SelectCharacters << 0 << 0 << true; + << standard[0] << 0 << 0 << QQuickTextEdit::SelectCharacters << 0 << 0 << true; QTest::newRow("dog()|characters") - << standard[0] << 44 << 44 << QSGTextEdit::SelectCharacters << 44 << 44 << true; + << standard[0] << 44 << 44 << QQuickTextEdit::SelectCharacters << 44 << 44 << true; QTest::newRow("jum()ped|characters") - << standard[0] << 23 << 23 << QSGTextEdit::SelectCharacters << 23 << 23 << true; + << standard[0] << 23 << 23 << QQuickTextEdit::SelectCharacters << 23 << 23 << true; QTest::newRow("<(t)he>|words") - << standard[0] << 0 << 1 << QSGTextEdit::SelectWords << 0 << 3 << true; + << standard[0] << 0 << 1 << QQuickTextEdit::SelectWords << 0 << 3 << true; QTest::newRow("<do(g)>|words") - << standard[0] << 43 << 44 << QSGTextEdit::SelectWords << 41 << 44 << true; + << standard[0] << 43 << 44 << QQuickTextEdit::SelectWords << 41 << 44 << true; QTest::newRow("<jum(p)ed>|words") - << standard[0] << 23 << 24 << QSGTextEdit::SelectWords << 20 << 26 << true; + << standard[0] << 23 << 24 << QQuickTextEdit::SelectWords << 20 << 26 << true; QTest::newRow("<jumped( )>over|words") - << standard[0] << 26 << 27 << QSGTextEdit::SelectWords << 20 << 27 << false; + << standard[0] << 26 << 27 << QQuickTextEdit::SelectWords << 20 << 27 << false; QTest::newRow("jumped<( )over>|words,reversed") - << standard[0] << 27 << 26 << QSGTextEdit::SelectWords << 26 << 31 << false; + << standard[0] << 27 << 26 << QQuickTextEdit::SelectWords << 26 << 31 << false; QTest::newRow("<(the )>quick|words") - << standard[0] << 0 << 4 << QSGTextEdit::SelectWords << 0 << 4 << false; + << standard[0] << 0 << 4 << QQuickTextEdit::SelectWords << 0 << 4 << false; QTest::newRow("<(the )quick>|words,reversed") - << standard[0] << 4 << 0 << QSGTextEdit::SelectWords << 0 << 9 << false; + << standard[0] << 4 << 0 << QQuickTextEdit::SelectWords << 0 << 9 << false; QTest::newRow("<lazy( dog)>|words") - << standard[0] << 40 << 44 << QSGTextEdit::SelectWords << 36 << 44 << false; + << standard[0] << 40 << 44 << QQuickTextEdit::SelectWords << 36 << 44 << false; QTest::newRow("lazy<( dog)>|words,reversed") - << standard[0] << 44 << 40 << QSGTextEdit::SelectWords << 40 << 44 << false; + << standard[0] << 44 << 40 << QQuickTextEdit::SelectWords << 40 << 44 << false; QTest::newRow("<fox( jumped )>over|words") - << standard[0] << 19 << 27 << QSGTextEdit::SelectWords << 16 << 27 << false; + << standard[0] << 19 << 27 << QQuickTextEdit::SelectWords << 16 << 27 << false; QTest::newRow("fox<( jumped )over>|words,reversed") - << standard[0] << 27 << 19 << QSGTextEdit::SelectWords << 19 << 31 << false; + << standard[0] << 27 << 19 << QQuickTextEdit::SelectWords << 19 << 31 << false; QTest::newRow("<th(e qu)ick>|words") - << standard[0] << 2 << 6 << QSGTextEdit::SelectWords << 0 << 9 << true; + << standard[0] << 2 << 6 << QQuickTextEdit::SelectWords << 0 << 9 << true; QTest::newRow("<la(zy d)og|words>") - << standard[0] << 38 << 42 << QSGTextEdit::SelectWords << 36 << 44 << true; + << standard[0] << 38 << 42 << QQuickTextEdit::SelectWords << 36 << 44 << true; QTest::newRow("<jum(ped ov)er>|words") - << standard[0] << 23 << 29 << QSGTextEdit::SelectWords << 20 << 31 << true; + << standard[0] << 23 << 29 << QQuickTextEdit::SelectWords << 20 << 31 << true; QTest::newRow("<()>the|words") - << standard[0] << 0 << 0 << QSGTextEdit::SelectWords << 0 << 0 << true; + << standard[0] << 0 << 0 << QQuickTextEdit::SelectWords << 0 << 0 << true; QTest::newRow("dog<()>|words") - << standard[0] << 44 << 44 << QSGTextEdit::SelectWords << 44 << 44 << true; + << standard[0] << 44 << 44 << QQuickTextEdit::SelectWords << 44 << 44 << true; QTest::newRow("jum<()>ped|words") - << standard[0] << 23 << 23 << QSGTextEdit::SelectWords << 23 << 23 << true; + << standard[0] << 23 << 23 << QQuickTextEdit::SelectWords << 23 << 23 << true; QTest::newRow("Hello<(,)> |words") - << standard[2] << 5 << 6 << QSGTextEdit::SelectWords << 5 << 6 << true; + << standard[2] << 5 << 6 << QQuickTextEdit::SelectWords << 5 << 6 << true; QTest::newRow("Hello<(, )>world|words") - << standard[2] << 5 << 7 << QSGTextEdit::SelectWords << 5 << 7 << false; + << standard[2] << 5 << 7 << QQuickTextEdit::SelectWords << 5 << 7 << false; QTest::newRow("Hello<(, )world>|words,reversed") - << standard[2] << 7 << 5 << QSGTextEdit::SelectWords << 5 << 12 << false; + << standard[2] << 7 << 5 << QQuickTextEdit::SelectWords << 5 << 12 << false; QTest::newRow("<Hel(lo, )>world|words") - << standard[2] << 3 << 7 << QSGTextEdit::SelectWords << 0 << 7 << false; + << standard[2] << 3 << 7 << QQuickTextEdit::SelectWords << 0 << 7 << false; QTest::newRow("<Hel(lo, )world>|words,reversed") - << standard[2] << 7 << 3 << QSGTextEdit::SelectWords << 0 << 12 << false; + << standard[2] << 7 << 3 << QQuickTextEdit::SelectWords << 0 << 12 << false; QTest::newRow("<Hel(lo)>,|words") - << standard[2] << 3 << 5 << QSGTextEdit::SelectWords << 0 << 5 << true; + << standard[2] << 3 << 5 << QQuickTextEdit::SelectWords << 0 << 5 << true; QTest::newRow("Hello<()>,|words") - << standard[2] << 5 << 5 << QSGTextEdit::SelectWords << 5 << 5 << true; + << standard[2] << 5 << 5 << QQuickTextEdit::SelectWords << 5 << 5 << true; QTest::newRow("Hello,<()>|words") - << standard[2] << 6 << 6 << QSGTextEdit::SelectWords << 6 << 6 << true; + << standard[2] << 6 << 6 << QQuickTextEdit::SelectWords << 6 << 6 << true; QTest::newRow("Hello<,( )>world|words") - << standard[2] << 6 << 7 << QSGTextEdit::SelectWords << 5 << 7 << false; + << standard[2] << 6 << 7 << QQuickTextEdit::SelectWords << 5 << 7 << false; QTest::newRow("Hello,<( )world>|words,reversed") - << standard[2] << 7 << 6 << QSGTextEdit::SelectWords << 6 << 12 << false; + << standard[2] << 7 << 6 << QQuickTextEdit::SelectWords << 6 << 12 << false; QTest::newRow("Hello<,( world)>|words") - << standard[2] << 6 << 12 << QSGTextEdit::SelectWords << 5 << 12 << false; + << standard[2] << 6 << 12 << QQuickTextEdit::SelectWords << 5 << 12 << false; QTest::newRow("Hello,<( world)>|words,reversed") - << standard[2] << 12 << 6 << QSGTextEdit::SelectWords << 6 << 12 << false; + << standard[2] << 12 << 6 << QQuickTextEdit::SelectWords << 6 << 12 << false; QTest::newRow("Hello<,( world!)>|words") - << standard[2] << 6 << 13 << QSGTextEdit::SelectWords << 5 << 13 << false; + << standard[2] << 6 << 13 << QQuickTextEdit::SelectWords << 5 << 13 << false; QTest::newRow("Hello,<( world!)>|words,reversed") - << standard[2] << 13 << 6 << QSGTextEdit::SelectWords << 6 << 13 << false; + << standard[2] << 13 << 6 << QQuickTextEdit::SelectWords << 6 << 13 << false; QTest::newRow("Hello<(, world!)>|words") - << standard[2] << 5 << 13 << QSGTextEdit::SelectWords << 5 << 13 << true; + << standard[2] << 5 << 13 << QQuickTextEdit::SelectWords << 5 << 13 << true; QTest::newRow("world<(!)>|words") - << standard[2] << 12 << 13 << QSGTextEdit::SelectWords << 12 << 13 << true; + << standard[2] << 12 << 13 << QQuickTextEdit::SelectWords << 12 << 13 << true; QTest::newRow("world!<()>)|words") - << standard[2] << 13 << 13 << QSGTextEdit::SelectWords << 13 << 13 << true; + << standard[2] << 13 << 13 << QQuickTextEdit::SelectWords << 13 << 13 << true; QTest::newRow("world<()>!)|words") - << standard[2] << 12 << 12 << QSGTextEdit::SelectWords << 12 << 12 << true; + << standard[2] << 12 << 12 << QQuickTextEdit::SelectWords << 12 << 12 << true; QTest::newRow("<(,)>olleH |words") - << standard[3] << 7 << 8 << QSGTextEdit::SelectWords << 7 << 8 << true; + << standard[3] << 7 << 8 << QQuickTextEdit::SelectWords << 7 << 8 << true; QTest::newRow("<dlrow( ,)>olleH|words") - << standard[3] << 6 << 8 << QSGTextEdit::SelectWords << 1 << 8 << false; + << standard[3] << 6 << 8 << QQuickTextEdit::SelectWords << 1 << 8 << false; QTest::newRow("dlrow<( ,)>olleH|words,reversed") - << standard[3] << 8 << 6 << QSGTextEdit::SelectWords << 6 << 8 << false; + << standard[3] << 8 << 6 << QQuickTextEdit::SelectWords << 6 << 8 << false; QTest::newRow("<dlrow( ,ol)leH>|words") - << standard[3] << 6 << 10 << QSGTextEdit::SelectWords << 1 << 13 << false; + << standard[3] << 6 << 10 << QQuickTextEdit::SelectWords << 1 << 13 << false; QTest::newRow("dlrow<( ,ol)leH>|words,reversed") - << standard[3] << 10 << 6 << QSGTextEdit::SelectWords << 6 << 13 << false; + << standard[3] << 10 << 6 << QQuickTextEdit::SelectWords << 6 << 13 << false; QTest::newRow(",<(ol)leH>,|words") - << standard[3] << 8 << 10 << QSGTextEdit::SelectWords << 8 << 13 << true; + << standard[3] << 8 << 10 << QQuickTextEdit::SelectWords << 8 << 13 << true; QTest::newRow(",<()>olleH|words") - << standard[3] << 8 << 8 << QSGTextEdit::SelectWords << 8 << 8 << true; + << standard[3] << 8 << 8 << QQuickTextEdit::SelectWords << 8 << 8 << true; QTest::newRow("<()>,olleH|words") - << standard[3] << 7 << 7 << QSGTextEdit::SelectWords << 7 << 7 << true; + << standard[3] << 7 << 7 << QQuickTextEdit::SelectWords << 7 << 7 << true; QTest::newRow("<dlrow( )>,olleH|words") - << standard[3] << 6 << 7 << QSGTextEdit::SelectWords << 1 << 7 << false; + << standard[3] << 6 << 7 << QQuickTextEdit::SelectWords << 1 << 7 << false; QTest::newRow("dlrow<( ),>olleH|words,reversed") - << standard[3] << 7 << 6 << QSGTextEdit::SelectWords << 6 << 8 << false; + << standard[3] << 7 << 6 << QQuickTextEdit::SelectWords << 6 << 8 << false; QTest::newRow("<(dlrow )>,olleH|words") - << standard[3] << 1 << 7 << QSGTextEdit::SelectWords << 1 << 7 << false; + << standard[3] << 1 << 7 << QQuickTextEdit::SelectWords << 1 << 7 << false; QTest::newRow("<(dlrow ),>olleH|words,reversed") - << standard[3] << 7 << 1 << QSGTextEdit::SelectWords << 1 << 8 << false; + << standard[3] << 7 << 1 << QQuickTextEdit::SelectWords << 1 << 8 << false; QTest::newRow("<(!dlrow )>,olleH|words") - << standard[3] << 0 << 7 << QSGTextEdit::SelectWords << 0 << 7 << false; + << standard[3] << 0 << 7 << QQuickTextEdit::SelectWords << 0 << 7 << false; QTest::newRow("<(!dlrow ),>olleH|words,reversed") - << standard[3] << 7 << 0 << QSGTextEdit::SelectWords << 0 << 8 << false; + << standard[3] << 7 << 0 << QQuickTextEdit::SelectWords << 0 << 8 << false; QTest::newRow("(!dlrow ,)olleH|words") - << standard[3] << 0 << 8 << QSGTextEdit::SelectWords << 0 << 8 << true; + << standard[3] << 0 << 8 << QQuickTextEdit::SelectWords << 0 << 8 << true; QTest::newRow("<(!)>dlrow|words") - << standard[3] << 0 << 1 << QSGTextEdit::SelectWords << 0 << 1 << true; + << standard[3] << 0 << 1 << QQuickTextEdit::SelectWords << 0 << 1 << true; QTest::newRow("<()>!dlrow|words") - << standard[3] << 0 << 0 << QSGTextEdit::SelectWords << 0 << 0 << true; + << standard[3] << 0 << 0 << QQuickTextEdit::SelectWords << 0 << 0 << true; QTest::newRow("!<()>dlrow|words") - << standard[3] << 1 << 1 << QSGTextEdit::SelectWords << 1 << 1 << true; + << standard[3] << 1 << 1 << QQuickTextEdit::SelectWords << 1 << 1 << true; } -void tst_qsgtextedit::moveCursorSelection() +void tst_qquicktextedit::moveCursorSelection() { QFETCH(QString, testStr); QFETCH(int, cursorPosition); QFETCH(int, movePosition); - QFETCH(QSGTextEdit::SelectionMode, mode); + QFETCH(QQuickTextEdit::SelectionMode, mode); QFETCH(int, selectionStart); QFETCH(int, selectionEnd); QFETCH(bool, reversible); @@ -1171,7 +1171,7 @@ void tst_qsgtextedit::moveCursorSelection() QString componentStr = "import QtQuick 2.0\nTextEdit { text: \""+ testStr +"\"; }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *texteditObject = qobject_cast<QSGTextEdit*>(textinputComponent.create()); + QQuickTextEdit *texteditObject = qobject_cast<QQuickTextEdit*>(textinputComponent.create()); QVERIFY(texteditObject != 0); texteditObject->setCursorPosition(cursorPosition); @@ -1191,7 +1191,7 @@ void tst_qsgtextedit::moveCursorSelection() } } -void tst_qsgtextedit::moveCursorSelectionSequence_data() +void tst_qquicktextedit::moveCursorSelectionSequence_data() { QTest::addColumn<QString>("testStr"); QTest::addColumn<int>("cursorPosition"); @@ -1316,7 +1316,7 @@ void tst_qsgtextedit::moveCursorSelectionSequence_data() << 1 << 13; } -void tst_qsgtextedit::moveCursorSelectionSequence() +void tst_qquicktextedit::moveCursorSelectionSequence() { QFETCH(QString, testStr); QFETCH(int, cursorPosition); @@ -1330,24 +1330,24 @@ void tst_qsgtextedit::moveCursorSelectionSequence() QString componentStr = "import QtQuick 2.0\nTextEdit { text: \""+ testStr +"\"; }"; QDeclarativeComponent texteditComponent(&engine); texteditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *texteditObject = qobject_cast<QSGTextEdit*>(texteditComponent.create()); + QQuickTextEdit *texteditObject = qobject_cast<QQuickTextEdit*>(texteditComponent.create()); QVERIFY(texteditObject != 0); texteditObject->setCursorPosition(cursorPosition); - texteditObject->moveCursorSelection(movePosition1, QSGTextEdit::SelectWords); + texteditObject->moveCursorSelection(movePosition1, QQuickTextEdit::SelectWords); QCOMPARE(texteditObject->selectedText(), testStr.mid(selection1Start, selection1End - selection1Start)); QCOMPARE(texteditObject->selectionStart(), selection1Start); QCOMPARE(texteditObject->selectionEnd(), selection1End); - texteditObject->moveCursorSelection(movePosition2, QSGTextEdit::SelectWords); + texteditObject->moveCursorSelection(movePosition2, QQuickTextEdit::SelectWords); QCOMPARE(texteditObject->selectedText(), testStr.mid(selection2Start, selection2End - selection2Start)); QCOMPARE(texteditObject->selectionStart(), selection2Start); QCOMPARE(texteditObject->selectionEnd(), selection2End); } -void tst_qsgtextedit::mouseSelection_data() +void tst_qquicktextedit::mouseSelection_data() { QTest::addColumn<QString>("qmlfile"); QTest::addColumn<int>("from"); @@ -1370,14 +1370,14 @@ void tst_qsgtextedit::mouseSelection_data() QTest::newRow("on word selection (30,9)") << TESTDATA("mouseselection_true_words.qml") << 30 << 9 << "0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ"; } -void tst_qsgtextedit::mouseSelection() +void tst_qquicktextedit::mouseSelection() { QFETCH(QString, qmlfile); QFETCH(int, from); QFETCH(int, to); QFETCH(QString, selectedText); - QSGView canvas(QUrl::fromLocalFile(qmlfile)); + QQuickView canvas(QUrl::fromLocalFile(qmlfile)); canvas.show(); canvas.requestActivateWindow(); @@ -1385,7 +1385,7 @@ void tst_qsgtextedit::mouseSelection() QTRY_COMPARE(&canvas, qGuiApp->focusWindow()); QVERIFY(canvas.rootObject() != 0); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit *>(canvas.rootObject()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit *>(canvas.rootObject()); QVERIFY(textEditObject != 0); // press-and-drag-and-release from x1 to x2 @@ -1407,11 +1407,11 @@ void tst_qsgtextedit::mouseSelection() QTRY_COMPARE(textEditObject->selectedText(), selectedText); } -void tst_qsgtextedit::dragMouseSelection() +void tst_qquicktextedit::dragMouseSelection() { QString qmlfile = TESTDATA("mouseselection_true.qml"); - QSGView canvas(QUrl::fromLocalFile(qmlfile)); + QQuickView canvas(QUrl::fromLocalFile(qmlfile)); canvas.show(); canvas.requestActivateWindow(); @@ -1419,7 +1419,7 @@ void tst_qsgtextedit::dragMouseSelection() QTRY_COMPARE(&canvas, qGuiApp->focusWindow()); QVERIFY(canvas.rootObject() != 0); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit *>(canvas.rootObject()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit *>(canvas.rootObject()); QVERIFY(textEditObject != 0); // press-and-drag-and-release from x1 to x2 @@ -1446,7 +1446,7 @@ void tst_qsgtextedit::dragMouseSelection() QVERIFY(str1 != str2); // Verify the second press and drag is a new selection and not the first moved. } -void tst_qsgtextedit::mouseSelectionMode_data() +void tst_qquicktextedit::mouseSelectionMode_data() { QTest::addColumn<QString>("qmlfile"); QTest::addColumn<bool>("selectWords"); @@ -1457,14 +1457,14 @@ void tst_qsgtextedit::mouseSelectionMode_data() QTest::newRow("default") << TESTDATA("mouseselectionmode_default.qml") << false; } -void tst_qsgtextedit::mouseSelectionMode() +void tst_qquicktextedit::mouseSelectionMode() { QFETCH(QString, qmlfile); QFETCH(bool, selectWords); QString text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QSGView canvas(QUrl::fromLocalFile(qmlfile)); + QQuickView canvas(QUrl::fromLocalFile(qmlfile)); canvas.show(); canvas.requestActivateWindow(); @@ -1472,7 +1472,7 @@ void tst_qsgtextedit::mouseSelectionMode() QTRY_COMPARE(&canvas, qGuiApp->focusWindow()); QVERIFY(canvas.rootObject() != 0); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit *>(canvas.rootObject()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit *>(canvas.rootObject()); QVERIFY(textEditObject != 0); // press-and-drag-and-release from x1 to x2 @@ -1494,30 +1494,30 @@ void tst_qsgtextedit::mouseSelectionMode() } } -void tst_qsgtextedit::inputMethodHints() +void tst_qquicktextedit::inputMethodHints() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("inputmethodhints.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("inputmethodhints.qml"))); canvas.show(); canvas.requestActivateWindow(); QVERIFY(canvas.rootObject() != 0); - QSGTextEdit *textEditObject = qobject_cast<QSGTextEdit *>(canvas.rootObject()); + QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit *>(canvas.rootObject()); QVERIFY(textEditObject != 0); QVERIFY(textEditObject->inputMethodHints() & Qt::ImhNoPredictiveText); textEditObject->setInputMethodHints(Qt::ImhUppercaseOnly); QVERIFY(textEditObject->inputMethodHints() & Qt::ImhUppercaseOnly); } -void tst_qsgtextedit::positionAt() +void tst_qquicktextedit::positionAt() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("positionAt.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("positionAt.qml"))); QVERIFY(canvas.rootObject() != 0); canvas.show(); canvas.requestActivateWindow(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); - QSGTextEdit *texteditObject = qobject_cast<QSGTextEdit *>(canvas.rootObject()); + QQuickTextEdit *texteditObject = qobject_cast<QQuickTextEdit *>(canvas.rootObject()); QVERIFY(texteditObject != 0); QFontMetrics fm(texteditObject->font()); @@ -1578,17 +1578,17 @@ void tst_qsgtextedit::positionAt() QVERIFY(texteditObject->positionAt(x0 / 2, y1) > 0); } -void tst_qsgtextedit::cursorDelegate() +void tst_qquicktextedit::cursorDelegate() { - QSGView view(QUrl::fromLocalFile(TESTDATA("cursorTest.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("cursorTest.qml"))); view.show(); view.requestActivateWindow(); - QSGTextEdit *textEditObject = view.rootObject()->findChild<QSGTextEdit*>("textEditObject"); + QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject"); QVERIFY(textEditObject != 0); - QVERIFY(textEditObject->findChild<QSGItem*>("cursorInstance")); + QVERIFY(textEditObject->findChild<QQuickItem*>("cursorInstance")); //Test Delegate gets created textEditObject->setFocus(true); - QSGItem* delegateObject = textEditObject->findChild<QSGItem*>("cursorInstance"); + QQuickItem* delegateObject = textEditObject->findChild<QQuickItem*>("cursorInstance"); QVERIFY(delegateObject); QCOMPARE(delegateObject->property("localProperty").toString(), QString("Hello")); //Test Delegate gets moved @@ -1643,18 +1643,18 @@ void tst_qsgtextedit::cursorDelegate() QCOMPARE(textEditObject->cursorRectangle().y(), qRound(delegateObject->y())); //Test Delegate gets deleted textEditObject->setCursorDelegate(0); - QVERIFY(!textEditObject->findChild<QSGItem*>("cursorInstance")); + QVERIFY(!textEditObject->findChild<QQuickItem*>("cursorInstance")); } -void tst_qsgtextedit::cursorVisible() +void tst_qquicktextedit::cursorVisible() { - QSGView view(QUrl::fromLocalFile(TESTDATA("cursorVisible.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("cursorVisible.qml"))); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextEdit edit; + QQuickTextEdit edit; QSignalSpy spy(&edit, SIGNAL(cursorVisibleChanged(bool))); QCOMPARE(edit.isCursorVisible(), false); @@ -1710,7 +1710,7 @@ void tst_qsgtextedit::cursorVisible() #endif } -void tst_qsgtextedit::delegateLoading_data() +void tst_qquicktextedit::delegateLoading_data() { QTest::addColumn<QString>("qmlfile"); QTest::addColumn<QString>("error"); @@ -1721,7 +1721,7 @@ void tst_qsgtextedit::delegateLoading_data() QTest::newRow("fail2") << "cursorHttpTestFail2.qml" << "http://localhost:42332/ErrItem.qml:4:5: Fungus is not a type "; } -void tst_qsgtextedit::delegateLoading() +void tst_qquicktextedit::delegateLoading() { QFETCH(QString, qmlfile); QFETCH(QString, error); @@ -1731,24 +1731,24 @@ void tst_qsgtextedit::delegateLoading() server.serveDirectory(TESTDATA("httpslow"), TestHTTPServer::Delay); server.serveDirectory(TESTDATA("http")); - QSGView view(QUrl(QLatin1String("http://localhost:42332/") + qmlfile)); + QQuickView view(QUrl(QLatin1String("http://localhost:42332/") + qmlfile)); view.show(); view.requestActivateWindow(); if (!error.isEmpty()) { QTest::ignoreMessage(QtWarningMsg, error.toUtf8()); - QTRY_VERIFY(view.status()==QSGView::Error); + QTRY_VERIFY(view.status()==QQuickView::Error); QTRY_VERIFY(!view.rootObject()); // there is fail item inside this test } else { QTRY_VERIFY(view.rootObject());//Wait for loading to finish. - QSGTextEdit *textEditObject = view.rootObject()->findChild<QSGTextEdit*>("textEditObject"); + QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject"); // view.rootObject()->dumpObjectTree(); QVERIFY(textEditObject != 0); textEditObject->setFocus(true); - QSGItem *delegate; - delegate = view.rootObject()->findChild<QSGItem*>("delegateOkay"); + QQuickItem *delegate; + delegate = view.rootObject()->findChild<QQuickItem*>("delegateOkay"); QVERIFY(delegate); - delegate = view.rootObject()->findChild<QSGItem*>("delegateSlow"); + delegate = view.rootObject()->findChild<QQuickItem*>("delegateSlow"); QVERIFY(delegate); delete delegate; @@ -1756,9 +1756,9 @@ void tst_qsgtextedit::delegateLoading() //A test should be added here with a component which is ready but component.create() returns null - //Not sure how to accomplish this with QSGTextEdits cursor delegate + //Not sure how to accomplish this with QQuickTextEdits cursor delegate //###This was only needed for code coverage, and could be a case of overzealous defensive programming - //delegate = view.rootObject()->findChild<QSGItem*>("delegateErrorB"); + //delegate = view.rootObject()->findChild<QQuickItem*>("delegateErrorB"); //QVERIFY(!delegate); } @@ -1766,15 +1766,15 @@ void tst_qsgtextedit::delegateLoading() TextEdit element should only handle left/right keys until the cursor reaches the extent of the text, then they should ignore the keys. */ -void tst_qsgtextedit::navigation() +void tst_qquicktextedit::navigation() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("navigation.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("navigation.qml"))); canvas.show(); canvas.requestActivateWindow(); QVERIFY(canvas.rootObject() != 0); - QSGItem *input = qobject_cast<QSGItem *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); + QQuickItem *input = qobject_cast<QQuickItem *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); QVERIFY(input != 0); QTRY_VERIFY(input->hasActiveFocus() == true); @@ -1790,7 +1790,7 @@ void tst_qsgtextedit::navigation() QVERIFY(input->hasActiveFocus() == true); } -void tst_qsgtextedit::copyAndPaste() { +void tst_qquicktextedit::copyAndPaste() { #ifndef QT_NO_CLIPBOARD #ifdef Q_WS_MAC @@ -1807,7 +1807,7 @@ void tst_qsgtextedit::copyAndPaste() { QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"Hello world!\" }"; QDeclarativeComponent textEditComponent(&engine); textEditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEdit = qobject_cast<QSGTextEdit*>(textEditComponent.create()); + QQuickTextEdit *textEdit = qobject_cast<QQuickTextEdit*>(textEditComponent.create()); QVERIFY(textEdit != 0); // copy and paste @@ -1831,8 +1831,8 @@ void tst_qsgtextedit::copyAndPaste() { // QTBUG-12339 // test that document and internal text attribute are in sync - QSGItemPrivate* pri = QSGItemPrivate::get(textEdit); - QSGTextEditPrivate *editPrivate = static_cast<QSGTextEditPrivate*>(pri); + QQuickItemPrivate* pri = QQuickItemPrivate::get(textEdit); + QQuickTextEditPrivate *editPrivate = static_cast<QQuickTextEditPrivate*>(pri); QCOMPARE(textEdit->text(), editPrivate->text); // select word @@ -1850,7 +1850,7 @@ void tst_qsgtextedit::copyAndPaste() { #endif } -void tst_qsgtextedit::canPaste() { +void tst_qquicktextedit::canPaste() { #ifndef QT_NO_CLIPBOARD QGuiApplication::clipboard()->setText("Some text"); @@ -1858,7 +1858,7 @@ void tst_qsgtextedit::canPaste() { QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"Hello world!\" }"; QDeclarativeComponent textEditComponent(&engine); textEditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEdit = qobject_cast<QSGTextEdit*>(textEditComponent.create()); + QQuickTextEdit *textEdit = qobject_cast<QQuickTextEdit*>(textEditComponent.create()); QVERIFY(textEdit != 0); // check initial value - QTBUG-17765 @@ -1868,7 +1868,7 @@ void tst_qsgtextedit::canPaste() { #endif } -void tst_qsgtextedit::canPasteEmpty() { +void tst_qquicktextedit::canPasteEmpty() { #ifndef QT_NO_CLIPBOARD QGuiApplication::clipboard()->clear(); @@ -1876,7 +1876,7 @@ void tst_qsgtextedit::canPasteEmpty() { QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"Hello world!\" }"; QDeclarativeComponent textEditComponent(&engine); textEditComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextEdit *textEdit = qobject_cast<QSGTextEdit*>(textEditComponent.create()); + QQuickTextEdit *textEdit = qobject_cast<QQuickTextEdit*>(textEditComponent.create()); QVERIFY(textEdit != 0); // check initial value - QTBUG-17765 @@ -1886,15 +1886,15 @@ void tst_qsgtextedit::canPasteEmpty() { #endif } -void tst_qsgtextedit::readOnly() +void tst_qquicktextedit::readOnly() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("readOnly.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("readOnly.qml"))); canvas.show(); canvas.requestActivateWindow(); QVERIFY(canvas.rootObject() != 0); - QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); + QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); QVERIFY(edit != 0); QTRY_VERIFY(edit->hasActiveFocus() == true); @@ -1913,7 +1913,7 @@ void tst_qsgtextedit::readOnly() QCOMPARE(edit->cursorPosition(), edit->text().length()); } -void tst_qsgtextedit::simulateKey(QSGView *view, int key, Qt::KeyboardModifiers modifiers) +void tst_qquicktextedit::simulateKey(QQuickView *view, int key, Qt::KeyboardModifiers modifiers) { QKeyEvent press(QKeyEvent::KeyPress, key, modifiers); QKeyEvent release(QKeyEvent::KeyRelease, key, modifiers); @@ -1971,14 +1971,14 @@ public: }; #endif -void tst_qsgtextedit::textInput() +void tst_qquicktextedit::textInput() { - QSGView view(QUrl::fromLocalFile(TESTDATA("inputMethodEvent.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("inputMethodEvent.qml"))); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject()); + QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject()); QVERIFY(edit); QVERIFY(edit->hasActiveFocus() == true); @@ -1991,19 +1991,19 @@ void tst_qsgtextedit::textInput() // QTBUG-12339 // test that document and internal text attribute are in sync - QSGTextEditPrivate *editPrivate = static_cast<QSGTextEditPrivate*>(QSGItemPrivate::get(edit)); + QQuickTextEditPrivate *editPrivate = static_cast<QQuickTextEditPrivate*>(QQuickItemPrivate::get(edit)); QCOMPARE(editPrivate->text, QString("Hello world!")); } -void tst_qsgtextedit::openInputPanel() +void tst_qquicktextedit::openInputPanel() { - QSGView view(QUrl::fromLocalFile(TESTDATA("openInputPanel.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("openInputPanel.qml"))); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject()); + QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject()); QVERIFY(edit); // check default values @@ -2035,7 +2035,7 @@ void tst_qsgtextedit::openInputPanel() // input panel should stay visible if focus is lost to another text editor QSignalSpy inputPanelVisibilitySpy(qApp->inputPanel(), SIGNAL(visibleChanged())); - QSGTextEdit anotherEdit; + QQuickTextEdit anotherEdit; anotherEdit.setParentItem(view.rootObject()); anotherEdit.setFocus(true); QCOMPARE(qApp->inputPanel()->visible(), true); @@ -2048,7 +2048,7 @@ void tst_qsgtextedit::openInputPanel() anotherEdit.setFocus(true); // input item should be null if focus is lost to an item that doesn't accept inputs - QSGItem item; + QQuickItem item; item.setParentItem(view.rootObject()); item.setFocus(true); QCOMPARE(qApp->inputPanel()->inputItem(), static_cast<QObject*>(0)); @@ -2083,7 +2083,7 @@ void tst_qsgtextedit::openInputPanel() QCOMPARE(qApp->inputPanel()->visible(), false); } -void tst_qsgtextedit::geometrySignals() +void tst_qquicktextedit::geometrySignals() { QDeclarativeComponent component(&engine, TESTDATA("geometrySignals.qml")); QObject *o = component.create(); @@ -2093,16 +2093,16 @@ void tst_qsgtextedit::geometrySignals() delete o; } -void tst_qsgtextedit::pastingRichText_QTBUG_14003() +void tst_qquicktextedit::pastingRichText_QTBUG_14003() { #ifndef QT_NO_CLIPBOARD QString componentStr = "import QtQuick 2.0\nTextEdit { textFormat: TextEdit.PlainText }"; QDeclarativeComponent component(&engine); component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGTextEdit *obj = qobject_cast<QSGTextEdit*>(component.create()); + QQuickTextEdit *obj = qobject_cast<QQuickTextEdit*>(component.create()); QTRY_VERIFY(obj != 0); - QTRY_VERIFY(obj->textFormat() == QSGTextEdit::PlainText); + QTRY_VERIFY(obj->textFormat() == QQuickTextEdit::PlainText); QMimeData *mData = new QMimeData; mData->setHtml("<font color=\"red\">Hello</font>"); @@ -2110,11 +2110,11 @@ void tst_qsgtextedit::pastingRichText_QTBUG_14003() obj->paste(); QTRY_VERIFY(obj->text() == ""); - QTRY_VERIFY(obj->textFormat() == QSGTextEdit::PlainText); + QTRY_VERIFY(obj->textFormat() == QQuickTextEdit::PlainText); #endif } -void tst_qsgtextedit::implicitSize_data() +void tst_qquicktextedit::implicitSize_data() { QTest::addColumn<QString>("text"); QTest::addColumn<QString>("wrap"); @@ -2124,14 +2124,14 @@ void tst_qsgtextedit::implicitSize_data() QTest::newRow("richtext_wrap") << "<b>The quick red fox jumped over the lazy brown dog</b>" << "TextEdit.Wrap"; } -void tst_qsgtextedit::implicitSize() +void tst_qquicktextedit::implicitSize() { QFETCH(QString, text); QFETCH(QString, wrap); QString componentStr = "import QtQuick 2.0\nTextEdit { text: \"" + text + "\"; width: 50; wrapMode: " + wrap + " }"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGTextEdit *textObject = qobject_cast<QSGTextEdit*>(textComponent.create()); + QQuickTextEdit *textObject = qobject_cast<QQuickTextEdit*>(textComponent.create()); QVERIFY(textObject->width() < textObject->implicitWidth()); QVERIFY(textObject->height() == textObject->implicitHeight()); @@ -2141,7 +2141,7 @@ void tst_qsgtextedit::implicitSize() QVERIFY(textObject->height() == textObject->implicitHeight()); } -void tst_qsgtextedit::testQtQuick11Attributes() +void tst_qquicktextedit::testQtQuick11Attributes() { QFETCH(QString, code); QFETCH(QString, warning); @@ -2165,7 +2165,7 @@ void tst_qsgtextedit::testQtQuick11Attributes() delete obj; } -void tst_qsgtextedit::testQtQuick11Attributes_data() +void tst_qquicktextedit::testQtQuick11Attributes_data() { QTest::addColumn<QString>("code"); QTest::addColumn<QString>("warning"); @@ -2192,7 +2192,7 @@ void tst_qsgtextedit::testQtQuick11Attributes_data() << ":1 \"TextEdit.onLinkActivated\" is not available in QtQuick 1.0.\n"; } -void tst_qsgtextedit::preeditMicroFocus() +void tst_qquicktextedit::preeditMicroFocus() { #ifdef QTBUG_21691 QEXPECT_FAIL("", QTBUG_21691_MESSAGE, Abort); @@ -2200,13 +2200,13 @@ void tst_qsgtextedit::preeditMicroFocus() #else QString preeditText = "super"; - QSGView view(QUrl::fromLocalFile(TESTDATA("inputMethodEvent.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("inputMethodEvent.qml"))); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject()); + QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject()); QVERIFY(edit); QSignalSpy cursorRectangleSpy(edit, SIGNAL(cursorRectangleChanged())); @@ -2254,7 +2254,7 @@ void tst_qsgtextedit::preeditMicroFocus() #endif } -void tst_qsgtextedit::inputContextMouseHandler() +void tst_qquicktextedit::inputContextMouseHandler() { #ifdef QTBUG_21691 @@ -2263,9 +2263,9 @@ void tst_qsgtextedit::inputContextMouseHandler() #else QString text = "supercalifragisiticexpialidocious!"; - QSGView view(QUrl::fromLocalFile(TESTDATA("inputContext.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("inputContext.qml"))); MyInputContext ic; - // QSGCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has focus + // QQuickCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has focus // and QWidget won't allow an input context to be set when the flag is not set. view.setAttribute(Qt::WA_InputMethodEnabled, true); view.setInputContext(&ic); @@ -2275,7 +2275,7 @@ void tst_qsgtextedit::inputContextMouseHandler() QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject()); + QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject()); QVERIFY(edit); edit->setCursorPosition(12); @@ -2378,16 +2378,16 @@ void tst_qsgtextedit::inputContextMouseHandler() #endif } -void tst_qsgtextedit::inputMethodComposing() +void tst_qquicktextedit::inputMethodComposing() { QString text = "supercalifragisiticexpialidocious!"; - QSGView view(QUrl::fromLocalFile(TESTDATA("inputContext.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("inputContext.qml"))); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject()); + QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject()); QVERIFY(edit); QSignalSpy spy(edit, SIGNAL(inputMethodComposingChanged())); edit->setCursorPosition(12); @@ -2416,15 +2416,15 @@ void tst_qsgtextedit::inputMethodComposing() QCOMPARE(spy.count(), 2); } -void tst_qsgtextedit::cursorRectangleSize() +void tst_qquicktextedit::cursorRectangleSize() { - QSGView *canvas = new QSGView(QUrl::fromLocalFile(TESTDATA("CursorRect.qml"))); + QQuickView *canvas = new QQuickView(QUrl::fromLocalFile(TESTDATA("CursorRect.qml"))); QVERIFY(canvas->rootObject() != 0); canvas->show(); canvas->requestActivateWindow(); QTest::qWaitForWindowShown(canvas); - QSGTextEdit *textEdit = qobject_cast<QSGTextEdit *>(canvas->rootObject()); + QQuickTextEdit *textEdit = qobject_cast<QQuickTextEdit *>(canvas->rootObject()); QVERIFY(textEdit != 0); textEdit->setFocus(Qt::OtherFocusReason); QRectF cursorRect = textEdit->positionToRectangle(textEdit->cursorPosition()); @@ -2440,15 +2440,15 @@ void tst_qsgtextedit::cursorRectangleSize() delete canvas; } -void tst_qsgtextedit::emptytags_QTBUG_22058() +void tst_qquicktextedit::emptytags_QTBUG_22058() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("qtbug-22058.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("qtbug-22058.qml"))); QVERIFY(canvas.rootObject() != 0); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); - QSGTextEdit *input = qobject_cast<QSGTextEdit *>(qvariant_cast<QObject *>(canvas.rootObject()->property("inputField"))); + QQuickTextEdit *input = qobject_cast<QQuickTextEdit *>(qvariant_cast<QObject *>(canvas.rootObject()->property("inputField"))); QVERIFY(input->hasActiveFocus()); QInputMethodEvent event("", QList<QInputMethodEvent::Attribute>()); @@ -2462,6 +2462,6 @@ void tst_qsgtextedit::emptytags_QTBUG_22058() QCOMPARE(input->text(), QString("<b>Bold<>")); } -QTEST_MAIN(tst_qsgtextedit) +QTEST_MAIN(tst_qquicktextedit) -#include "tst_qsgtextedit.moc" +#include "tst_qquicktextedit.moc" diff --git a/tests/auto/declarative/qsgtextinput/data/cursorTest.qml b/tests/auto/declarative/qquicktextinput/data/cursorTest.qml index 71a420ee7c..71a420ee7c 100644 --- a/tests/auto/declarative/qsgtextinput/data/cursorTest.qml +++ b/tests/auto/declarative/qquicktextinput/data/cursorTest.qml diff --git a/tests/auto/declarative/qsgtextinput/data/cursorVisible.qml b/tests/auto/declarative/qquicktextinput/data/cursorVisible.qml index 49e9386947..49e9386947 100644 --- a/tests/auto/declarative/qsgtextinput/data/cursorVisible.qml +++ b/tests/auto/declarative/qquicktextinput/data/cursorVisible.qml diff --git a/tests/auto/declarative/qsgtextinput/data/echoMode.qml b/tests/auto/declarative/qquicktextinput/data/echoMode.qml index f8a6cf1c89..f8a6cf1c89 100644 --- a/tests/auto/declarative/qsgtextinput/data/echoMode.qml +++ b/tests/auto/declarative/qquicktextinput/data/echoMode.qml diff --git a/tests/auto/declarative/qsgtextinput/data/geometrySignals.qml b/tests/auto/declarative/qquicktextinput/data/geometrySignals.qml index 90855a61cf..90855a61cf 100644 --- a/tests/auto/declarative/qsgtextinput/data/geometrySignals.qml +++ b/tests/auto/declarative/qquicktextinput/data/geometrySignals.qml diff --git a/tests/auto/declarative/qsgtextinput/data/halign_center.png b/tests/auto/declarative/qquicktextinput/data/halign_center.png Binary files differindex 53e09a8e5b..53e09a8e5b 100644 --- a/tests/auto/declarative/qsgtextinput/data/halign_center.png +++ b/tests/auto/declarative/qquicktextinput/data/halign_center.png diff --git a/tests/auto/declarative/qsgtextinput/data/halign_left.png b/tests/auto/declarative/qquicktextinput/data/halign_left.png Binary files differindex 247acbc9df..247acbc9df 100644 --- a/tests/auto/declarative/qsgtextinput/data/halign_left.png +++ b/tests/auto/declarative/qquicktextinput/data/halign_left.png diff --git a/tests/auto/declarative/qsgtextinput/data/halign_right.png b/tests/auto/declarative/qquicktextinput/data/halign_right.png Binary files differindex 691bc75c89..691bc75c89 100644 --- a/tests/auto/declarative/qsgtextinput/data/halign_right.png +++ b/tests/auto/declarative/qquicktextinput/data/halign_right.png diff --git a/tests/auto/declarative/qsgtextinput/data/horizontalAlignment.qml b/tests/auto/declarative/qquicktextinput/data/horizontalAlignment.qml index e0fef4c11e..e0fef4c11e 100644 --- a/tests/auto/declarative/qsgtextinput/data/horizontalAlignment.qml +++ b/tests/auto/declarative/qquicktextinput/data/horizontalAlignment.qml diff --git a/tests/auto/declarative/qsgtextinput/data/horizontalAlignment_RightToLeft.qml b/tests/auto/declarative/qquicktextinput/data/horizontalAlignment_RightToLeft.qml index 5f88025536..5f88025536 100644 --- a/tests/auto/declarative/qsgtextinput/data/horizontalAlignment_RightToLeft.qml +++ b/tests/auto/declarative/qquicktextinput/data/horizontalAlignment_RightToLeft.qml diff --git a/tests/auto/declarative/qsgtextinput/data/inputContext.qml b/tests/auto/declarative/qquicktextinput/data/inputContext.qml index dfc80990c6..dfc80990c6 100644 --- a/tests/auto/declarative/qsgtextinput/data/inputContext.qml +++ b/tests/auto/declarative/qquicktextinput/data/inputContext.qml diff --git a/tests/auto/declarative/qsgtextinput/data/inputMethodEvent.qml b/tests/auto/declarative/qquicktextinput/data/inputMethodEvent.qml index 7aefdf28f4..7aefdf28f4 100644 --- a/tests/auto/declarative/qsgtextinput/data/inputMethodEvent.qml +++ b/tests/auto/declarative/qquicktextinput/data/inputMethodEvent.qml diff --git a/tests/auto/declarative/qsgtextinput/data/inputmethods.qml b/tests/auto/declarative/qquicktextinput/data/inputmethods.qml index 711e89144c..711e89144c 100644 --- a/tests/auto/declarative/qsgtextinput/data/inputmethods.qml +++ b/tests/auto/declarative/qquicktextinput/data/inputmethods.qml diff --git a/tests/auto/declarative/qsgtextinput/data/masks.qml b/tests/auto/declarative/qquicktextinput/data/masks.qml index 589b6a3c15..589b6a3c15 100644 --- a/tests/auto/declarative/qsgtextinput/data/masks.qml +++ b/tests/auto/declarative/qquicktextinput/data/masks.qml diff --git a/tests/auto/declarative/qsgtextinput/data/maxLength.qml b/tests/auto/declarative/qquicktextinput/data/maxLength.qml index cca537ed6b..cca537ed6b 100644 --- a/tests/auto/declarative/qsgtextinput/data/maxLength.qml +++ b/tests/auto/declarative/qquicktextinput/data/maxLength.qml diff --git a/tests/auto/declarative/qsgtextinput/data/mouseselection_true.qml b/tests/auto/declarative/qquicktextinput/data/mouseselection_true.qml index 974041b04a..974041b04a 100644 --- a/tests/auto/declarative/qsgtextinput/data/mouseselection_true.qml +++ b/tests/auto/declarative/qquicktextinput/data/mouseselection_true.qml diff --git a/tests/auto/declarative/qsgtextinput/data/mouseselectionmode_characters.qml b/tests/auto/declarative/qquicktextinput/data/mouseselectionmode_characters.qml index f7c658b618..f7c658b618 100644 --- a/tests/auto/declarative/qsgtextinput/data/mouseselectionmode_characters.qml +++ b/tests/auto/declarative/qquicktextinput/data/mouseselectionmode_characters.qml diff --git a/tests/auto/declarative/qsgtextinput/data/mouseselectionmode_default.qml b/tests/auto/declarative/qquicktextinput/data/mouseselectionmode_default.qml index 974041b04a..974041b04a 100644 --- a/tests/auto/declarative/qsgtextinput/data/mouseselectionmode_default.qml +++ b/tests/auto/declarative/qquicktextinput/data/mouseselectionmode_default.qml diff --git a/tests/auto/declarative/qsgtextinput/data/mouseselectionmode_words.qml b/tests/auto/declarative/qquicktextinput/data/mouseselectionmode_words.qml index 20e777e470..20e777e470 100644 --- a/tests/auto/declarative/qsgtextinput/data/mouseselectionmode_words.qml +++ b/tests/auto/declarative/qquicktextinput/data/mouseselectionmode_words.qml diff --git a/tests/auto/declarative/qsgtextinput/data/navigation.qml b/tests/auto/declarative/qquicktextinput/data/navigation.qml index 3a7d07b3c7..3a7d07b3c7 100644 --- a/tests/auto/declarative/qsgtextinput/data/navigation.qml +++ b/tests/auto/declarative/qquicktextinput/data/navigation.qml diff --git a/tests/auto/declarative/qsgtextinput/data/openInputPanel.qml b/tests/auto/declarative/qquicktextinput/data/openInputPanel.qml index ca5cb263aa..ca5cb263aa 100644 --- a/tests/auto/declarative/qsgtextinput/data/openInputPanel.qml +++ b/tests/auto/declarative/qquicktextinput/data/openInputPanel.qml diff --git a/tests/auto/declarative/qsgtextinput/data/positionAt.qml b/tests/auto/declarative/qquicktextinput/data/positionAt.qml index 1840462c87..1840462c87 100644 --- a/tests/auto/declarative/qsgtextinput/data/positionAt.qml +++ b/tests/auto/declarative/qquicktextinput/data/positionAt.qml diff --git a/tests/auto/declarative/qsgtextinput/data/preeditAutoScroll.qml b/tests/auto/declarative/qquicktextinput/data/preeditAutoScroll.qml index 9d98a2e220..9d98a2e220 100644 --- a/tests/auto/declarative/qsgtextinput/data/preeditAutoScroll.qml +++ b/tests/auto/declarative/qquicktextinput/data/preeditAutoScroll.qml diff --git a/tests/auto/declarative/qsgtextinput/data/qtbug-19956double.qml b/tests/auto/declarative/qquicktextinput/data/qtbug-19956double.qml index e9b80fceb2..e9b80fceb2 100644 --- a/tests/auto/declarative/qsgtextinput/data/qtbug-19956double.qml +++ b/tests/auto/declarative/qquicktextinput/data/qtbug-19956double.qml diff --git a/tests/auto/declarative/qsgtextinput/data/qtbug-19956int.qml b/tests/auto/declarative/qquicktextinput/data/qtbug-19956int.qml index 0d70eedb80..0d70eedb80 100644 --- a/tests/auto/declarative/qsgtextinput/data/qtbug-19956int.qml +++ b/tests/auto/declarative/qquicktextinput/data/qtbug-19956int.qml diff --git a/tests/auto/declarative/qsgtextinput/data/qtbug-19956regexp.qml b/tests/auto/declarative/qquicktextinput/data/qtbug-19956regexp.qml index b5af13cc4c..b5af13cc4c 100644 --- a/tests/auto/declarative/qsgtextinput/data/qtbug-19956regexp.qml +++ b/tests/auto/declarative/qquicktextinput/data/qtbug-19956regexp.qml diff --git a/tests/auto/declarative/qsgtextinput/data/readOnly.qml b/tests/auto/declarative/qquicktextinput/data/readOnly.qml index 9cda7fbd1d..9cda7fbd1d 100644 --- a/tests/auto/declarative/qsgtextinput/data/readOnly.qml +++ b/tests/auto/declarative/qquicktextinput/data/readOnly.qml diff --git a/tests/auto/declarative/qsgtextinput/data/validators.qml b/tests/auto/declarative/qquicktextinput/data/validators.qml index 0a074ce7dc..0a074ce7dc 100644 --- a/tests/auto/declarative/qsgtextinput/data/validators.qml +++ b/tests/auto/declarative/qquicktextinput/data/validators.qml diff --git a/tests/auto/declarative/qsgtextinput/qsgtextinput.pro b/tests/auto/declarative/qquicktextinput/qquicktextinput.pro index 1c988be880..9c74559cb2 100644 --- a/tests/auto/declarative/qsgtextinput/qsgtextinput.pro +++ b/tests/auto/declarative/qquicktextinput/qquicktextinput.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgtextinput +TARGET = tst_qquicktextinput macx:CONFIG -= app_bundle -SOURCES += tst_qsgtextinput.cpp +SOURCES += tst_qquicktextinput.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp b/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp index 09f4fb8650..8c8166b2f1 100644 --- a/tests/auto/declarative/qsgtextinput/tst_qsgtextinput.cpp +++ b/tests/auto/declarative/qquicktextinput/tst_qquicktextinput.cpp @@ -43,11 +43,11 @@ #include "../shared/util.h" #include <QtDeclarative/qdeclarativeengine.h> #include <QFile> -#include <QtDeclarative/qsgview.h> +#include <QtDeclarative/qquickview.h> #include <QtGui/qguiapplication.h> #include <QInputPanel> -#include <private/qsgtextinput_p.h> -#include <private/qsgtextinput_p_p.h> +#include <private/qquicktextinput_p.h> +#include <private/qquicktextinput_p_p.h> #include <QDebug> #include <QDir> #include <QStyle> @@ -58,7 +58,7 @@ #include "qplatformdefs.h" -Q_DECLARE_METATYPE(QSGTextInput::SelectionMode) +Q_DECLARE_METATYPE(QQuickTextInput::SelectionMode) DEFINE_BOOL_CONFIG_OPTION(qmlDisableDistanceField, QML_DISABLE_DISTANCEFIELD) #define QTBUG_21691 @@ -81,12 +81,12 @@ QString createExpectedFileIfNotFound(const QString& filebasename, const QImage& return expectfile; } -class tst_qsgtextinput : public QObject +class tst_qquicktextinput : public QObject { Q_OBJECT public: - tst_qsgtextinput(); + tst_qquicktextinput(); private slots: void initTestCase(); @@ -152,21 +152,21 @@ private slots: void QTBUG_19956_regexp(); private: - void simulateKey(QSGView *, int key); + void simulateKey(QQuickView *, int key); QDeclarativeEngine engine; QStringList standard; QStringList colorStrings; }; -void tst_qsgtextinput::initTestCase() +void tst_qquicktextinput::initTestCase() { } -void tst_qsgtextinput::cleanupTestCase() +void tst_qquicktextinput::cleanupTestCase() { } -tst_qsgtextinput::tst_qsgtextinput() +tst_qquicktextinput::tst_qquicktextinput() { standard << "the quick brown fox jumped over the lazy dog" << "It's supercalifragisiticexpialidocious!" @@ -188,12 +188,12 @@ tst_qsgtextinput::tst_qsgtextinput() << "#2AC05F"; } -void tst_qsgtextinput::text() +void tst_qquicktextinput::text() { { QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData("import QtQuick 2.0\nTextInput { text: \"\" }", QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->text(), QString("")); @@ -206,7 +206,7 @@ void tst_qsgtextinput::text() QString componentStr = "import QtQuick 2.0\nTextInput { text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->text(), standard.at(i)); @@ -216,13 +216,13 @@ void tst_qsgtextinput::text() } -void tst_qsgtextinput::width() +void tst_qquicktextinput::width() { // uses Font metrics to find the width for standard { QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData("import QtQuick 2.0\nTextInput { text: \"\" }", QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->width(), 0.0); @@ -266,7 +266,7 @@ void tst_qsgtextinput::width() QString componentStr = "import QtQuick 2.0\nTextInput { text: \"" + standard.at(i) + "\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); int delta = abs(int(int(textinputObject->width()) - metricWidth)); @@ -276,14 +276,14 @@ void tst_qsgtextinput::width() } } -void tst_qsgtextinput::font() +void tst_qquicktextinput::font() { //test size, then bold, then italic, then family { QString componentStr = "import QtQuick 2.0\nTextInput { font.pointSize: 40; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().pointSize(), 40); @@ -297,7 +297,7 @@ void tst_qsgtextinput::font() QString componentStr = "import QtQuick 2.0\nTextInput { font.bold: true; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().bold(), true); @@ -310,7 +310,7 @@ void tst_qsgtextinput::font() QString componentStr = "import QtQuick 2.0\nTextInput { font.italic: true; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().italic(), true); @@ -323,7 +323,7 @@ void tst_qsgtextinput::font() QString componentStr = "import QtQuick 2.0\nTextInput { font.family: \"Helvetica\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().family(), QString("Helvetica")); @@ -337,7 +337,7 @@ void tst_qsgtextinput::font() QString componentStr = "import QtQuick 2.0\nTextInput { font.family: \"\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->font().family(), QString("")); @@ -346,7 +346,7 @@ void tst_qsgtextinput::font() } } -void tst_qsgtextinput::color() +void tst_qquicktextinput::color() { //test color for (int i = 0; i < colorStrings.size(); i++) @@ -354,7 +354,7 @@ void tst_qsgtextinput::color() QString componentStr = "import QtQuick 2.0\nTextInput { color: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->color(), QColor(colorStrings.at(i))); @@ -367,7 +367,7 @@ void tst_qsgtextinput::color() QString componentStr = "import QtQuick 2.0\nTextInput { selectionColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->selectionColor(), QColor(colorStrings.at(i))); @@ -380,7 +380,7 @@ void tst_qsgtextinput::color() QString componentStr = "import QtQuick 2.0\nTextInput { selectedTextColor: \"" + colorStrings.at(i) + "\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->selectedTextColor(), QColor(colorStrings.at(i))); @@ -395,7 +395,7 @@ void tst_qsgtextinput::color() QString componentStr = "import QtQuick 2.0\nTextInput { color: \"" + colorStr + "\"; text: \"Hello World\" }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); QCOMPARE(textinputObject->color(), testColor); @@ -404,13 +404,13 @@ void tst_qsgtextinput::color() } } -void tst_qsgtextinput::selection() +void tst_qquicktextinput::selection() { QString testStr = standard[0]; QString componentStr = "import QtQuick 2.0\nTextInput { text: \""+ testStr +"\"; }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); @@ -490,7 +490,7 @@ void tst_qsgtextinput::selection() delete textinputObject; } -void tst_qsgtextinput::isRightToLeft_data() +void tst_qquicktextinput::isRightToLeft_data() { QTest::addColumn<QString>("text"); QTest::addColumn<bool>("emptyString"); @@ -510,7 +510,7 @@ void tst_qsgtextinput::isRightToLeft_data() QTest::newRow("Bidi LTR + RTL + LTR") << QString("Hello world") + QString::fromUtf16(arabic_str, 11) + QString("Hello world") << false << false << false << true << false << false << false; } -void tst_qsgtextinput::isRightToLeft() +void tst_qquicktextinput::isRightToLeft() { QFETCH(QString, text); QFETCH(bool, emptyString); @@ -521,7 +521,7 @@ void tst_qsgtextinput::isRightToLeft() QFETCH(bool, midString); QFETCH(bool, endString); - QSGTextInput textInput; + QQuickTextInput textInput; textInput.setText(text); // first test that the right string is delivered to the QString::isRightToLeft() @@ -547,12 +547,12 @@ void tst_qsgtextinput::isRightToLeft() QCOMPARE(textInput.isRightToLeft(3*text.count()/4,text.count()-1), endString); } -void tst_qsgtextinput::moveCursorSelection_data() +void tst_qquicktextinput::moveCursorSelection_data() { QTest::addColumn<QString>("testStr"); QTest::addColumn<int>("cursorPosition"); QTest::addColumn<int>("movePosition"); - QTest::addColumn<QSGTextInput::SelectionMode>("mode"); + QTest::addColumn<QQuickTextInput::SelectionMode>("mode"); QTest::addColumn<int>("selectionStart"); QTest::addColumn<int>("selectionEnd"); QTest::addColumn<bool>("reversible"); @@ -561,168 +561,168 @@ void tst_qsgtextinput::moveCursorSelection_data() // <> contains the actual selection. QTest::newRow("(t)he|characters") - << standard[0] << 0 << 1 << QSGTextInput::SelectCharacters << 0 << 1 << true; + << standard[0] << 0 << 1 << QQuickTextInput::SelectCharacters << 0 << 1 << true; QTest::newRow("do(g)|characters") - << standard[0] << 43 << 44 << QSGTextInput::SelectCharacters << 43 << 44 << true; + << standard[0] << 43 << 44 << QQuickTextInput::SelectCharacters << 43 << 44 << true; QTest::newRow("jum(p)ed|characters") - << standard[0] << 23 << 24 << QSGTextInput::SelectCharacters << 23 << 24 << true; + << standard[0] << 23 << 24 << QQuickTextInput::SelectCharacters << 23 << 24 << true; QTest::newRow("jumped( )over|characters") - << standard[0] << 26 << 27 << QSGTextInput::SelectCharacters << 26 << 27 << true; + << standard[0] << 26 << 27 << QQuickTextInput::SelectCharacters << 26 << 27 << true; QTest::newRow("(the )|characters") - << standard[0] << 0 << 4 << QSGTextInput::SelectCharacters << 0 << 4 << true; + << standard[0] << 0 << 4 << QQuickTextInput::SelectCharacters << 0 << 4 << true; QTest::newRow("( dog)|characters") - << standard[0] << 40 << 44 << QSGTextInput::SelectCharacters << 40 << 44 << true; + << standard[0] << 40 << 44 << QQuickTextInput::SelectCharacters << 40 << 44 << true; QTest::newRow("( jumped )|characters") - << standard[0] << 19 << 27 << QSGTextInput::SelectCharacters << 19 << 27 << true; + << standard[0] << 19 << 27 << QQuickTextInput::SelectCharacters << 19 << 27 << true; QTest::newRow("th(e qu)ick|characters") - << standard[0] << 2 << 6 << QSGTextInput::SelectCharacters << 2 << 6 << true; + << standard[0] << 2 << 6 << QQuickTextInput::SelectCharacters << 2 << 6 << true; QTest::newRow("la(zy d)og|characters") - << standard[0] << 38 << 42 << QSGTextInput::SelectCharacters << 38 << 42 << true; + << standard[0] << 38 << 42 << QQuickTextInput::SelectCharacters << 38 << 42 << true; QTest::newRow("jum(ped ov)er|characters") - << standard[0] << 23 << 29 << QSGTextInput::SelectCharacters << 23 << 29 << true; + << standard[0] << 23 << 29 << QQuickTextInput::SelectCharacters << 23 << 29 << true; QTest::newRow("()the|characters") - << standard[0] << 0 << 0 << QSGTextInput::SelectCharacters << 0 << 0 << true; + << standard[0] << 0 << 0 << QQuickTextInput::SelectCharacters << 0 << 0 << true; QTest::newRow("dog()|characters") - << standard[0] << 44 << 44 << QSGTextInput::SelectCharacters << 44 << 44 << true; + << standard[0] << 44 << 44 << QQuickTextInput::SelectCharacters << 44 << 44 << true; QTest::newRow("jum()ped|characters") - << standard[0] << 23 << 23 << QSGTextInput::SelectCharacters << 23 << 23 << true; + << standard[0] << 23 << 23 << QQuickTextInput::SelectCharacters << 23 << 23 << true; QTest::newRow("<(t)he>|words") - << standard[0] << 0 << 1 << QSGTextInput::SelectWords << 0 << 3 << true; + << standard[0] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 3 << true; QTest::newRow("<do(g)>|words") - << standard[0] << 43 << 44 << QSGTextInput::SelectWords << 41 << 44 << true; + << standard[0] << 43 << 44 << QQuickTextInput::SelectWords << 41 << 44 << true; QTest::newRow("<jum(p)ed>|words") - << standard[0] << 23 << 24 << QSGTextInput::SelectWords << 20 << 26 << true; + << standard[0] << 23 << 24 << QQuickTextInput::SelectWords << 20 << 26 << true; QTest::newRow("<jumped( )>over|words,ltr") - << standard[0] << 26 << 27 << QSGTextInput::SelectWords << 20 << 27 << false; + << standard[0] << 26 << 27 << QQuickTextInput::SelectWords << 20 << 27 << false; QTest::newRow("jumped<( )over>|words,rtl") - << standard[0] << 27 << 26 << QSGTextInput::SelectWords << 26 << 31 << false; + << standard[0] << 27 << 26 << QQuickTextInput::SelectWords << 26 << 31 << false; QTest::newRow("<(the )>quick|words,ltr") - << standard[0] << 0 << 4 << QSGTextInput::SelectWords << 0 << 4 << false; + << standard[0] << 0 << 4 << QQuickTextInput::SelectWords << 0 << 4 << false; QTest::newRow("<(the )quick>|words,rtl") - << standard[0] << 4 << 0 << QSGTextInput::SelectWords << 0 << 9 << false; + << standard[0] << 4 << 0 << QQuickTextInput::SelectWords << 0 << 9 << false; QTest::newRow("<lazy( dog)>|words,ltr") - << standard[0] << 40 << 44 << QSGTextInput::SelectWords << 36 << 44 << false; + << standard[0] << 40 << 44 << QQuickTextInput::SelectWords << 36 << 44 << false; QTest::newRow("lazy<( dog)>|words,rtl") - << standard[0] << 44 << 40 << QSGTextInput::SelectWords << 40 << 44 << false; + << standard[0] << 44 << 40 << QQuickTextInput::SelectWords << 40 << 44 << false; QTest::newRow("<fox( jumped )>over|words,ltr") - << standard[0] << 19 << 27 << QSGTextInput::SelectWords << 16 << 27 << false; + << standard[0] << 19 << 27 << QQuickTextInput::SelectWords << 16 << 27 << false; QTest::newRow("fox<( jumped )over>|words,rtl") - << standard[0] << 27 << 19 << QSGTextInput::SelectWords << 19 << 31 << false; + << standard[0] << 27 << 19 << QQuickTextInput::SelectWords << 19 << 31 << false; QTest::newRow("<th(e qu)ick>|words") - << standard[0] << 2 << 6 << QSGTextInput::SelectWords << 0 << 9 << true; + << standard[0] << 2 << 6 << QQuickTextInput::SelectWords << 0 << 9 << true; QTest::newRow("<la(zy d)og|words>") - << standard[0] << 38 << 42 << QSGTextInput::SelectWords << 36 << 44 << true; + << standard[0] << 38 << 42 << QQuickTextInput::SelectWords << 36 << 44 << true; QTest::newRow("<jum(ped ov)er>|words") - << standard[0] << 23 << 29 << QSGTextInput::SelectWords << 20 << 31 << true; + << standard[0] << 23 << 29 << QQuickTextInput::SelectWords << 20 << 31 << true; QTest::newRow("<()>the|words") - << standard[0] << 0 << 0 << QSGTextInput::SelectWords << 0 << 0 << true; + << standard[0] << 0 << 0 << QQuickTextInput::SelectWords << 0 << 0 << true; QTest::newRow("dog<()>|words") - << standard[0] << 44 << 44 << QSGTextInput::SelectWords << 44 << 44 << true; + << standard[0] << 44 << 44 << QQuickTextInput::SelectWords << 44 << 44 << true; QTest::newRow("jum<()>ped|words") - << standard[0] << 23 << 23 << QSGTextInput::SelectWords << 23 << 23 << true; + << standard[0] << 23 << 23 << QQuickTextInput::SelectWords << 23 << 23 << true; QTest::newRow("Hello<(,)> |words") - << standard[2] << 5 << 6 << QSGTextInput::SelectWords << 5 << 6 << true; + << standard[2] << 5 << 6 << QQuickTextInput::SelectWords << 5 << 6 << true; QTest::newRow("Hello<(, )>world|words,ltr") - << standard[2] << 5 << 7 << QSGTextInput::SelectWords << 5 << 7 << false; + << standard[2] << 5 << 7 << QQuickTextInput::SelectWords << 5 << 7 << false; QTest::newRow("Hello<(, )world>|words,rtl") - << standard[2] << 7 << 5 << QSGTextInput::SelectWords << 5 << 12 << false; + << standard[2] << 7 << 5 << QQuickTextInput::SelectWords << 5 << 12 << false; QTest::newRow("<Hel(lo, )>world|words,ltr") - << standard[2] << 3 << 7 << QSGTextInput::SelectWords << 0 << 7 << false; + << standard[2] << 3 << 7 << QQuickTextInput::SelectWords << 0 << 7 << false; QTest::newRow("<Hel(lo, )world>|words,rtl") - << standard[2] << 7 << 3 << QSGTextInput::SelectWords << 0 << 12 << false; + << standard[2] << 7 << 3 << QQuickTextInput::SelectWords << 0 << 12 << false; QTest::newRow("<Hel(lo)>,|words") - << standard[2] << 3 << 5 << QSGTextInput::SelectWords << 0 << 5 << true; + << standard[2] << 3 << 5 << QQuickTextInput::SelectWords << 0 << 5 << true; QTest::newRow("Hello<()>,|words") - << standard[2] << 5 << 5 << QSGTextInput::SelectWords << 5 << 5 << true; + << standard[2] << 5 << 5 << QQuickTextInput::SelectWords << 5 << 5 << true; QTest::newRow("Hello,<()>|words") - << standard[2] << 6 << 6 << QSGTextInput::SelectWords << 6 << 6 << true; + << standard[2] << 6 << 6 << QQuickTextInput::SelectWords << 6 << 6 << true; QTest::newRow("Hello<,( )>world|words,ltr") - << standard[2] << 6 << 7 << QSGTextInput::SelectWords << 5 << 7 << false; + << standard[2] << 6 << 7 << QQuickTextInput::SelectWords << 5 << 7 << false; QTest::newRow("Hello,<( )world>|words,rtl") - << standard[2] << 7 << 6 << QSGTextInput::SelectWords << 6 << 12 << false; + << standard[2] << 7 << 6 << QQuickTextInput::SelectWords << 6 << 12 << false; QTest::newRow("Hello<,( world)>|words,ltr") - << standard[2] << 6 << 12 << QSGTextInput::SelectWords << 5 << 12 << false; + << standard[2] << 6 << 12 << QQuickTextInput::SelectWords << 5 << 12 << false; QTest::newRow("Hello,<( world)>|words,rtl") - << standard[2] << 12 << 6 << QSGTextInput::SelectWords << 6 << 12 << false; + << standard[2] << 12 << 6 << QQuickTextInput::SelectWords << 6 << 12 << false; QTest::newRow("Hello<,( world!)>|words,ltr") - << standard[2] << 6 << 13 << QSGTextInput::SelectWords << 5 << 13 << false; + << standard[2] << 6 << 13 << QQuickTextInput::SelectWords << 5 << 13 << false; QTest::newRow("Hello,<( world!)>|words,rtl") - << standard[2] << 13 << 6 << QSGTextInput::SelectWords << 6 << 13 << false; + << standard[2] << 13 << 6 << QQuickTextInput::SelectWords << 6 << 13 << false; QTest::newRow("Hello<(, world!)>|words") - << standard[2] << 5 << 13 << QSGTextInput::SelectWords << 5 << 13 << true; + << standard[2] << 5 << 13 << QQuickTextInput::SelectWords << 5 << 13 << true; // Fails due to an issue with QTextBoundaryFinder and punctuation at the end of strings. // QTBUG-11365 // QTest::newRow("world<(!)>|words") - // << standard[2] << 12 << 13 << QSGTextInput::SelectWords << 12 << 13 << true; + // << standard[2] << 12 << 13 << QQuickTextInput::SelectWords << 12 << 13 << true; QTest::newRow("world!<()>)|words") - << standard[2] << 13 << 13 << QSGTextInput::SelectWords << 13 << 13 << true; + << standard[2] << 13 << 13 << QQuickTextInput::SelectWords << 13 << 13 << true; QTest::newRow("world<()>!)|words") - << standard[2] << 12 << 12 << QSGTextInput::SelectWords << 12 << 12 << true; + << standard[2] << 12 << 12 << QQuickTextInput::SelectWords << 12 << 12 << true; QTest::newRow("<(,)>olleH |words") - << standard[3] << 7 << 8 << QSGTextInput::SelectWords << 7 << 8 << true; + << standard[3] << 7 << 8 << QQuickTextInput::SelectWords << 7 << 8 << true; QTest::newRow("<dlrow( ,)>olleH|words,ltr") - << standard[3] << 6 << 8 << QSGTextInput::SelectWords << 1 << 8 << false; + << standard[3] << 6 << 8 << QQuickTextInput::SelectWords << 1 << 8 << false; QTest::newRow("dlrow<( ,)>olleH|words,rtl") - << standard[3] << 8 << 6 << QSGTextInput::SelectWords << 6 << 8 << false; + << standard[3] << 8 << 6 << QQuickTextInput::SelectWords << 6 << 8 << false; QTest::newRow("<dlrow( ,ol)leH>|words,ltr") - << standard[3] << 6 << 10 << QSGTextInput::SelectWords << 1 << 13 << false; + << standard[3] << 6 << 10 << QQuickTextInput::SelectWords << 1 << 13 << false; QTest::newRow("dlrow<( ,ol)leH>|words,rtl") - << standard[3] << 10 << 6 << QSGTextInput::SelectWords << 6 << 13 << false; + << standard[3] << 10 << 6 << QQuickTextInput::SelectWords << 6 << 13 << false; QTest::newRow(",<(ol)leH>,|words") - << standard[3] << 8 << 10 << QSGTextInput::SelectWords << 8 << 13 << true; + << standard[3] << 8 << 10 << QQuickTextInput::SelectWords << 8 << 13 << true; QTest::newRow(",<()>olleH|words") - << standard[3] << 8 << 8 << QSGTextInput::SelectWords << 8 << 8 << true; + << standard[3] << 8 << 8 << QQuickTextInput::SelectWords << 8 << 8 << true; QTest::newRow("<()>,olleH|words") - << standard[3] << 7 << 7 << QSGTextInput::SelectWords << 7 << 7 << true; + << standard[3] << 7 << 7 << QQuickTextInput::SelectWords << 7 << 7 << true; QTest::newRow("<dlrow( )>,olleH|words,ltr") - << standard[3] << 6 << 7 << QSGTextInput::SelectWords << 1 << 7 << false; + << standard[3] << 6 << 7 << QQuickTextInput::SelectWords << 1 << 7 << false; QTest::newRow("dlrow<( ),>olleH|words,rtl") - << standard[3] << 7 << 6 << QSGTextInput::SelectWords << 6 << 8 << false; + << standard[3] << 7 << 6 << QQuickTextInput::SelectWords << 6 << 8 << false; QTest::newRow("<(dlrow )>,olleH|words,ltr") - << standard[3] << 1 << 7 << QSGTextInput::SelectWords << 1 << 7 << false; + << standard[3] << 1 << 7 << QQuickTextInput::SelectWords << 1 << 7 << false; QTest::newRow("<(dlrow ),>olleH|words,rtl") - << standard[3] << 7 << 1 << QSGTextInput::SelectWords << 1 << 8 << false; + << standard[3] << 7 << 1 << QQuickTextInput::SelectWords << 1 << 8 << false; QTest::newRow("<(!dlrow )>,olleH|words,ltr") - << standard[3] << 0 << 7 << QSGTextInput::SelectWords << 0 << 7 << false; + << standard[3] << 0 << 7 << QQuickTextInput::SelectWords << 0 << 7 << false; QTest::newRow("<(!dlrow ),>olleH|words,rtl") - << standard[3] << 7 << 0 << QSGTextInput::SelectWords << 0 << 8 << false; + << standard[3] << 7 << 0 << QQuickTextInput::SelectWords << 0 << 8 << false; QTest::newRow("(!dlrow ,)olleH|words") - << standard[3] << 0 << 8 << QSGTextInput::SelectWords << 0 << 8 << true; + << standard[3] << 0 << 8 << QQuickTextInput::SelectWords << 0 << 8 << true; QTest::newRow("<(!)>dlrow|words") - << standard[3] << 0 << 1 << QSGTextInput::SelectWords << 0 << 1 << true; + << standard[3] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 1 << true; QTest::newRow("<()>!dlrow|words") - << standard[3] << 0 << 0 << QSGTextInput::SelectWords << 0 << 0 << true; + << standard[3] << 0 << 0 << QQuickTextInput::SelectWords << 0 << 0 << true; QTest::newRow("!<()>dlrow|words") - << standard[3] << 1 << 1 << QSGTextInput::SelectWords << 1 << 1 << true; + << standard[3] << 1 << 1 << QQuickTextInput::SelectWords << 1 << 1 << true; QTest::newRow(" <s(pac)ey> text |words") - << standard[4] << 1 << 4 << QSGTextInput::SelectWords << 1 << 7 << true; + << standard[4] << 1 << 4 << QQuickTextInput::SelectWords << 1 << 7 << true; QTest::newRow(" spacey <t(ex)t> |words") - << standard[4] << 11 << 13 << QSGTextInput::SelectWords << 10 << 14 << false; // Should be reversible. QTBUG-11365 + << standard[4] << 11 << 13 << QQuickTextInput::SelectWords << 10 << 14 << false; // Should be reversible. QTBUG-11365 QTest::newRow("<( )>spacey text |words|ltr") - << standard[4] << 0 << 1 << QSGTextInput::SelectWords << 0 << 1 << false; + << standard[4] << 0 << 1 << QQuickTextInput::SelectWords << 0 << 1 << false; QTest::newRow("<( )spacey> text |words|rtl") - << standard[4] << 1 << 0 << QSGTextInput::SelectWords << 0 << 7 << false; + << standard[4] << 1 << 0 << QQuickTextInput::SelectWords << 0 << 7 << false; QTest::newRow("spacey <text( )>|words|ltr") - << standard[4] << 14 << 15 << QSGTextInput::SelectWords << 10 << 15 << false; + << standard[4] << 14 << 15 << QQuickTextInput::SelectWords << 10 << 15 << false; // QTBUG-11365 // QTest::newRow("spacey text<( )>|words|rtl") -// << standard[4] << 15 << 14 << QSGTextInput::SelectWords << 14 << 15 << false; +// << standard[4] << 15 << 14 << QQuickTextInput::SelectWords << 14 << 15 << false; QTest::newRow("<()> spacey text |words") - << standard[4] << 0 << 0 << QSGTextInput::SelectWords << 0 << 0 << false; + << standard[4] << 0 << 0 << QQuickTextInput::SelectWords << 0 << 0 << false; QTest::newRow(" spacey text <()>|words") - << standard[4] << 15 << 15 << QSGTextInput::SelectWords << 15 << 15 << false; + << standard[4] << 15 << 15 << QQuickTextInput::SelectWords << 15 << 15 << false; } -void tst_qsgtextinput::moveCursorSelection() +void tst_qquicktextinput::moveCursorSelection() { QFETCH(QString, testStr); QFETCH(int, cursorPosition); QFETCH(int, movePosition); - QFETCH(QSGTextInput::SelectionMode, mode); + QFETCH(QQuickTextInput::SelectionMode, mode); QFETCH(int, selectionStart); QFETCH(int, selectionEnd); QFETCH(bool, reversible); @@ -730,7 +730,7 @@ void tst_qsgtextinput::moveCursorSelection() QString componentStr = "import QtQuick 2.0\nTextInput { text: \""+ testStr +"\"; }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); textinputObject->setCursorPosition(cursorPosition); @@ -752,7 +752,7 @@ void tst_qsgtextinput::moveCursorSelection() delete textinputObject; } -void tst_qsgtextinput::moveCursorSelectionSequence_data() +void tst_qquicktextinput::moveCursorSelectionSequence_data() { QTest::addColumn<QString>("testStr"); QTest::addColumn<int>("cursorPosition"); @@ -926,7 +926,7 @@ void tst_qsgtextinput::moveCursorSelectionSequence_data() // << 10 << 14; } -void tst_qsgtextinput::moveCursorSelectionSequence() +void tst_qquicktextinput::moveCursorSelectionSequence() { QFETCH(QString, testStr); QFETCH(int, cursorPosition); @@ -940,17 +940,17 @@ void tst_qsgtextinput::moveCursorSelectionSequence() QString componentStr = "import QtQuick 2.0\nTextInput { text: \""+ testStr +"\"; }"; QDeclarativeComponent textinputComponent(&engine); textinputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput*>(textinputComponent.create()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput*>(textinputComponent.create()); QVERIFY(textinputObject != 0); textinputObject->setCursorPosition(cursorPosition); - textinputObject->moveCursorSelection(movePosition1, QSGTextInput::SelectWords); + textinputObject->moveCursorSelection(movePosition1, QQuickTextInput::SelectWords); QCOMPARE(textinputObject->selectedText(), testStr.mid(selection1Start, selection1End - selection1Start)); QCOMPARE(textinputObject->selectionStart(), selection1Start); QCOMPARE(textinputObject->selectionEnd(), selection1End); - textinputObject->moveCursorSelection(movePosition2, QSGTextInput::SelectWords); + textinputObject->moveCursorSelection(movePosition2, QQuickTextInput::SelectWords); QCOMPARE(textinputObject->selectedText(), testStr.mid(selection2Start, selection2End - selection2Start)); QCOMPARE(textinputObject->selectionStart(), selection2Start); QCOMPARE(textinputObject->selectionEnd(), selection2End); @@ -958,11 +958,11 @@ void tst_qsgtextinput::moveCursorSelectionSequence() delete textinputObject; } -void tst_qsgtextinput::dragMouseSelection() +void tst_qquicktextinput::dragMouseSelection() { QString qmlfile = TESTDATA("mouseselection_true.qml"); - QSGView canvas(QUrl::fromLocalFile(qmlfile)); + QQuickView canvas(QUrl::fromLocalFile(qmlfile)); canvas.show(); canvas.requestActivateWindow(); @@ -971,7 +971,7 @@ void tst_qsgtextinput::dragMouseSelection() QTRY_COMPARE(&canvas, qGuiApp->focusWindow()); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *textInputObject = qobject_cast<QSGTextInput *>(canvas.rootObject()); + QQuickTextInput *textInputObject = qobject_cast<QQuickTextInput *>(canvas.rootObject()); QVERIFY(textInputObject != 0); // press-and-drag-and-release from x1 to x2 @@ -999,7 +999,7 @@ void tst_qsgtextinput::dragMouseSelection() QVERIFY(str1 != str2); } -void tst_qsgtextinput::mouseSelectionMode_data() +void tst_qquicktextinput::mouseSelectionMode_data() { QTest::addColumn<QString>("qmlfile"); QTest::addColumn<bool>("selectWords"); @@ -1010,14 +1010,14 @@ void tst_qsgtextinput::mouseSelectionMode_data() QTest::newRow("default") << TESTDATA("mouseselectionmode_default.qml") << false; } -void tst_qsgtextinput::mouseSelectionMode() +void tst_qquicktextinput::mouseSelectionMode() { QFETCH(QString, qmlfile); QFETCH(bool, selectWords); QString text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - QSGView canvas(QUrl::fromLocalFile(qmlfile)); + QQuickView canvas(QUrl::fromLocalFile(qmlfile)); canvas.show(); canvas.requestActivateWindow(); @@ -1025,7 +1025,7 @@ void tst_qsgtextinput::mouseSelectionMode() QTRY_COMPARE(&canvas, qGuiApp->focusWindow()); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *textInputObject = qobject_cast<QSGTextInput *>(canvas.rootObject()); + QQuickTextInput *textInputObject = qobject_cast<QQuickTextInput *>(canvas.rootObject()); QVERIFY(textInputObject != 0); // press-and-drag-and-release from x1 to x2 @@ -1044,7 +1044,7 @@ void tst_qsgtextinput::mouseSelectionMode() } } -void tst_qsgtextinput::horizontalAlignment_data() +void tst_qquicktextinput::horizontalAlignment_data() { QTest::addColumn<int>("hAlign"); QTest::addColumn<QString>("expectfile"); @@ -1054,14 +1054,14 @@ void tst_qsgtextinput::horizontalAlignment_data() QTest::newRow("C") << int(Qt::AlignHCenter) << "halign_center"; } -void tst_qsgtextinput::horizontalAlignment() +void tst_qquicktextinput::horizontalAlignment() { QSKIP("Image comparison of text is almost guaranteed to fail during development"); QFETCH(int, hAlign); QFETCH(QString, expectfile); - QSGView canvas(QUrl::fromLocalFile(TESTDATA("horizontalAlignment.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("horizontalAlignment.qml"))); canvas.show(); canvas.requestActivateWindow(); @@ -1079,77 +1079,77 @@ void tst_qsgtextinput::horizontalAlignment() QCOMPARE(actual,expect); } -void tst_qsgtextinput::horizontalAlignment_RightToLeft() +void tst_qquicktextinput::horizontalAlignment_RightToLeft() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("horizontalAlignment_RightToLeft.qml"))); - QSGTextInput *textInput = canvas.rootObject()->findChild<QSGTextInput*>("text"); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("horizontalAlignment_RightToLeft.qml"))); + QQuickTextInput *textInput = canvas.rootObject()->findChild<QQuickTextInput*>("text"); QVERIFY(textInput != 0); canvas.show(); const QString rtlText = textInput->text(); - QSGTextInputPrivate *textInputPrivate = QSGTextInputPrivate::get(textInput); + QQuickTextInputPrivate *textInputPrivate = QQuickTextInputPrivate::get(textInput); QVERIFY(textInputPrivate != 0); QVERIFY(-textInputPrivate->hscroll > canvas.width()/2); // implicit alignment should follow the reading direction of RTL text - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignRight); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight); QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign()); QVERIFY(-textInputPrivate->hscroll > canvas.width()/2); // explicitly left aligned - textInput->setHAlign(QSGTextInput::AlignLeft); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignLeft); + textInput->setHAlign(QQuickTextInput::AlignLeft); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignLeft); QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign()); QVERIFY(-textInputPrivate->hscroll < canvas.width()/2); // explicitly right aligned - textInput->setHAlign(QSGTextInput::AlignRight); + textInput->setHAlign(QQuickTextInput::AlignRight); QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign()); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignRight); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight); QVERIFY(-textInputPrivate->hscroll > canvas.width()/2); // explicitly center aligned - textInput->setHAlign(QSGTextInput::AlignHCenter); + textInput->setHAlign(QQuickTextInput::AlignHCenter); QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign()); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignHCenter); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignHCenter); QVERIFY(-textInputPrivate->hscroll < canvas.width()/2); QVERIFY(-textInputPrivate->hscroll + textInputPrivate->width > canvas.width()/2); // reseted alignment should go back to following the text reading direction textInput->resetHAlign(); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignRight); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight); QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign()); QVERIFY(-textInputPrivate->hscroll > canvas.width()/2); // mirror the text item - QSGItemPrivate::get(textInput)->setLayoutMirror(true); + QQuickItemPrivate::get(textInput)->setLayoutMirror(true); // mirrored implicit alignment should continue to follow the reading direction of the text - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignRight); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight); QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign()); QVERIFY(-textInputPrivate->hscroll > canvas.width()/2); // explicitly right aligned behaves as left aligned - textInput->setHAlign(QSGTextInput::AlignRight); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignRight); - QCOMPARE(textInput->effectiveHAlign(), QSGTextInput::AlignLeft); + textInput->setHAlign(QQuickTextInput::AlignRight); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight); + QCOMPARE(textInput->effectiveHAlign(), QQuickTextInput::AlignLeft); QVERIFY(-textInputPrivate->hscroll < canvas.width()/2); // mirrored explicitly left aligned behaves as right aligned - textInput->setHAlign(QSGTextInput::AlignLeft); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignLeft); - QCOMPARE(textInput->effectiveHAlign(), QSGTextInput::AlignRight); + textInput->setHAlign(QQuickTextInput::AlignLeft); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignLeft); + QCOMPARE(textInput->effectiveHAlign(), QQuickTextInput::AlignRight); QVERIFY(-textInputPrivate->hscroll > canvas.width()/2); // disable mirroring - QSGItemPrivate::get(textInput)->setLayoutMirror(false); + QQuickItemPrivate::get(textInput)->setLayoutMirror(false); QCOMPARE(textInput->effectiveHAlign(), textInput->hAlign()); textInput->resetHAlign(); // English text should be implicitly left aligned textInput->setText("Hello world!"); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignLeft); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignLeft); QVERIFY(-textInputPrivate->hscroll < canvas.width()/2); canvas.requestActivateWindow(); @@ -1160,22 +1160,22 @@ void tst_qsgtextinput::horizontalAlignment_RightToLeft() textInput->setText(QString()); { QInputMethodEvent ev(rtlText, QList<QInputMethodEvent::Attribute>()); QGuiApplication::sendEvent(&canvas, &ev); } QEXPECT_FAIL("", "QTBUG-21691", Continue); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignRight); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight); { QInputMethodEvent ev("Hello world!", QList<QInputMethodEvent::Attribute>()); QGuiApplication::sendEvent(&canvas, &ev); } - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignLeft); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignLeft); #ifndef Q_OS_MAC // QTBUG-18040 // empty text with implicit alignment follows the system locale-based // keyboard input direction from QGuiApplication::keyboardInputDirection textInput->setText(""); QCOMPARE(textInput->hAlign(), QGuiApplication::keyboardInputDirection() == Qt::LeftToRight ? - QSGTextInput::AlignLeft : QSGTextInput::AlignRight); + QQuickTextInput::AlignLeft : QQuickTextInput::AlignRight); if (QGuiApplication::keyboardInputDirection() == Qt::LeftToRight) QVERIFY(-textInputPrivate->hscroll < canvas.width()/2); else QVERIFY(-textInputPrivate->hscroll > canvas.width()/2); - textInput->setHAlign(QSGTextInput::AlignRight); - QCOMPARE(textInput->hAlign(), QSGTextInput::AlignRight); + textInput->setHAlign(QQuickTextInput::AlignRight); + QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignRight); QVERIFY(-textInputPrivate->hscroll > canvas.width()/2); #endif @@ -1184,22 +1184,22 @@ void tst_qsgtextinput::horizontalAlignment_RightToLeft() QString componentStr = "import QtQuick 2.0\nTextInput {}"; QDeclarativeComponent textComponent(&engine); textComponent.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QSGTextInput *textObject = qobject_cast<QSGTextInput*>(textComponent.create()); + QQuickTextInput *textObject = qobject_cast<QQuickTextInput*>(textComponent.create()); QCOMPARE(textObject->hAlign(), QGuiApplication::keyboardInputDirection() == Qt::LeftToRight ? - QSGTextInput::AlignLeft : QSGTextInput::AlignRight); + QQuickTextInput::AlignLeft : QQuickTextInput::AlignRight); delete textObject; #endif } -void tst_qsgtextinput::positionAt() +void tst_qquicktextinput::positionAt() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("positionAt.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("positionAt.qml"))); QVERIFY(canvas.rootObject() != 0); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput *>(canvas.rootObject()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput *>(canvas.rootObject()); QVERIFY(textinputObject != 0); // Check autoscrolled... @@ -1255,8 +1255,8 @@ void tst_qsgtextinput::positionAt() #endif int x = textinputObject->positionToRectangle(pos + 1).x() - 1; - QCOMPARE(textinputObject->positionAt(x, QSGTextInput::CursorBetweenCharacters), pos + 1); - QCOMPARE(textinputObject->positionAt(x, QSGTextInput::CursorOnCharacter), pos); + QCOMPARE(textinputObject->positionAt(x, QQuickTextInput::CursorBetweenCharacters), pos + 1); + QCOMPARE(textinputObject->positionAt(x, QQuickTextInput::CursorOnCharacter), pos); // Check without autoscroll... textinputObject->setAutoScroll(false); @@ -1292,8 +1292,8 @@ void tst_qsgtextinput::positionAt() #endif x = textinputObject->positionToRectangle(pos + 1).x() - 1; - QCOMPARE(textinputObject->positionAt(x, QSGTextInput::CursorBetweenCharacters), pos + 1); - QCOMPARE(textinputObject->positionAt(x, QSGTextInput::CursorOnCharacter), pos); + QCOMPARE(textinputObject->positionAt(x, QQuickTextInput::CursorBetweenCharacters), pos + 1); + QCOMPARE(textinputObject->positionAt(x, QQuickTextInput::CursorOnCharacter), pos); const qreal x0 = textinputObject->positionToRectangle(pos).x(); const qreal x1 = textinputObject->positionToRectangle(pos + 1).x(); @@ -1315,15 +1315,15 @@ void tst_qsgtextinput::positionAt() QCOMPARE(textinputObject->positionToRectangle(1).x(), x1); } -void tst_qsgtextinput::maxLength() +void tst_qquicktextinput::maxLength() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("maxLength.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("maxLength.qml"))); QVERIFY(canvas.rootObject() != 0); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput *>(canvas.rootObject()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput *>(canvas.rootObject()); QVERIFY(textinputObject != 0); QVERIFY(textinputObject->text().isEmpty()); QVERIFY(textinputObject->maxLength() == 10); @@ -1344,15 +1344,15 @@ void tst_qsgtextinput::maxLength() } } -void tst_qsgtextinput::masks() +void tst_qquicktextinput::masks() { //Not a comprehensive test of the possible masks, that's done elsewhere (QLineEdit) //QString componentStr = "import QtQuick 2.0\nTextInput { inputMask: 'HHHHhhhh'; }"; - QSGView canvas(QUrl::fromLocalFile(TESTDATA("masks.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("masks.qml"))); canvas.show(); canvas.requestActivateWindow(); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *textinputObject = qobject_cast<QSGTextInput *>(canvas.rootObject()); + QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput *>(canvas.rootObject()); QVERIFY(textinputObject != 0); QTRY_VERIFY(textinputObject->hasActiveFocus() == true); QVERIFY(textinputObject->text().length() == 0); @@ -1367,19 +1367,19 @@ void tst_qsgtextinput::masks() } } -void tst_qsgtextinput::validators() +void tst_qquicktextinput::validators() { // Note that this test assumes that the validators are working properly // so you may need to run their tests first. All validators are checked // here to ensure that their exposure to QML is working. - QSGView canvas(QUrl::fromLocalFile(TESTDATA("validators.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("validators.qml"))); canvas.show(); canvas.requestActivateWindow(); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *intInput = qobject_cast<QSGTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("intInput"))); + QQuickTextInput *intInput = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("intInput"))); QVERIFY(intInput); intInput->setFocus(true); QTRY_VERIFY(intInput->hasActiveFocus()); @@ -1404,7 +1404,7 @@ void tst_qsgtextinput::validators() QCOMPARE(intInput->text(), QLatin1String("11")); QCOMPARE(intInput->hasAcceptableInput(), true); - QSGTextInput *dblInput = qobject_cast<QSGTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("dblInput"))); + QQuickTextInput *dblInput = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("dblInput"))); QTRY_VERIFY(dblInput); dblInput->setFocus(true); QVERIFY(dblInput->hasActiveFocus() == true); @@ -1439,7 +1439,7 @@ void tst_qsgtextinput::validators() QTRY_COMPARE(dblInput->text(), QLatin1String("12.11")); QCOMPARE(dblInput->hasAcceptableInput(), true); - QSGTextInput *strInput = qobject_cast<QSGTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("strInput"))); + QQuickTextInput *strInput = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("strInput"))); QTRY_VERIFY(strInput); strInput->setFocus(true); QVERIFY(strInput->hasActiveFocus() == true); @@ -1475,16 +1475,16 @@ void tst_qsgtextinput::validators() QCOMPARE(strInput->hasAcceptableInput(), true); } -void tst_qsgtextinput::inputMethods() +void tst_qquicktextinput::inputMethods() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("inputmethods.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("inputmethods.qml"))); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); // test input method hints QVERIFY(canvas.rootObject() != 0); - QSGTextInput *input = qobject_cast<QSGTextInput *>(canvas.rootObject()); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(canvas.rootObject()); QVERIFY(input != 0); QVERIFY(input->inputMethodHints() & Qt::ImhNoPredictiveText); input->setInputMethodHints(Qt::ImhUppercaseOnly); @@ -1523,15 +1523,15 @@ TextInput element should only handle left/right keys until the cursor reaches the extent of the text, then they should ignore the keys. */ -void tst_qsgtextinput::navigation() +void tst_qquicktextinput::navigation() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("navigation.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("navigation.qml"))); canvas.show(); canvas.requestActivateWindow(); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *input = qobject_cast<QSGTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); QVERIFY(input != 0); input->setCursorPosition(0); @@ -1562,15 +1562,15 @@ void tst_qsgtextinput::navigation() QCOMPARE(input->cursorPosition(),2); } -void tst_qsgtextinput::navigation_RTL() +void tst_qquicktextinput::navigation_RTL() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("navigation.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("navigation.qml"))); canvas.show(); canvas.requestActivateWindow(); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *input = qobject_cast<QSGTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); QVERIFY(input != 0); const quint16 arabic_str[] = { 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0638, 0x0643, 0x00646, 0x0647, 0x0633, 0x0647}; @@ -1599,7 +1599,7 @@ void tst_qsgtextinput::navigation_RTL() QVERIFY(input->hasActiveFocus() == true); } -void tst_qsgtextinput::copyAndPaste() { +void tst_qquicktextinput::copyAndPaste() { #ifndef QT_NO_CLIPBOARD #ifdef Q_WS_MAC @@ -1616,7 +1616,7 @@ void tst_qsgtextinput::copyAndPaste() { QString componentStr = "import QtQuick 2.0\nTextInput { text: \"Hello world!\" }"; QDeclarativeComponent textInputComponent(&engine); textInputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textInput = qobject_cast<QSGTextInput*>(textInputComponent.create()); + QQuickTextInput *textInput = qobject_cast<QQuickTextInput*>(textInputComponent.create()); QVERIFY(textInput != 0); // copy and paste @@ -1661,12 +1661,12 @@ void tst_qsgtextinput::copyAndPaste() { // when echo mode is set to hide text/password mode int index = 0; while (index < 4) { - QSGTextInput::EchoMode echoMode = QSGTextInput::EchoMode(index); + QQuickTextInput::EchoMode echoMode = QQuickTextInput::EchoMode(index); textInput->setEchoMode(echoMode); textInput->setText("My password"); textInput->select(0, textInput->text().length());; textInput->copy(); - if (echoMode == QSGTextInput::Normal) { + if (echoMode == QQuickTextInput::Normal) { QVERIFY(!clipboard->text().isEmpty()); QCOMPARE(clipboard->text(), QString("My password")); clipboard->clear(); @@ -1680,7 +1680,7 @@ void tst_qsgtextinput::copyAndPaste() { #endif } -void tst_qsgtextinput::canPasteEmpty() { +void tst_qquicktextinput::canPasteEmpty() { #ifndef QT_NO_CLIPBOARD QGuiApplication::clipboard()->clear(); @@ -1688,7 +1688,7 @@ void tst_qsgtextinput::canPasteEmpty() { QString componentStr = "import QtQuick 2.0\nTextInput { text: \"Hello world!\" }"; QDeclarativeComponent textInputComponent(&engine); textInputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textInput = qobject_cast<QSGTextInput*>(textInputComponent.create()); + QQuickTextInput *textInput = qobject_cast<QQuickTextInput*>(textInputComponent.create()); QVERIFY(textInput != 0); QLineControl lc; @@ -1698,7 +1698,7 @@ void tst_qsgtextinput::canPasteEmpty() { #endif } -void tst_qsgtextinput::canPaste() { +void tst_qquicktextinput::canPaste() { #ifndef QT_NO_CLIPBOARD QGuiApplication::clipboard()->setText("Some text"); @@ -1706,7 +1706,7 @@ void tst_qsgtextinput::canPaste() { QString componentStr = "import QtQuick 2.0\nTextInput { text: \"Hello world!\" }"; QDeclarativeComponent textInputComponent(&engine); textInputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textInput = qobject_cast<QSGTextInput*>(textInputComponent.create()); + QQuickTextInput *textInput = qobject_cast<QQuickTextInput*>(textInputComponent.create()); QVERIFY(textInput != 0); QLineControl lc; @@ -1716,12 +1716,12 @@ void tst_qsgtextinput::canPaste() { #endif } -void tst_qsgtextinput::passwordCharacter() +void tst_qquicktextinput::passwordCharacter() { QString componentStr = "import QtQuick 2.0\nTextInput { text: \"Hello world!\"; font.family: \"Helvetica\"; echoMode: TextInput.Password }"; QDeclarativeComponent textInputComponent(&engine); textInputComponent.setData(componentStr.toLatin1(), QUrl()); - QSGTextInput *textInput = qobject_cast<QSGTextInput*>(textInputComponent.create()); + QQuickTextInput *textInput = qobject_cast<QQuickTextInput*>(textInputComponent.create()); QVERIFY(textInput != 0); textInput->setPasswordCharacter("X"); @@ -1734,17 +1734,17 @@ void tst_qsgtextinput::passwordCharacter() delete textInput; } -void tst_qsgtextinput::cursorDelegate() +void tst_qquicktextinput::cursorDelegate() { - QSGView view(QUrl::fromLocalFile(TESTDATA("cursorTest.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("cursorTest.qml"))); view.show(); view.requestActivateWindow(); - QSGTextInput *textInputObject = view.rootObject()->findChild<QSGTextInput*>("textInputObject"); + QQuickTextInput *textInputObject = view.rootObject()->findChild<QQuickTextInput*>("textInputObject"); QVERIFY(textInputObject != 0); - QVERIFY(textInputObject->findChild<QSGItem*>("cursorInstance")); + QVERIFY(textInputObject->findChild<QQuickItem*>("cursorInstance")); //Test Delegate gets created textInputObject->setFocus(true); - QSGItem* delegateObject = textInputObject->findChild<QSGItem*>("cursorInstance"); + QQuickItem* delegateObject = textInputObject->findChild<QQuickItem*>("cursorInstance"); QVERIFY(delegateObject); QCOMPARE(delegateObject->property("localProperty").toString(), QString("Hello")); //Test Delegate gets moved @@ -1758,18 +1758,18 @@ void tst_qsgtextinput::cursorDelegate() QCOMPARE(textInputObject->cursorRectangle().y(), qRound(delegateObject->y())); //Test Delegate gets deleted textInputObject->setCursorDelegate(0); - QVERIFY(!textInputObject->findChild<QSGItem*>("cursorInstance")); + QVERIFY(!textInputObject->findChild<QQuickItem*>("cursorInstance")); } -void tst_qsgtextinput::cursorVisible() +void tst_qquicktextinput::cursorVisible() { - QSGView view(QUrl::fromLocalFile(TESTDATA("cursorVisible.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("cursorVisible.qml"))); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextInput input; + QQuickTextInput input; QSignalSpy spy(&input, SIGNAL(cursorVisibleChanged(bool))); QCOMPARE(input.isCursorVisible(), false); @@ -1824,13 +1824,13 @@ void tst_qsgtextinput::cursorVisible() #endif } -void tst_qsgtextinput::cursorRectangle() +void tst_qquicktextinput::cursorRectangle() { QSKIP("QTBUG-21689"); QString text = "Hello World!"; - QSGTextInput input; + QQuickTextInput input; input.setText(text); QFontMetricsF fm(input.font()); input.setWidth(fm.width(text.mid(0, 5))); @@ -1873,21 +1873,21 @@ void tst_qsgtextinput::cursorRectangle() } input.setText("Hi!"); - input.setHAlign(QSGTextInput::AlignRight); + input.setHAlign(QQuickTextInput::AlignRight); r = input.cursorRectangle(); QVERIFY(r.left() < input.boundingRect().width()); QVERIFY(r.right() >= input.width() - error); } -void tst_qsgtextinput::readOnly() +void tst_qquicktextinput::readOnly() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("readOnly.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("readOnly.qml"))); canvas.show(); canvas.requestActivateWindow(); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *input = qobject_cast<QSGTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); QVERIFY(input != 0); QTRY_VERIFY(input->hasActiveFocus() == true); @@ -1906,9 +1906,9 @@ void tst_qsgtextinput::readOnly() QCOMPARE(input->cursorPosition(), input->text().length()); } -void tst_qsgtextinput::echoMode() +void tst_qquicktextinput::echoMode() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("echoMode.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("echoMode.qml"))); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); @@ -1916,20 +1916,20 @@ void tst_qsgtextinput::echoMode() QVERIFY(canvas.rootObject() != 0); - QSGTextInput *input = qobject_cast<QSGTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); QVERIFY(input != 0); QTRY_VERIFY(input->hasActiveFocus() == true); QString initial = input->text(); Qt::InputMethodHints ref; QCOMPARE(initial, QLatin1String("ABCDefgh")); - QCOMPARE(input->echoMode(), QSGTextInput::Normal); + QCOMPARE(input->echoMode(), QQuickTextInput::Normal); QCOMPARE(input->displayText(), input->text()); //Normal ref &= ~Qt::ImhHiddenText; ref &= ~(Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText); QCOMPARE(input->inputMethodHints(), ref); - input->setEchoMode(QSGTextInput::NoEcho); + input->setEchoMode(QQuickTextInput::NoEcho); QCOMPARE(input->text(), initial); QCOMPARE(input->displayText(), QLatin1String("")); QCOMPARE(input->passwordCharacter(), QLatin1String("*")); @@ -1937,7 +1937,7 @@ void tst_qsgtextinput::echoMode() ref |= Qt::ImhHiddenText; ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText); QCOMPARE(input->inputMethodHints(), ref); - input->setEchoMode(QSGTextInput::Password); + input->setEchoMode(QQuickTextInput::Password); //Password ref |= Qt::ImhHiddenText; ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText); @@ -1948,7 +1948,7 @@ void tst_qsgtextinput::echoMode() QCOMPARE(input->passwordCharacter(), QLatin1String("Q")); QCOMPARE(input->text(), initial); QCOMPARE(input->displayText(), QLatin1String("QQQQQQQQ")); - input->setEchoMode(QSGTextInput::PasswordEchoOnEdit); + input->setEchoMode(QQuickTextInput::PasswordEchoOnEdit); //PasswordEchoOnEdit ref &= ~Qt::ImhHiddenText; ref |= (Qt::ImhNoAutoUppercase | Qt::ImhNoPredictiveText); @@ -1978,7 +1978,7 @@ void tst_qsgtextinput::echoMode() #ifdef QT_GUI_PASSWORD_ECHO_DELAY void tst_qdeclarativetextinput::passwordEchoDelay() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("echoMode.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("echoMode.qml"))); canvas.show(); canvas.setFocus(); QGuiApplication::setActiveWindow(&canvas); @@ -1987,7 +1987,7 @@ void tst_qdeclarativetextinput::passwordEchoDelay() QVERIFY(canvas.rootObject() != 0); - QSGTextInput *input = qobject_cast<QSGTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(canvas.rootObject()->property("myInput"))); QChar fillChar = QLatin1Char('*'); @@ -2028,7 +2028,7 @@ void tst_qdeclarativetextinput::passwordEchoDelay() #endif -void tst_qsgtextinput::simulateKey(QSGView *view, int key) +void tst_qquicktextinput::simulateKey(QQuickView *view, int key) { QKeyEvent press(QKeyEvent::KeyPress, key, 0); QKeyEvent release(QKeyEvent::KeyRelease, key, 0); @@ -2085,15 +2085,15 @@ public: }; #endif -void tst_qsgtextinput::openInputPanel() +void tst_qquicktextinput::openInputPanel() { - QSGView view(QUrl::fromLocalFile(TESTDATA("openInputPanel.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("openInputPanel.qml"))); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextInput *input = qobject_cast<QSGTextInput *>(view.rootObject()); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject()); QVERIFY(input); // check default values @@ -2125,7 +2125,7 @@ void tst_qsgtextinput::openInputPanel() // input panel should stay visible if focus is lost to another text inputor QSignalSpy inputPanelVisibilitySpy(qApp->inputPanel(), SIGNAL(visibleChanged())); - QSGTextInput anotherInput; + QQuickTextInput anotherInput; anotherInput.setParentItem(view.rootObject()); anotherInput.setFocus(true); QCOMPARE(qApp->inputPanel()->visible(), true); @@ -2138,7 +2138,7 @@ void tst_qsgtextinput::openInputPanel() anotherInput.setFocus(true); // input item should be null if focus is lost to an item that doesn't accept inputs - QSGItem item; + QQuickItem item; item.setParentItem(view.rootObject()); item.setFocus(true); QCOMPARE(qApp->inputPanel()->inputItem(), static_cast<QObject*>(0)); @@ -2173,24 +2173,24 @@ void tst_qsgtextinput::openInputPanel() QCOMPARE(qApp->inputPanel()->visible(), false); } -class MyTextInput : public QSGTextInput +class MyTextInput : public QQuickTextInput { public: - MyTextInput(QSGItem *parent = 0) : QSGTextInput(parent) + MyTextInput(QQuickItem *parent = 0) : QQuickTextInput(parent) { nbPaint = 0; } virtual QSGNode *updatePaintNode(QSGNode *node, UpdatePaintNodeData *data) { nbPaint++; - return QSGTextInput::updatePaintNode(node, data); + return QQuickTextInput::updatePaintNode(node, data); } int nbPaint; }; -void tst_qsgtextinput::setHAlignClearCache() +void tst_qquicktextinput::setHAlignClearCache() { - QSGView view; + QQuickView view; MyTextInput input; input.setText("Hello world"); input.setParentItem(view.rootItem()); @@ -2198,16 +2198,16 @@ void tst_qsgtextinput::setHAlignClearCache() view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(input.nbPaint, 1); - input.setHAlign(QSGTextInput::AlignRight); + input.setHAlign(QQuickTextInput::AlignRight); //Changing the alignment should trigger a repaint QTRY_COMPARE(input.nbPaint, 2); } -void tst_qsgtextinput::focusOutClearSelection() +void tst_qquicktextinput::focusOutClearSelection() { - QSGView view; - QSGTextInput input; - QSGTextInput input2; + QQuickView view; + QQuickTextInput input; + QQuickTextInput input2; input.setText(QLatin1String("Hello world")); input.setFocus(true); input2.setParentItem(view.rootItem()); @@ -2224,7 +2224,7 @@ void tst_qsgtextinput::focusOutClearSelection() QTRY_COMPARE(input.selectedText(), QLatin1String("")); } -void tst_qsgtextinput::geometrySignals() +void tst_qquicktextinput::geometrySignals() { QDeclarativeComponent component(&engine, TESTDATA("geometrySignals.qml")); QObject *o = component.create(); @@ -2234,7 +2234,7 @@ void tst_qsgtextinput::geometrySignals() delete o; } -void tst_qsgtextinput::testQtQuick11Attributes() +void tst_qquicktextinput::testQtQuick11Attributes() { QFETCH(QString, code); QFETCH(QString, warning); @@ -2258,7 +2258,7 @@ void tst_qsgtextinput::testQtQuick11Attributes() delete obj; } -void tst_qsgtextinput::testQtQuick11Attributes_data() +void tst_qquicktextinput::testQtQuick11Attributes_data() { QTest::addColumn<QString>("code"); QTest::addColumn<QString>("warning"); @@ -2277,7 +2277,7 @@ void tst_qsgtextinput::testQtQuick11Attributes_data() << ""; } -void tst_qsgtextinput::preeditAutoScroll() +void tst_qquicktextinput::preeditAutoScroll() { #ifdef QTBUG_21691 QEXPECT_FAIL("", QTBUG_21691_MESSAGE, Abort); @@ -2285,9 +2285,9 @@ void tst_qsgtextinput::preeditAutoScroll() #else QString preeditText = "califragisiticexpialidocious!"; - QSGView view(QUrl::fromLocalFile(TESTDATA("preeditAutoScroll.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("preeditAutoScroll.qml"))); MyInputContext ic; - // QSGCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus + // QQuickCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus // and QWidget won't allow an input context to be set when the flag is not set. view.setAttribute(Qt::WA_InputMethodEnabled, true); view.setInputContext(&ic); @@ -2296,7 +2296,7 @@ void tst_qsgtextinput::preeditAutoScroll() view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextInput *input = qobject_cast<QSGTextInput *>(view.rootObject()); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject()); QVERIFY(input); QSignalSpy cursorRectangleSpy(input, SIGNAL(cursorRectangleChanged())); @@ -2368,7 +2368,7 @@ void tst_qsgtextinput::preeditAutoScroll() #endif } -void tst_qsgtextinput::preeditMicroFocus() +void tst_qquicktextinput::preeditMicroFocus() { #ifdef QTBUG_21691 QEXPECT_FAIL("", QTBUG_21691_MESSAGE, Abort); @@ -2376,9 +2376,9 @@ void tst_qsgtextinput::preeditMicroFocus() #else QString preeditText = "super"; - QSGView view(QUrl::fromLocalFile(TESTDATA("inputMethodEvent.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("inputMethodEvent.qml"))); MyInputContext ic; - // QSGCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus + // QQuickCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus // and QWidget won't allow an input context to be set when the flag is not set. view.setAttribute(Qt::WA_InputMethodEnabled, true); view.setInputContext(&ic); @@ -2387,7 +2387,7 @@ void tst_qsgtextinput::preeditMicroFocus() view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextInput *input = qobject_cast<QSGTextInput *>(view.rootObject()); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject()); QVERIFY(input); QRect currentRect; @@ -2429,7 +2429,7 @@ void tst_qsgtextinput::preeditMicroFocus() #endif } -void tst_qsgtextinput::inputContextMouseHandler() +void tst_qquicktextinput::inputContextMouseHandler() { #ifdef QTBUG_21691 QEXPECT_FAIL("", QTBUG_21691_MESSAGE, Abort); @@ -2437,9 +2437,9 @@ void tst_qsgtextinput::inputContextMouseHandler() #else QString text = "supercalifragisiticexpialidocious!"; - QSGView view(QUrl::fromLocalFile(TESTDATA("inputContext.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("inputContext.qml"))); MyInputContext ic; - // QSGCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus + // QQuickCanvas won't set the Qt::WA_InputMethodEnabled flag unless a suitable item has active focus // and QWidget won't allow an input context to be set when the flag is not set. view.setAttribute(Qt::WA_InputMethodEnabled, true); view.setInputContext(&ic); @@ -2448,7 +2448,7 @@ void tst_qsgtextinput::inputContextMouseHandler() view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextInput *input = qobject_cast<QSGTextInput *>(view.rootObject()); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject()); QVERIFY(input); QFontMetricsF fm(input->font()); @@ -2550,16 +2550,16 @@ void tst_qsgtextinput::inputContextMouseHandler() #endif } -void tst_qsgtextinput::inputMethodComposing() +void tst_qquicktextinput::inputMethodComposing() { QString text = "supercalifragisiticexpialidocious!"; - QSGView view(QUrl::fromLocalFile(TESTDATA("inputContext.qml"))); + QQuickView view(QUrl::fromLocalFile(TESTDATA("inputContext.qml"))); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextInput *input = qobject_cast<QSGTextInput *>(view.rootObject()); + QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject()); QVERIFY(input); QSignalSpy spy(input, SIGNAL(inputMethodComposingChanged())); @@ -2585,15 +2585,15 @@ void tst_qsgtextinput::inputMethodComposing() QCOMPARE(spy.count(), 2); } -void tst_qsgtextinput::cursorRectangleSize() +void tst_qquicktextinput::cursorRectangleSize() { - QSGView *canvas = new QSGView(QUrl::fromLocalFile(TESTDATA("positionAt.qml"))); + QQuickView *canvas = new QQuickView(QUrl::fromLocalFile(TESTDATA("positionAt.qml"))); QVERIFY(canvas->rootObject() != 0); canvas->show(); canvas->requestActivateWindow(); QTest::qWaitForWindowShown(canvas); - QSGTextInput *textInput = qobject_cast<QSGTextInput *>(canvas->rootObject()); + QQuickTextInput *textInput = qobject_cast<QQuickTextInput *>(canvas->rootObject()); QVERIFY(textInput != 0); textInput->setFocus(Qt::OtherFocusReason); QRectF cursorRect = textInput->positionToRectangle(textInput->cursorPosition()); @@ -2609,17 +2609,17 @@ void tst_qsgtextinput::cursorRectangleSize() delete canvas; } -void tst_qsgtextinput::tripleClickSelectsAll() +void tst_qquicktextinput::tripleClickSelectsAll() { QString qmlfile = TESTDATA("positionAt.qml"); - QSGView view(QUrl::fromLocalFile(qmlfile)); + QQuickView view(QUrl::fromLocalFile(qmlfile)); view.show(); view.requestActivateWindow(); QTest::qWaitForWindowShown(&view); QTRY_COMPARE(&view, qGuiApp->focusWindow()); - QSGTextInput* input = qobject_cast<QSGTextInput*>(view.rootObject()); + QQuickTextInput* input = qobject_cast<QQuickTextInput*>(view.rootObject()); QVERIFY(input); QLatin1String hello("Hello world!"); @@ -2651,23 +2651,23 @@ void tst_qsgtextinput::tripleClickSelectsAll() QVERIFY(input->selectedText().isEmpty()); } -void tst_qsgtextinput::QTBUG_19956_data() +void tst_qquicktextinput::QTBUG_19956_data() { QTest::addColumn<QString>("url"); QTest::newRow("intvalidator") << "qtbug-19956int.qml"; QTest::newRow("doublevalidator") << "qtbug-19956double.qml"; } -void tst_qsgtextinput::QTBUG_19956() +void tst_qquicktextinput::QTBUG_19956() { QFETCH(QString, url); - QSGView canvas(QUrl::fromLocalFile(TESTDATA(url))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA(url))); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *input = qobject_cast<QSGTextInput*>(canvas.rootObject()); + QQuickTextInput *input = qobject_cast<QQuickTextInput*>(canvas.rootObject()); QVERIFY(input); input->setFocus(true); QVERIFY(input->hasActiveFocus()); @@ -2694,14 +2694,14 @@ void tst_qsgtextinput::QTBUG_19956() QVERIFY(canvas.rootObject()->property("acceptableInput").toBool()); } -void tst_qsgtextinput::QTBUG_19956_regexp() +void tst_qquicktextinput::QTBUG_19956_regexp() { - QSGView canvas(QUrl::fromLocalFile(TESTDATA("qtbug-19956regexp.qml"))); + QQuickView canvas(QUrl::fromLocalFile(TESTDATA("qtbug-19956regexp.qml"))); canvas.show(); canvas.requestActivateWindow(); QTest::qWaitForWindowShown(&canvas); QVERIFY(canvas.rootObject() != 0); - QSGTextInput *input = qobject_cast<QSGTextInput*>(canvas.rootObject()); + QQuickTextInput *input = qobject_cast<QQuickTextInput*>(canvas.rootObject()); QVERIFY(input); input->setFocus(true); QVERIFY(input->hasActiveFocus()); @@ -2720,6 +2720,6 @@ void tst_qsgtextinput::QTBUG_19956_regexp() QVERIFY(canvas.rootObject()->property("acceptableInput").toBool()); } -QTEST_MAIN(tst_qsgtextinput) +QTEST_MAIN(tst_qquicktextinput) -#include "tst_qsgtextinput.moc" +#include "tst_qquicktextinput.moc" diff --git a/tests/auto/declarative/qsgview/data/error1.qml b/tests/auto/declarative/qquickview/data/error1.qml index 09df679555..09df679555 100644 --- a/tests/auto/declarative/qsgview/data/error1.qml +++ b/tests/auto/declarative/qquickview/data/error1.qml diff --git a/tests/auto/declarative/qsgview/data/resizemodeitem.qml b/tests/auto/declarative/qquickview/data/resizemodeitem.qml index ed73009b26..ed73009b26 100644 --- a/tests/auto/declarative/qsgview/data/resizemodeitem.qml +++ b/tests/auto/declarative/qquickview/data/resizemodeitem.qml diff --git a/tests/auto/declarative/qsgview/qsgview.pro b/tests/auto/declarative/qquickview/qquickview.pro index dd67cff632..c5cc3ce6a7 100644 --- a/tests/auto/declarative/qsgview/qsgview.pro +++ b/tests/auto/declarative/qquickview/qquickview.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgview +TARGET = tst_qquickview macx:CONFIG -= app_bundle -SOURCES += tst_qsgview.cpp +SOURCES += tst_qquickview.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgview/tst_qsgview.cpp b/tests/auto/declarative/qquickview/tst_qquickview.cpp index d2c51d60e9..a2334d2e58 100644 --- a/tests/auto/declarative/qsgview/tst_qsgview.cpp +++ b/tests/auto/declarative/qquickview/tst_qquickview.cpp @@ -42,17 +42,17 @@ #include <QtTest/QSignalSpy> #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativecontext.h> -#include <QtDeclarative/qsgview.h> -#include <QtDeclarative/qsgitem.h> +#include <QtDeclarative/qquickview.h> +#include <QtDeclarative/qquickitem.h> #include "../shared/util.h" #include <QtGui/QWindow> #include <QtCore/QDebug> -class tst_QSGView : public QObject +class tst_QQuickView : public QObject { Q_OBJECT public: - tst_QSGView(); + tst_QQuickView(); private slots: void resizemodeitem(); @@ -60,21 +60,21 @@ private slots: }; -tst_QSGView::tst_QSGView() +tst_QQuickView::tst_QQuickView() { } -void tst_QSGView::resizemodeitem() +void tst_QQuickView::resizemodeitem() { QWindow window; window.setGeometry(0, 0, 400, 400); - QSGView *canvas = new QSGView(&window); + QQuickView *canvas = new QQuickView(&window); QVERIFY(canvas); - canvas->setResizeMode(QSGView::SizeRootObjectToView); + canvas->setResizeMode(QQuickView::SizeRootObjectToView); QCOMPARE(QSize(0,0), canvas->initialSize()); canvas->setSource(QUrl::fromLocalFile(TESTDATA("resizemodeitem.qml"))); - QSGItem* item = qobject_cast<QSGItem*>(canvas->rootObject()); + QQuickItem* item = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(item); window.show(); @@ -96,7 +96,7 @@ void tst_QSGView::resizemodeitem() QCOMPARE(canvas->size(), QSize(80, 100)); QCOMPARE(canvas->size(), canvas->sizeHint()); - canvas->setResizeMode(QSGView::SizeViewToRootObject); + canvas->setResizeMode(QQuickView::SizeViewToRootObject); // size update from view disabled canvas->resize(QSize(60,80)); @@ -117,11 +117,11 @@ void tst_QSGView::resizemodeitem() // reset canvas window.hide(); delete canvas; - canvas = new QSGView(&window); + canvas = new QQuickView(&window); QVERIFY(canvas); - canvas->setResizeMode(QSGView::SizeViewToRootObject); + canvas->setResizeMode(QQuickView::SizeViewToRootObject); canvas->setSource(QUrl::fromLocalFile(TESTDATA("resizemodeitem.qml"))); - item = qobject_cast<QSGItem*>(canvas->rootObject()); + item = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(item); window.show(); @@ -143,7 +143,7 @@ void tst_QSGView::resizemodeitem() QCOMPARE(canvas->size(), canvas->sizeHint()); // size update from root object disabled - canvas->setResizeMode(QSGView::SizeRootObjectToView); + canvas->setResizeMode(QQuickView::SizeRootObjectToView); item->setWidth(60); item->setHeight(80); QCOMPARE(canvas->width(), 80); @@ -163,13 +163,13 @@ void tst_QSGView::resizemodeitem() // if we set a specific size for the view then it should keep that size // for SizeRootObjectToView mode. - canvas = new QSGView(&window); + canvas = new QQuickView(&window); canvas->resize(300, 300); - canvas->setResizeMode(QSGView::SizeRootObjectToView); + canvas->setResizeMode(QQuickView::SizeRootObjectToView); QCOMPARE(QSize(0,0), canvas->initialSize()); canvas->setSource(QUrl::fromLocalFile(TESTDATA("resizemodeitem.qml"))); canvas->resize(300, 300); - item = qobject_cast<QSGItem*>(canvas->rootObject()); + item = qobject_cast<QQuickItem*>(canvas->rootObject()); QVERIFY(item); window.show(); @@ -191,19 +191,19 @@ static void silentErrorsMsgHandler(QtMsgType, const char *) { } -void tst_QSGView::errors() +void tst_QQuickView::errors() { - QSGView *canvas = new QSGView; + QQuickView *canvas = new QQuickView; QVERIFY(canvas); QtMsgHandler old = qInstallMsgHandler(silentErrorsMsgHandler); canvas->setSource(QUrl::fromLocalFile(TESTDATA("error1.qml"))); qInstallMsgHandler(old); - QVERIFY(canvas->status() == QSGView::Error); + QVERIFY(canvas->status() == QQuickView::Error); QVERIFY(canvas->errors().count() == 1); delete canvas; } -QTEST_MAIN(tst_QSGView) +QTEST_MAIN(tst_QQuickView) -#include "tst_qsgview.moc" +#include "tst_qquickview.moc" diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/create.qml b/tests/auto/declarative/qquickvisualdatamodel/data/create.qml index 36ea3baf76..36ea3baf76 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/create.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/create.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/datalist.qml b/tests/auto/declarative/qquickvisualdatamodel/data/datalist.qml index 8ce59caddc..8ce59caddc 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/datalist.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/datalist.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/groups.qml b/tests/auto/declarative/qquickvisualdatamodel/data/groups.qml index a24e223bc5..a24e223bc5 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/groups.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/groups.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties.qml b/tests/auto/declarative/qquickvisualdatamodel/data/modelproperties.qml index 73b766f1af..73b766f1af 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/modelproperties.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties2.qml b/tests/auto/declarative/qquickvisualdatamodel/data/modelproperties2.qml index ea5c240b29..ea5c240b29 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/modelproperties2.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/modelproperties2.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/objectlist.qml b/tests/auto/declarative/qquickvisualdatamodel/data/objectlist.qml index b3952a8a4d..b3952a8a4d 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/objectlist.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/objectlist.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/singlerole1.qml b/tests/auto/declarative/qquickvisualdatamodel/data/singlerole1.qml index c471893e1d..c471893e1d 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/singlerole1.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/singlerole1.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/singlerole2.qml b/tests/auto/declarative/qquickvisualdatamodel/data/singlerole2.qml index ab1798999d..ab1798999d 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/singlerole2.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/singlerole2.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/data/visualdatamodel.qml b/tests/auto/declarative/qquickvisualdatamodel/data/visualdatamodel.qml index 0d4d9e2e46..0d4d9e2e46 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/data/visualdatamodel.qml +++ b/tests/auto/declarative/qquickvisualdatamodel/data/visualdatamodel.qml diff --git a/tests/auto/declarative/qsgvisualdatamodel/qsgvisualdatamodel.pro b/tests/auto/declarative/qquickvisualdatamodel/qquickvisualdatamodel.pro index 1e8b8a29d3..35e627c1ad 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/qsgvisualdatamodel.pro +++ b/tests/auto/declarative/qquickvisualdatamodel/qquickvisualdatamodel.pro @@ -1,8 +1,8 @@ CONFIG += testcase -TARGET = tst_qsgvisualdatamodel +TARGET = tst_qquickvisualdatamodel macx:CONFIG -= app_bundle -SOURCES += tst_qsgvisualdatamodel.cpp +SOURCES += tst_qquickvisualdatamodel.cpp testDataFiles.files = data testDataFiles.path = . diff --git a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp b/tests/auto/declarative/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp index 019493109d..aba760db91 100644 --- a/tests/auto/declarative/qsgvisualdatamodel/tst_qsgvisualdatamodel.cpp +++ b/tests/auto/declarative/qquickvisualdatamodel/tst_qquickvisualdatamodel.cpp @@ -46,10 +46,10 @@ #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/qsgview.h> -#include <private/qsglistview_p.h> -#include <private/qsgtext_p.h> -#include <private/qsgvisualdatamodel_p.h> +#include <QtDeclarative/qquickview.h> +#include <private/qquicklistview_p.h> +#include <private/qquicktext_p.h> +#include <private/qquickvisualdatamodel_p.h> #include <private/qdeclarativevaluetype_p.h> #include <private/qdeclarativechangeset_p.h> #include <private/qdeclarativeengine_p.h> @@ -112,11 +112,11 @@ protected: }; -class tst_qsgvisualdatamodel : public QObject +class tst_qquickvisualdatamodel : public QObject { Q_OBJECT public: - tst_qsgvisualdatamodel(); + tst_qquickvisualdatamodel(); private slots: void initTestCase(); @@ -139,7 +139,7 @@ private slots: private: template <int N> void groups_verify( const SingleRoleModel &model, - QSGItem *contentItem, + QQuickItem *contentItem, const int (&mIndex)[N], const int (&iIndex)[N], const int (&vIndex)[N], @@ -149,9 +149,9 @@ private: template <int N> void get_verify( const SingleRoleModel &model, - QSGVisualDataModel *visualModel, - QSGVisualDataGroup *visibleItems, - QSGVisualDataGroup *selectedItems, + QQuickVisualDataModel *visualModel, + QQuickVisualDataGroup *visibleItems, + QQuickVisualDataGroup *selectedItems, const int (&mIndex)[N], const int (&iIndex)[N], const int (&vIndex)[N], @@ -162,17 +162,17 @@ private: bool failed; QDeclarativeEngine engine; template<typename T> - T *findItem(QSGItem *parent, const QString &objectName, int index); + T *findItem(QQuickItem *parent, const QString &objectName, int index); }; Q_DECLARE_METATYPE(QDeclarativeChangeSet) -void tst_qsgvisualdatamodel::initTestCase() +void tst_qquickvisualdatamodel::initTestCase() { qRegisterMetaType<QDeclarativeChangeSet>(); } -void tst_qsgvisualdatamodel::cleanupTestCase() +void tst_qquickvisualdatamodel::cleanupTestCase() { } @@ -231,11 +231,11 @@ template <> void evaluate<void>(QObject *scope, const QString &expression) qWarning() << expr.error().toString(); } -tst_qsgvisualdatamodel::tst_qsgvisualdatamodel() +tst_qquickvisualdatamodel::tst_qquickvisualdatamodel() { } -void tst_qsgvisualdatamodel::rootIndex() +void tst_qquickvisualdatamodel::rootIndex() { QDeclarativeEngine engine; QDeclarativeComponent c(&engine, QUrl::fromLocalFile(TESTDATA("visualdatamodel.qml"))); @@ -245,7 +245,7 @@ void tst_qsgvisualdatamodel::rootIndex() engine.rootContext()->setContextProperty("myModel", &model); - QSGVisualDataModel *obj = qobject_cast<QSGVisualDataModel*>(c.create()); + QQuickVisualDataModel *obj = qobject_cast<QQuickVisualDataModel*>(c.create()); QVERIFY(obj != 0); QMetaObject::invokeMethod(obj, "setRoot"); @@ -262,9 +262,9 @@ void tst_qsgvisualdatamodel::rootIndex() delete obj; } -void tst_qsgvisualdatamodel::updateLayout() +void tst_qquickvisualdatamodel::updateLayout() { - QSGView view; + QQuickView view; QStandardItemModel model; initStandardTreeModel(&model); @@ -273,38 +273,38 @@ void tst_qsgvisualdatamodel::updateLayout() view.setSource(QUrl::fromLocalFile(TESTDATA("datalist.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGText *name = findItem<QSGText>(contentItem, "display", 0); + QQuickText *name = findItem<QQuickText>(contentItem, "display", 0); QVERIFY(name); QCOMPARE(name->text(), QString("Row 1 Item")); - name = findItem<QSGText>(contentItem, "display", 1); + name = findItem<QQuickText>(contentItem, "display", 1); QVERIFY(name); QCOMPARE(name->text(), QString("Row 2 Item")); - name = findItem<QSGText>(contentItem, "display", 2); + name = findItem<QQuickText>(contentItem, "display", 2); QVERIFY(name); QCOMPARE(name->text(), QString("Row 3 Item")); model.invisibleRootItem()->sortChildren(0, Qt::DescendingOrder); - name = findItem<QSGText>(contentItem, "display", 0); + name = findItem<QQuickText>(contentItem, "display", 0); QVERIFY(name); QCOMPARE(name->text(), QString("Row 3 Item")); - name = findItem<QSGText>(contentItem, "display", 1); + name = findItem<QQuickText>(contentItem, "display", 1); QVERIFY(name); QCOMPARE(name->text(), QString("Row 2 Item")); - name = findItem<QSGText>(contentItem, "display", 2); + name = findItem<QQuickText>(contentItem, "display", 2); QVERIFY(name); QCOMPARE(name->text(), QString("Row 1 Item")); } -void tst_qsgvisualdatamodel::childChanged() +void tst_qquickvisualdatamodel::childChanged() { - QSGView view; + QQuickView view; QStandardItemModel model; initStandardTreeModel(&model); @@ -313,53 +313,53 @@ void tst_qsgvisualdatamodel::childChanged() view.setSource(QUrl::fromLocalFile(TESTDATA("datalist.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGVisualDataModel *vdm = listview->findChild<QSGVisualDataModel*>("visualModel"); + QQuickVisualDataModel *vdm = listview->findChild<QQuickVisualDataModel*>("visualModel"); vdm->setRootIndex(QVariant::fromValue(model.indexFromItem(model.item(1,0)))); QCOMPARE(listview->count(), 1); - QSGText *name = findItem<QSGText>(contentItem, "display", 0); + QQuickText *name = findItem<QQuickText>(contentItem, "display", 0); QVERIFY(name); QCOMPARE(name->text(), QString("Row 2 Child Item")); model.item(1,0)->child(0,0)->setText("Row 2 updated child"); - name = findItem<QSGText>(contentItem, "display", 0); + name = findItem<QQuickText>(contentItem, "display", 0); QVERIFY(name); QCOMPARE(name->text(), QString("Row 2 updated child")); model.item(1,0)->appendRow(new QStandardItem(QLatin1String("Row 2 Child Item 2"))); QCOMPARE(listview->count(), 2); - name = findItem<QSGText>(contentItem, "display", 1); + name = findItem<QQuickText>(contentItem, "display", 1); QVERIFY(name != 0); QCOMPARE(name->text(), QString("Row 2 Child Item 2")); model.item(1,0)->takeRow(1); - name = findItem<QSGText>(contentItem, "display", 1); + name = findItem<QQuickText>(contentItem, "display", 1); QVERIFY(name == 0); vdm->setRootIndex(QVariant::fromValue(QModelIndex())); QCOMPARE(listview->count(), 3); - name = findItem<QSGText>(contentItem, "display", 0); + name = findItem<QQuickText>(contentItem, "display", 0); QVERIFY(name); QCOMPARE(name->text(), QString("Row 1 Item")); - name = findItem<QSGText>(contentItem, "display", 1); + name = findItem<QQuickText>(contentItem, "display", 1); QVERIFY(name); QCOMPARE(name->text(), QString("Row 2 Item")); - name = findItem<QSGText>(contentItem, "display", 2); + name = findItem<QQuickText>(contentItem, "display", 2); QVERIFY(name); QCOMPARE(name->text(), QString("Row 3 Item")); } -void tst_qsgvisualdatamodel::objectListModel() +void tst_qquickvisualdatamodel::objectListModel() { - QSGView view; + QQuickView view; QList<QObject*> dataList; dataList.append(new DataObject("Item 1", "red")); @@ -372,26 +372,26 @@ void tst_qsgvisualdatamodel::objectListModel() view.setSource(QUrl::fromLocalFile(TESTDATA("objectlist.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGText *name = findItem<QSGText>(contentItem, "name", 0); + QQuickText *name = findItem<QQuickText>(contentItem, "name", 0); QCOMPARE(name->text(), QString("Item 1")); - QSGText *section = findItem<QSGText>(contentItem, "section", 0); + QQuickText *section = findItem<QQuickText>(contentItem, "section", 0); QCOMPARE(section->text(), QString("Item 1")); dataList[0]->setProperty("name", QLatin1String("Changed")); QCOMPARE(name->text(), QString("Changed")); } -void tst_qsgvisualdatamodel::singleRole() +void tst_qquickvisualdatamodel::singleRole() { { - QSGView view; + QQuickView view; SingleRoleModel model; @@ -400,20 +400,20 @@ void tst_qsgvisualdatamodel::singleRole() view.setSource(QUrl::fromLocalFile(TESTDATA("singlerole1.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGText *name = findItem<QSGText>(contentItem, "name", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "name", 1); QCOMPARE(name->text(), QString("two")); model.set(1, "Changed"); QCOMPARE(name->text(), QString("Changed")); } { - QSGView view; + QQuickView view; SingleRoleModel model; @@ -422,20 +422,20 @@ void tst_qsgvisualdatamodel::singleRole() view.setSource(QUrl::fromLocalFile(TESTDATA("singlerole2.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGText *name = findItem<QSGText>(contentItem, "name", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "name", 1); QCOMPARE(name->text(), QString("two")); model.set(1, "Changed"); QCOMPARE(name->text(), QString("Changed")); } { - QSGView view; + QQuickView view; SingleRoleModel model("modelData"); @@ -444,13 +444,13 @@ void tst_qsgvisualdatamodel::singleRole() view.setSource(QUrl::fromLocalFile(TESTDATA("singlerole2.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGText *name = findItem<QSGText>(contentItem, "name", 1); + QQuickText *name = findItem<QQuickText>(contentItem, "name", 1); QCOMPARE(name->text(), QString("two")); model.set(1, "Changed"); @@ -458,10 +458,10 @@ void tst_qsgvisualdatamodel::singleRole() } } -void tst_qsgvisualdatamodel::modelProperties() +void tst_qquickvisualdatamodel::modelProperties() { { - QSGView view; + QQuickView view; SingleRoleModel model; @@ -470,13 +470,13 @@ void tst_qsgvisualdatamodel::modelProperties() view.setSource(QUrl::fromLocalFile(TESTDATA("modelproperties.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", 1); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", 1); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(),QString("two")); QCOMPARE(delegate->property("test2").toString(),QString("two")); @@ -490,7 +490,7 @@ void tst_qsgvisualdatamodel::modelProperties() } { - QSGView view; + QQuickView view; QList<QObject*> dataList; dataList.append(new DataObject("Item 1", "red")); @@ -503,13 +503,13 @@ void tst_qsgvisualdatamodel::modelProperties() view.setSource(QUrl::fromLocalFile(TESTDATA("modelproperties.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", 1); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", 1); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(),QString("Item 2")); QCOMPARE(delegate->property("test2").toString(),QString("Item 2")); @@ -523,7 +523,7 @@ void tst_qsgvisualdatamodel::modelProperties() } { - QSGView view; + QQuickView view; QStandardItemModel model; initStandardTreeModel(&model); @@ -545,13 +545,13 @@ void tst_qsgvisualdatamodel::modelProperties() view.setSource(source); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", 1); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", 1); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(),QString("Row 2 Item")); QCOMPARE(delegate->property("test2").toString(),QString("Row 2 Item")); @@ -567,9 +567,9 @@ void tst_qsgvisualdatamodel::modelProperties() //### should also test QStringList and QVariantList } -void tst_qsgvisualdatamodel::noDelegate() +void tst_qquickvisualdatamodel::noDelegate() { - QSGView view; + QQuickView view; QStandardItemModel model; initStandardTreeModel(&model); @@ -578,10 +578,10 @@ void tst_qsgvisualdatamodel::noDelegate() view.setSource(QUrl::fromLocalFile(TESTDATA("datalist.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGVisualDataModel *vdm = listview->findChild<QSGVisualDataModel*>("visualModel"); + QQuickVisualDataModel *vdm = listview->findChild<QQuickVisualDataModel*>("visualModel"); QVERIFY(vdm != 0); QCOMPARE(vdm->count(), 3); @@ -590,7 +590,7 @@ void tst_qsgvisualdatamodel::noDelegate() } -void tst_qsgvisualdatamodel::qaimRowsMoved() +void tst_qquickvisualdatamodel::qaimRowsMoved() { // Test parameters passed in QAIM::rowsMoved() signal are converted correctly // when translated and emitted as the QListModelInterface::itemsMoved() signal @@ -610,7 +610,7 @@ void tst_qsgvisualdatamodel::qaimRowsMoved() model.list << ("item " + i); engine.rootContext()->setContextProperty("myModel", &model); - QSGVisualDataModel *obj = qobject_cast<QSGVisualDataModel*>(c.create()); + QQuickVisualDataModel *obj = qobject_cast<QQuickVisualDataModel*>(c.create()); QVERIFY(obj != 0); QSignalSpy spy(obj, SIGNAL(modelUpdated(QDeclarativeChangeSet,bool))); @@ -639,7 +639,7 @@ void tst_qsgvisualdatamodel::qaimRowsMoved() delete obj; } -void tst_qsgvisualdatamodel::qaimRowsMoved_data() +void tst_qquickvisualdatamodel::qaimRowsMoved_data() { QTest::addColumn<int>("sourceFirst"); QTest::addColumn<int>("sourceLast"); @@ -669,9 +669,9 @@ void tst_qsgvisualdatamodel::qaimRowsMoved_data() << 10 << 1 << 5; } -void tst_qsgvisualdatamodel::remove() +void tst_qquickvisualdatamodel::remove() { - QSGView view; + QQuickView view; SingleRoleModel model; model.list = QStringList() @@ -693,13 +693,13 @@ void tst_qsgvisualdatamodel::remove() view.setSource(QUrl::fromLocalFile(TESTDATA("groups.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGVisualDataModel *visualModel = qobject_cast<QSGVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); + QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); QVERIFY(visualModel); { @@ -709,7 +709,7 @@ void tst_qsgvisualdatamodel::remove() static const int iIndex[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }; for (int i = 0; i < lengthOf(mIndex); ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt(), mIndex[i]); @@ -723,7 +723,7 @@ void tst_qsgvisualdatamodel::remove() static const int iIndex[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10 }; for (int i = 0; i < lengthOf(mIndex); ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt(), mIndex[i]); @@ -737,7 +737,7 @@ void tst_qsgvisualdatamodel::remove() static const int iIndex[] = { 0, 1, 2, 3, 4, 5, 6 }; for (int i = 0; i < lengthOf(mIndex); ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt(), mIndex[i]); @@ -766,9 +766,9 @@ void tst_qsgvisualdatamodel::remove() } } -void tst_qsgvisualdatamodel::move() +void tst_qquickvisualdatamodel::move() { - QSGView view; + QQuickView view; SingleRoleModel model; model.list = QStringList() @@ -790,13 +790,13 @@ void tst_qsgvisualdatamodel::move() view.setSource(QUrl::fromLocalFile(TESTDATA("groups.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGVisualDataModel *visualModel = qobject_cast<QSGVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); + QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); QVERIFY(visualModel); { @@ -806,7 +806,7 @@ void tst_qsgvisualdatamodel::move() static const int iIndex[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }; for (int i = 0; i < lengthOf(mIndex); ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt(), mIndex[i]); @@ -820,7 +820,7 @@ void tst_qsgvisualdatamodel::move() static const int iIndex[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }; for (int i = 0; i < lengthOf(mIndex); ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt(), mIndex[i]); @@ -834,7 +834,7 @@ void tst_qsgvisualdatamodel::move() static const int iIndex[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }; for (int i = 0; i < lengthOf(mIndex); ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt(), mIndex[i]); @@ -848,7 +848,7 @@ void tst_qsgvisualdatamodel::move() static const int iIndex[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }; for (int i = 0; i < lengthOf(mIndex); ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt(), mIndex[i]); @@ -862,7 +862,7 @@ void tst_qsgvisualdatamodel::move() static const int iIndex[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11 }; for (int i = 0; i < lengthOf(mIndex); ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt(), mIndex[i]); @@ -907,9 +907,9 @@ void tst_qsgvisualdatamodel::move() } -template <int N> void tst_qsgvisualdatamodel::groups_verify( +template <int N> void tst_qquickvisualdatamodel::groups_verify( const SingleRoleModel &model, - QSGItem *contentItem, + QQuickItem *contentItem, const int (&mIndex)[N], const int (&iIndex)[N], const int (&vIndex)[N], @@ -919,7 +919,7 @@ template <int N> void tst_qsgvisualdatamodel::groups_verify( { failed = true; for (int i = 0; i < N; ++i) { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", mIndex[i]); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", mIndex[i]); QVERIFY(delegate); QCOMPARE(delegate->property("test1").toString(), model.list.at(mIndex[i])); QCOMPARE(delegate->property("test2").toInt() , mIndex[i]); @@ -941,9 +941,9 @@ template <int N> void tst_qsgvisualdatamodel::groups_verify( QVERIFY(!failed) -void tst_qsgvisualdatamodel::groups() +void tst_qquickvisualdatamodel::groups() { - QSGView view; + QQuickView view; SingleRoleModel model; model.list = QStringList() @@ -965,19 +965,19 @@ void tst_qsgvisualdatamodel::groups() view.setSource(QUrl::fromLocalFile(TESTDATA("groups.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGVisualDataModel *visualModel = qobject_cast<QSGVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); + QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); QVERIFY(visualModel); - QSGVisualDataGroup *visibleItems = visualModel->findChild<QSGVisualDataGroup *>("visibleItems"); + QQuickVisualDataGroup *visibleItems = visualModel->findChild<QQuickVisualDataGroup *>("visibleItems"); QVERIFY(visibleItems); - QSGVisualDataGroup *selectedItems = visualModel->findChild<QSGVisualDataGroup *>("selectedItems"); + QQuickVisualDataGroup *selectedItems = visualModel->findChild<QQuickVisualDataGroup *>("selectedItems"); QVERIFY(selectedItems); const bool f = false; @@ -1148,7 +1148,7 @@ void tst_qsgvisualdatamodel::groups() QCOMPARE(visibleItems->count(), 9); QCOMPARE(selectedItems->count(), 2); } { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", 5); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", 5); QVERIFY(delegate); evaluate<void>(delegate, "hide()"); @@ -1164,7 +1164,7 @@ void tst_qsgvisualdatamodel::groups() static const bool sMember[] = { f, f, f, f, f, f, f, f, t, t, f, f }; VERIFY_GROUPS; } { - QSGItem *delegate = findItem<QSGItem>(contentItem, "delegate", 5); + QQuickItem *delegate = findItem<QQuickItem>(contentItem, "delegate", 5); QVERIFY(delegate); evaluate<void>(delegate, "select()"); @@ -1195,11 +1195,11 @@ void tst_qsgvisualdatamodel::groups() } } -template <int N> void tst_qsgvisualdatamodel::get_verify( +template <int N> void tst_qquickvisualdatamodel::get_verify( const SingleRoleModel &model, - QSGVisualDataModel *visualModel, - QSGVisualDataGroup *visibleItems, - QSGVisualDataGroup *selectedItems, + QQuickVisualDataModel *visualModel, + QQuickVisualDataGroup *visibleItems, + QQuickVisualDataGroup *selectedItems, const int (&mIndex)[N], const int (&iIndex)[N], const int (&vIndex)[N], @@ -1259,9 +1259,9 @@ template <int N> void tst_qsgvisualdatamodel::get_verify( get_verify(model, visualModel, visibleItems, selectedItems, mIndex, iIndex, vIndex, sIndex, vMember, sMember); \ QVERIFY(!failed) -void tst_qsgvisualdatamodel::get() +void tst_qquickvisualdatamodel::get() { - QSGView view; + QQuickView view; SingleRoleModel model; model.list = QStringList() @@ -1283,19 +1283,19 @@ void tst_qsgvisualdatamodel::get() view.setSource(QUrl::fromLocalFile(TESTDATA("groups.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGVisualDataModel *visualModel = qobject_cast<QSGVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); + QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); QVERIFY(visualModel); - QSGVisualDataGroup *visibleItems = visualModel->findChild<QSGVisualDataGroup *>("visibleItems"); + QQuickVisualDataGroup *visibleItems = visualModel->findChild<QQuickVisualDataGroup *>("visibleItems"); QVERIFY(visibleItems); - QSGVisualDataGroup *selectedItems = visualModel->findChild<QSGVisualDataGroup *>("selectedItems"); + QQuickVisualDataGroup *selectedItems = visualModel->findChild<QQuickVisualDataGroup *>("selectedItems"); QVERIFY(selectedItems); QV8Engine *v8Engine = QDeclarativeEnginePrivate::getV8Engine(ctxt->engine()); @@ -1410,9 +1410,9 @@ void tst_qsgvisualdatamodel::get() } } -void tst_qsgvisualdatamodel::create() +void tst_qquickvisualdatamodel::create() { - QSGView view; + QQuickView view; SingleRoleModel model; model.list = QStringList() @@ -1442,23 +1442,23 @@ void tst_qsgvisualdatamodel::create() view.setSource(QUrl::fromLocalFile(TESTDATA("create.qml"))); - QSGListView *listview = qobject_cast<QSGListView*>(view.rootObject()); + QQuickListView *listview = qobject_cast<QQuickListView*>(view.rootObject()); QVERIFY(listview != 0); - QSGItem *contentItem = listview->contentItem(); + QQuickItem *contentItem = listview->contentItem(); QVERIFY(contentItem != 0); - QSGVisualDataModel *visualModel = qobject_cast<QSGVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); + QQuickVisualDataModel *visualModel = qobject_cast<QQuickVisualDataModel *>(qvariant_cast<QObject *>(listview->model())); QVERIFY(visualModel); QCOMPARE(listview->count(), 20); - QSGItem *delegate; + QQuickItem *delegate; // Request an item instantiated by the view. - QVERIFY(findItem<QSGItem>(contentItem, "delegate", 1)); - QVERIFY(delegate = qobject_cast<QSGItem *>(evaluate<QObject *>(visualModel, "items.create(1)"))); - QCOMPARE(delegate, findItem<QSGItem>(contentItem, "delegate", 1)); + QVERIFY(findItem<QQuickItem>(contentItem, "delegate", 1)); + QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(1)"))); + QCOMPARE(delegate, findItem<QQuickItem>(contentItem, "delegate", 1)); QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true); QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1); @@ -1469,9 +1469,9 @@ void tst_qsgvisualdatamodel::create() QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0); // Request an item not instantiated by the view. - QVERIFY(!findItem<QSGItem>(contentItem, "delegate", 15)); - QVERIFY(delegate = qobject_cast<QSGItem *>(evaluate<QObject *>(visualModel, "items.create(15)"))); - QCOMPARE(delegate, findItem<QSGItem>(contentItem, "delegate", 15)); + QVERIFY(!findItem<QQuickItem>(contentItem, "delegate", 15)); + QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(15)"))); + QCOMPARE(delegate, findItem<QQuickItem>(contentItem, "delegate", 15)); QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true); QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1); @@ -1480,9 +1480,9 @@ void tst_qsgvisualdatamodel::create() QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0); // Request an item not instantiated by the view, then scroll the view so it will request it. - QVERIFY(!findItem<QSGItem>(contentItem, "delegate", 16)); - QVERIFY(delegate = qobject_cast<QSGItem *>(evaluate<QObject *>(visualModel, "items.create(16)"))); - QCOMPARE(delegate, findItem<QSGItem>(contentItem, "delegate", 16)); + QVERIFY(!findItem<QQuickItem>(contentItem, "delegate", 16)); + QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(16)"))); + QCOMPARE(delegate, findItem<QQuickItem>(contentItem, "delegate", 16)); QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true); QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1); @@ -1494,9 +1494,9 @@ void tst_qsgvisualdatamodel::create() QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 0); // Request and release an item instantiated by the view, then scroll the view so it releases it. - QVERIFY(findItem<QSGItem>(contentItem, "delegate", 17)); - QVERIFY(delegate = qobject_cast<QSGItem *>(evaluate<QObject *>(visualModel, "items.create(17)"))); - QCOMPARE(delegate, findItem<QSGItem>(contentItem, "delegate", 17)); + QVERIFY(findItem<QQuickItem>(contentItem, "delegate", 17)); + QVERIFY(delegate = qobject_cast<QQuickItem *>(evaluate<QObject *>(visualModel, "items.create(17)"))); + QCOMPARE(delegate, findItem<QQuickItem>(contentItem, "delegate", 17)); QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true); QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1); @@ -1512,10 +1512,10 @@ void tst_qsgvisualdatamodel::create() // the view it will be persisted. evaluate<void>(visualModel, "items.addGroups(18, \"persistedItems\")"); QCOMPARE(evaluate<int>(visualModel, "persistedItems.count"), 1); - QVERIFY(!findItem<QSGItem>(contentItem, "delegate", 18)); + QVERIFY(!findItem<QQuickItem>(contentItem, "delegate", 18)); evaluate<void>(listview, "positionViewAtIndex(19, ListView.End)"); QCOMPARE(listview->count(), 20); - QVERIFY(delegate = findItem<QSGItem>(contentItem, "delegate", 18)); + QVERIFY(delegate = findItem<QQuickItem>(contentItem, "delegate", 18)); QCOMPARE(evaluate<bool>(delegate, "VisualDataModel.inPersistedItems"), true); QCOMPARE(evaluate<bool>(delegate, "destroyed"), false); evaluate<void>(listview, "positionViewAtIndex(1, ListView.Beginning)"); @@ -1524,12 +1524,12 @@ void tst_qsgvisualdatamodel::create() } template<typename T> -T *tst_qsgvisualdatamodel::findItem(QSGItem *parent, const QString &objectName, int index) +T *tst_qquickvisualdatamodel::findItem(QQuickItem *parent, const QString &objectName, int index) { const QMetaObject &mo = T::staticMetaObject; //qDebug() << parent->childItems().count() << "children"; for (int i = 0; i < parent->childItems().count(); ++i) { - QSGItem *item = qobject_cast<QSGItem*>(parent->childItems().at(i)); + QQuickItem *item = qobject_cast<QQuickItem*>(parent->childItems().at(i)); if (!item) continue; //qDebug() << "try" << item; @@ -1550,6 +1550,6 @@ T *tst_qsgvisualdatamodel::findItem(QSGItem *parent, const QString &objectName, return 0; } -QTEST_MAIN(tst_qsgvisualdatamodel) +QTEST_MAIN(tst_qquickvisualdatamodel) -#include "tst_qsgvisualdatamodel.moc" +#include "tst_qquickvisualdatamodel.moc" diff --git a/tests/auto/particles/qsgage/tst_qsgage.cpp b/tests/auto/particles/qsgage/tst_qsgage.cpp index faa267560b..7dc3e6ae60 100644 --- a/tests/auto/particles/qsgage/tst_qsgage.cpp +++ b/tests/auto/particles/qsgage/tst_qsgage.cpp @@ -64,7 +64,7 @@ tst_qsgage::tst_qsgage() void tst_qsgage::test_kill() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/kill.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/kill.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); @@ -88,7 +88,7 @@ void tst_qsgage::test_kill() void tst_qsgage::test_jump() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/jump.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/jump.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); @@ -113,7 +113,7 @@ void tst_qsgage::test_jump() void tst_qsgage::test_onceOff() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/onceoff.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/onceoff.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); @@ -137,7 +137,7 @@ void tst_qsgage::test_onceOff() void tst_qsgage::test_sustained() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/sustained.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/sustained.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); //TODO: Ensure some particles have lived to 0.4s point despite unified timer diff --git a/tests/auto/particles/qsgangleddirection/tst_qsgangleddirection.cpp b/tests/auto/particles/qsgangleddirection/tst_qsgangleddirection.cpp index dbb23ff29e..2957b9ee59 100644 --- a/tests/auto/particles/qsgangleddirection/tst_qsgangleddirection.cpp +++ b/tests/auto/particles/qsgangleddirection/tst_qsgangleddirection.cpp @@ -62,7 +62,7 @@ tst_qsgangleddirection::tst_qsgangleddirection() void tst_qsgangleddirection::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgcumulativedirection/tst_qsgcumulativedirection.cpp b/tests/auto/particles/qsgcumulativedirection/tst_qsgcumulativedirection.cpp index 00efff54bf..0a21949aed 100644 --- a/tests/auto/particles/qsgcumulativedirection/tst_qsgcumulativedirection.cpp +++ b/tests/auto/particles/qsgcumulativedirection/tst_qsgcumulativedirection.cpp @@ -61,7 +61,7 @@ tst_qsgcumulativedirection::tst_qsgcumulativedirection() void tst_qsgcumulativedirection::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp b/tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp index 2b36d318c5..d49f6cb908 100644 --- a/tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp +++ b/tests/auto/particles/qsgcustomaffector/tst_qsgcustomaffector.cpp @@ -61,7 +61,7 @@ tst_qsgcustomaffector::tst_qsgcustomaffector() void tst_qsgcustomaffector::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgcustomparticle/tst_qsgcustomparticle.cpp b/tests/auto/particles/qsgcustomparticle/tst_qsgcustomparticle.cpp index 92762ea8e2..6fd02cd92b 100644 --- a/tests/auto/particles/qsgcustomparticle/tst_qsgcustomparticle.cpp +++ b/tests/auto/particles/qsgcustomparticle/tst_qsgcustomparticle.cpp @@ -61,7 +61,7 @@ tst_qsgcustomparticle::tst_qsgcustomparticle() void tst_qsgcustomparticle::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QVERIFY(view); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgellipseextruder/tst_qsgellipseextruder.cpp b/tests/auto/particles/qsgellipseextruder/tst_qsgellipseextruder.cpp index 040a5e98b5..92ee0c2623 100644 --- a/tests/auto/particles/qsgellipseextruder/tst_qsgellipseextruder.cpp +++ b/tests/auto/particles/qsgellipseextruder/tst_qsgellipseextruder.cpp @@ -77,7 +77,7 @@ bool tst_qsgellipseextruder::inCircle(qreal x, qreal y, qreal r, bool borderOnly void tst_qsgellipseextruder::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgfriction/tst_qsgfriction.cpp b/tests/auto/particles/qsgfriction/tst_qsgfriction.cpp index bc622e4648..ad37c3ef38 100644 --- a/tests/auto/particles/qsgfriction/tst_qsgfriction.cpp +++ b/tests/auto/particles/qsgfriction/tst_qsgfriction.cpp @@ -61,7 +61,7 @@ tst_qsgfriction::tst_qsgfriction() void tst_qsgfriction::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsggravity/tst_qsggravity.cpp b/tests/auto/particles/qsggravity/tst_qsggravity.cpp index 475809446c..ae82384540 100644 --- a/tests/auto/particles/qsggravity/tst_qsggravity.cpp +++ b/tests/auto/particles/qsggravity/tst_qsggravity.cpp @@ -61,7 +61,7 @@ tst_qsggravity::tst_qsggravity() void tst_qsggravity::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgimageparticle/tst_qsgimageparticle.cpp b/tests/auto/particles/qsgimageparticle/tst_qsgimageparticle.cpp index a416271669..cd0378392c 100644 --- a/tests/auto/particles/qsgimageparticle/tst_qsgimageparticle.cpp +++ b/tests/auto/particles/qsgimageparticle/tst_qsgimageparticle.cpp @@ -67,7 +67,7 @@ tst_qsgimageparticle::tst_qsgimageparticle() void tst_qsgimageparticle::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); @@ -110,7 +110,7 @@ void tst_qsgimageparticle::test_basic() void tst_qsgimageparticle::test_colored() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/colored.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/colored.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); @@ -153,7 +153,7 @@ void tst_qsgimageparticle::test_colored() void tst_qsgimageparticle::test_deformed() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/deformed.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/deformed.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); @@ -196,7 +196,7 @@ void tst_qsgimageparticle::test_deformed() void tst_qsgimageparticle::test_tabled() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/tabled.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/tabled.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); @@ -240,7 +240,7 @@ void tst_qsgimageparticle::test_tabled() void tst_qsgimageparticle::test_sprite() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/sprite.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/sprite.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgitemparticle/tst_qsgitemparticle.cpp b/tests/auto/particles/qsgitemparticle/tst_qsgitemparticle.cpp index e58ab834f9..07ae377f0f 100644 --- a/tests/auto/particles/qsgitemparticle/tst_qsgitemparticle.cpp +++ b/tests/auto/particles/qsgitemparticle/tst_qsgitemparticle.cpp @@ -42,7 +42,7 @@ #include <QtTest/QtTest> #include "../shared/particlestestsshared.h" #include <private/qsgparticlesystem_p.h> -#include <private/qsgimage_p.h> +#include <private/qquickimage_p.h> #include <private/qabstractanimation_p.h> class tst_qsgitemparticle : public QObject @@ -62,7 +62,7 @@ tst_qsgitemparticle::tst_qsgitemparticle() void tst_qsgitemparticle::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); @@ -86,7 +86,7 @@ void tst_qsgitemparticle::test_basic() if (d->t < ((qreal)system->timeInt/1000.0) - 0.45)//Delegates cleared on death continue; QVERIFY(d->delegate); - QVERIFY(qobject_cast<QSGImage*>(d->delegate)); + QVERIFY(qobject_cast<QQuickImage*>(d->delegate)); } } diff --git a/tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp b/tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp index 0f25f50089..b66c174211 100644 --- a/tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp +++ b/tests/auto/particles/qsglineextruder/tst_qsglineextruder.cpp @@ -61,7 +61,7 @@ tst_qsglineextruder::tst_qsglineextruder() void tst_qsglineextruder::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgmaskextruder/tst_qsgmaskextruder.cpp b/tests/auto/particles/qsgmaskextruder/tst_qsgmaskextruder.cpp index 03070d8be0..962ab27508 100644 --- a/tests/auto/particles/qsgmaskextruder/tst_qsgmaskextruder.cpp +++ b/tests/auto/particles/qsgmaskextruder/tst_qsgmaskextruder.cpp @@ -61,7 +61,7 @@ tst_qsgmaskextruder::tst_qsgmaskextruder() void tst_qsgmaskextruder::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgparticlegroup/tst_qsgparticlegroup.cpp b/tests/auto/particles/qsgparticlegroup/tst_qsgparticlegroup.cpp index 49dc197ebb..f49f3c444d 100644 --- a/tests/auto/particles/qsgparticlegroup/tst_qsgparticlegroup.cpp +++ b/tests/auto/particles/qsgparticlegroup/tst_qsgparticlegroup.cpp @@ -61,7 +61,7 @@ tst_qsgparticlegroup::tst_qsgparticlegroup() void tst_qsgparticlegroup::test_instantTransition() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgparticlesystem/tst_qsgparticlesystem.cpp b/tests/auto/particles/qsgparticlesystem/tst_qsgparticlesystem.cpp index 9c6f299884..06a2414e95 100644 --- a/tests/auto/particles/qsgparticlesystem/tst_qsgparticlesystem.cpp +++ b/tests/auto/particles/qsgparticlesystem/tst_qsgparticlesystem.cpp @@ -61,7 +61,7 @@ tst_qsgparticlesystem::tst_qsgparticlesystem() void tst_qsgparticlesystem::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgpointattractor/tst_qsgpointattractor.cpp b/tests/auto/particles/qsgpointattractor/tst_qsgpointattractor.cpp index 9e4ff328a7..14207f9fd6 100644 --- a/tests/auto/particles/qsgpointattractor/tst_qsgpointattractor.cpp +++ b/tests/auto/particles/qsgpointattractor/tst_qsgpointattractor.cpp @@ -61,7 +61,7 @@ tst_qsgpointattractor::tst_qsgpointattractor() void tst_qsgpointattractor::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgpointdirection/tst_qsgpointdirection.cpp b/tests/auto/particles/qsgpointdirection/tst_qsgpointdirection.cpp index c6a3a2c9b8..b9b3dc15cb 100644 --- a/tests/auto/particles/qsgpointdirection/tst_qsgpointdirection.cpp +++ b/tests/auto/particles/qsgpointdirection/tst_qsgpointdirection.cpp @@ -61,7 +61,7 @@ tst_qsgpointdirection::tst_qsgpointdirection() void tst_qsgpointdirection::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgrectangleextruder/tst_qsgrectangleextruder.cpp b/tests/auto/particles/qsgrectangleextruder/tst_qsgrectangleextruder.cpp index e8c27aab34..dd86713b5b 100644 --- a/tests/auto/particles/qsgrectangleextruder/tst_qsgrectangleextruder.cpp +++ b/tests/auto/particles/qsgrectangleextruder/tst_qsgrectangleextruder.cpp @@ -61,7 +61,7 @@ tst_qsgrectangleextruder::tst_qsgrectangleextruder() void tst_qsgrectangleextruder::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgtargetdirection/tst_qsgtargetdirection.cpp b/tests/auto/particles/qsgtargetdirection/tst_qsgtargetdirection.cpp index decc96117a..5637c4c473 100644 --- a/tests/auto/particles/qsgtargetdirection/tst_qsgtargetdirection.cpp +++ b/tests/auto/particles/qsgtargetdirection/tst_qsgtargetdirection.cpp @@ -61,7 +61,7 @@ tst_qsgtargetdirection::tst_qsgtargetdirection() void tst_qsgtargetdirection::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgtrailemitter/tst_qsgtrailemitter.cpp b/tests/auto/particles/qsgtrailemitter/tst_qsgtrailemitter.cpp index e24c63c9d5..19a63fb73d 100644 --- a/tests/auto/particles/qsgtrailemitter/tst_qsgtrailemitter.cpp +++ b/tests/auto/particles/qsgtrailemitter/tst_qsgtrailemitter.cpp @@ -61,7 +61,7 @@ tst_qsgtrailemitter::tst_qsgtrailemitter() void tst_qsgtrailemitter::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp b/tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp index 4230bc529f..ca8a797b78 100644 --- a/tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp +++ b/tests/auto/particles/qsgturbulence/tst_qsgturbulence.cpp @@ -61,7 +61,7 @@ tst_qsgturbulence::tst_qsgturbulence() void tst_qsgturbulence::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/qsgwander/tst_qsgwander.cpp b/tests/auto/particles/qsgwander/tst_qsgwander.cpp index b200b6fbf0..56ae15e7bb 100644 --- a/tests/auto/particles/qsgwander/tst_qsgwander.cpp +++ b/tests/auto/particles/qsgwander/tst_qsgwander.cpp @@ -61,7 +61,7 @@ tst_qsgwander::tst_qsgwander() void tst_qsgwander::test_basic() { - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml", 600); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); ensureAnimTime(600, system->m_animation); diff --git a/tests/auto/particles/shared/particlestestsshared.h b/tests/auto/particles/shared/particlestestsshared.h index ed483bae01..ab6b5f16af 100644 --- a/tests/auto/particles/shared/particlestestsshared.h +++ b/tests/auto/particles/shared/particlestestsshared.h @@ -41,7 +41,7 @@ #ifndef PARTICLES_TESTS_SHARED #define PARTICLES_TESTS_SHARED -#include <QSGView> +#include <QQuickView> #include <QtTest> #include <QAbstractAnimation> const qreal EPSILON = 0.0001; @@ -66,12 +66,12 @@ bool myFuzzyGEQ(qreal a, qreal b) return (a + EPSILON > b); } -QSGView* createView(const QString &filename, int additionalWait=0) +QQuickView* createView(const QString &filename, int additionalWait=0) { - QSGView *canvas = new QSGView(0); + QQuickView *canvas = new QQuickView(0); canvas->setSource(QUrl::fromLocalFile(filename)); - if (canvas->status() != QSGView::Ready) + if (canvas->status() != QQuickView::Ready) return 0; canvas->show(); QTest::qWaitForWindowShown(canvas); diff --git a/tests/auto/qmltest/borderimage/tst_borderimage.qml b/tests/auto/qmltest/borderimage/tst_borderimage.qml index c902cd77a6..e8e9c238c8 100644 --- a/tests/auto/qmltest/borderimage/tst_borderimage.qml +++ b/tests/auto/qmltest/borderimage/tst_borderimage.qml @@ -231,8 +231,8 @@ Item { function test_invalidSciFile() { - ignoreWarning("QSGGridScaledImage: Invalid tile rule specified. Using Stretch.") // for "Roun" - ignoreWarning("QSGGridScaledImage: Invalid tile rule specified. Using Stretch.") // for "Repea" + ignoreWarning("QQuickGridScaledImage: Invalid tile rule specified. Using Stretch.") // for "Roun" + ignoreWarning("QQuickGridScaledImage: Invalid tile rule specified. Using Stretch.") // for "Repea" var component = Qt.createComponent("InvalidSciFile.qml") var invalidSciFile = component.createObject(top) diff --git a/tests/benchmarks/particles/affectors/tst_affectors.cpp b/tests/benchmarks/particles/affectors/tst_affectors.cpp index f85f877c51..18068b2be2 100644 --- a/tests/benchmarks/particles/affectors/tst_affectors.cpp +++ b/tests/benchmarks/particles/affectors/tst_affectors.cpp @@ -82,7 +82,7 @@ void tst_affectors::test_filtered_data() void tst_affectors::test_basic() { QFETCH(int, dt); - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml"); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml"); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; @@ -122,7 +122,7 @@ void tst_affectors::test_basic() void tst_affectors::test_filtered() { QFETCH(int, dt); - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/filtered.qml"); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/filtered.qml"); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; diff --git a/tests/benchmarks/particles/emission/tst_emission.cpp b/tests/benchmarks/particles/emission/tst_emission.cpp index 66ce547dd2..01e2476431 100644 --- a/tests/benchmarks/particles/emission/tst_emission.cpp +++ b/tests/benchmarks/particles/emission/tst_emission.cpp @@ -73,7 +73,7 @@ void tst_emission::test_basic_data() void tst_emission::test_basic() { QFETCH(int, dt); - QSGView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml"); + QQuickView* view = createView(QCoreApplication::applicationDirPath() + "/data/basic.qml"); QSGParticleSystem* system = view->rootObject()->findChild<QSGParticleSystem*>("system"); //Pretend we're running, but we manually advance the simulation system->m_running = true; |