summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/graphicsitems/qdeclarativepath_p.h2
-rw-r--r--src/declarative/util/qdeclarativeanimation_p.h18
-rw-r--r--src/declarative/util/qdeclarativefontloader_p.h2
-rw-r--r--src/gui/text/qtextcontrol.cpp8
-rw-r--r--src/gui/widgets/qdatetimeedit.h2
-rw-r--r--src/tools/moc/generator.cpp48
-rw-r--r--src/tools/moc/moc.cpp58
-rw-r--r--src/tools/moc/moc.h1
-rw-r--r--tests/auto/moc/error-on-wrong-notify.h53
-rw-r--r--tests/auto/moc/tst_moc.cpp22
-rw-r--r--tests/auto/qgl/tst_qgl.cpp2
-rw-r--r--tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp8
-rw-r--r--tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp4
-rw-r--r--tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp12
-rw-r--r--tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp2
-rw-r--r--tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp12
-rw-r--r--tests/auto/qpauseanimation/tst_qpauseanimation.cpp6
17 files changed, 168 insertions, 92 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepath_p.h b/src/declarative/graphicsitems/qdeclarativepath_p.h
index 5ab5cfd..195057c 100644
--- a/src/declarative/graphicsitems/qdeclarativepath_p.h
+++ b/src/declarative/graphicsitems/qdeclarativepath_p.h
@@ -190,7 +190,7 @@ private:
class Q_AUTOTEST_EXPORT QDeclarativePathPercent : public QDeclarativePathElement
{
Q_OBJECT
- Q_PROPERTY(qreal value READ value WRITE setValue NOTIFY changed)
+ Q_PROPERTY(qreal value READ value WRITE setValue)
public:
QDeclarativePathPercent(QObject *parent=0) : QDeclarativePathElement(parent) {}
diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h
index 481c36c..d15d1f6 100644
--- a/src/declarative/util/qdeclarativeanimation_p.h
+++ b/src/declarative/util/qdeclarativeanimation_p.h
@@ -74,7 +74,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeAbstractAnimation : public QObject, public Q
Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY runningChanged)
Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged)
Q_PROPERTY(bool alwaysRunToEnd READ alwaysRunToEnd WRITE setAlwaysRunToEnd NOTIFY alwaysRunToEndChanged)
- Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopsChanged)
+ Q_PROPERTY(int loops READ loops WRITE setLoops NOTIFY loopCountChanged)
Q_CLASSINFO("DefaultMethod", "start()")
public:
@@ -301,8 +301,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeColorAnimation : public QDeclarativeProperty
{
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
- Q_PROPERTY(QColor from READ from WRITE setFrom NOTIFY fromChanged)
- Q_PROPERTY(QColor to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(QColor from READ from WRITE setFrom)
+ Q_PROPERTY(QColor to READ to WRITE setTo)
public:
QDeclarativeColorAnimation(QObject *parent=0);
@@ -320,8 +320,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeNumberAnimation : public QDeclarativePropert
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
- Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged)
- Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(qreal from READ from WRITE setFrom)
+ Q_PROPERTY(qreal to READ to WRITE setTo)
public:
QDeclarativeNumberAnimation(QObject *parent=0);
@@ -345,8 +345,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeVector3dAnimation : public QDeclarativePrope
Q_OBJECT
Q_DECLARE_PRIVATE(QDeclarativePropertyAnimation)
- Q_PROPERTY(QVector3D from READ from WRITE setFrom NOTIFY fromChanged)
- Q_PROPERTY(QVector3D to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(QVector3D from READ from WRITE setFrom)
+ Q_PROPERTY(QVector3D to READ to WRITE setTo)
public:
QDeclarativeVector3dAnimation(QObject *parent=0);
@@ -366,8 +366,8 @@ class Q_AUTOTEST_EXPORT QDeclarativeRotationAnimation : public QDeclarativePrope
Q_DECLARE_PRIVATE(QDeclarativeRotationAnimation)
Q_ENUMS(RotationDirection)
- Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged)
- Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged)
+ Q_PROPERTY(qreal from READ from WRITE setFrom)
+ Q_PROPERTY(qreal to READ to WRITE setTo)
Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged)
public:
diff --git a/src/declarative/util/qdeclarativefontloader_p.h b/src/declarative/util/qdeclarativefontloader_p.h
index 6947547..a5fbb8f 100644
--- a/src/declarative/util/qdeclarativefontloader_p.h
+++ b/src/declarative/util/qdeclarativefontloader_p.h
@@ -60,7 +60,7 @@ class Q_AUTOTEST_EXPORT QDeclarativeFontLoader : public QObject
Q_DECLARE_PRIVATE(QDeclarativeFontLoader)
Q_ENUMS(Status)
- Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
+ Q_PROPERTY(QUrl source READ source WRITE setSource)
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
Q_PROPERTY(Status status READ status NOTIFY statusChanged)
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 3d34687..5fe0c0c 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -1101,14 +1101,6 @@ void QTextControl::processEvent(QEvent *e, const QMatrix &matrix, QWidget *conte
}
}
break;
- case QEvent::LayoutDirectionChange: {
- if (contextWidget) {
- QTextOption opt = document()->defaultTextOption();
- opt.setTextDirection(contextWidget->layoutDirection());
- document()->setDefaultTextOption(opt);
- }
- }
- // FALL THROUGH
default:
break;
}
diff --git a/src/gui/widgets/qdatetimeedit.h b/src/gui/widgets/qdatetimeedit.h
index 81bbdb9..d2f315a 100644
--- a/src/gui/widgets/qdatetimeedit.h
+++ b/src/gui/widgets/qdatetimeedit.h
@@ -206,7 +206,6 @@ private:
class Q_GUI_EXPORT QTimeEdit : public QDateTimeEdit
{
Q_OBJECT
- Q_PROPERTY(QTime time READ time WRITE setTime NOTIFY timeChanged USER true)
public:
QTimeEdit(QWidget *parent = 0);
QTimeEdit(const QTime &time, QWidget *parent = 0);
@@ -215,7 +214,6 @@ public:
class Q_GUI_EXPORT QDateEdit : public QDateTimeEdit
{
Q_OBJECT
- Q_PROPERTY(QDate date READ date WRITE setDate NOTIFY dateChanged USER true)
public:
QDateEdit(QWidget *parent = 0);
QDateEdit(const QDate &date, QWidget *parent = 0);
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 9a982d0..c3bbba1 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -483,54 +483,6 @@ void Generator::generateFunctions(QList<FunctionDef>& list, const char *functype
void Generator::generateProperties()
{
//
- // specify get function, for compatibiliy we accept functions
- // returning pointers, or const char * for QByteArray.
- //
- for (int i = 0; i < cdef->propertyList.count(); ++i) {
- PropertyDef &p = cdef->propertyList[i];
- if (p.read.isEmpty())
- continue;
- for (int j = 0; j < cdef->publicList.count(); ++j) {
- const FunctionDef &f = cdef->publicList.at(j);
- if (f.name != p.read)
- continue;
- if (!f.isConst) // get functions must be const
- continue;
- if (f.arguments.size()) // and must not take any arguments
- continue;
- PropertyDef::Specification spec = PropertyDef::ValueSpec;
- QByteArray tmp = f.normalizedType;
- if (p.type == "QByteArray" && tmp == "const char *")
- tmp = "QByteArray";
- if (tmp.left(6) == "const ")
- tmp = tmp.mid(6);
- if (p.type != tmp && tmp.endsWith('*')) {
- tmp.chop(1);
- spec = PropertyDef::PointerSpec;
- } else if (f.type.name.endsWith('&')) { // raw type, not normalized type
- spec = PropertyDef::ReferenceSpec;
- }
- if (p.type != tmp)
- continue;
- p.gspec = spec;
- break;
- }
- if(!p.notify.isEmpty()) {
- int notifyId = -1;
- for (int j = 0; j < cdef->signalList.count(); ++j) {
- const FunctionDef &f = cdef->signalList.at(j);
- if(f.name != p.notify) {
- continue;
- } else {
- notifyId = j /* Signal indexes start from 0 */;
- break;
- }
- }
- p.notifyId = notifyId;
- }
- }
-
- //
// Create meta data
//
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index ac49d65..2c24165 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -727,6 +727,7 @@ void Moc::parse()
error("Class declarations lacks Q_OBJECT macro.");
checkSuperClasses(&def);
+ checkProperties(&def);
classList += def;
knownQObjectClasses.insert(def.classname);
@@ -1312,5 +1313,62 @@ void Moc::checkSuperClasses(ClassDef *def)
}
}
+void Moc::checkProperties(ClassDef *cdef)
+{
+ //
+ // specify get function, for compatibiliy we accept functions
+ // returning pointers, or const char * for QByteArray.
+ //
+ for (int i = 0; i < cdef->propertyList.count(); ++i) {
+ PropertyDef &p = cdef->propertyList[i];
+ if (p.read.isEmpty())
+ continue;
+ for (int j = 0; j < cdef->publicList.count(); ++j) {
+ const FunctionDef &f = cdef->publicList.at(j);
+ if (f.name != p.read)
+ continue;
+ if (!f.isConst) // get functions must be const
+ continue;
+ if (f.arguments.size()) // and must not take any arguments
+ continue;
+ PropertyDef::Specification spec = PropertyDef::ValueSpec;
+ QByteArray tmp = f.normalizedType;
+ if (p.type == "QByteArray" && tmp == "const char *")
+ tmp = "QByteArray";
+ if (tmp.left(6) == "const ")
+ tmp = tmp.mid(6);
+ if (p.type != tmp && tmp.endsWith('*')) {
+ tmp.chop(1);
+ spec = PropertyDef::PointerSpec;
+ } else if (f.type.name.endsWith('&')) { // raw type, not normalized type
+ spec = PropertyDef::ReferenceSpec;
+ }
+ if (p.type != tmp)
+ continue;
+ p.gspec = spec;
+ break;
+ }
+ if(!p.notify.isEmpty()) {
+ int notifyId = -1;
+ for (int j = 0; j < cdef->signalList.count(); ++j) {
+ const FunctionDef &f = cdef->signalList.at(j);
+ if(f.name != p.notify) {
+ continue;
+ } else {
+ notifyId = j /* Signal indexes start from 0 */;
+ break;
+ }
+ }
+ p.notifyId = notifyId;
+ if (notifyId == -1) {
+ QByteArray msg = "NOTIFY signal '" + p.notify + "' of property '" + p.name
+ + "' does not exist in class " + cdef->classname + ".";
+ error(msg.constData());
+ }
+ }
+ }
+}
+
+
QT_END_NAMESPACE
diff --git a/src/tools/moc/moc.h b/src/tools/moc/moc.h
index 9f349b5..5e47d9a 100644
--- a/src/tools/moc/moc.h
+++ b/src/tools/moc/moc.h
@@ -238,6 +238,7 @@ public:
bool testFunctionAttribute(Token tok, FunctionDef *def);
void checkSuperClasses(ClassDef *def);
+ void checkProperties(ClassDef* cdef);
};
inline QByteArray noRef(const QByteArray &type)
diff --git a/tests/auto/moc/error-on-wrong-notify.h b/tests/auto/moc/error-on-wrong-notify.h
new file mode 100644
index 0000000..4b6284a
--- /dev/null
+++ b/tests/auto/moc/error-on-wrong-notify.h
@@ -0,0 +1,53 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+#include <QObject>
+
+class ClassWithWrongNOTIFY : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(int foo READ foo WRITE setFoo NOTIFY fooChanged)
+
+ int m_foo;
+public:
+ void setFoo(int i) { m_foo = i; }
+ int foo() { return m_foo; }
+};
+
diff --git a/tests/auto/moc/tst_moc.cpp b/tests/auto/moc/tst_moc.cpp
index d3a7e03..f9c3ccb 100644
--- a/tests/auto/moc/tst_moc.cpp
+++ b/tests/auto/moc/tst_moc.cpp
@@ -492,6 +492,7 @@ private slots:
void warnOnVirtualSignal();
void QTBUG5590_dummyProperty();
void QTBUG12260_defaultTemplate();
+ void notifyError();
signals:
void sigWithUnsignedArg(unsigned foo);
void sigWithSignedArg(signed foo);
@@ -1362,6 +1363,27 @@ void tst_Moc::QTBUG12260_defaultTemplate()
QVERIFY(QTBUG12260_defaultTemplate_Object::staticMetaObject.indexOfSlot("doAnotherThing(bool,bool)") != -1);
}
+void tst_Moc::notifyError()
+{
+#ifdef MOC_CROSS_COMPILED
+ QSKIP("Not tested when cross-compiled", SkipAll);
+#endif
+#if defined(Q_OS_LINUX) && defined(Q_CC_GNU) && !defined(QT_NO_PROCESS)
+ QProcess proc;
+ proc.start("moc", QStringList(srcify("error-on-wrong-notify.h")));
+ QVERIFY(proc.waitForFinished());
+ QCOMPARE(proc.exitCode(), 1);
+ QCOMPARE(proc.exitStatus(), QProcess::NormalExit);
+ QByteArray mocOut = proc.readAllStandardOutput();
+ QVERIFY(mocOut.isEmpty());
+ QString mocError = QString::fromLocal8Bit(proc.readAllStandardError());
+ QCOMPARE(mocError, QString(SRCDIR) +
+ QString("/error-on-wrong-notify.h:52: Error: NOTIFY signal 'fooChanged' of property 'foo' does not exist in class ClassWithWrongNOTIFY.\n"));
+#else
+ QSKIP("Only tested on linux/gcc", SkipAll);
+#endif
+}
+
QTEST_APPLESS_MAIN(tst_Moc)
#include "tst_moc.moc"
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp
index 7fe461c..bdff5ed 100644
--- a/tests/auto/qgl/tst_qgl.cpp
+++ b/tests/auto/qgl/tst_qgl.cpp
@@ -1835,7 +1835,7 @@ void tst_QGL::clipTest()
// Sample pixels in a grid pattern which avoids false failures due to
// off-by-one pixel errors on some buggy GL implementations
for (int x = 2; x < reference.width(); x += 5) {
- for (int y = 2; y < reference.width(); y += 5) {
+ for (int y = 2; y < reference.height(); y += 5) {
QFUZZY_COMPARE_PIXELS(widgetFB.pixel(x, y), reference.pixel(x, y));
}
}
diff --git a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
index 5dc0c9d..fa6a5ec 100644
--- a/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
+++ b/tests/auto/qgraphicseffect/tst_qgraphicseffect.cpp
@@ -183,20 +183,20 @@ void tst_QGraphicsEffect::source()
QGraphicsItem *item = new QGraphicsRectItem(0, 0, 10, 10);
item->setGraphicsEffect(effect);
QVERIFY(effect->source());
- QCOMPARE(effect->source()->graphicsItem(), item);
+ QCOMPARE(effect->source()->graphicsItem(), (const QGraphicsItem*)item);
QVERIFY(effect->m_sourceChangedFlags & QGraphicsEffect::SourceAttached);
effect->reset();
// Make sure disabling/enabling the effect doesn't change the source.
effect->setEnabled(false);
QVERIFY(effect->source());
- QCOMPARE(effect->source()->graphicsItem(), item);
+ QCOMPARE(effect->source()->graphicsItem(), (const QGraphicsItem*)item);
QVERIFY(!effect->m_sourceChangedFlags);
effect->reset();
effect->setEnabled(true);
QVERIFY(effect->source());
- QCOMPARE(effect->source()->graphicsItem(), item);
+ QCOMPARE(effect->source()->graphicsItem(), (const QGraphicsItem*)item);
QVERIFY(!effect->m_sourceChangedFlags);
effect->reset();
@@ -210,7 +210,7 @@ void tst_QGraphicsEffect::source()
item->setGraphicsEffect(effect);
QPointer<QGraphicsEffectSource> source = effect->source();
QVERIFY(source);
- QCOMPARE(source->graphicsItem(), item);
+ QCOMPARE(source->graphicsItem(), (const QGraphicsItem*)item);
delete item;
QVERIFY(!effect);
QVERIFY(!source);
diff --git a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
index 49a76fa..af23b46 100644
--- a/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
+++ b/tests/auto/qgraphicseffectsource/tst_qgraphicseffectsource.cpp
@@ -209,7 +209,7 @@ void tst_QGraphicsEffectSource::init()
void tst_QGraphicsEffectSource::graphicsItem()
{
QVERIFY(effect->source());
- QCOMPARE(effect->source()->graphicsItem(), item);
+ QCOMPARE(effect->source()->graphicsItem(), (const QGraphicsItem*)item);
}
void tst_QGraphicsEffectSource::styleOption()
@@ -237,7 +237,7 @@ void tst_QGraphicsEffectSource::isPixmap()
CustomEffect *anotherEffect = new CustomEffect;
pixmapItem->setGraphicsEffect(anotherEffect);
QVERIFY(anotherEffect->source());
- QCOMPARE(anotherEffect->source()->graphicsItem(), static_cast<QGraphicsItem *>(pixmapItem));
+ QCOMPARE(anotherEffect->source()->graphicsItem(), static_cast<const QGraphicsItem *>(pixmapItem));
QVERIFY(anotherEffect->source()->isPixmap());
delete pixmapItem;
}
diff --git a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 6cea834..411c790 100644
--- a/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -788,7 +788,7 @@ void tst_QGraphicsProxyWidget::focusNextPrevChild()
view.show();
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
if (hasScene) {
scene.addItem(proxy);
proxy->show();
@@ -837,7 +837,7 @@ void tst_QGraphicsProxyWidget::focusOutEvent()
view.setFocus();
QTest::qWaitForWindowShown(&view);
QTRY_VERIFY(view.isVisible());
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
QWidget *widget = new QWidget;
widget->setFocusPolicy(Qt::WheelFocus);
@@ -1093,7 +1093,7 @@ void tst_QGraphicsProxyWidget::keyPressEvent()
view.viewport()->setFocus();
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
@@ -1134,7 +1134,7 @@ void tst_QGraphicsProxyWidget::keyReleaseEvent()
view.show();
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
@@ -1178,7 +1178,7 @@ void tst_QGraphicsProxyWidget::mouseDoubleClickEvent()
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
@@ -3472,7 +3472,7 @@ void tst_QGraphicsProxyWidget::clickFocus()
qt_x11_wait_for_window_manager(&view);
#endif
QApplication::setActiveWindow(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
QVERIFY(!proxy->hasFocus());
QVERIFY(!proxy->widget()->hasFocus());
diff --git a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
index 67a41ca..903977c 100644
--- a/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -1491,7 +1491,7 @@ void tst_QGraphicsScene::clear()
scene.setItemIndexMethod(QGraphicsScene::NoIndex);
scene.addItem(firstItem);
scene.addItem(secondItem);
- QCOMPARE(scene.items().at(0), firstItem);
+ QCOMPARE(scene.items().at(0), (QGraphicsItem*)firstItem);
QCOMPARE(scene.items().at(1), secondItem);
ClearTestItem *thirdItem = new ClearTestItem(firstItem);
diff --git a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
index bda22eb..e5628d1 100644
--- a/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -890,7 +890,7 @@ void tst_QGraphicsWidget::initStyleOption()
qt_x11_wait_for_window_manager(&view);
#endif
QApplication::setActiveWindow(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
view.setAlignment(Qt::AlignTop | Qt::AlignLeft);
SubQGraphicsWidget *widget = new SubQGraphicsWidget;
@@ -1222,7 +1222,7 @@ void tst_QGraphicsWidget::setTabOrder()
qt_x11_wait_for_window_manager(&view);
#endif
QApplication::setActiveWindow(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
QGraphicsWidget *lastItem = 0;
QTest::ignoreMessage(QtWarningMsg, "QGraphicsWidget::setTabOrder(0, 0) is undefined");
@@ -1285,7 +1285,7 @@ void tst_QGraphicsWidget::setTabOrderAndReparent()
view.show();
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
int i;
QGraphicsWidget *w1, *w2, *w3, *w4;
@@ -1425,7 +1425,7 @@ void tst_QGraphicsWidget::verifyFocusChain()
view.show();
QApplication::setActiveWindow(&view);
QTest::qWaitForWindowShown(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
{
// parent/child focus
@@ -1552,7 +1552,7 @@ void tst_QGraphicsWidget::updateFocusChainWhenChildDie()
qt_x11_wait_for_window_manager(&view);
#endif
QApplication::setActiveWindow(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
// delete item in focus chain with no focus and verify chain
SubQGraphicsWidget *parent = new SubQGraphicsWidget(0, Qt::Window);
@@ -2503,7 +2503,7 @@ void tst_QGraphicsWidget::task250119_shortcutContext()
view.setScene(&scene);
view.show();
QApplication::setActiveWindow(&view);
- QTRY_COMPARE(QApplication::activeWindow(), &view);
+ QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
// *** Event: ***
diff --git a/tests/auto/qpauseanimation/tst_qpauseanimation.cpp b/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
index e473176..605cee6 100644
--- a/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
+++ b/tests/auto/qpauseanimation/tst_qpauseanimation.cpp
@@ -280,7 +280,7 @@ void tst_QPauseAnimation::sequentialPauseGroup()
QVERIFY(group.state() == QAbstractAnimation::Running);
QVERIFY(animation1.state() == QAbstractAnimation::Stopped);
- QCOMPARE(&animation2, group.currentAnimation());
+ QCOMPARE((QAbstractAnimation*)&animation2, group.currentAnimation());
QVERIFY(animation2.state() == QAbstractAnimation::Running);
QVERIFY(animation3.state() == QAbstractAnimation::Stopped);
@@ -292,7 +292,7 @@ void tst_QPauseAnimation::sequentialPauseGroup()
QVERIFY(group.state() == QAbstractAnimation::Running);
QVERIFY(animation1.state() == QAbstractAnimation::Stopped);
QVERIFY(animation2.state() == QAbstractAnimation::Stopped);
- QCOMPARE(&animation3, group.currentAnimation());
+ QCOMPARE((QAbstractAnimation*)&animation3, group.currentAnimation());
QVERIFY(animation3.state() == QAbstractAnimation::Running);
group.setCurrentTime(750);
@@ -329,7 +329,7 @@ void tst_QPauseAnimation::sequentialGroupWithPause()
QVERIFY(group.state() == QAbstractAnimation::Running);
QVERIFY(animation.state() == QAbstractAnimation::Stopped);
- QCOMPARE(&pause, group.currentAnimation());
+ QCOMPARE((QAbstractAnimation*)&pause, group.currentAnimation());
QVERIFY(pause.state() == QAbstractAnimation::Running);
group.setCurrentTime(600);