+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
import QtQuick 2.0
Item {
function checkMapAToInvalid(x, y) {
var pos = itemA.mapToItem(1122, x, y)
- return pos.x == undefined && pos.y == undefined
+ return pos == undefined;
}
function checkMapAFromInvalid(x, y) {
var pos = itemA.mapFromItem(1122, x, y)
- return pos.x == undefined && pos.y == undefined
+ return pos == undefined;
}
}
void tst_QSGItem::keys()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setBaseSize(QSize(240,320));
KeysTestObject *testObject = new KeysTestObject;
canvas->rootContext()->setContextProperty("keysTestObject", testObject);
void tst_QSGItem::keysProcessingOrder()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setBaseSize(QSize(240,320));
KeysTestObject *testObject = new KeysTestObject;
canvas->rootContext()->setContextProperty("keysTestObject", testObject);
void tst_QSGItem::keyNavigation()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setBaseSize(QSize(240,320));
canvas->setSource(QUrl::fromLocalFile(TESTDATA("keynavigationtest.qml")));
canvas->show();
void tst_QSGItem::keyNavigation_RightToLeft()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setBaseSize(QSize(240,320));
canvas->setSource(QUrl::fromLocalFile(TESTDATA("keynavigationtest.qml")));
canvas->show();
void tst_QSGItem::keyNavigation_skipNotVisible()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setBaseSize(QSize(240,320));
canvas->setSource(QUrl::fromLocalFile(TESTDATA("keynavigationtest.qml")));
canvas->show();
void tst_QSGItem::keyNavigation_implicitSetting()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setBaseSize(QSize(240,320));
canvas->setSource(QUrl::fromLocalFile(TESTDATA("keynavigationtest_implicit.qml")));
canvas->show();
QFETCH(int, y);
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(300, 300);
+ canvas->setBaseSize(QSize(300, 300));
canvas->setSource(QUrl::fromLocalFile(TESTDATA("mapCoordinates.qml")));
canvas->show();
qApp->processEvents();
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)));
- QString warning1 = QUrl::fromLocalFile(TESTDATA("mapCoordinates.qml")).toString() + ":7:5: QML Item: mapToItem() given argument \"1122\" which is neither null nor an Item";
- QString warning2 = QUrl::fromLocalFile(TESTDATA("mapCoordinates.qml")).toString() + ":7:5: QML Item: mapFromItem() given argument \"1122\" which is neither null nor an Item";
+ 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";
QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1));
QVERIFY(QMetaObject::invokeMethod(root, "checkMapAToInvalid",
void tst_QSGItem::propertyChanges()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
+ canvas->setBaseSize(QSize(300, 300));
canvas->setSource(QUrl::fromLocalFile(TESTDATA("propertychanges.qml")));
canvas->show();
- QApplication::setActiveWindow(canvas);
QTest::qWaitForWindowShown(canvas);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(canvas));
QSGItem *item = findItem<QSGItem>(canvas->rootObject(), "item");
QSGItem *parentItem = findItem<QSGItem>(canvas->rootObject(), "parentItem");
void tst_QSGItem::childrenRect()
{
QSGView *canvas = new QSGView(0);
- canvas->setFixedSize(240,320);
canvas->setSource(QUrl::fromLocalFile(TESTDATA("childrenRect.qml")));
+ canvas->setBaseSize(QSize(240,320));
canvas->show();
QSGItem *o = canvas->rootObject();