QCOMPARE(object->property("test1").toBool(), true);
QCOMPARE(object->property("test2").toBool(), false);
- QTRY_VERIFY(object->property("test2").toBool() == true);
+ QTRY_VERIFY(object->property("test2").toBool());
delete object;
}
QQmlEngine engine;
QQmlComponent c(&engine, url);
- QVERIFY(c.isError() == true);
+ QVERIFY(c.isError());
QList<QQmlError> errors = c.errors();
QVERIFY(errors.count() == 1);
QCOMPARE(errors.at(0).description(), error);
// test QObjects in QML
QMetaObject::invokeMethod(object, "testHasOwnPropertySuccess");
- QVERIFY(object->property("result").value<bool>() == true);
+ QVERIFY(object->property("result").value<bool>());
QMetaObject::invokeMethod(object, "testHasOwnPropertyFailure");
- QVERIFY(object->property("result").value<bool>() == false);
+ QVERIFY(!object->property("result").value<bool>());
// now test other types in QML
QObject *child = object->findChild<QObject*>("typeObj");
QQmlComponent component(&engine, testFileUrl("singletontype/singletonTypeResolution.qml"));
QObject *object = component.create();
QVERIFY(object);
- QVERIFY(object->property("success") == true);
+ QVERIFY(object->property("success").toBool());
delete object;
}
o->setProperty("serverBaseUrl", server.baseUrl().toString());
component.completeCreate();
- QTRY_VERIFY(o->property("done").toBool() == true);
+ QTRY_VERIFY(o->property("done").toBool());
QCOMPARE(o->property("test1").toBool(), true);
QCOMPARE(o->property("test2").toBool(), true);
o->setProperty("serverBaseUrl", server.baseUrl().toString());
component.completeCreate();
- QTRY_VERIFY(o->property("done").toBool() == true);
- QTRY_VERIFY(o->property("done2").toBool() == true);
+ QTRY_VERIFY(o->property("done").toBool());
+ QTRY_VERIFY(o->property("done2").toBool());
QCOMPARE(o->property("test1").toBool(), true);
QCOMPARE(o->property("test2").toBool(), true);
QObject *object = component.create();
QVERIFY(object != 0);
- QVERIFY(object->property("result").value<bool>() == true);
+ QVERIFY(object->property("result").value<bool>());
delete object;
}
QVariant q;
QMetaObject::invokeMethod(object, function.toAscii().constData(), Q_RETURN_ARG(QVariant, q), Q_ARG(QVariant, useComparer));
- QVERIFY(q.toBool() == true);
+ QVERIFY(q.toBool());
delete object;
}
QVariant q;
QMetaObject::invokeMethod(object, "test_is_invalid_jsDateTime", Q_RETURN_ARG(QVariant, q));
- QVERIFY(q.toBool() == true);
+ QVERIFY(q.toBool());
QMetaObject::invokeMethod(object, "test_is_invalid_qtDateTime", Q_RETURN_ARG(QVariant, q));
- QVERIFY(q.toBool() == true);
+ QVERIFY(q.toBool());
QMetaObject::invokeMethod(object, "test_rfc2822_date", Q_RETURN_ARG(QVariant, q));
QCOMPARE(q.toLongLong(), 1379512851000LL);
QVariant q;
QVariant val = QString::fromLatin1("2014-07-16T23:30:31");
QMetaObject::invokeMethod(object, "check_utc", Q_RETURN_ARG(QVariant, q), Q_ARG(QVariant, val));
- QVERIFY(q.toBool() == true);
+ QVERIFY(q.toBool());
}
void tst_qqmlecmascript::negativeYear()
QVariant q;
QMetaObject::invokeMethod(object, "test_invalid_url_equal", Q_RETURN_ARG(QVariant, q));
- QVERIFY(q.toBool() == true);
+ QVERIFY(q.toBool());
QMetaObject::invokeMethod(object, "test_invalid_url_strictequal", Q_RETURN_ARG(QVariant, q));
- QVERIFY(q.toBool() == true);
+ QVERIFY(q.toBool());
QMetaObject::invokeMethod(object, "test_valid_url_equal", Q_RETURN_ARG(QVariant, q));
- QVERIFY(q.toBool() == true);
+ QVERIFY(q.toBool());
QMetaObject::invokeMethod(object, "test_valid_url_strictequal", Q_RETURN_ARG(QVariant, q));
- QVERIFY(q.toBool() == true);
+ QVERIFY(q.toBool());
delete object;
}
if (obj.isNull())
qDebug() << component.errors().first().toString();
QVERIFY(!obj.isNull());
- QVERIFY(obj->property("success") == true);
+ QVERIFY(obj->property("success").toBool());
}
void tst_qqmlecmascript::importedScriptsAccessOnObjectWithInvalidContext()
if (obj.isNull())
qDebug() << component.errors().first().toString();
QVERIFY(!obj.isNull());
- QTRY_VERIFY(obj->property("success") == true);
+ QTRY_VERIFY(obj->property("success").toBool());
}
void tst_qqmlecmascript::importedScriptsWithoutQmlMode()
if (obj.isNull())
qDebug() << component.errors().first().toString();
QVERIFY(!obj.isNull());
- QTRY_VERIFY(obj->property("success") == true);
+ QTRY_VERIFY(obj->property("success").toBool());
}
void tst_qqmlecmascript::contextObjectOnLazyBindings()
QQmlComponent c(&engine);
c.setData("import QtQuick 2.0; QtObject { property int a: undefined }", QUrl());
- QVERIFY(c.isReady() == true);
+ QVERIFY(c.isReady());
QQmlTestMessageHandler messageHandler;
TestType tt;
QQmlListReference r(&tt, "data");
- QVERIFY(r.isValid() == true);
+ QVERIFY(r.isValid());
QCOMPARE(r.count(), 0);
tt.data.append(&tt);
// Invalid
{
QQmlListReference r;
- QVERIFY(r.isValid() == false);
+ QVERIFY(!r.isValid());
QVERIFY(r.object() == 0);
QVERIFY(r.listElementType() == 0);
- QVERIFY(r.canAt() == false);
- QVERIFY(r.canClear() == false);
- QVERIFY(r.canCount() == false);
- QVERIFY(r.append(0) == false);
+ QVERIFY(!r.canAt());
+ QVERIFY(!r.canClear());
+ QVERIFY(!r.canCount());
+ QVERIFY(!r.append(0));
QVERIFY(r.at(10) == 0);
- QVERIFY(r.clear() == false);
+ QVERIFY(!r.clear());
QVERIFY(r.count() == 0);
- QVERIFY(r.isReadable() == false);
- QVERIFY(r.isManipulable() == false);
+ QVERIFY(!r.isReadable());
+ QVERIFY(!r.isManipulable());
}
// Non-property
{
QQmlListReference r(&tt, "blah");
- QVERIFY(r.isValid() == false);
+ QVERIFY(!r.isValid());
QVERIFY(r.object() == 0);
QVERIFY(r.listElementType() == 0);
- QVERIFY(r.canAt() == false);
- QVERIFY(r.canClear() == false);
- QVERIFY(r.canCount() == false);
- QVERIFY(r.append(0) == false);
+ QVERIFY(!r.canAt());
+ QVERIFY(!r.canClear());
+ QVERIFY(!r.canCount());
+ QVERIFY(!r.append(0));
QVERIFY(r.at(10) == 0);
- QVERIFY(r.clear() == false);
+ QVERIFY(!r.clear());
QVERIFY(r.count() == 0);
- QVERIFY(r.isReadable() == false);
- QVERIFY(r.isManipulable() == false);
+ QVERIFY(!r.isReadable());
+ QVERIFY(!r.isManipulable());
}
// Non-list property
{
QQmlListReference r(&tt, "intProperty");
- QVERIFY(r.isValid() == false);
+ QVERIFY(!r.isValid());
QVERIFY(r.object() == 0);
QVERIFY(r.listElementType() == 0);
- QVERIFY(r.canAt() == false);
- QVERIFY(r.canClear() == false);
- QVERIFY(r.canCount() == false);
- QVERIFY(r.append(0) == false);
+ QVERIFY(!r.canAt());
+ QVERIFY(!r.canClear());
+ QVERIFY(!r.canCount());
+ QVERIFY(!r.append(0));
QVERIFY(r.at(10) == 0);
- QVERIFY(r.clear() == false);
+ QVERIFY(!r.clear());
QVERIFY(r.count() == 0);
- QVERIFY(r.isReadable() == false);
- QVERIFY(r.isManipulable() == false);
+ QVERIFY(!r.isReadable());
+ QVERIFY(!r.isManipulable());
}
}
{
QQmlListReference ref;
- QVERIFY(ref.isValid() == false);
+ QVERIFY(!ref.isValid());
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.isValid() == false);
+ QVERIFY(!ref.isValid());
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.isValid() == true);
+ QVERIFY(ref.isValid());
delete tt;
- QVERIFY(ref.isValid() == false);
+ QVERIFY(!ref.isValid());
}
}
{
QQmlListReference ref;
- QVERIFY(ref.canAppend() == false);
+ QVERIFY(!ref.canAppend());
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.canAppend() == false);
+ QVERIFY(!ref.canAppend());
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.canAppend() == true);
+ QVERIFY(ref.canAppend());
delete tt;
- QVERIFY(ref.canAppend() == false);
+ QVERIFY(!ref.canAppend());
}
{
TestType tt;
tt.property.append = 0;
QQmlListReference ref(&tt, "data");
- QVERIFY(ref.canAppend() == false);
+ QVERIFY(!ref.canAppend());
}
}
{
QQmlListReference ref;
- QVERIFY(ref.canAt() == false);
+ QVERIFY(!ref.canAt());
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.canAt() == false);
+ QVERIFY(!ref.canAt());
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.canAt() == true);
+ QVERIFY(ref.canAt());
delete tt;
- QVERIFY(ref.canAt() == false);
+ QVERIFY(!ref.canAt());
}
{
TestType tt;
tt.property.at = 0;
QQmlListReference ref(&tt, "data");
- QVERIFY(ref.canAt() == false);
+ QVERIFY(!ref.canAt());
}
}
{
QQmlListReference ref;
- QVERIFY(ref.canClear() == false);
+ QVERIFY(!ref.canClear());
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.canClear() == false);
+ QVERIFY(!ref.canClear());
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.canClear() == true);
+ QVERIFY(ref.canClear());
delete tt;
- QVERIFY(ref.canClear() == false);
+ QVERIFY(!ref.canClear());
}
{
TestType tt;
tt.property.clear = 0;
QQmlListReference ref(&tt, "data");
- QVERIFY(ref.canClear() == false);
+ QVERIFY(!ref.canClear());
}
}
{
QQmlListReference ref;
- QVERIFY(ref.canCount() == false);
+ QVERIFY(!ref.canCount());
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.canCount() == false);
+ QVERIFY(!ref.canCount());
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.canCount() == true);
+ QVERIFY(ref.canCount());
delete tt;
- QVERIFY(ref.canCount() == false);
+ QVERIFY(!ref.canCount());
}
{
TestType tt;
tt.property.count = 0;
QQmlListReference ref(&tt, "data");
- QVERIFY(ref.canCount() == false);
+ QVERIFY(!ref.canCount());
}
}
{
QQmlListReference ref;
- QVERIFY(ref.isReadable() == false);
+ QVERIFY(!ref.isReadable());
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.isReadable() == false);
+ QVERIFY(!ref.isReadable());
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.isReadable() == true);
+ QVERIFY(ref.isReadable());
delete tt;
- QVERIFY(ref.isReadable() == false);
+ QVERIFY(!ref.isReadable());
}
{
TestType tt;
tt.property.count = 0;
QQmlListReference ref(&tt, "data");
- QVERIFY(ref.isReadable() == false);
+ QVERIFY(!ref.isReadable());
}
}
{
QQmlListReference ref;
- QVERIFY(ref.isManipulable() == false);
+ QVERIFY(!ref.isManipulable());
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.isManipulable() == false);
+ QVERIFY(!ref.isManipulable());
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.isManipulable() == true);
+ QVERIFY(ref.isManipulable());
delete tt;
- QVERIFY(ref.isManipulable() == false);
+ QVERIFY(!ref.isManipulable());
}
{
TestType tt;
tt.property.count = 0;
QQmlListReference ref(&tt, "data");
- QVERIFY(ref.isManipulable() == false);
+ QVERIFY(!ref.isManipulable());
}
}
{
QQmlListReference ref;
- QVERIFY(ref.append(tt) == false);
+ QVERIFY(!ref.append(tt));
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.append(tt) == false);
+ QVERIFY(!ref.append(tt));
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.append(tt) == true);
+ QVERIFY(ref.append(tt));
QVERIFY(tt->data.count() == 1);
QVERIFY(tt->data.at(0) == tt);
- QVERIFY(ref.append(&object) == false);
+ QVERIFY(!ref.append(&object));
QVERIFY(tt->data.count() == 1);
QVERIFY(tt->data.at(0) == tt);
- QVERIFY(ref.append(0) == true);
+ QVERIFY(ref.append(0));
QVERIFY(tt->data.count() == 2);
QVERIFY(tt->data.at(0) == tt);
QVERIFY(tt->data.at(1) == 0);
delete tt;
- QVERIFY(ref.append(0) == false);
+ QVERIFY(!ref.append(0));
}
{
TestType tt;
tt.property.append = 0;
QQmlListReference ref(&tt, "data");
- QVERIFY(ref.append(&tt) == false);
+ QVERIFY(!ref.append(&tt));
}
}
{
QQmlListReference ref;
- QVERIFY(ref.clear() == false);
+ QVERIFY(!ref.clear());
}
{
QQmlListReference ref(tt, "blah");
- QVERIFY(ref.clear() == false);
+ QVERIFY(!ref.clear());
}
{
QQmlListReference ref(tt, "data");
- QVERIFY(ref.clear() == true);
+ QVERIFY(ref.clear());
QVERIFY(tt->data.count() == 0);
delete tt;
- QVERIFY(ref.clear() == false);
+ QVERIFY(!ref.clear());
}
{
TestType tt;
tt.property.clear = 0;
QQmlListReference ref(&tt, "data");
- QVERIFY(ref.clear() == false);
+ QVERIFY(!ref.clear());
}
}
QCOMPARE(helper.count, 1);
consistentWait(200);
QCOMPARE(helper.count, 1);
- QVERIFY(timer->isRunning() == false);
+ QVERIFY(!timer->isRunning());
}
void tst_qqmltimer::notRepeatingStart()
QCOMPARE(helper.count, 1);
consistentWait(200);
QCOMPARE(helper.count, 1);
- QVERIFY(timer->isRunning() == false);
+ QVERIFY(!timer->isRunning());
delete timer;
}
consistentWait(200);
QVERIFY(helper.count == oldCount);
- QVERIFY(timer->isRunning() == false);
+ QVERIFY(!timer->isRunning());
QSignalSpy spy(timer, SIGNAL(repeatChanged()));
QCOMPARE(helper.count, 2);
consistentWait(200);
QCOMPARE(helper.count, 2);
- QVERIFY(timer->isRunning() == false);
+ QVERIFY(!timer->isRunning());
QSignalSpy spy(timer, SIGNAL(triggeredOnStartChanged()));
object->setProperty("which", which);
component.completeCreate();
- QTRY_VERIFY(object->property("threw").toBool() == true);
+ QTRY_VERIFY(object->property("threw").toBool());
}
// Test that the state value properties on the XMLHttpRequest constructor have the correct values.
QCOMPARE(object->property("responseText").toBool(), true);
QCOMPARE(object->property("responseXML").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
void tst_qqmlxmlhttprequest::open_data()
object->setProperty("url", server.urlString("/testdocument.html"));
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
// Test valid setRequestHeader() calls with different header cases
object->setProperty("url", server.urlString("/testdocument.html"));
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
// Test setting headers before open() throws exception
void tst_qqmlxmlhttprequest::setRequestHeader_unsent()
QCOMPARE(object->property("responseText").toBool(), true);
QCOMPARE(object->property("responseXML").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
// Test that attempting to set a header after a request is sent throws an exception
QCOMPARE(object->property("test").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
// Invalid arg count throws exception
QVERIFY(!object.isNull());
QCOMPARE(object->property("test").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
// Test that sends for GET, HEAD and DELETE ignore data
object->setProperty("url", server.urlString("/testdocument.html"));
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
{
object->setProperty("url", server.urlString("/testdocument.html"));
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
{
object->setProperty("url", server.urlString("/testdocument.html"));
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
}
object->setProperty("url", server.urlString("/testdocument.html"));
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
void tst_qqmlxmlhttprequest::send_withdata_data()
QCOMPARE(object->property("responseText").toBool(), true);
QCOMPARE(object->property("responseXML").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
// Test abort() cancels an open (but unsent) request
QCOMPARE(object->property("responseText").toBool(), true);
QCOMPARE(object->property("responseXML").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
// Test abort() aborts in progress send
QCOMPARE(object->property("didNotSeeUnsent").toBool(), true);
QCOMPARE(object->property("endStateUnsent").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
}
void tst_qqmlxmlhttprequest::getResponseHeader()
QCOMPARE(object->property("readyState").toBool(), true);
QCOMPARE(object->property("openedState").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("headersReceivedState").toBool(), true);
QCOMPARE(object->property("headersReceivedNullHeader").toBool(), true);
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
- QTRY_VERIFY(object->property("exceptionThrown").toBool() == true);
+ QTRY_VERIFY(object->property("exceptionThrown").toBool());
}
void tst_qqmlxmlhttprequest::getAllResponseHeaders()
QCOMPARE(object->property("readyState").toBool(), true);
QCOMPARE(object->property("openedState").toBool(), true);
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("headersReceivedState").toBool(), true);
QCOMPARE(object->property("headersReceivedHeader").toBool(), true);
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
- QTRY_VERIFY(object->property("exceptionThrown").toBool() == true);
+ QTRY_VERIFY(object->property("exceptionThrown").toBool());
}
void tst_qqmlxmlhttprequest::getBinaryData()
object->setProperty("expectedStatus", status);
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("unsentException").toBool(), true);
QCOMPARE(object->property("openedException").toBool(), true);
object->setProperty("expectedStatus", statusText);
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("unsentException").toBool(), true);
QCOMPARE(object->property("openedException").toBool(), true);
object->setProperty("expectedText", responseText);
component.completeCreate();
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("unsent").toBool(), true);
QCOMPARE(object->property("opened").toBool(), true);
object->setProperty("fileName", fileName);
QMetaObject::invokeMethod(object.data(), "startRequest");
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("responseText").toString(), responseText);
object->setProperty("expectedText", "");
component.completeCreate();
- QTRY_VERIFY(object->property("done").toBool() == true);
+ QTRY_VERIFY(object->property("done").toBool());
QCOMPARE(object->property("dataOK").toBool(), true);
}
object->setProperty("expectedText", "");
component.completeCreate();
- QTRY_VERIFY(object->property("done").toBool() == true);
+ QTRY_VERIFY(object->property("done").toBool());
QCOMPARE(object->property("dataOK").toBool(), true);
}
if (object->property("done").toBool()) break;
QTest::qWait(50);
}
- QVERIFY(object->property("done").toBool() == true);
+ QVERIFY(object->property("done").toBool());
QCOMPARE(object->property("dataOK").toBool(), true);
}
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("xmlNull").toBool(), true);
}
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("xmlTest").toBool(), true);
}
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("xmlTest").toBool(), true);
}
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("xmlTest").toBool(), true);
}
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("xmlTest").toBool(), true);
QCOMPARE(object->property("status").toInt(), 200);
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
- QTRY_VERIFY(object->property("dataOK").toBool() == true);
+ QTRY_VERIFY(object->property("dataOK").toBool());
QCOMPARE(object->property("xmlTest").toBool(), true);
QCOMPARE(object->property("status").toInt(), 200);
object->setProperty("serverBaseUrl", server.baseUrl().toString());
component.completeCreate();
server.sendDelayedItem();
- QTRY_VERIFY(object->property("success").toBool() == true);
+ QTRY_VERIFY(object->property("success").toBool());
}
QTEST_MAIN(tst_qqmlxmlhttprequest)
animation.setLoops(-1);
animation.setAlwaysRunToEnd(true);
QVERIFY(animation.loops() == -1);
- QVERIFY(animation.alwaysRunToEnd() == true);
+ QVERIFY(animation.alwaysRunToEnd());
QElapsedTimer timer;
timer.start();
QQuickAbstractAnimation *myAnim = rect->findChild<QQuickAbstractAnimation*>("MyAnim");
QVERIFY(myAnim);
- QVERIFY(myAnim->isRunning() == false);
+ QVERIFY(!myAnim->isRunning());
}
{
animation.setLoops(-1);
animation.setAlwaysRunToEnd(true);
QVERIFY(animation.loops() == -1);
- QVERIFY(animation.alwaysRunToEnd() == true);
+ QVERIFY(animation.alwaysRunToEnd());
animation.start();
animation.stop();
animation.start();
QCOMPARE(obj->pressDelay(), 200);
QCOMPARE(obj->maximumFlickVelocity(), 2000.);
- QVERIFY(obj->property("ok").toBool() == false);
+ QVERIFY(!obj->property("ok").toBool());
QMetaObject::invokeMethod(obj, "check");
- QVERIFY(obj->property("ok").toBool() == true);
+ QVERIFY(obj->property("ok").toBool());
delete obj;
}
moveAndPress(window.data(), QPoint(150, 150));
// The press should not occur immediately
- QVERIFY(mouseArea->property("pressed").toBool() == false);
+ QVERIFY(!mouseArea->property("pressed").toBool());
// But, it should occur eventually
- QTRY_VERIFY(mouseArea->property("pressed").toBool() == true);
+ QTRY_VERIFY(mouseArea->property("pressed").toBool());
QCOMPARE(clickedSpy.count(),0);
moveAndPress(window.data(), QPoint(180, 180));
// The press should not occur immediately
- QVERIFY(mouseArea->property("pressed").toBool() == false);
+ QVERIFY(!mouseArea->property("pressed").toBool());
QCOMPARE(clickedSpy.count(),0);
moveAndPress(window.data(), QPoint(150, 110));
// The press should not occur immediately
- QVERIFY(mouseArea->property("pressed").toBool() == false);
+ QVERIFY(!mouseArea->property("pressed").toBool());
QTest::mouseMove(window.data(), QPoint(150, 190));
// As we moved pass the drag threshold, we should never receive the press
- QVERIFY(mouseArea->property("pressed").toBool() == false);
- QTRY_VERIFY(mouseArea->property("pressed").toBool() == false);
+ QVERIFY(!mouseArea->property("pressed").toBool());
+ QTRY_VERIFY(!mouseArea->property("pressed").toBool());
// On release the clicked signal should *not* be emitted
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 190));
moveAndPress(window.data(), QPoint(150, 150));
// the MouseArea is not pressed immediately
- QVERIFY(outer->property("pressed").toBool() == false);
- QVERIFY(inner->property("pressed").toBool() == false);
+ QVERIFY(!outer->property("pressed").toBool());
+ QVERIFY(!inner->property("pressed").toBool());
// The inner pressDelay will prevail (50ms, vs. 10sec)
// QTRY_VERIFY() has 5sec timeout, so will timeout well within 10sec.
- QTRY_VERIFY(outer->property("pressed").toBool() == true);
+ QTRY_VERIFY(outer->property("pressed").toBool());
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 150));
// Dragging inner Flickable should work
moveAndPress(window.data(), QPoint(80, 150));
// the MouseArea is not pressed immediately
- QVERIFY(outer->property("pressed").toBool() == false);
- QVERIFY(inner->property("pressed").toBool() == false);
+ QVERIFY(!outer->property("pressed").toBool());
+ QVERIFY(!inner->property("pressed").toBool());
QTest::mouseMove(window.data(), QPoint(60, 150));
QTest::mouseMove(window.data(), QPoint(40, 150));
QTest::mouseMove(window.data(), QPoint(20, 150));
- QVERIFY(inner->property("moving").toBool() == true);
- QVERIFY(outer->property("moving").toBool() == false);
+ QVERIFY(inner->property("moving").toBool());
+ QVERIFY(!outer->property("moving").toBool());
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(20, 150));
// Dragging the MouseArea in the inner Flickable should move the inner Flickable
moveAndPress(window.data(), QPoint(150, 150));
// the MouseArea is not pressed immediately
- QVERIFY(outer->property("pressed").toBool() == false);
+ QVERIFY(!outer->property("pressed").toBool());
QTest::mouseMove(window.data(), QPoint(130, 150));
QTest::mouseMove(window.data(), QPoint(110, 150));
QTest::mouseMove(window.data(), QPoint(90, 150));
- QVERIFY(outer->property("moving").toBool() == false);
- QVERIFY(inner->property("moving").toBool() == true);
+ QVERIFY(!outer->property("moving").toBool());
+ QVERIFY(inner->property("moving").toBool());
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(90, 150));
}
moveAndPress(window.data(), QPoint(150, 150));
// the MouseArea is not pressed immediately
- QVERIFY(outer->property("pressed").toBool() == false);
- QTRY_VERIFY(outer->property("pressed").toBool() == true);
+ QVERIFY(!outer->property("pressed").toBool());
+ QTRY_VERIFY(outer->property("pressed").toBool());
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(150, 150));
- QVERIFY(outer->property("pressed").toBool() == false);
+ QVERIFY(!outer->property("pressed").toBool());
// Dragging inner Flickable should work
moveAndPress(window.data(), QPoint(80, 150));
// the MouseArea is not pressed immediately
- QVERIFY(outer->property("pressed").toBool() == false);
+ QVERIFY(!outer->property("pressed").toBool());
QTest::mouseMove(window.data(), QPoint(80, 148));
QTest::mouseMove(window.data(), QPoint(80, 140));
QTest::mouseMove(window.data(), QPoint(80, 120));
QTest::mouseMove(window.data(), QPoint(80, 100));
- QVERIFY(outer->property("moving").toBool() == false);
- QVERIFY(inner->property("moving").toBool() == true);
+ QVERIFY(!outer->property("moving").toBool());
+ QVERIFY(inner->property("moving").toBool());
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(80, 100));
}
// Don't test whether moving finished because a flick could occur
// wait for any motion to end
- QTRY_VERIFY(flickable->isMoving() == false);
+ QTRY_VERIFY(!flickable->isMoving());
QVERIFY(!flickable->isMovingHorizontally());
QVERIFY(!flickable->isMovingVertically());
QCOMPARE(vFlickSpy.count(), 1);
// wait for any motion to end
- QTRY_VERIFY(flickable->isMoving() == false);
+ QTRY_VERIFY(!flickable->isMoving());
#ifdef Q_OS_MAC
QEXPECT_FAIL("", "QTBUG-26094 stopping on a full pixel doesn't work on OS X", Continue);
QTest::mouseMove(window.data(), QPoint(50, 70));
QTest::mouseMove(window.data(), QPoint(50, 60));
- QVERIFY(flick->isMoving() == false);
+ QVERIFY(!flick->isMoving());
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 60));
moveAndPress(window.data(), QPoint(50, 10));
QTest::mouseRelease(window.data(), Qt::LeftButton, 0, QPoint(50, 10));
- QTRY_VERIFY(window->rootObject()->property("clicked").toBool() == true);
+ QTRY_VERIFY(window->rootObject()->property("clicked").toBool());
}
void tst_qquickflickable::flickVelocity()
QTRY_VERIFY(view == qGuiApp->focusWindow());
QVERIFY(view->isTopLevel());
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Right);
QTest::qWait(50);
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == true);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Down);
QTest::qWait(50);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == true);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(item3->hasActiveFocus());
delete view;
}
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == true);
- QVERIFY(item3->hasActiveFocus() == true);
- QVERIFY(item4->hasActiveFocus() == true);
- QVERIFY(item5->hasActiveFocus() == true);
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(item2->hasActiveFocus());
+ QVERIFY(item3->hasActiveFocus());
+ QVERIFY(item4->hasActiveFocus());
+ QVERIFY(item5->hasActiveFocus());
delete view;
}
QVERIFY(QTest::qWaitForWindowActive(view));
QVERIFY(view == qGuiApp->focusWindow());
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Right);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Down);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
delete view;
}
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Right);
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Right);
QTest::keyClick(view, Qt::Key_Right);
QTest::keyClick(view, Qt::Key_Right);
QTest::keyClick(view, Qt::Key_Right);
QTest::keyClick(view, Qt::Key_Right);
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == true);
- QVERIFY(item3->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
QTest::keyClick(view, Qt::Key_Down);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == true);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(item3->hasActiveFocus());
delete view;
}
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
- QVERIFY(item4->hasActiveFocus() == false);
- QVERIFY(item5->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
+ QVERIFY(!item4->hasActiveFocus());
+ QVERIFY(!item5->hasActiveFocus());
QTest::keyClick(view, Qt::Key_4);
- QVERIFY(item0->hasActiveFocus() == true);
- QVERIFY(item1->hasActiveFocus() == true);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == false);
- QVERIFY(item4->hasActiveFocus() == false);
- QVERIFY(item5->hasActiveFocus() == false);
+ QVERIFY(item0->hasActiveFocus());
+ QVERIFY(item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(!item3->hasActiveFocus());
+ QVERIFY(!item4->hasActiveFocus());
+ QVERIFY(!item5->hasActiveFocus());
QTest::keyClick(view, Qt::Key_5);
- QVERIFY(item0->hasActiveFocus() == false);
- QVERIFY(item1->hasActiveFocus() == false);
- QVERIFY(item2->hasActiveFocus() == false);
- QVERIFY(item3->hasActiveFocus() == true);
- QVERIFY(item4->hasActiveFocus() == false);
- QVERIFY(item5->hasActiveFocus() == true);
+ QVERIFY(!item0->hasActiveFocus());
+ QVERIFY(!item1->hasActiveFocus());
+ QVERIFY(!item2->hasActiveFocus());
+ QVERIFY(item3->hasActiveFocus());
+ QVERIFY(!item4->hasActiveFocus());
+ QVERIFY(item5->hasActiveFocus());
delete view;
}
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
- QVERIFY(view->rootObject()->property("focus1") == false);
- QVERIFY(view->rootObject()->property("focus2") == false);
- QVERIFY(view->rootObject()->property("focus3") == true);
- QVERIFY(view->rootObject()->property("focus4") == true);
- QVERIFY(view->rootObject()->property("focus5") == true);
+ QVERIFY(!view->rootObject()->property("focus1").toBool());
+ QVERIFY(!view->rootObject()->property("focus2").toBool());
+ QVERIFY(view->rootObject()->property("focus3").toBool());
+ QVERIFY(view->rootObject()->property("focus4").toBool());
+ QVERIFY(view->rootObject()->property("focus5").toBool());
delete view;
}
// turn off auto highlight
gridview->setHighlightFollowsCurrentItem(false);
- QVERIFY(gridview->highlightFollowsCurrentItem() == false);
+ QVERIFY(!gridview->highlightFollowsCurrentItem());
QVERIFY(gridview->highlightItem());
qreal hlPosX = gridview->highlightItem()->x();
qreal hlPosY = gridview->highlightItem()->y();
QVERIFY(obj != 0);
if (async)
- QVERIFY(obj->asynchronous() == true);
+ QVERIFY(obj->asynchronous());
else
- QVERIFY(obj->asynchronous() == false);
+ QVERIFY(!obj->asynchronous());
if (cache)
- QVERIFY(obj->cache() == true);
+ QVERIFY(obj->cache());
else
- QVERIFY(obj->cache() == false);
+ QVERIFY(!obj->cache());
if (remote || async)
QTRY_VERIFY(obj->status() == QQuickImage::Loading);
QCOMPARE(spy.count(),1);
QList<QVariant> arguments = spy.first();
QVERIFY(arguments.count() == 1);
- QVERIFY(arguments.at(0).toBool() == true);
+ QVERIFY(arguments.at(0).toBool());
item->setSmooth(true);
QCOMPARE(spy.count(),1);
QCOMPARE(spy.count(),1);
QList<QVariant> arguments = spy.first();
QVERIFY(arguments.count() == 1);
- QVERIFY(arguments.at(0).toBool() == true);
+ QVERIFY(arguments.at(0).toBool());
item->setAntialiasing(true);
QCOMPARE(spy.count(),1);
QList<QVariant> arguments = spy.first();
QVERIFY(arguments.count() == 1);
- QVERIFY(arguments.at(0).toBool() == true);
+ QVERIFY(arguments.at(0).toBool());
QCOMPARE(spy.count(),1);
item->setClip(true);
QTRY_VERIFY(contentItem != 0);
QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
- QTRY_VERIFY(testObject->error() == false);
+ QTRY_VERIFY(!testObject->error());
QTRY_VERIFY(listview->highlightItem() != 0);
QTRY_COMPARE(listview->count(), model.count());
// switch to other delegate
testObject->setAnimate(true);
QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
- QTRY_VERIFY(testObject->error() == false);
+ QTRY_VERIFY(!testObject->error());
QTRY_VERIFY(listview->currentItem());
// set invalid highlight
testObject->setInvalidHighlight(true);
QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
- QTRY_VERIFY(testObject->error() == false);
+ QTRY_VERIFY(!testObject->error());
QTRY_VERIFY(listview->currentItem());
QTRY_VERIFY(listview->highlightItem() == 0);
// back to normal highlight
testObject->setInvalidHighlight(false);
QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
- QTRY_VERIFY(testObject->error() == false);
+ QTRY_VERIFY(!testObject->error());
QTRY_VERIFY(listview->currentItem());
QTRY_VERIFY(listview->highlightItem() != 0);
listview->setCurrentIndex(20);
QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
QTRY_VERIFY(qFuzzyCompare(listview->contentY(), 200.0));
- QTRY_VERIFY(listview->isMoving() == false);
+ QTRY_VERIFY(!listview->isMoving());
listview->setCurrentIndex(0);
QTRY_VERIFY(qFuzzyIsNull(listview->contentY()));
// turn off auto highlight
listview->setHighlightFollowsCurrentItem(false);
- QVERIFY(listview->highlightFollowsCurrentItem() == false);
+ QVERIFY(!listview->highlightFollowsCurrentItem());
QVERIFY(listview->highlightItem());
qreal hlPos = listview->highlightItem()->y();
// flick past the end and check content pos still settles on correct extents
flick(window, flickStart, flickEnd, 180);
- QTRY_VERIFY(listview->isMoving() == false);
+ QTRY_VERIFY(!listview->isMoving());
if (orientation == QQuickListView::Vertical)
QTRY_COMPARE(listview->contentY(), end);
else
// flick past the beginning and check content pos still settles on correct extents
flick(window, flickEnd, flickStart, 180);
- QTRY_VERIFY(listview->isMoving() == false);
+ QTRY_VERIFY(!listview->isMoving());
if (orientation == QQuickListView::Vertical)
QTRY_COMPARE(listview->contentY(), start);
else
// simulate mouse flick
flick(window.data(), QPoint(200, 200), QPoint(200, 50), 100);
- QTRY_VERIFY(listview->isMoving() == false);
+ QTRY_VERIFY(!listview->isMoving());
qreal contentY = listview->contentY();
// flick down
QVERIFY(pathview != 0);
QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
- QVERIFY(testObject->error() == false);
+ QVERIFY(!testObject->error());
QQuickItem *item = findItem<QQuickItem>(pathview, "wrapper", 0);
QVERIFY(item);
testObject->setPathItemCount(5);
QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
- QVERIFY(testObject->error() == false);
+ QVERIFY(!testObject->error());
QTRY_COMPARE(findItems<QQuickItem>(pathview, "wrapper").count(), 5);
int posIndex = greenRect->property("posIndex").toInt();
QVERIFY(posIndex == 0);
bool isFirst = greenRect->property("isFirstItem").toBool();
- QVERIFY(isFirst == true);
+ QVERIFY(isFirst);
bool isLast = greenRect->property("isLastItem").toBool();
- QVERIFY(isLast == false);
+ QVERIFY(!isLast);
QQuickRectangle *yellowRect = window->rootObject()->findChild<QQuickRectangle *>("yellowRect");
QVERIFY(yellowRect != 0);
posIndex = yellowRect->property("posIndex").toInt();
QVERIFY(posIndex == -1);
isFirst = yellowRect->property("isFirstItem").toBool();
- QVERIFY(isFirst == false);
+ QVERIFY(!isFirst);
isLast = yellowRect->property("isLastItem").toBool();
- QVERIFY(isLast == false);
+ QVERIFY(!isLast);
yellowRect->metaObject()->invokeMethod(yellowRect, "onDemandPositioner");
posIndex = yellowRect->property("posIndex").toInt();
QVERIFY(posIndex == 1);
isFirst = yellowRect->property("isFirstItem").toBool();
- QVERIFY(isFirst == false);
+ QVERIFY(!isFirst);
isLast = yellowRect->property("isLastItem").toBool();
- QVERIFY(isLast == true);
+ QVERIFY(isLast);
}
int posIndex = rect0->property("index").toInt();
QVERIFY(posIndex == 0);
bool isFirst = rect0->property("firstItem").toBool();
- QVERIFY(isFirst == true);
+ QVERIFY(isFirst);
bool isLast = rect0->property("lastItem").toBool();
- QVERIFY(isLast == false);
+ QVERIFY(!isLast);
QQuickRectangle *rect1 = window->rootObject()->findChild<QQuickRectangle *>("rect1");
QVERIFY(rect1 != 0);
posIndex = rect1->property("index").toInt();
QVERIFY(posIndex == 1);
isFirst = rect1->property("firstItem").toBool();
- QVERIFY(isFirst == false);
+ QVERIFY(!isFirst);
isLast = rect1->property("lastItem").toBool();
- QVERIFY(isLast == true);
+ QVERIFY(isLast);
row->metaObject()->invokeMethod(row, "createSubRect");
QTRY_VERIFY(rect1->property("index").toInt() == 1);
- QTRY_VERIFY(rect1->property("firstItem").toBool() == false);
- QTRY_VERIFY(rect1->property("lastItem").toBool() == false);
+ QTRY_VERIFY(!rect1->property("firstItem").toBool());
+ QTRY_VERIFY(!rect1->property("lastItem").toBool());
QQuickRectangle *rect2 = window->rootObject()->findChild<QQuickRectangle *>("rect2");
QVERIFY(rect2 != 0);
posIndex = rect2->property("index").toInt();
QVERIFY(posIndex == 2);
isFirst = rect2->property("firstItem").toBool();
- QVERIFY(isFirst == false);
+ QVERIFY(!isFirst);
isLast = rect2->property("lastItem").toBool();
- QVERIFY(isLast == true);
+ QVERIFY(isLast);
row->metaObject()->invokeMethod(row, "destroySubRect");
QCoreApplication::processEvents();
QTRY_VERIFY(rect1->property("index").toInt() == 1);
- QTRY_VERIFY(rect1->property("firstItem").toBool() == false);
- QTRY_VERIFY(rect1->property("lastItem").toBool() == true);
+ QTRY_VERIFY(!rect1->property("firstItem").toBool());
+ QTRY_VERIFY(rect1->property("lastItem").toBool());
}
QVERIFY(!repeater->itemAt(repeater->count()));
QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
- QVERIFY(testObject->error() == false);
+ QVERIFY(!testObject->error());
delete testObject;
delete window;
testObject->setUseModel(true);
QMetaObject::invokeMethod(window->rootObject(), "checkProperties");
- QVERIFY(testObject->error() == false);
+ QVERIFY(!testObject->error());
QCOMPARE(container->childItems().count(), 4);
QVERIFY(qobject_cast<QObject*>(container->childItems().at(0))->objectName() == "item1");
QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(textObject);
QVERIFY(textPrivate != 0);
- QVERIFY(textPrivate->richText == true);
+ QVERIFY(textPrivate->richText);
delete textObject;
}
QQuickTextPrivate *textPrivate = QQuickTextPrivate::get(textObject);
QVERIFY(textPrivate != 0);
- QVERIFY(textPrivate->styledText == true);
+ QVERIFY(textPrivate->styledText);
delete textObject;
}
QSignalSpy spy(input, SIGNAL(selectedTextChanged()));
simulateKey(&window, Qt::Key_Right, Qt::ShiftModifier);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
QCOMPARE(input->selectedText(), QString("a"));
QCOMPARE(spy.count(), 1);
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
QCOMPARE(input->selectedText(), QString());
QCOMPARE(spy.count(), 2);
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
QCOMPARE(input->selectedText(), QString());
QCOMPARE(spy.count(), 2);
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
QCOMPARE(spy.count(), 2);
simulateKey(&window, Qt::Key_Left, Qt::ShiftModifier);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
QCOMPARE(input->selectedText(), QString("a"));
QCOMPARE(spy.count(), 3);
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
QCOMPARE(input->selectedText(), QString());
QCOMPARE(spy.count(), 4);
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
QCOMPARE(input->selectedText(), QString());
QCOMPARE(spy.count(), 4);
}
QQuickTextEdit *input = qobject_cast<QQuickTextEdit *>(qvariant_cast<QObject *>(window.rootObject()->property("myInput")));
QVERIFY(input != 0);
- QTRY_VERIFY(input->hasActiveFocus() == true);
+ QTRY_VERIFY(input->hasActiveFocus());
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
// Test left and right navigation works if the TextEdit is empty (QTBUG-25447).
input->setText(QString());
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(qvariant_cast<QObject *>(window.rootObject()->property("myInput")));
QVERIFY(edit != 0);
- QTRY_VERIFY(edit->hasActiveFocus() == true);
- QVERIFY(edit->isReadOnly() == true);
+ QTRY_VERIFY(edit->hasActiveFocus());
+ QVERIFY(edit->isReadOnly());
QString initial = edit->text();
for (int k=Qt::Key_0; k<=Qt::Key_Z; k++)
simulateKey(&window, k);
QTest::qWaitForWindowActive(&view);
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
QVERIFY(edit);
- QVERIFY(edit->hasActiveFocus() == true);
+ QVERIFY(edit->hasActiveFocus());
// test that input method event is committed and change signal is emitted
QSignalSpy spy(edit, SIGNAL(textChanged()));
QTest::qWaitForWindowActive(&view);
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
QVERIFY(edit);
- QVERIFY(edit->hasActiveFocus() == true);
+ QVERIFY(edit->hasActiveFocus());
// text change even without cursor position change needs to trigger update
edit->setText("test");
}
textinputObject->setText("");
- QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
+ QTRY_VERIFY(textinputObject->hasActiveFocus());
for (int i=0; i<20; i++) {
QTRY_COMPARE(textinputObject->text().length(), qMin(i,10));
//simulateKey(&window, Qt::Key_A);
QVERIFY(window.rootObject() != 0);
QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput *>(window.rootObject());
QVERIFY(textinputObject != 0);
- QTRY_VERIFY(textinputObject->hasActiveFocus() == true);
+ QTRY_VERIFY(textinputObject->hasActiveFocus());
QVERIFY(textinputObject->text().length() == 0);
QCOMPARE(textinputObject->inputMask(), QString("HHHHhhhh; "));
QCOMPARE(textinputObject->length(), 8);
QCOMPARE(dblInput->validator()->locale(), defaultLocale);
dblInput->setFocus(true);
- QVERIFY(dblInput->hasActiveFocus() == true);
+ QVERIFY(dblInput->hasActiveFocus());
QCOMPARE(dblInput->hasAcceptableInput(), false);
QCOMPARE(dblInput->property("acceptable").toBool(), false);
QTest::keyPress(&window, Qt::Key_1);
QVERIFY(strInput);
QSignalSpy strSpy(strInput, SIGNAL(acceptableInputChanged()));
strInput->setFocus(true);
- QVERIFY(strInput->hasActiveFocus() == true);
+ QVERIFY(strInput->hasActiveFocus());
QCOMPARE(strInput->hasAcceptableInput(), false);
QCOMPARE(strInput->property("acceptable").toBool(), false);
QTest::keyPress(&window, Qt::Key_1);
QVERIFY(unvalidatedInput);
QSignalSpy unvalidatedSpy(unvalidatedInput, SIGNAL(acceptableInputChanged()));
unvalidatedInput->setFocus(true);
- QVERIFY(unvalidatedInput->hasActiveFocus() == true);
+ QVERIFY(unvalidatedInput->hasActiveFocus());
QCOMPARE(unvalidatedInput->hasAcceptableInput(), true);
QCOMPARE(unvalidatedInput->property("acceptable").toBool(), true);
QTest::keyPress(&window, Qt::Key_1);
QCOMPARE(plainInput.inputMethodHints(), Qt::ImhNone);
input->setFocus(true);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
// test that input method event is committed
QInputMethodEvent event;
event.setCommitString( "My ", -12, 0);
QVERIFY(input != 0);
input->setCursorPosition(0);
- QTRY_VERIFY(input->hasActiveFocus() == true);
+ QTRY_VERIFY(input->hasActiveFocus());
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
//QT-2944: If text is selected, ensure we deselect upon cursor motion
input->setCursorPosition(input->text().length());
input->select(0,input->text().length());
simulateKey(&window, Qt::Key_Right);
QVERIFY(input->selectionStart() == input->selectionEnd());
QVERIFY(input->selectionStart() == input->text().length());
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
// Up and Down should NOT do Home/End, even on Mac OS X (QTBUG-10438).
input->setCursorPosition(2);
input->setText(QString::fromUtf16(arabic_str, 11));
input->setCursorPosition(0);
- QTRY_VERIFY(input->hasActiveFocus() == true);
+ QTRY_VERIFY(input->hasActiveFocus());
// move off
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
// move back
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
input->setCursorPosition(input->text().length());
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
// move off
simulateKey(&window, Qt::Key_Left);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
// move back
simulateKey(&window, Qt::Key_Right);
- QVERIFY(input->hasActiveFocus() == true);
+ QVERIFY(input->hasActiveFocus());
}
#ifndef QT_NO_CLIPBOARD
QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(window.rootObject()->property("myInput")));
QVERIFY(input != 0);
- QTRY_VERIFY(input->hasActiveFocus() == true);
- QVERIFY(input->isReadOnly() == true);
- QVERIFY(input->isCursorVisible() == false);
+ QTRY_VERIFY(input->hasActiveFocus());
+ QVERIFY(input->isReadOnly());
+ QVERIFY(!input->isCursorVisible());
QString initial = input->text();
for (int k=Qt::Key_0; k<=Qt::Key_Z; k++)
simulateKey(&window, k);
input->setReadOnly(false);
QCOMPARE(input->isReadOnly(), false);
QCOMPARE(input->cursorPosition(), input->text().length());
- QVERIFY(input->isCursorVisible() == true);
+ QVERIFY(input->isCursorVisible());
}
void tst_qquicktextinput::echoMode()
QQuickTextInput *input = qobject_cast<QQuickTextInput *>(qvariant_cast<QObject *>(window.rootObject()->property("myInput")));
QVERIFY(input != 0);
- QTRY_VERIFY(input->hasActiveFocus() == true);
+ QTRY_VERIFY(input->hasActiveFocus());
QString initial = input->text();
Qt::InputMethodHints ref;
QCOMPARE(initial, QLatin1String("ABCDefgh"));
QCOMPARE(input->displayText(), QLatin1String("a"));
COMPARE_INPUT_METHOD_QUERY(QString, input, Qt::ImSurroundingText, toString, QLatin1String("a"));
input->setFocus(false);
- QVERIFY(input->hasActiveFocus() == false);
+ QVERIFY(!input->hasActiveFocus());
QCOMPARE(input->displayText(), QLatin1String("Q"));
COMPARE_INPUT_METHOD_QUERY(QString, input, Qt::ImSurroundingText, toString, QLatin1String("Q"));
input->setFocus(true);
window1->requestActivate(); // and then transfer the focus to window1
QTRY_COMPARE(QGuiApplication::focusWindow(), window1.data());
- QVERIFY(window1->isActive() == true);
+ QVERIFY(window1->isActive());
QQuickItem *item = QQuickVisualTestUtil::findItem<QQuickItem>(window1->contentItem(), "item1");
QVERIFY(item);