Merge branch 'qtquick2' of scm.dev.nokia.troll.no:qt/qtdeclarative-staging into qtquick2
This commit is contained in:
commit
1edb32e75d
|
@ -0,0 +1,140 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Canvas {
|
||||||
|
id:motionChart
|
||||||
|
width:1300
|
||||||
|
height: 700
|
||||||
|
property int progress:-1
|
||||||
|
property variant applesFrom: [1000, 300];
|
||||||
|
property variant applesTo:[1200, 400];
|
||||||
|
property variant orangesFrom: [1150, 200];
|
||||||
|
property variant orangesTo:[250, 550];
|
||||||
|
property variant bananasFrom: [300, 250];
|
||||||
|
property variant bananasTo:[788, 617];
|
||||||
|
|
||||||
|
property date startDate:new Date (1988,0,1)
|
||||||
|
property date endDate:new Date (1989,6,1)
|
||||||
|
property variant title:["Fruit", "Sales", "Expenses", "Location"];
|
||||||
|
property bool clearTrace:true
|
||||||
|
Text {id:appleText; text:"Apples"; font.bold:true; font.pixelSize:12; opacity:0}
|
||||||
|
Text {id:orangeText; text:"Oranges"; font.bold:true; font.pixelSize:12; opacity:0}
|
||||||
|
Text {id:bananaText; text:"Bananas"; font.bold:true; font.pixelSize:12; opacity:0}
|
||||||
|
|
||||||
|
Text {id:sales; text: "700 Sales"; x:15; y:15;font.bold:true; font.pixelSize:15; opacity:0}
|
||||||
|
Text {id:expenses; text: "Expenses 1300"; x:1170; y:670;font.bold:true; font.pixelSize:15; opacity:0}
|
||||||
|
Timer {
|
||||||
|
id:timer
|
||||||
|
interval: 1; running: true; repeat: true
|
||||||
|
onTriggered: {
|
||||||
|
if (motionChart.progress == -1) {
|
||||||
|
motionChart.setup();
|
||||||
|
running = false;
|
||||||
|
}
|
||||||
|
motionChart.draw();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onPressed : {
|
||||||
|
motionChart.progress = 0;
|
||||||
|
setup();
|
||||||
|
timer.running = true;
|
||||||
|
motionChart.clearTrace = true;
|
||||||
|
}
|
||||||
|
onDoubleClicked : {
|
||||||
|
motionChart.progress = 0;
|
||||||
|
setup();
|
||||||
|
timer.running = true;
|
||||||
|
motionChart.clearTrace = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function setup() {
|
||||||
|
var ctx = motionChart.getContext("2d");
|
||||||
|
ctx.globalCompositeOperation = "source-over";
|
||||||
|
ctx.clearRect(0, 0, motionChart.width, motionChart.height);
|
||||||
|
|
||||||
|
ctx.strokeColor = Qt.rgba(133, 133, 133,1);
|
||||||
|
ctx.lineWidth = 2;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(10,690);
|
||||||
|
ctx.lineTo(10, 5);
|
||||||
|
ctx.moveTo(10,690);
|
||||||
|
ctx.lineTo(1295, 690);
|
||||||
|
|
||||||
|
for ( var i = 0; i < 10; i++) {
|
||||||
|
ctx.moveTo(10, i*70);
|
||||||
|
ctx.lineTo(15, i*70);
|
||||||
|
ctx.moveTo(i*130, 690);
|
||||||
|
ctx.lineTo(i*130, 685);
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.stroke();
|
||||||
|
sales.opacity =1;
|
||||||
|
expenses.opacity = 1;
|
||||||
|
appleText.opacity = 1;
|
||||||
|
orangeText.opacity = 1;
|
||||||
|
bananaText.opacity = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
function draw() {
|
||||||
|
var totalDays = Math.ceil((endDate.getTime()-startDate.getTime())/(1000*60*60*24));
|
||||||
|
if (motionChart.progress >= totalDays) {
|
||||||
|
timer.running = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var apples = [];
|
||||||
|
apples[0] = applesFrom[0] + ((applesTo[0] - applesFrom[0]) * (motionChart.progress/totalDays));
|
||||||
|
apples[1] = applesFrom[1] + ((applesTo[1] - applesFrom[1]) * (motionChart.progress/totalDays));
|
||||||
|
|
||||||
|
var oranges = [];
|
||||||
|
oranges[0] = orangesFrom[0] + ((orangesTo[0] - orangesFrom[0]) * (motionChart.progress/totalDays));
|
||||||
|
oranges[1] = orangesFrom[1] + ((orangesTo[1] - orangesFrom[1]) * (motionChart.progress/totalDays));
|
||||||
|
|
||||||
|
var bananas = [];
|
||||||
|
bananas[0] = bananasFrom[0] + ((bananasTo[0] - bananasFrom[0]) * (motionChart.progress/totalDays));
|
||||||
|
bananas[1] = bananasFrom[1] + ((bananasTo[1] - bananasFrom[1]) * (motionChart.progress/totalDays));
|
||||||
|
|
||||||
|
var ctx = motionChart.getContext("2d");
|
||||||
|
ctx.globalCompositeOperation = "source-over";
|
||||||
|
|
||||||
|
if (motionChart.clearTrace)
|
||||||
|
ctx.clearRect(15, 15, motionChart.width - 15, motionChart.height - 30);
|
||||||
|
|
||||||
|
|
||||||
|
//apples
|
||||||
|
ctx.fillColor = Qt.rgba(0,255,0,1);
|
||||||
|
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc( apples[0] , 700 - apples[1] , 20 , 0 , Math.PI * 2 , true );
|
||||||
|
//ctx.closePath();
|
||||||
|
ctx.fill();
|
||||||
|
ctx.fillRect(apples[0], 700 - apples[1], 28, 28);
|
||||||
|
appleText.x = apples[0];
|
||||||
|
appleText.y = 700 - apples[1] - 30;
|
||||||
|
//oranges
|
||||||
|
ctx.fillColor = Qt.rgba(0,0,255,1);
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc( oranges[0], 700 - oranges[1] , 20 , 0 , Math.PI * 2 , true );
|
||||||
|
ctx.closePath();
|
||||||
|
ctx.fill();
|
||||||
|
ctx.fillRect(oranges[0], 700 - oranges[1], 28, 28);
|
||||||
|
orangeText.x = oranges[0];
|
||||||
|
orangeText.y = 700 - oranges[1] - 30;
|
||||||
|
|
||||||
|
//bananas
|
||||||
|
ctx.fillColor = Qt.rgba(255,0,0,1);
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc( bananas[0] , 700 - bananas[1] , 20 , 0 , Math.PI * 2 , true );
|
||||||
|
ctx.closePath();
|
||||||
|
ctx.fill();
|
||||||
|
ctx.fillRect(bananas[0], 700 - bananas[1], 28, 28);
|
||||||
|
bananaText.x = bananas[0];
|
||||||
|
bananaText.y = 700 - bananas[1] - 30;
|
||||||
|
|
||||||
|
ctx.sync();
|
||||||
|
motionChart.progress ++;
|
||||||
|
}
|
||||||
|
}
|
|
@ -774,12 +774,12 @@ QSGNode *QSGShaderEffectSource::updatePaintNode(QSGNode *oldNode, UpdatePaintNod
|
||||||
|
|
||||||
tex->setLive(m_live);
|
tex->setLive(m_live);
|
||||||
tex->setItem(QSGItemPrivate::get(m_sourceItem)->itemNode());
|
tex->setItem(QSGItemPrivate::get(m_sourceItem)->itemNode());
|
||||||
QRectF sourceRect = m_sourceRect.isNull()
|
QRectF sourceRect = m_sourceRect.isEmpty()
|
||||||
? QRectF(0, 0, m_sourceItem->width(), m_sourceItem->height())
|
? QRectF(0, 0, m_sourceItem->width(), m_sourceItem->height())
|
||||||
: m_sourceRect;
|
: m_sourceRect;
|
||||||
tex->setRect(sourceRect);
|
tex->setRect(sourceRect);
|
||||||
QSize textureSize = m_textureSize.isEmpty()
|
QSize textureSize = m_textureSize.isEmpty()
|
||||||
? QSize(qCeil(qAbs(sourceRect.width())), qCeil(qAbs(sourceRect.height())))
|
? QSize(qCeil(sourceRect.width()), qCeil(sourceRect.height()))
|
||||||
: m_textureSize;
|
: m_textureSize;
|
||||||
tex->setSize(textureSize);
|
tex->setSize(textureSize);
|
||||||
tex->setRecursive(m_recursive);
|
tex->setRecursive(m_recursive);
|
||||||
|
|
|
@ -1740,6 +1740,9 @@ QScriptValue QDeclarativeEnginePrivate::rect(QScriptContext *ctxt, QScriptEngine
|
||||||
qsreal w = ctxt->argument(2).toNumber();
|
qsreal w = ctxt->argument(2).toNumber();
|
||||||
qsreal h = ctxt->argument(3).toNumber();
|
qsreal h = ctxt->argument(3).toNumber();
|
||||||
|
|
||||||
|
if (w < 0 || h < 0)
|
||||||
|
return engine->nullValue();
|
||||||
|
|
||||||
return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
|
return QDeclarativeEnginePrivate::get(engine)->scriptValueFromVariant(QVariant::fromValue(QRectF(x, y, w, h)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,12 +76,14 @@ contains(QT_CONFIG, private_tests) {
|
||||||
qdeclarativexmllistmodel \
|
qdeclarativexmllistmodel \
|
||||||
qpacketprotocol \
|
qpacketprotocol \
|
||||||
qdeclarativev4 \
|
qdeclarativev4 \
|
||||||
|
qsganimatedimage \
|
||||||
qsgborderimage \
|
qsgborderimage \
|
||||||
qsgcanvas \
|
qsgcanvas \
|
||||||
qsgflickable \
|
qsgflickable \
|
||||||
qsgflipable \
|
qsgflipable \
|
||||||
qsgfocusscope \
|
qsgfocusscope \
|
||||||
qsggridview \
|
qsggridview \
|
||||||
|
qsgimage \
|
||||||
qsgitem \
|
qsgitem \
|
||||||
qsglistview \
|
qsglistview \
|
||||||
qsgloader \
|
qsgloader \
|
||||||
|
|
|
@ -368,7 +368,7 @@ void tst_QDeclarativeDebug::initTestCase()
|
||||||
for (int i=0; i<qml.count(); i++) {
|
for (int i=0; i<qml.count(); i++) {
|
||||||
QDeclarativeComponent component(m_engine);
|
QDeclarativeComponent component(m_engine);
|
||||||
component.setData(qml[i], QUrl::fromLocalFile(""));
|
component.setData(qml[i], QUrl::fromLocalFile(""));
|
||||||
Q_ASSERT(component.isReady()); // fails if bad syntax
|
QVERIFY(component.isReady()); // fails if bad syntax
|
||||||
m_components << qobject_cast<QDeclarativeItem*>(component.create());
|
m_components << qobject_cast<QDeclarativeItem*>(component.create());
|
||||||
}
|
}
|
||||||
m_rootItem = qobject_cast<QDeclarativeItem*>(m_components.first());
|
m_rootItem = qobject_cast<QDeclarativeItem*>(m_components.first());
|
||||||
|
@ -382,7 +382,7 @@ void tst_QDeclarativeDebug::initTestCase()
|
||||||
|
|
||||||
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established");
|
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established");
|
||||||
bool ok = m_conn->waitForConnected();
|
bool ok = m_conn->waitForConnected();
|
||||||
Q_ASSERT(ok);
|
QVERIFY(ok);
|
||||||
QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
|
QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
|
||||||
m_dbg = new QDeclarativeEngineDebug(m_conn, this);
|
m_dbg = new QDeclarativeEngineDebug(m_conn, this);
|
||||||
QTRY_VERIFY(m_dbg->status() == QDeclarativeEngineDebug::Enabled);
|
QTRY_VERIFY(m_dbg->status() == QDeclarativeEngineDebug::Enabled);
|
||||||
|
@ -483,11 +483,11 @@ void tst_QDeclarativeDebug::watch_object()
|
||||||
QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
|
QDeclarativeDebugEnginesQuery *q_engines = m_dbg->queryAvailableEngines(this);
|
||||||
waitForQuery(q_engines);
|
waitForQuery(q_engines);
|
||||||
|
|
||||||
Q_ASSERT(q_engines->engines().count() > 0);
|
QVERIFY(q_engines->engines().count() > 0);
|
||||||
QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this);
|
QDeclarativeDebugRootContextQuery *q_context = m_dbg->queryRootContexts(q_engines->engines()[0].debugId(), this);
|
||||||
waitForQuery(q_context);
|
waitForQuery(q_context);
|
||||||
|
|
||||||
Q_ASSERT(q_context->rootContext().objects().count() > 0);
|
QVERIFY(q_context->rootContext().objects().count() > 0);
|
||||||
QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this);
|
QDeclarativeDebugObjectQuery *q_obj = m_dbg->queryObject(q_context->rootContext().objects()[0], this);
|
||||||
waitForQuery(q_obj);
|
waitForQuery(q_obj);
|
||||||
|
|
||||||
|
|
|
@ -88,7 +88,7 @@ void tst_QDeclarativeDebugClient::initTestCase()
|
||||||
|
|
||||||
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established");
|
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established");
|
||||||
bool ok = m_conn->waitForConnected();
|
bool ok = m_conn->waitForConnected();
|
||||||
Q_ASSERT(ok);
|
QVERIFY(ok);
|
||||||
|
|
||||||
QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
|
QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
|
||||||
QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
|
QTRY_COMPARE(client.status(), QDeclarativeDebugClient::Enabled);
|
||||||
|
|
|
@ -87,7 +87,7 @@ void tst_QDeclarativeDebugService::initTestCase()
|
||||||
|
|
||||||
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established");
|
QTest::ignoreMessage(QtWarningMsg, "QDeclarativeDebugServer: Connection established");
|
||||||
bool ok = m_conn->waitForConnected();
|
bool ok = m_conn->waitForConnected();
|
||||||
Q_ASSERT(ok);
|
QVERIFY(ok);
|
||||||
|
|
||||||
QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
|
QTRY_VERIFY(QDeclarativeDebugService::hasDebuggingClient());
|
||||||
}
|
}
|
||||||
|
|
|
@ -2272,16 +2272,12 @@ public:
|
||||||
~CppOwnershipReturnValue() { delete value; }
|
~CppOwnershipReturnValue() { delete value; }
|
||||||
|
|
||||||
Q_INVOKABLE QObject *create() {
|
Q_INVOKABLE QObject *create() {
|
||||||
Q_ASSERT(value == 0);
|
|
||||||
|
|
||||||
value = new QObject;
|
value = new QObject;
|
||||||
QDeclarativeEngine::setObjectOwnership(value, QDeclarativeEngine::CppOwnership);
|
QDeclarativeEngine::setObjectOwnership(value, QDeclarativeEngine::CppOwnership);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE MyQmlObject *createQmlObject() {
|
Q_INVOKABLE MyQmlObject *createQmlObject() {
|
||||||
Q_ASSERT(value == 0);
|
|
||||||
|
|
||||||
MyQmlObject *rv = new MyQmlObject;
|
MyQmlObject *rv = new MyQmlObject;
|
||||||
value = rv;
|
value = rv;
|
||||||
return rv;
|
return rv;
|
||||||
|
|
|
@ -55,13 +55,13 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class tst_qdeclarativefontloader : public QObject
|
class tst_qdeclarativefontloader : public QObject
|
||||||
|
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
tst_qdeclarativefontloader();
|
tst_qdeclarativefontloader();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void init();
|
||||||
void noFont();
|
void noFont();
|
||||||
void namedFont();
|
void namedFont();
|
||||||
void localFont();
|
void localFont();
|
||||||
|
@ -71,8 +71,6 @@ private slots:
|
||||||
void failWebFont();
|
void failWebFont();
|
||||||
void changeFont();
|
void changeFont();
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QDeclarativeEngine engine;
|
QDeclarativeEngine engine;
|
||||||
TestHTTPServer server;
|
TestHTTPServer server;
|
||||||
|
@ -82,7 +80,11 @@ tst_qdeclarativefontloader::tst_qdeclarativefontloader() :
|
||||||
server(SERVER_PORT)
|
server(SERVER_PORT)
|
||||||
{
|
{
|
||||||
server.serveDirectory(SRCDIR "/data");
|
server.serveDirectory(SRCDIR "/data");
|
||||||
Q_ASSERT(server.isValid());
|
}
|
||||||
|
|
||||||
|
void tst_qdeclarativefontloader::init()
|
||||||
|
{
|
||||||
|
QVERIFY(server.isValid());
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qdeclarativefontloader::noFont()
|
void tst_qdeclarativefontloader::noFont()
|
||||||
|
|
|
@ -115,7 +115,6 @@ int tst_qdeclarativelistmodel::roleFromName(const QDeclarativeListModel *model,
|
||||||
if (model->toString(roles[i]) == roleName)
|
if (model->toString(roles[i]) == roleName)
|
||||||
return roles[i];
|
return roles[i];
|
||||||
}
|
}
|
||||||
Q_ASSERT(false);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -741,6 +740,7 @@ void tst_qdeclarativelistmodel::get()
|
||||||
"}", QUrl());
|
"}", QUrl());
|
||||||
QDeclarativeListModel *model = qobject_cast<QDeclarativeListModel*>(component.create());
|
QDeclarativeListModel *model = qobject_cast<QDeclarativeListModel*>(component.create());
|
||||||
int role = roleFromName(model, roleName);
|
int role = roleFromName(model, roleName);
|
||||||
|
QVERIFY(role >= 0);
|
||||||
|
|
||||||
QSignalSpy spy(model, SIGNAL(itemsChanged(int, int, QList<int>)));
|
QSignalSpy spy(model, SIGNAL(itemsChanged(int, int, QList<int>)));
|
||||||
QDeclarativeExpression expr(eng.rootContext(), model, expression);
|
QDeclarativeExpression expr(eng.rootContext(), model, expression);
|
||||||
|
@ -804,6 +804,7 @@ void tst_qdeclarativelistmodel::get_worker()
|
||||||
model.append(sv);
|
model.append(sv);
|
||||||
model.append(sv);
|
model.append(sv);
|
||||||
int role = roleFromName(&model, roleName);
|
int role = roleFromName(&model, roleName);
|
||||||
|
QVERIFY(role >= 0);
|
||||||
|
|
||||||
const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script";
|
const char *warning = "<Unknown File>: QML ListModel: Cannot add list-type data when modifying or after modification from a worker script";
|
||||||
if (roleValue.type() == QVariant::List || roleValue.type() == QVariant::Map)
|
if (roleValue.type() == QVariant::List || roleValue.type() == QVariant::Map)
|
||||||
|
@ -895,6 +896,7 @@ void tst_qdeclarativelistmodel::get_nested()
|
||||||
int outerListIndex = testData[i].first;
|
int outerListIndex = testData[i].first;
|
||||||
QString outerListRoleName = testData[i].second;
|
QString outerListRoleName = testData[i].second;
|
||||||
int outerListRole = roleFromName(model, outerListRoleName);
|
int outerListRole = roleFromName(model, outerListRoleName);
|
||||||
|
QVERIFY(outerListRole >= 0);
|
||||||
|
|
||||||
childModel = qobject_cast<QDeclarativeListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
|
childModel = qobject_cast<QDeclarativeListModel*>(model->data(outerListIndex, outerListRole).value<QObject*>());
|
||||||
QVERIFY(childModel);
|
QVERIFY(childModel);
|
||||||
|
@ -907,6 +909,7 @@ void tst_qdeclarativelistmodel::get_nested()
|
||||||
QVERIFY(!expr.hasError());
|
QVERIFY(!expr.hasError());
|
||||||
|
|
||||||
int role = roleFromName(childModel, roleName);
|
int role = roleFromName(childModel, roleName);
|
||||||
|
QVERIFY(role >= 0);
|
||||||
QCOMPARE(childModel->data(index, role), roleValue);
|
QCOMPARE(childModel->data(index, role), roleValue);
|
||||||
QCOMPARE(spy.count(), 1);
|
QCOMPARE(spy.count(), 1);
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,10 @@ private:
|
||||||
QStringList fields = item.split(",");
|
QStringList fields = item.split(",");
|
||||||
foreach(const QString &field, fields) {
|
foreach(const QString &field, fields) {
|
||||||
QStringList values = field.split("=");
|
QStringList values = field.split("=");
|
||||||
Q_ASSERT(values.count() == 2);
|
if (values.count() != 2) {
|
||||||
|
qWarning() << "makeItemXmlAndData: invalid field:" << field;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
xml += QString("<%1>%2</%1>").arg(values[0], values[1]);
|
xml += QString("<%1>%2</%1>").arg(values[0], values[1]);
|
||||||
if (!modelData)
|
if (!modelData)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -185,16 +185,22 @@ QString tst_qmlvisual::toTestScript(const QString &file, Mode mode)
|
||||||
if (platformsuffix && (mode == UpdatePlatformVisuals || QFile::exists(testdata+QLatin1String(platformsuffix)+QDir::separator()+testname+".qml"))) {
|
if (platformsuffix && (mode == UpdatePlatformVisuals || QFile::exists(testdata+QLatin1String(platformsuffix)+QDir::separator()+testname+".qml"))) {
|
||||||
QString platformdir = testdata + QLatin1String(platformsuffix);
|
QString platformdir = testdata + QLatin1String(platformsuffix);
|
||||||
if (mode == UpdatePlatformVisuals) {
|
if (mode == UpdatePlatformVisuals) {
|
||||||
Q_ASSERT(QDir().mkpath(platformdir));
|
if (!QDir().mkpath(platformdir)) {
|
||||||
|
qFatal("Cannot make path %s", qPrintable(platformdir));
|
||||||
|
}
|
||||||
// Copy from base
|
// Copy from base
|
||||||
QDir dir(testdata,testname+".*");
|
QDir dir(testdata,testname+".*");
|
||||||
dir.setFilter(QDir::Files);
|
dir.setFilter(QDir::Files);
|
||||||
QFileInfoList list = dir.entryInfoList();
|
QFileInfoList list = dir.entryInfoList();
|
||||||
for (int i = 0; i < list.size(); ++i) {
|
for (int i = 0; i < list.size(); ++i) {
|
||||||
QFile in(list.at(i).filePath());
|
QFile in(list.at(i).filePath());
|
||||||
Q_ASSERT(in.open(QIODevice::ReadOnly));
|
if (!in.open(QIODevice::ReadOnly)) {
|
||||||
|
qFatal("Cannot open file %s: %s", qPrintable(in.fileName()), qPrintable(in.errorString()));
|
||||||
|
}
|
||||||
QFile out(platformdir + QDir::separator() + list.at(i).fileName());
|
QFile out(platformdir + QDir::separator() + list.at(i).fileName());
|
||||||
Q_ASSERT(out.open(QIODevice::WriteOnly));
|
if (!out.open(QIODevice::WriteOnly)) {
|
||||||
|
qFatal("Cannot open file %s: %s", qPrintable(out.fileName()), qPrintable(out.errorString()));
|
||||||
|
}
|
||||||
out.write(in.readAll());
|
out.write(in.readAll());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -234,8 +240,6 @@ QStringList tst_qmlvisual::findQmlFiles(const QDir &d)
|
||||||
|
|
||||||
void action(Mode mode, const QString &file)
|
void action(Mode mode, const QString &file)
|
||||||
{
|
{
|
||||||
Q_ASSERT(mode != Test);
|
|
||||||
|
|
||||||
QString testdata = tst_qmlvisual::toTestScript(file,mode);
|
QString testdata = tst_qmlvisual::toTestScript(file,mode);
|
||||||
|
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
|
|
|
@ -209,7 +209,7 @@ void tst_qsganimatedimage::mirror_notRunning()
|
||||||
anim->setProperty("mirror", true);
|
anim->setProperty("mirror", true);
|
||||||
screenshot = canvas->renderPixmap();
|
screenshot = canvas->renderPixmap();
|
||||||
|
|
||||||
QEXPECT_FAIL("", "QTBUG-19252", Abort);
|
QSKIP("Skip while QTBUG-19351 and QTBUG-19252 are not resolved", SkipSingle);
|
||||||
QCOMPARE(screenshot, expected);
|
QCOMPARE(screenshot, expected);
|
||||||
|
|
||||||
// mirroring should not change the current frame or playing status
|
// mirroring should not change the current frame or playing status
|
||||||
|
@ -288,7 +288,7 @@ void tst_qsganimatedimage::invalidSource()
|
||||||
{
|
{
|
||||||
QDeclarativeEngine engine;
|
QDeclarativeEngine engine;
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData("import QtQuick 1.0\n AnimatedImage { source: \"no-such-file.gif\" }", QUrl::fromLocalFile(""));
|
component.setData("import QtQuick 2.0\n AnimatedImage { source: \"no-such-file.gif\" }", QUrl::fromLocalFile(""));
|
||||||
QVERIFY(component.isReady());
|
QVERIFY(component.isReady());
|
||||||
|
|
||||||
QTest::ignoreMessage(QtWarningMsg, "file::2:2: QML AnimatedImage: Error Reading Animated Image File file:no-such-file.gif");
|
QTest::ignoreMessage(QtWarningMsg, "file::2:2: QML AnimatedImage: Error Reading Animated Image File file:no-such-file.gif");
|
||||||
|
@ -332,7 +332,7 @@ void tst_qsganimatedimage::progressAndStatusChanges()
|
||||||
server.serveDirectory(SRCDIR "/data");
|
server.serveDirectory(SRCDIR "/data");
|
||||||
|
|
||||||
QDeclarativeEngine engine;
|
QDeclarativeEngine engine;
|
||||||
QString componentStr = "import QtQuick 1.0\nAnimatedImage { source: srcImage }";
|
QString componentStr = "import QtQuick 2.0\nAnimatedImage { source: srcImage }";
|
||||||
QDeclarativeContext *ctxt = engine.rootContext();
|
QDeclarativeContext *ctxt = engine.rootContext();
|
||||||
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/stickman.gif"));
|
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/stickman.gif"));
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import QtQuick 1.0
|
import QtQuick 2.0
|
||||||
|
|
||||||
BorderImage {
|
BorderImage {
|
||||||
source: "heart200.png"
|
source: "heart200.png"
|
||||||
|
|
|
@ -98,7 +98,7 @@ tst_qsgborderimage::tst_qsgborderimage()
|
||||||
|
|
||||||
void tst_qsgborderimage::noSource()
|
void tst_qsgborderimage::noSource()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"\" }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"\" }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
@ -142,7 +142,7 @@ void tst_qsgborderimage::imageSource()
|
||||||
if (!error.isEmpty())
|
if (!error.isEmpty())
|
||||||
QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
|
QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
|
||||||
|
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\" }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + source + "\" }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
@ -171,7 +171,7 @@ void tst_qsgborderimage::imageSource()
|
||||||
|
|
||||||
void tst_qsgborderimage::clearSource()
|
void tst_qsgborderimage::clearSource()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: srcImage }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: srcImage }";
|
||||||
QDeclarativeContext *ctxt = engine.rootContext();
|
QDeclarativeContext *ctxt = engine.rootContext();
|
||||||
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
|
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
|
@ -191,7 +191,7 @@ void tst_qsgborderimage::clearSource()
|
||||||
|
|
||||||
void tst_qsgborderimage::resized()
|
void tst_qsgborderimage::resized()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() + "\"; width: 300; height: 300 }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() + "\"; width: 300; height: 300 }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
@ -208,7 +208,7 @@ void tst_qsgborderimage::resized()
|
||||||
|
|
||||||
void tst_qsgborderimage::smooth()
|
void tst_qsgborderimage::smooth()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; smooth: true; width: 300; height: 300 }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; smooth: true; width: 300; height: 300 }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
@ -238,7 +238,7 @@ void tst_qsgborderimage::mirror()
|
||||||
image->setProperty("mirror", true);
|
image->setProperty("mirror", true);
|
||||||
QPixmap mirrored;
|
QPixmap mirrored;
|
||||||
|
|
||||||
QEXPECT_FAIL("", "QTBUG-19252", Abort);
|
QSKIP("Skip while QTBUG-19351 and QTBUG-19252 are not resolved", SkipSingle);
|
||||||
QCOMPARE(screenshot, mirrored);
|
QCOMPARE(screenshot, mirrored);
|
||||||
|
|
||||||
delete canvas;
|
delete canvas;
|
||||||
|
@ -247,7 +247,7 @@ void tst_qsgborderimage::mirror()
|
||||||
void tst_qsgborderimage::tileModes()
|
void tst_qsgborderimage::tileModes()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 100; height: 300; horizontalTileMode: BorderImage.Repeat; verticalTileMode: BorderImage.Repeat }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 100; height: 300; horizontalTileMode: BorderImage.Repeat; verticalTileMode: BorderImage.Repeat }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
@ -260,7 +260,7 @@ void tst_qsgborderimage::tileModes()
|
||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 150; horizontalTileMode: BorderImage.Round; verticalTileMode: BorderImage.Round }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 150; horizontalTileMode: BorderImage.Round; verticalTileMode: BorderImage.Round }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
@ -287,7 +287,7 @@ void tst_qsgborderimage::sciSource()
|
||||||
server->serveDirectory(SRCDIR "/data");
|
server->serveDirectory(SRCDIR "/data");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\"; width: 300; height: 300 }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + source + "\"; width: 300; height: 300 }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
@ -333,7 +333,7 @@ void tst_qsgborderimage::invalidSciFile()
|
||||||
QTest::ignoreMessage(QtWarningMsg, "QSGGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Roun"
|
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, "QSGGridScaledImage: Invalid tile rule specified. Using Stretch."); // for "Repea"
|
||||||
|
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/invalid.sci").toString() +"\"; width: 300; height: 300 }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + QUrl::fromLocalFile(SRCDIR "/data/invalid.sci").toString() +"\"; width: 300; height: 300 }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
@ -351,7 +351,7 @@ void tst_qsgborderimage::pendingRemoteRequest()
|
||||||
{
|
{
|
||||||
QFETCH(QString, source);
|
QFETCH(QString, source);
|
||||||
|
|
||||||
QString componentStr = "import QtQuick 1.0\nBorderImage { source: \"" + source + "\" }";
|
QString componentStr = "import QtQuick 2.0\nBorderImage { source: \"" + source + "\" }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
QSGBorderImage *obj = qobject_cast<QSGBorderImage*>(component.create());
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include <private/qdeclarativevaluetype_p.h>
|
#include <private/qdeclarativevaluetype_p.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "../../../shared/util.h"
|
#include "../../../shared/util.h"
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -60,6 +61,9 @@ public:
|
||||||
tst_qsgflickable();
|
tst_qsgflickable();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
|
|
||||||
void create();
|
void create();
|
||||||
void horizontalViewportSize();
|
void horizontalViewportSize();
|
||||||
void verticalViewportSize();
|
void verticalViewportSize();
|
||||||
|
@ -86,6 +90,18 @@ tst_qsgflickable::tst_qsgflickable()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_qsgflickable::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("Flickable item needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_qsgflickable::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void tst_qsgflickable::create()
|
void tst_qsgflickable::create()
|
||||||
{
|
{
|
||||||
QDeclarativeEngine engine;
|
QDeclarativeEngine engine;
|
||||||
|
|
|
@ -47,6 +47,8 @@
|
||||||
#include <QFontMetrics>
|
#include <QFontMetrics>
|
||||||
#include <private/qsgrectangle_p.h>
|
#include <private/qsgrectangle_p.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -60,6 +62,8 @@ public:
|
||||||
tst_qsgflipable();
|
tst_qsgflipable();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void create();
|
void create();
|
||||||
void checkFrontAndBack();
|
void checkFrontAndBack();
|
||||||
void setFrontAndBack();
|
void setFrontAndBack();
|
||||||
|
@ -74,6 +78,17 @@ private:
|
||||||
|
|
||||||
tst_qsgflipable::tst_qsgflipable()
|
tst_qsgflipable::tst_qsgflipable()
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
void tst_qsgflipable::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("Flipable item needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_qsgflipable::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qsgflipable::create()
|
void tst_qsgflipable::create()
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include <private/qsgtextedit_p.h>
|
#include <private/qsgtextedit_p.h>
|
||||||
#include <private/qsgtext_p.h>
|
#include <private/qsgtext_p.h>
|
||||||
#include <QtDeclarative/private/qsgfocusscope_p.h>
|
#include <QtDeclarative/private/qsgfocusscope_p.h>
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -63,6 +64,8 @@ public:
|
||||||
T *findItem(QSGItem *parent, const QString &id);
|
T *findItem(QSGItem *parent, const QString &id);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void basic();
|
void basic();
|
||||||
void nested();
|
void nested();
|
||||||
void noFocus();
|
void noFocus();
|
||||||
|
@ -73,6 +76,17 @@ private slots:
|
||||||
void qtBug13380();
|
void qtBug13380();
|
||||||
void forceActiveFocus();
|
void forceActiveFocus();
|
||||||
};
|
};
|
||||||
|
void tst_qsgfocusscope::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("FocusScope item needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_qsgfocusscope::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Find an item with the specified id.
|
Find an item with the specified id.
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
#include <QtDeclarative/private/qsgtext_p.h>
|
#include <QtDeclarative/private/qsgtext_p.h>
|
||||||
#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
|
#include <QtDeclarative/private/qdeclarativelistmodel_p.h>
|
||||||
#include "../../../shared/util.h"
|
#include "../../../shared/util.h"
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -65,6 +66,8 @@ public:
|
||||||
tst_QSGGridView();
|
tst_QSGGridView();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void items();
|
void items();
|
||||||
void changed();
|
void changed();
|
||||||
void inserted();
|
void inserted();
|
||||||
|
@ -106,7 +109,17 @@ private:
|
||||||
QList<T*> findItems(QSGItem *parent, const QString &objectName);
|
QList<T*> findItems(QSGItem *parent, const QString &objectName);
|
||||||
void dumpTree(QSGItem *parent, int depth = 0);
|
void dumpTree(QSGItem *parent, int depth = 0);
|
||||||
};
|
};
|
||||||
|
void tst_QSGGridView::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("QSGGridView needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_QSGGridView::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
class TestModel : public QAbstractListModel
|
class TestModel : public QAbstractListModel
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 200; height: 550
|
||||||
|
|
||||||
|
Image {
|
||||||
|
objectName: "tiling"; anchors.fill: parent
|
||||||
|
source: "green.png"; fillMode: Image.TileHorizontally
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Image {
|
||||||
|
source: "heart200.png"
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Image {
|
||||||
|
width: 10; height:10; fillMode: Image.PreserveAspectFit
|
||||||
|
source: ""
|
||||||
|
}
|
|
@ -1,16 +0,0 @@
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
width: 800; height: 600
|
|
||||||
|
|
||||||
Image {
|
|
||||||
objectName: "vTiling"; height: 550; width: 200
|
|
||||||
source: "green.png"; fillMode: Image.TileVertically
|
|
||||||
}
|
|
||||||
|
|
||||||
Image {
|
|
||||||
objectName: "hTiling"; x: 225; height: 250; width: 550
|
|
||||||
source: "green.png"; fillMode: Image.TileHorizontally
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 550; height: 200
|
||||||
|
|
||||||
|
Image {
|
||||||
|
objectName: "tiling"; anchors.fill: parent
|
||||||
|
source: "green.png"; fillMode: Image.TileVertically
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -86,13 +86,12 @@ private slots:
|
||||||
void geometry_data();
|
void geometry_data();
|
||||||
void big();
|
void big();
|
||||||
void tiling_QTBUG_6716();
|
void tiling_QTBUG_6716();
|
||||||
|
void tiling_QTBUG_6716_data();
|
||||||
void noLoading();
|
void noLoading();
|
||||||
void paintedWidthHeight();
|
void paintedWidthHeight();
|
||||||
void sourceSize_QTBUG_14303();
|
void sourceSize_QTBUG_14303();
|
||||||
void sourceSize_QTBUG_16389();
|
void sourceSize_QTBUG_16389();
|
||||||
void nullPixmapPaint();
|
void nullPixmapPaint();
|
||||||
void testQtQuick11Attributes();
|
|
||||||
void testQtQuick11Attributes_data();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@ -107,7 +106,7 @@ tst_qsgimage::tst_qsgimage()
|
||||||
|
|
||||||
void tst_qsgimage::noSource()
|
void tst_qsgimage::noSource()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: \"\" }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"\" }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
||||||
|
@ -167,7 +166,7 @@ void tst_qsgimage::imageSource()
|
||||||
if (!error.isEmpty())
|
if (!error.isEmpty())
|
||||||
QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
|
QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
|
||||||
|
|
||||||
QString componentStr = "import QtQuick 1.1\nImage { source: \"" + source + "\"; asynchronous: "
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + source + "\"; asynchronous: "
|
||||||
+ (async ? QLatin1String("true") : QLatin1String("false")) + "; cache: "
|
+ (async ? QLatin1String("true") : QLatin1String("false")) + "; cache: "
|
||||||
+ (cache ? QLatin1String("true") : QLatin1String("false")) + " }";
|
+ (cache ? QLatin1String("true") : QLatin1String("false")) + " }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
|
@ -205,7 +204,7 @@ void tst_qsgimage::imageSource()
|
||||||
|
|
||||||
void tst_qsgimage::clearSource()
|
void tst_qsgimage::clearSource()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: srcImage }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: srcImage }";
|
||||||
QDeclarativeContext *ctxt = engine.rootContext();
|
QDeclarativeContext *ctxt = engine.rootContext();
|
||||||
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
|
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/colors.png"));
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
|
@ -229,7 +228,7 @@ void tst_qsgimage::clearSource()
|
||||||
|
|
||||||
void tst_qsgimage::resized()
|
void tst_qsgimage::resized()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 300 }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"" SRCDIR "/data/colors.png\"; width: 300; height: 300 }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
||||||
|
@ -264,7 +263,7 @@ void tst_qsgimage::preserveAspectRatio()
|
||||||
|
|
||||||
void tst_qsgimage::smooth()
|
void tst_qsgimage::smooth()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: \"" SRCDIR "/data/colors.png\"; smooth: true; width: 300; height: 300 }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"" SRCDIR "/data/colors.png\"; smooth: true; width: 300; height: 300 }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
||||||
|
@ -284,12 +283,11 @@ void tst_qsgimage::mirror()
|
||||||
qreal width = 300;
|
qreal width = 300;
|
||||||
qreal height = 250;
|
qreal height = 250;
|
||||||
|
|
||||||
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart200.png").toString();
|
QSGView *canvas = new QSGView;
|
||||||
QString componentStr = "import QtQuick 1.1\nImage { source: \"" + src + "\"; }";
|
canvas->show();
|
||||||
|
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/mirror.qml"));
|
||||||
|
|
||||||
QDeclarativeComponent component(&engine);
|
QSGImage *obj = qobject_cast<QSGImage*>(canvas->rootObject());
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
|
||||||
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
|
||||||
QVERIFY(obj != 0);
|
QVERIFY(obj != 0);
|
||||||
|
|
||||||
obj->setProperty("width", width);
|
obj->setProperty("width", width);
|
||||||
|
@ -297,12 +295,7 @@ void tst_qsgimage::mirror()
|
||||||
obj->setFillMode((QSGImage::FillMode)fillMode);
|
obj->setFillMode((QSGImage::FillMode)fillMode);
|
||||||
obj->setProperty("mirror", true);
|
obj->setProperty("mirror", true);
|
||||||
|
|
||||||
QGraphicsScene scene;
|
QPixmap screenshot = canvas->renderPixmap();
|
||||||
scene.addItem(qobject_cast<QSGItem *>(obj));
|
|
||||||
QPixmap screenshot(width, height);
|
|
||||||
screenshot.fill();
|
|
||||||
QPainter p_screenshot(&screenshot);
|
|
||||||
scene.render(&p_screenshot, QRect(0, 0, width, height), QRect(0, 0, width, height));
|
|
||||||
|
|
||||||
QPixmap srcPixmap;
|
QPixmap srcPixmap;
|
||||||
QVERIFY(srcPixmap.load(SRCDIR "/data/heart200.png"));
|
QVERIFY(srcPixmap.load(SRCDIR "/data/heart200.png"));
|
||||||
|
@ -344,9 +337,10 @@ void tst_qsgimage::mirror()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSKIP("Skip while QTBUG-19351 and QTBUG-19252 are not resolved", SkipSingle);
|
||||||
QCOMPARE(screenshot, expected);
|
QCOMPARE(screenshot, expected);
|
||||||
|
|
||||||
delete obj;
|
delete canvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qsgimage::mirror_data()
|
void tst_qsgimage::mirror_data()
|
||||||
|
@ -364,32 +358,17 @@ void tst_qsgimage::mirror_data()
|
||||||
void tst_qsgimage::svg()
|
void tst_qsgimage::svg()
|
||||||
{
|
{
|
||||||
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.svg").toString();
|
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.svg").toString();
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; sourceSize.width: 300; sourceSize.height: 300 }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
||||||
QVERIFY(obj != 0);
|
QVERIFY(obj != 0);
|
||||||
QCOMPARE(obj->pixmap().width(), 300);
|
|
||||||
QCOMPARE(obj->pixmap().height(), 300);
|
|
||||||
QCOMPARE(obj->width(), 300.0);
|
QCOMPARE(obj->width(), 300.0);
|
||||||
QCOMPARE(obj->height(), 300.0);
|
QCOMPARE(obj->height(), 300.0);
|
||||||
#if defined(Q_OS_LINUX)
|
|
||||||
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png"));
|
|
||||||
#elif defined(Q_OS_WIN32)
|
|
||||||
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart-win32.png"));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
obj->setSourceSize(QSize(200,200));
|
obj->setSourceSize(QSize(200,200));
|
||||||
|
|
||||||
QCOMPARE(obj->pixmap().width(), 200);
|
|
||||||
QCOMPARE(obj->pixmap().height(), 200);
|
|
||||||
QCOMPARE(obj->width(), 200.0);
|
QCOMPARE(obj->width(), 200.0);
|
||||||
QCOMPARE(obj->height(), 200.0);
|
QCOMPARE(obj->height(), 200.0);
|
||||||
#if defined(Q_OS_LINUX)
|
|
||||||
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200.png"));
|
|
||||||
#elif defined(Q_OS_WIN32)
|
|
||||||
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart200-win32.png"));
|
|
||||||
#endif
|
|
||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,7 +422,7 @@ void tst_qsgimage::geometry()
|
||||||
QFETCH(double, boundingHeight);
|
QFETCH(double, boundingHeight);
|
||||||
|
|
||||||
QString src = QUrl::fromLocalFile(SRCDIR "/data/rect.png").toString();
|
QString src = QUrl::fromLocalFile(SRCDIR "/data/rect.png").toString();
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; fillMode: Image." + fillMode + "; ";
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; fillMode: Image." + fillMode + "; ";
|
||||||
|
|
||||||
if (explicitWidth)
|
if (explicitWidth)
|
||||||
componentStr.append("width: 300; ");
|
componentStr.append("width: 300; ");
|
||||||
|
@ -471,63 +450,48 @@ void tst_qsgimage::big()
|
||||||
// have to build a 400 MB image. That would be a bug in the JPEG loader.
|
// have to build a 400 MB image. That would be a bug in the JPEG loader.
|
||||||
|
|
||||||
QString src = QUrl::fromLocalFile(SRCDIR "/data/big.jpeg").toString();
|
QString src = QUrl::fromLocalFile(SRCDIR "/data/big.jpeg").toString();
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 100; sourceSize.height: 256 }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; width: 100; sourceSize.height: 256 }";
|
||||||
|
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
||||||
QVERIFY(obj != 0);
|
QVERIFY(obj != 0);
|
||||||
QCOMPARE(obj->pixmap().width(), 256);
|
|
||||||
QCOMPARE(obj->pixmap().height(), 256);
|
|
||||||
QCOMPARE(obj->width(), 100.0);
|
QCOMPARE(obj->width(), 100.0);
|
||||||
QCOMPARE(obj->height(), 256.0);
|
QCOMPARE(obj->height(), 256.0);
|
||||||
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/big256.png"));
|
|
||||||
|
|
||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qsgimage::tiling_QTBUG_6716()
|
void tst_qsgimage::tiling_QTBUG_6716()
|
||||||
{
|
{
|
||||||
|
QFETCH(QString, source);
|
||||||
|
|
||||||
QSGView *canvas = new QSGView(0);
|
QSGView *canvas = new QSGView(0);
|
||||||
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/tiling.qml"));
|
canvas->setSource(QUrl::fromLocalFile(SRCDIR + source));
|
||||||
canvas->show();
|
canvas->show();
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
QSGImage *vTiling = findItem<QSGImage>(canvas->rootObject(), "vTiling");
|
QSGImage *tiling = findItem<QSGImage>(canvas->rootObject(), "tiling");
|
||||||
QSGImage *hTiling = findItem<QSGImage>(canvas->rootObject(), "hTiling");
|
|
||||||
|
|
||||||
QVERIFY(vTiling != 0);
|
QVERIFY(tiling != 0);
|
||||||
QVERIFY(hTiling != 0);
|
QPixmap pm = canvas->renderPixmap();
|
||||||
|
QImage img = pm.toImage();
|
||||||
{
|
for (int x = 0; x < tiling->width(); ++x) {
|
||||||
QPixmap pm(vTiling->width(), vTiling->height());
|
for (int y = 0; y < tiling->height(); ++y) {
|
||||||
QPainter p(&pm);
|
QEXPECT_FAIL("", "QTBUG-19351", Abort);
|
||||||
vTiling->paint(&p, 0, 0);
|
QVERIFY(img.pixel(x, y) == qRgb(0, 255, 0));
|
||||||
|
|
||||||
QImage img = pm.toImage();
|
|
||||||
for (int x = 0; x < vTiling->width(); ++x) {
|
|
||||||
for (int y = 0; y < vTiling->height(); ++y) {
|
|
||||||
QVERIFY(img.pixel(x, y) == qRgb(0, 255, 0));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
QPixmap pm(hTiling->width(), hTiling->height());
|
|
||||||
QPainter p(&pm);
|
|
||||||
hTiling->paint(&p, 0, 0);
|
|
||||||
|
|
||||||
QImage img = pm.toImage();
|
|
||||||
for (int x = 0; x < hTiling->width(); ++x) {
|
|
||||||
for (int y = 0; y < hTiling->height(); ++y) {
|
|
||||||
QVERIFY(img.pixel(x, y) == qRgb(0, 255, 0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
delete canvas;
|
delete canvas;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_qsgimage::tiling_QTBUG_6716_data()
|
||||||
|
{
|
||||||
|
QTest::addColumn<QString>("source");
|
||||||
|
QTest::newRow("vertical_tiling") << "/data/vtiling.qml";
|
||||||
|
QTest::newRow("horizontal_tiling") << "/data/htiling.qml";
|
||||||
|
}
|
||||||
|
|
||||||
void tst_qsgimage::noLoading()
|
void tst_qsgimage::noLoading()
|
||||||
{
|
{
|
||||||
TestHTTPServer server(SERVER_PORT);
|
TestHTTPServer server(SERVER_PORT);
|
||||||
|
@ -535,7 +499,7 @@ void tst_qsgimage::noLoading()
|
||||||
server.serveDirectory(SRCDIR "/data");
|
server.serveDirectory(SRCDIR "/data");
|
||||||
server.addRedirect("oldcolors.png", SERVER_ADDR "/colors.png");
|
server.addRedirect("oldcolors.png", SERVER_ADDR "/colors.png");
|
||||||
|
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: srcImage }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: srcImage }";
|
||||||
QDeclarativeContext *ctxt = engine.rootContext();
|
QDeclarativeContext *ctxt = engine.rootContext();
|
||||||
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart.png"));
|
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart.png"));
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
|
@ -582,37 +546,31 @@ void tst_qsgimage::paintedWidthHeight()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString();
|
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString();
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 200; height: 25; fillMode: Image.PreserveAspectFit }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; width: 200; height: 25; fillMode: Image.PreserveAspectFit }";
|
||||||
|
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
||||||
QVERIFY(obj != 0);
|
QVERIFY(obj != 0);
|
||||||
QCOMPARE(obj->pixmap().width(), 300);
|
|
||||||
QCOMPARE(obj->pixmap().height(), 300);
|
|
||||||
QCOMPARE(obj->width(), 200.0);
|
QCOMPARE(obj->width(), 200.0);
|
||||||
QCOMPARE(obj->height(), 25.0);
|
QCOMPARE(obj->height(), 25.0);
|
||||||
QCOMPARE(obj->paintedWidth(), 25.0);
|
QCOMPARE(obj->paintedWidth(), 25.0);
|
||||||
QCOMPARE(obj->paintedHeight(), 25.0);
|
QCOMPARE(obj->paintedHeight(), 25.0);
|
||||||
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png"));
|
|
||||||
|
|
||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString();
|
QString src = QUrl::fromLocalFile(SRCDIR "/data/heart.png").toString();
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: \"" + src + "\"; width: 26; height: 175; fillMode: Image.PreserveAspectFit }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: \"" + src + "\"; width: 26; height: 175; fillMode: Image.PreserveAspectFit }";
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
||||||
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
QSGImage *obj = qobject_cast<QSGImage*>(component.create());
|
||||||
QVERIFY(obj != 0);
|
QVERIFY(obj != 0);
|
||||||
QCOMPARE(obj->pixmap().width(), 300);
|
|
||||||
QCOMPARE(obj->pixmap().height(), 300);
|
|
||||||
QCOMPARE(obj->width(), 26.0);
|
QCOMPARE(obj->width(), 26.0);
|
||||||
QCOMPARE(obj->height(), 175.0);
|
QCOMPARE(obj->height(), 175.0);
|
||||||
QCOMPARE(obj->paintedWidth(), 26.0);
|
QCOMPARE(obj->paintedWidth(), 26.0);
|
||||||
QCOMPARE(obj->paintedHeight(), 26.0);
|
QCOMPARE(obj->paintedHeight(), 26.0);
|
||||||
QCOMPARE(obj->pixmap(), QPixmap(SRCDIR "/data/heart.png"));
|
|
||||||
|
|
||||||
delete obj;
|
delete obj;
|
||||||
}
|
}
|
||||||
|
@ -620,7 +578,7 @@ void tst_qsgimage::paintedWidthHeight()
|
||||||
|
|
||||||
void tst_qsgimage::sourceSize_QTBUG_14303()
|
void tst_qsgimage::sourceSize_QTBUG_14303()
|
||||||
{
|
{
|
||||||
QString componentStr = "import QtQuick 1.0\nImage { source: srcImage }";
|
QString componentStr = "import QtQuick 2.0\nImage { source: srcImage }";
|
||||||
QDeclarativeContext *ctxt = engine.rootContext();
|
QDeclarativeContext *ctxt = engine.rootContext();
|
||||||
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png"));
|
ctxt->setContextProperty("srcImage", QUrl::fromLocalFile(SRCDIR "/data/heart200.png"));
|
||||||
QDeclarativeComponent component(&engine);
|
QDeclarativeComponent component(&engine);
|
||||||
|
@ -681,65 +639,24 @@ static void checkWarnings(QtMsgType, const char *)
|
||||||
// QTBUG-15690
|
// QTBUG-15690
|
||||||
void tst_qsgimage::nullPixmapPaint()
|
void tst_qsgimage::nullPixmapPaint()
|
||||||
{
|
{
|
||||||
QString componentStr = QString("import QtQuick 1.0\nImage { width: 10; height:10; fillMode: Image.PreserveAspectFit; source: \"")
|
QSGView *canvas = new QSGView(0);
|
||||||
+ SERVER_ADDR + QString("/no-such-file.png\" }");
|
canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/nullpixmap.qml"));
|
||||||
QDeclarativeComponent component(&engine);
|
canvas->show();
|
||||||
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
|
|
||||||
QSGImage *image = qobject_cast<QSGImage*>(component.create());
|
|
||||||
|
|
||||||
|
QSGImage *image = qobject_cast<QSGImage*>(canvas->rootObject());
|
||||||
QTRY_VERIFY(image != 0);
|
QTRY_VERIFY(image != 0);
|
||||||
|
image->setSource(SERVER_ADDR + QString("/no-such-file.png"));
|
||||||
|
|
||||||
QtMsgHandler previousMsgHandler = qInstallMsgHandler(checkWarnings);
|
QtMsgHandler previousMsgHandler = qInstallMsgHandler(checkWarnings);
|
||||||
|
|
||||||
QPixmap pm(100, 100);
|
|
||||||
QPainter p(&pm);
|
|
||||||
|
|
||||||
// used to print "QTransform::translate with NaN called"
|
// used to print "QTransform::translate with NaN called"
|
||||||
image->paint(&p, 0, 0);
|
QPixmap pm = canvas->renderPixmap();
|
||||||
|
|
||||||
qInstallMsgHandler(previousMsgHandler);
|
qInstallMsgHandler(previousMsgHandler);
|
||||||
QVERIFY(numberOfWarnings == 0);
|
QVERIFY(numberOfWarnings == 0);
|
||||||
delete image;
|
delete image;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qsgimage::testQtQuick11Attributes()
|
|
||||||
{
|
|
||||||
QFETCH(QString, code);
|
|
||||||
QFETCH(QString, warning);
|
|
||||||
QFETCH(QString, error);
|
|
||||||
|
|
||||||
QDeclarativeEngine engine;
|
|
||||||
QObject *obj;
|
|
||||||
|
|
||||||
QDeclarativeComponent valid(&engine);
|
|
||||||
valid.setData("import QtQuick 1.1; Image { " + code.toUtf8() + " }", QUrl(""));
|
|
||||||
obj = valid.create();
|
|
||||||
QVERIFY(obj);
|
|
||||||
QVERIFY(valid.errorString().isEmpty());
|
|
||||||
delete obj;
|
|
||||||
|
|
||||||
QDeclarativeComponent invalid(&engine);
|
|
||||||
invalid.setData("import QtQuick 1.0; Image { " + code.toUtf8() + " }", QUrl(""));
|
|
||||||
QTest::ignoreMessage(QtWarningMsg, warning.toUtf8());
|
|
||||||
obj = invalid.create();
|
|
||||||
QCOMPARE(invalid.errorString(), error);
|
|
||||||
delete obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
void tst_qsgimage::testQtQuick11Attributes_data()
|
|
||||||
{
|
|
||||||
QTest::addColumn<QString>("code");
|
|
||||||
QTest::addColumn<QString>("warning");
|
|
||||||
QTest::addColumn<QString>("error");
|
|
||||||
|
|
||||||
QTest::newRow("mirror") << "mirror: true"
|
|
||||||
<< "QDeclarativeComponent: Component is not ready"
|
|
||||||
<< ":1 \"Image.mirror\" is not available in QtQuick 1.0.\n";
|
|
||||||
|
|
||||||
QTest::newRow("cache") << "cache: true"
|
|
||||||
<< "QDeclarativeComponent: Component is not ready"
|
|
||||||
<< ":1 \"Image.cache\" is not available in QtQuick 1.0.\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Find an item with the specified objectName. If index is supplied then the
|
Find an item with the specified objectName. If index is supplied then the
|
||||||
item must also evaluate the {index} expression equal to index
|
item must also evaluate the {index} expression equal to index
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
#include <QtDeclarative/private/qlistmodelinterface_p.h>
|
#include <QtDeclarative/private/qlistmodelinterface_p.h>
|
||||||
#include "../../../shared/util.h"
|
#include "../../../shared/util.h"
|
||||||
#include "incrementalmodel.h"
|
#include "incrementalmodel.h"
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -66,6 +67,8 @@ public:
|
||||||
tst_QSGListView();
|
tst_QSGListView();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
// Test both QListModelInterface and QAbstractItemModel model types
|
// Test both QListModelInterface and QAbstractItemModel model types
|
||||||
void qListModelInterface_items();
|
void qListModelInterface_items();
|
||||||
void qAbstractItemModel_items();
|
void qAbstractItemModel_items();
|
||||||
|
@ -133,6 +136,17 @@ private:
|
||||||
void dumpTree(QSGItem *parent, int depth = 0);
|
void dumpTree(QSGItem *parent, int depth = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void tst_QSGListView::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("QSGListView needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_QSGListView::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
class TestObject : public QObject
|
class TestObject : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -47,6 +47,7 @@
|
||||||
#include <QtDeclarative/qsgview.h>
|
#include <QtDeclarative/qsgview.h>
|
||||||
#include <QtDeclarative/qdeclarativecontext.h>
|
#include <QtDeclarative/qdeclarativecontext.h>
|
||||||
#include <QtDeclarative/qdeclarativeengine.h>
|
#include <QtDeclarative/qdeclarativeengine.h>
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -57,6 +58,8 @@ class tst_QSGMouseArea: public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void dragProperties();
|
void dragProperties();
|
||||||
void resetDrag();
|
void resetDrag();
|
||||||
void dragging();
|
void dragging();
|
||||||
|
@ -77,6 +80,18 @@ private:
|
||||||
QSGView *createView();
|
QSGView *createView();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void tst_QSGMouseArea::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("MouseArea needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_QSGMouseArea::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void tst_QSGMouseArea::dragProperties()
|
void tst_QSGMouseArea::dragProperties()
|
||||||
{
|
{
|
||||||
QSGView *canvas = createView();
|
QSGView *canvas = createView();
|
||||||
|
|
|
@ -55,6 +55,7 @@
|
||||||
#include <QStringListModel>
|
#include <QStringListModel>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#include "../../../shared/util.h"
|
#include "../../../shared/util.h"
|
||||||
|
|
||||||
|
@ -89,6 +90,8 @@ public:
|
||||||
tst_QSGPathView();
|
tst_QSGPathView();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void initValues();
|
void initValues();
|
||||||
void items();
|
void items();
|
||||||
void dataModel();
|
void dataModel();
|
||||||
|
@ -121,6 +124,18 @@ private:
|
||||||
QList<T*> findItems(QSGItem *parent, const QString &objectName);
|
QList<T*> findItems(QSGItem *parent, const QString &objectName);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void tst_QSGPathView::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("PathView needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_QSGPathView::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
class TestObject : public QObject
|
class TestObject : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
#include <private/qsgrectangle_p.h>
|
#include <private/qsgrectangle_p.h>
|
||||||
#include <QtDeclarative/qsgview.h>
|
#include <QtDeclarative/qsgview.h>
|
||||||
#include <QtDeclarative/qdeclarativecontext.h>
|
#include <QtDeclarative/qdeclarativecontext.h>
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -55,6 +56,8 @@ class tst_QSGPinchArea: public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void pinchProperties();
|
void pinchProperties();
|
||||||
void scale();
|
void scale();
|
||||||
void pan();
|
void pan();
|
||||||
|
@ -62,7 +65,17 @@ private slots:
|
||||||
private:
|
private:
|
||||||
QSGView *createView();
|
QSGView *createView();
|
||||||
};
|
};
|
||||||
|
void tst_QSGPinchArea::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("PinchArea needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_QSGPinchArea::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
void tst_QSGPinchArea::pinchProperties()
|
void tst_QSGPinchArea::pinchProperties()
|
||||||
{
|
{
|
||||||
QSGView *canvas = createView();
|
QSGView *canvas = createView();
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
|
|
||||||
#include "../../../shared/util.h"
|
#include "../../../shared/util.h"
|
||||||
#include "testhttpserver.h"
|
#include "testhttpserver.h"
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -68,6 +69,8 @@ public:
|
||||||
tst_qsgtext();
|
tst_qsgtext();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void text();
|
void text();
|
||||||
void width();
|
void width();
|
||||||
void wrap();
|
void wrap();
|
||||||
|
@ -127,7 +130,17 @@ private:
|
||||||
|
|
||||||
QSGView *createView(const QString &filename);
|
QSGView *createView(const QString &filename);
|
||||||
};
|
};
|
||||||
|
void tst_qsgtext::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("Text item needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_qsgtext::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
tst_qsgtext::tst_qsgtext()
|
tst_qsgtext::tst_qsgtext()
|
||||||
{
|
{
|
||||||
standard << "the quick brown fox jumped over the lazy dog"
|
standard << "the quick brown fox jumped over the lazy dog"
|
||||||
|
@ -461,6 +474,8 @@ void tst_qsgtext::alignments_data()
|
||||||
|
|
||||||
void tst_qsgtext::alignments()
|
void tst_qsgtext::alignments()
|
||||||
{
|
{
|
||||||
|
QSKIP("Text alignment pixmap comparison tests will not work with scenegraph", SkipAll);
|
||||||
|
|
||||||
QFETCH(int, hAlign);
|
QFETCH(int, hAlign);
|
||||||
QFETCH(int, vAlign);
|
QFETCH(int, vAlign);
|
||||||
QFETCH(QString, expectfile);
|
QFETCH(QString, expectfile);
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <private/qapplication_p.h>
|
#include <private/qapplication_p.h>
|
||||||
#include <private/qtextcontrol_p.h>
|
#include <private/qtextcontrol_p.h>
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
#include <Carbon/Carbon.h>
|
#include <Carbon/Carbon.h>
|
||||||
|
@ -97,6 +98,8 @@ public:
|
||||||
tst_qsgtextedit();
|
tst_qsgtextedit();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void text();
|
void text();
|
||||||
void width();
|
void width();
|
||||||
void wrap();
|
void wrap();
|
||||||
|
@ -170,7 +173,17 @@ private:
|
||||||
|
|
||||||
QDeclarativeEngine engine;
|
QDeclarativeEngine engine;
|
||||||
};
|
};
|
||||||
|
void tst_qsgtextedit::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("TextEdit item needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_qsgtextedit::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
tst_qsgtextedit::tst_qsgtextedit()
|
tst_qsgtextedit::tst_qsgtextedit()
|
||||||
{
|
{
|
||||||
standard << "the quick brown fox jumped over the lazy dog"
|
standard << "the quick brown fox jumped over the lazy dog"
|
||||||
|
@ -2173,6 +2186,8 @@ void tst_qsgtextedit::preeditMicroFocus()
|
||||||
QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject());
|
QSGTextEdit *edit = qobject_cast<QSGTextEdit *>(view.rootObject());
|
||||||
QVERIFY(edit);
|
QVERIFY(edit);
|
||||||
|
|
||||||
|
QSignalSpy cursorRectangleSpy(edit, SIGNAL(cursorRectangleChanged()));
|
||||||
|
|
||||||
QRect currentRect;
|
QRect currentRect;
|
||||||
QRect previousRect = edit->inputMethodQuery(Qt::ImMicroFocus).toRect();
|
QRect previousRect = edit->inputMethodQuery(Qt::ImMicroFocus).toRect();
|
||||||
|
|
||||||
|
@ -2183,8 +2198,9 @@ void tst_qsgtextedit::preeditMicroFocus()
|
||||||
currentRect = edit->inputMethodQuery(Qt::ImMicroFocus).toRect();
|
currentRect = edit->inputMethodQuery(Qt::ImMicroFocus).toRect();
|
||||||
QCOMPARE(currentRect, previousRect);
|
QCOMPARE(currentRect, previousRect);
|
||||||
#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
|
#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
|
||||||
QCOMPARE(ic.updateReceived, true);
|
QCOMPARE(ic.updateReceived, false); // The cursor position hasn't changed.
|
||||||
#endif
|
#endif
|
||||||
|
QCOMPARE(cursorRectangleSpy.count(), 0);
|
||||||
|
|
||||||
// Verify that the micro focus rect moves to the left as the cursor position
|
// Verify that the micro focus rect moves to the left as the cursor position
|
||||||
// is incremented.
|
// is incremented.
|
||||||
|
@ -2196,6 +2212,8 @@ void tst_qsgtextedit::preeditMicroFocus()
|
||||||
#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
|
#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
|
||||||
QCOMPARE(ic.updateReceived, true);
|
QCOMPARE(ic.updateReceived, true);
|
||||||
#endif
|
#endif
|
||||||
|
QVERIFY(cursorRectangleSpy.count() > 0);
|
||||||
|
cursorRectangleSpy.clear();
|
||||||
previousRect = currentRect;
|
previousRect = currentRect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2209,6 +2227,7 @@ void tst_qsgtextedit::preeditMicroFocus()
|
||||||
#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
|
#if defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)
|
||||||
QCOMPARE(ic.updateReceived, true);
|
QCOMPARE(ic.updateReceived, true);
|
||||||
#endif
|
#endif
|
||||||
|
QVERIFY(cursorRectangleSpy.count() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_qsgtextedit::inputContextMouseHandler()
|
void tst_qsgtextedit::inputContextMouseHandler()
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
#include <QInputContext>
|
#include <QInputContext>
|
||||||
#include <private/qapplication_p.h>
|
#include <private/qapplication_p.h>
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -83,7 +84,8 @@ public:
|
||||||
tst_qsgtextinput();
|
tst_qsgtextinput();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void text();
|
void text();
|
||||||
void width();
|
void width();
|
||||||
void font();
|
void font();
|
||||||
|
@ -144,7 +146,17 @@ private:
|
||||||
QStringList standard;
|
QStringList standard;
|
||||||
QStringList colorStrings;
|
QStringList colorStrings;
|
||||||
};
|
};
|
||||||
|
void tst_qsgtextinput::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("TextInput item needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_qsgtextinput::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
tst_qsgtextinput::tst_qsgtextinput()
|
tst_qsgtextinput::tst_qsgtextinput()
|
||||||
{
|
{
|
||||||
standard << "the quick brown fox jumped over the lazy dog"
|
standard << "the quick brown fox jumped over the lazy dog"
|
||||||
|
|
|
@ -51,6 +51,7 @@
|
||||||
#include <private/qsgvisualitemmodel_p.h>
|
#include <private/qsgvisualitemmodel_p.h>
|
||||||
#include <private/qdeclarativevaluetype_p.h>
|
#include <private/qdeclarativevaluetype_p.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <QtOpenGL/QGLShaderProgram>
|
||||||
|
|
||||||
#ifdef Q_OS_SYMBIAN
|
#ifdef Q_OS_SYMBIAN
|
||||||
// In Symbian OS test data is located in applications private dir
|
// In Symbian OS test data is located in applications private dir
|
||||||
|
@ -115,6 +116,8 @@ public:
|
||||||
tst_qsgvisualdatamodel();
|
tst_qsgvisualdatamodel();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void cleanupTestCase();
|
||||||
void rootIndex();
|
void rootIndex();
|
||||||
void updateLayout();
|
void updateLayout();
|
||||||
void childChanged();
|
void childChanged();
|
||||||
|
@ -128,7 +131,17 @@ private:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T *findItem(QSGItem *parent, const QString &objectName, int index);
|
T *findItem(QSGItem *parent, const QString &objectName, int index);
|
||||||
};
|
};
|
||||||
|
void tst_qsgvisualdatamodel::initTestCase()
|
||||||
|
{
|
||||||
|
QSGView canvas;
|
||||||
|
if (!QGLShaderProgram::hasOpenGLShaderPrograms(canvas.context()))
|
||||||
|
QSKIP("VisualDatamodel item needs OpenGL 2.0", SkipAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
void tst_qsgvisualdatamodel::cleanupTestCase()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
class DataObject : public QObject
|
class DataObject : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
Loading…
Reference in New Issue