summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro2
-rw-r--r--tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml27
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp17
-rw-r--r--tests/auto/qclipboard/test/test.pro6
-rw-r--r--tests/auto/qfileinfo/qfileinfo.pro2
-rw-r--r--tests/auto/qfontdatabase/tst_qfontdatabase.cpp14
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp108
-rw-r--r--tests/auto/qgroupbox/tst_qgroupbox.cpp23
-rw-r--r--tests/auto/qintvalidator/tst_qintvalidator.cpp9
-rw-r--r--tests/auto/qlocalsocket/test/test.pro2
-rw-r--r--tests/auto/qmessagebox/tst_qmessagebox.cpp3
-rw-r--r--tests/auto/qprogressbar/tst_qprogressbar.cpp39
-rw-r--r--tests/auto/qsqldatabase/tst_databases.h10
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp11
-rw-r--r--tests/benchmarks/corelib/tools/qstring/main.cpp4
15 files changed, 265 insertions, 12 deletions
diff --git a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro
index 2c13644..3bdb3fc 100644
--- a/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro
+++ b/tests/auto/declarative/qdeclarativepincharea/qdeclarativepincharea.pro
@@ -7,7 +7,7 @@ SOURCES += tst_qdeclarativepincharea.cpp
symbian: {
importFiles.sources = data
importFiles.path = .
- DEPLOYMENT = importFiles
+ DEPLOYMENT += importFiles
} else {
DEFINES += SRCDIR=\\\"$$PWD\\\"
}
diff --git a/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml
new file mode 100644
index 0000000..ed1f22f
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativestates/data/signalOverrideCrash3.qml
@@ -0,0 +1,27 @@
+import QtQuick 1.0
+
+Rectangle {
+ id: myRect
+ width: 400
+ height: 400
+
+ onHeightChanged: console.log("base state")
+
+ states: [
+ State {
+ name: "state1"
+ PropertyChanges {
+ target: myRect
+ onHeightChanged: console.log("state1")
+ color: "green"
+ }
+ },
+ State {
+ name: "state2";
+ PropertyChanges {
+ target: myRect
+ onHeightChanged: console.log("state2")
+ color: "red"
+ }
+ }]
+}
diff --git a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
index 9fafa7d..e90e6fb 100644
--- a/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
+++ b/tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp
@@ -113,6 +113,7 @@ private slots:
void signalOverride();
void signalOverrideCrash();
void signalOverrideCrash2();
+ void signalOverrideCrash3();
void parentChange();
void parentChangeErrors();
void anchorChanges();
@@ -520,6 +521,22 @@ void tst_qdeclarativestates::signalOverrideCrash2()
delete rect;
}
+void tst_qdeclarativestates::signalOverrideCrash3()
+{
+ QDeclarativeEngine engine;
+
+ QDeclarativeComponent rectComponent(&engine, SRCDIR "/data/signalOverrideCrash3.qml");
+ QDeclarativeRectangle *rect = qobject_cast<QDeclarativeRectangle*>(rectComponent.create());
+ QVERIFY(rect != 0);
+
+ QDeclarativeItemPrivate::get(rect)->setState("state1");
+ QDeclarativeItemPrivate::get(rect)->setState("");
+ QDeclarativeItemPrivate::get(rect)->setState("state2");
+ QDeclarativeItemPrivate::get(rect)->setState("");
+
+ delete rect;
+}
+
void tst_qdeclarativestates::parentChange()
{
QDeclarativeEngine engine;
diff --git a/tests/auto/qclipboard/test/test.pro b/tests/auto/qclipboard/test/test.pro
index 12c6b6c..2e8f6db 100644
--- a/tests/auto/qclipboard/test/test.pro
+++ b/tests/auto/qclipboard/test/test.pro
@@ -15,7 +15,7 @@ wince*|symbian: {
copier.path = copier
paster.files = ../paster/paster.exe
paster.path = paster
-
+
symbian: {
LIBS += -lbafl -lestor -letext
@@ -27,6 +27,6 @@ wince*|symbian: {
reg_resource.files += $${EPOCROOT}$$HW_ZDIR$$REG_RESOURCE_IMPORT_DIR/paster_reg.rsc
reg_resource.path = $$REG_RESOURCE_IMPORT_DIR
}
-
+
DEPLOYMENT += copier paster rsc reg_resource
-} \ No newline at end of file
+}
diff --git a/tests/auto/qfileinfo/qfileinfo.pro b/tests/auto/qfileinfo/qfileinfo.pro
index b35b1e0..7a2cf9c 100644
--- a/tests/auto/qfileinfo/qfileinfo.pro
+++ b/tests/auto/qfileinfo/qfileinfo.pro
@@ -19,7 +19,7 @@ symbian {
TARGET.CAPABILITY=AllFiles
LIBS *= -lefsrv
INCLUDEPATH *= $$MW_LAYER_SYSTEMINCLUDE # Needed for e32svr.h in S^3 envs
- }
+}
# support for running test from shadow build directory
wince* {
diff --git a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
index 735c7e4..7bbd32d 100644
--- a/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
+++ b/tests/auto/qfontdatabase/tst_qfontdatabase.cpp
@@ -80,6 +80,10 @@ private slots:
void addAppFont_data();
void addAppFont();
+
+#ifdef Q_WS_MAC
+ void localizedFonts();
+#endif
};
tst_QFontDatabase::tst_QFontDatabase()
@@ -275,5 +279,15 @@ void tst_QFontDatabase::addAppFont()
QVERIFY(db.families() == oldFamilies);
}
+#ifdef Q_WS_MAC
+void tst_QFontDatabase::localizedFonts()
+{
+ QFontDatabase db;
+
+ QVERIFY(db.hasFamily(QString::fromUtf8("ヒラギノ明朝 Pro")));
+ QVERIFY(!db.hasFamily(QString::fromUtf8("NotValidFont")));
+}
+#endif
+
QTEST_MAIN(tst_QFontDatabase)
#include "tst_qfontdatabase.moc"
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 9b834d5..b6a402e 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -306,6 +306,7 @@ private slots:
void inputMethodHints();
void toolTip();
void visible();
+ void isVisibleTo();
void explicitlyVisible();
void enabled();
void explicitlyEnabled();
@@ -1138,6 +1139,113 @@ void tst_QGraphicsItem::visible()
QVERIFY(!item->hasFocus());
}
+void tst_QGraphicsItem::isVisibleTo()
+{
+ QGraphicsScene scene;
+ QGraphicsItem *parent = scene.addRect(QRectF(0, 0, 100, 100));
+ QGraphicsItem *child = scene.addRect(QRectF(25, 25, 50, 50));
+ QGraphicsItem *grandChild = scene.addRect(QRectF(50, 50, 50, 50));
+ QGraphicsItem *stranger = scene.addRect(100, 100, 100, 100);
+
+ child->setParentItem(parent);
+ grandChild->setParentItem(child);
+
+ QVERIFY(grandChild->isVisible());
+ QVERIFY(grandChild->isVisibleTo(grandChild));
+ QVERIFY(grandChild->isVisibleTo(child));
+ QVERIFY(grandChild->isVisibleTo(parent));
+ QVERIFY(grandChild->isVisibleTo(0));
+ QVERIFY(child->isVisible());
+ QVERIFY(child->isVisibleTo(child));
+ QVERIFY(child->isVisibleTo(parent));
+ QVERIFY(child->isVisibleTo(0));
+ QVERIFY(parent->isVisible());
+ QVERIFY(parent->isVisibleTo(parent));
+ QVERIFY(parent->isVisibleTo(0));
+ QVERIFY(!parent->isVisibleTo(child));
+ QVERIFY(!child->isVisibleTo(grandChild));
+ QVERIFY(!grandChild->isVisibleTo(stranger));
+ QVERIFY(!child->isVisibleTo(stranger));
+ QVERIFY(!parent->isVisibleTo(stranger));
+ QVERIFY(!stranger->isVisibleTo(grandChild));
+ QVERIFY(!stranger->isVisibleTo(child));
+ QVERIFY(!stranger->isVisibleTo(parent));
+
+ // Case 1: only parent is explicitly hidden
+ parent->hide();
+
+ QVERIFY(!grandChild->isVisible());
+ QVERIFY(grandChild->isVisibleTo(grandChild));
+ QVERIFY(grandChild->isVisibleTo(child));
+ QVERIFY(grandChild->isVisibleTo(parent));
+ QVERIFY(!grandChild->isVisibleTo(0));
+ QVERIFY(!child->isVisible());
+ QVERIFY(child->isVisibleTo(child));
+ QVERIFY(child->isVisibleTo(parent));
+ QVERIFY(!child->isVisibleTo(0));
+ QVERIFY(!parent->isVisible());
+ QVERIFY(!parent->isVisibleTo(parent));
+ QVERIFY(!parent->isVisibleTo(0));
+ QVERIFY(!parent->isVisibleTo(child));
+ QVERIFY(!child->isVisibleTo(grandChild));
+ QVERIFY(!grandChild->isVisibleTo(stranger));
+ QVERIFY(!child->isVisibleTo(stranger));
+ QVERIFY(!parent->isVisibleTo(stranger));
+ QVERIFY(!stranger->isVisibleTo(grandChild));
+ QVERIFY(!stranger->isVisibleTo(child));
+ QVERIFY(!stranger->isVisibleTo(parent));
+
+ // Case 2: only child is hidden
+ parent->show();
+ child->hide();
+
+ QVERIFY(!grandChild->isVisible());
+ QVERIFY(grandChild->isVisibleTo(grandChild));
+ QVERIFY(grandChild->isVisibleTo(child));
+ QVERIFY(!grandChild->isVisibleTo(parent));
+ QVERIFY(!grandChild->isVisibleTo(0));
+ QVERIFY(!child->isVisible());
+ QVERIFY(!child->isVisibleTo(child));
+ QVERIFY(!child->isVisibleTo(parent));
+ QVERIFY(!child->isVisibleTo(0));
+ QVERIFY(parent->isVisible());
+ QVERIFY(parent->isVisibleTo(parent));
+ QVERIFY(parent->isVisibleTo(0));
+ QVERIFY(!parent->isVisibleTo(child));
+ QVERIFY(!child->isVisibleTo(grandChild));
+ QVERIFY(!grandChild->isVisibleTo(stranger));
+ QVERIFY(!child->isVisibleTo(stranger));
+ QVERIFY(!parent->isVisibleTo(stranger));
+ QVERIFY(!stranger->isVisibleTo(grandChild));
+ QVERIFY(!stranger->isVisibleTo(child));
+ QVERIFY(!stranger->isVisibleTo(parent));
+
+ // Case 3: only grand child is hidden
+ child->show();
+ grandChild->hide();
+
+ QVERIFY(!grandChild->isVisible());
+ QVERIFY(!grandChild->isVisibleTo(grandChild));
+ QVERIFY(!grandChild->isVisibleTo(child));
+ QVERIFY(!grandChild->isVisibleTo(parent));
+ QVERIFY(!grandChild->isVisibleTo(0));
+ QVERIFY(child->isVisible());
+ QVERIFY(child->isVisibleTo(child));
+ QVERIFY(child->isVisibleTo(parent));
+ QVERIFY(child->isVisibleTo(0));
+ QVERIFY(parent->isVisible());
+ QVERIFY(parent->isVisibleTo(parent));
+ QVERIFY(parent->isVisibleTo(0));
+ QVERIFY(!parent->isVisibleTo(child));
+ QVERIFY(!child->isVisibleTo(grandChild));
+ QVERIFY(!grandChild->isVisibleTo(stranger));
+ QVERIFY(!child->isVisibleTo(stranger));
+ QVERIFY(!parent->isVisibleTo(stranger));
+ QVERIFY(!stranger->isVisibleTo(grandChild));
+ QVERIFY(!stranger->isVisibleTo(child));
+ QVERIFY(!stranger->isVisibleTo(parent));
+}
+
void tst_QGraphicsItem::explicitlyVisible()
{
QGraphicsScene scene;
diff --git a/tests/auto/qgroupbox/tst_qgroupbox.cpp b/tests/auto/qgroupbox/tst_qgroupbox.cpp
index f1388bc..f3d26ef 100644
--- a/tests/auto/qgroupbox/tst_qgroupbox.cpp
+++ b/tests/auto/qgroupbox/tst_qgroupbox.cpp
@@ -83,6 +83,7 @@ private slots:
void toggledVsClicked();
void childrenAreDisabled();
void propagateFocus();
+ void task_QTBUG_19170_ignoreMouseReleseEvent();
private:
bool checked;
@@ -473,5 +474,27 @@ void tst_QGroupBox::propagateFocus()
QTRY_COMPARE(qApp->focusWidget(), static_cast<QWidget*>(&lineEdit));
}
+void tst_QGroupBox::task_QTBUG_19170_ignoreMouseReleseEvent()
+{
+ QGroupBox box;
+ box.setCheckable(true);
+ box.setChecked(false);
+ box.setTitle("This is a test for QTBUG-19170");
+ box.show();
+
+ QStyleOptionGroupBox option;
+ option.initFrom(&box);
+ option.subControls = QStyle::SubControls(QStyle::SC_All);
+ QRect rect = box.style()->subControlRect(QStyle::CC_GroupBox, &option,
+ QStyle::SC_GroupBoxCheckBox, &box);
+
+ QTest::mouseClick(&box, Qt::LeftButton, 0, rect.center());
+ QCOMPARE(box.isChecked(), true);
+
+ box.setChecked(false);
+ QTest::mouseRelease(&box, Qt::LeftButton, 0, rect.center());
+ QCOMPARE(box.isChecked(), false);
+}
+
QTEST_MAIN(tst_QGroupBox)
#include "tst_qgroupbox.moc"
diff --git a/tests/auto/qintvalidator/tst_qintvalidator.cpp b/tests/auto/qintvalidator/tst_qintvalidator.cpp
index d537635..7e36093 100644
--- a/tests/auto/qintvalidator/tst_qintvalidator.cpp
+++ b/tests/auto/qintvalidator/tst_qintvalidator.cpp
@@ -168,6 +168,15 @@ void tst_QIntValidator::validate_data()
QTest::newRow("8.9") << -1 << 100 << QString("5") << ACC;
QTest::newRow("8.10") << -1 << 100 << QString("+") << INT;
QTest::newRow("8.11") << -1 << 100 << QString("+50") << ACC;
+
+ QTest::newRow("9.0") << -10 << 10 << QString("000") << ACC;
+ QTest::newRow("9.1") << -10 << 10 << QString("008") << ACC;
+ QTest::newRow("9.2") << -10 << 10 << QString("-008") << ACC;
+ QTest::newRow("9.3") << -10 << 10 << QString("00010") << ACC;
+ QTest::newRow("9.4") << -10 << 10 << QString("-00010") << ACC;
+ QTest::newRow("9.5") << -10 << 10 << QString("00020") << INV;
+ QTest::newRow("9.6") << -10 << 10 << QString("-00020") << INV;
+
}
void tst_QIntValidator::validateArabic()
diff --git a/tests/auto/qlocalsocket/test/test.pro b/tests/auto/qlocalsocket/test/test.pro
index b2755b5..7d85cba 100644
--- a/tests/auto/qlocalsocket/test/test.pro
+++ b/tests/auto/qlocalsocket/test/test.pro
@@ -44,7 +44,7 @@ wince*|symbian {
scriptFiles.path = lackey/scripts
DEPLOYMENT += additionalFiles scriptFiles
QT += script # for easy deployment of QtScript
-
+
requires(contains(QT_CONFIG,script))
}
diff --git a/tests/auto/qmessagebox/tst_qmessagebox.cpp b/tests/auto/qmessagebox/tst_qmessagebox.cpp
index ed085ce..06e242c 100644
--- a/tests/auto/qmessagebox/tst_qmessagebox.cpp
+++ b/tests/auto/qmessagebox/tst_qmessagebox.cpp
@@ -720,7 +720,8 @@ void tst_QMessageBox::detailsButtonText()
QAbstractButton* btn = NULL;
foreach(btn, list) {
if (btn && (btn->inherits("QPushButton"))) {
- if (btn->text() != QMessageBox::tr("OK") && btn->text() != QMessageBox::tr("Show Details...")) {
+ if (btn->text().remove("&") != QMessageBox::tr("OK")
+ && btn->text() != QMessageBox::tr("Show Details...")) {
QFAIL(qPrintable(QString("Unexpected messagebox button text: %1").arg(btn->text())));
}
}
diff --git a/tests/auto/qprogressbar/tst_qprogressbar.cpp b/tests/auto/qprogressbar/tst_qprogressbar.cpp
index 04b7ce7..878cce8 100644
--- a/tests/auto/qprogressbar/tst_qprogressbar.cpp
+++ b/tests/auto/qprogressbar/tst_qprogressbar.cpp
@@ -63,6 +63,7 @@ private slots:
void text();
void format();
void setValueRepaint();
+ void setMinMaxRepaint();
void sizeHint();
void formatedText_data();
void formatedText();
@@ -216,6 +217,44 @@ void tst_QProgressBar::setValueRepaint()
}
}
+void tst_QProgressBar::setMinMaxRepaint()
+{
+ ProgressBar pbar;
+ pbar.setMinimum(0);
+ pbar.setMaximum(10);
+ pbar.setFormat("%v");
+ pbar.show();
+ QTest::qWaitForWindowShown(&pbar);
+
+ QApplication::processEvents();
+
+ // No repaint when setting minimum to the current minimum
+ pbar.repainted = false;
+ pbar.setMinimum(0);
+ QTest::qWait(50);
+ QTRY_VERIFY(!pbar.repainted);
+
+ // No repaint when setting maximum to the current maximum
+ pbar.repainted = false;
+ pbar.setMaximum(10);
+ QTest::qWait(50);
+ QTRY_VERIFY(!pbar.repainted);
+
+ // Repaint when setting minimum
+ for (int i = 9; i >= 0; i--) {
+ pbar.repainted = false;
+ pbar.setMinimum(i);
+ QTRY_VERIFY(pbar.repainted);
+ }
+
+ // Repaint when setting maximum
+ for (int i = 0; i < 10; ++i) {
+ pbar.repainted = false;
+ pbar.setMaximum(i);
+ QTRY_VERIFY(pbar.repainted);
+ }
+}
+
void tst_QProgressBar::sizeHint()
{
ProgressBar bar;
diff --git a/tests/auto/qsqldatabase/tst_databases.h b/tests/auto/qsqldatabase/tst_databases.h
index 497f5a4..95ead61 100644
--- a/tests/auto/qsqldatabase/tst_databases.h
+++ b/tests/auto/qsqldatabase/tst_databases.h
@@ -246,7 +246,8 @@ public:
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3308, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 4.1.1
// addDb( "QMYSQL3", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 3309, "CLIENT_COMPRESS=1;CLIENT_SSL=1" ); // MySQL 5.0.18 Linux
// addDb( "QMYSQL3", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // MySQL 5.1.36 Windows
-// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "mysql4-nokia.trolltech.com.au" ); // MySQL 4.1.22-2.el4 linux
+
+// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql41.apac.nokia.com" ); // MySQL 4.1.22-2.el4 linux
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql50.apac.nokia.com" ); // MySQL 5.0.45-7.el5 linux
// addDb( "QMYSQL3", "testdb", "testuser", "Ee4Gabf6_", "bq-mysql51.apac.nokia.com" ); // MySQL 5.1.36-6.7.2.i586 linux
@@ -256,13 +257,15 @@ public:
// addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5436 ); // V7.4
// addDb( "QPSQL7", "testdb", "troll", "trond", "horsehead.nokia.troll.no", 5437 ); // V8.0.3
// addDb( "QPSQL7", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // V8.2.1, UTF-8
-// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "postgres74-nokia.trolltech.com.au" ); // Version 7.4.19-1.el4_6.1
+
+// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-postgres74.apac.nokia.com" ); // Version 7.4.19-1.el4_6.1
// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql81.apac.nokia.com" ); // Version 8.1.11-1.el5_1.1
// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql84.apac.nokia.com" ); // Version 8.4.1-2.1.i586
// addDb( "QPSQL7", "testdb", "testuser", "Ee4Gabf6_", "bq-pgsql90.apac.nokia.com" ); // Version 9.0.0
// addDb( "QDB2", "testdb", "troll", "trond", "silence.nokia.troll.no" ); // DB2 v9.1 on silence
+// addDb( "QDB2", "testdb", "testuser", "Ee4Gabf6_", "bq-db2-972.apac.nokia.com" ); // DB2
// yes - interbase really wants the physical path on the host machine.
// addDb( "QIBASE", "/opt/interbase/qttest.gdb", "SYSDBA", "masterkey", "horsehead.nokia.troll.no" );
@@ -271,6 +274,9 @@ public:
// addDb( "QIBASE", "/opt/firebird/databases/testdb.fdb", "testuser", "Ee4Gabf6_", "firebird1-nokia.trolltech.com.au" ); // Firebird 1.5.5
// addDb( "QIBASE", "/opt/firebird/databases/testdb.fdb", "testuser", "Ee4Gabf6_", "firebird2-nokia.trolltech.com.au" ); // Firebird 2.1.1
+// addDb( "QIBASE", "/opt/firebird/databases/testdb.fdb", "testuser", "Ee4Gabf6_", "bq-firebird1.apac.nokia.com" ); // Firebird 1.5.5
+// addDb( "QIBASE", "/opt/firebird/databases/testdb.fdb", "testuser", "Ee4Gabf6_", "bq-firebird2.apac.nokia.com" ); // Firebird 2.1.1
+
// use in-memory database to prevent local files
// addDb("QSQLITE", ":memory:");
addDb( "QSQLITE", QDir::toNativeSeparators(QDir::tempPath()+"/foo.db") );
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp
index facb982..c37a4ea 100644
--- a/tests/auto/qtreeview/tst_qtreeview.cpp
+++ b/tests/auto/qtreeview/tst_qtreeview.cpp
@@ -45,6 +45,7 @@
#include <QtTest/QtTest>
#include <QtGui/QtGui>
+#include <private/qabstractitemview_p.h>
#include "../../shared/util.h"
//TESTED_CLASS=
@@ -112,6 +113,8 @@ struct PublicView : public QTreeView
inline QStyleOptionViewItem viewOptions() const { return QTreeView::viewOptions(); }
inline int sizeHintForColumn(int column) const { return QTreeView::sizeHintForColumn(column); }
+ inline void startDrag(Qt::DropActions supportedActions) { QTreeView::startDrag(supportedActions); }
+ QAbstractItemViewPrivate* aiv_priv() { return static_cast<QAbstractItemViewPrivate*>(d_ptr.data()); }
};
class tst_QTreeView : public QObject
@@ -2947,7 +2950,7 @@ void tst_QTreeView::styleOptionViewItem()
bool allCollapsed;
};
- QTreeView view;
+ PublicView view;
QStandardItemModel model;
view.setModel(&model);
MyDelegate delegate;
@@ -3006,6 +3009,12 @@ void tst_QTreeView::styleOptionViewItem()
QApplication::processEvents();
QTRY_VERIFY(delegate.count >= 4);
+ // test that the rendering of drag pixmap sets the correct options too (QTBUG-15834)
+ delegate.count = 0;
+ QItemSelection sel(model.index(0,0), model.index(0,3));
+ QRect rect;
+ view.aiv_priv()->renderToPixmap(sel.indexes(), &rect);
+ QTRY_VERIFY(delegate.count >= 4);
//test dynamic models
{
diff --git a/tests/benchmarks/corelib/tools/qstring/main.cpp b/tests/benchmarks/corelib/tools/qstring/main.cpp
index 5b5f0f7..daefe12 100644
--- a/tests/benchmarks/corelib/tools/qstring/main.cpp
+++ b/tests/benchmarks/corelib/tools/qstring/main.cpp
@@ -784,7 +784,7 @@ void tst_QString::equals2_data() const
static void __attribute__((noinline)) equals2_selftest()
{
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
const long pagesize = sysconf(_SC_PAGESIZE);
void *page1, *page3;
ushort *page2;
@@ -1341,7 +1341,7 @@ void tst_QString::ucstrncmp() const
};
static const int functionCount = sizeof func / sizeof func[0];
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_SYMBIAN)
const long pagesize = sysconf(_SC_PAGESIZE);
void *page1, *page3;
ushort *page2;