summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-10-08 10:56:25 +0200
committerLiang Qi <liang.qi@qt.io>2018-10-08 10:56:25 +0200
commit7344987c20d13710af89300f9b39e06397ec592a (patch)
tree4c12e46adefd3aee9d2ce479923fe56bab483764 /tests/auto
parent8ad5967793f43bda2c38e3f9dddd3d2b6fef5390 (diff)
parent29208fa07c1b9f656ea2535696828385b7832226 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: src/widgets/styles/qstylesheetstyle.cpp Change-Id: I3a503b44ae413fbc0a90f4af70b8f84daffd86ad
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp10
-rw-r--r--tests/auto/opengl/qgl/BLACKLIST2
-rw-r--r--tests/auto/tools/uic/baseline/buttongroup.ui.h20
-rw-r--r--tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h14
-rw-r--r--tests/auto/tools/uic/baseline/qtgradienteditor.ui.h30
-rw-r--r--tests/auto/tools/uic/baseline/validators.ui.h14
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp36
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/images/testimage.pngbin299 -> 300 bytes
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/images/testimage@2x.pngbin0 -> 318 bytes
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/resources.qrc1
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp33
11 files changed, 120 insertions, 40 deletions
diff --git a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp
index e83738661e..38607f1378 100644
--- a/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp
+++ b/tests/auto/corelib/itemmodels/qsortfilterproxymodel_regexp/tst_qsortfilterproxymodel_regexp.cpp
@@ -37,6 +37,7 @@ public:
tst_QSortFilterProxyModelRegExp();
private slots:
void tst_invalid();
+ void tst_caseSensitivity();
};
tst_QSortFilterProxyModelRegExp::tst_QSortFilterProxyModelRegExp() :
@@ -55,5 +56,14 @@ void tst_QSortFilterProxyModelRegExp::tst_invalid()
QCOMPARE(model.filterRegExp(), QRegExp());
}
+void tst_QSortFilterProxyModelRegExp::tst_caseSensitivity()
+{
+ const QLatin1String pattern("test");
+ QSortFilterProxyModel model;
+ model.setFilterCaseSensitivity(Qt::CaseInsensitive);
+ model.setFilterRegExp(pattern);
+ QCOMPARE(model.filterCaseSensitivity(), Qt::CaseInsensitive);
+}
+
QTEST_MAIN(tst_QSortFilterProxyModelRegExp)
#include "tst_qsortfilterproxymodel_regexp.moc"
diff --git a/tests/auto/opengl/qgl/BLACKLIST b/tests/auto/opengl/qgl/BLACKLIST
index 1eb0197484..d3165a51e5 100644
--- a/tests/auto/opengl/qgl/BLACKLIST
+++ b/tests/auto/opengl/qgl/BLACKLIST
@@ -19,7 +19,7 @@ winrt
[graphicsViewClipping]
windows
winrt
-rhel-7.4 ci
+linux ci
[glFBOUseInGLWidget]
windows
winrt
diff --git a/tests/auto/tools/uic/baseline/buttongroup.ui.h b/tests/auto/tools/uic/baseline/buttongroup.ui.h
index ddc3995d4b..87814dcba1 100644
--- a/tests/auto/tools/uic/baseline/buttongroup.ui.h
+++ b/tests/auto/tools/uic/baseline/buttongroup.ui.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'buttongroup.ui'
**
-** Created by: Qt User Interface Compiler version 5.10.1
+** Created by: Qt User Interface Compiler version 5.12.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -129,9 +129,9 @@ public:
sizePolicy3.setHeightForWidth(periodSpinBox->sizePolicy().hasHeightForWidth());
periodSpinBox->setSizePolicy(sizePolicy3);
periodSpinBox->setMinimumSize(QSize(0, 30));
- periodSpinBox->setMinimum(-1);
- periodSpinBox->setSingleStep(0.1);
- periodSpinBox->setValue(-1);
+ periodSpinBox->setMinimum(-1.000000000000000);
+ periodSpinBox->setSingleStep(0.100000000000000);
+ periodSpinBox->setValue(-1.000000000000000);
formLayout->setWidget(0, QFormLayout::FieldRole, periodSpinBox);
@@ -139,9 +139,9 @@ public:
amplitudeSpinBox->setObjectName(QString::fromUtf8("amplitudeSpinBox"));
amplitudeSpinBox->setEnabled(false);
amplitudeSpinBox->setMinimumSize(QSize(0, 30));
- amplitudeSpinBox->setMinimum(-1);
- amplitudeSpinBox->setSingleStep(0.1);
- amplitudeSpinBox->setValue(-1);
+ amplitudeSpinBox->setMinimum(-1.000000000000000);
+ amplitudeSpinBox->setSingleStep(0.100000000000000);
+ amplitudeSpinBox->setValue(-1.000000000000000);
formLayout->setWidget(2, QFormLayout::FieldRole, amplitudeSpinBox);
@@ -155,9 +155,9 @@ public:
overshootSpinBox->setObjectName(QString::fromUtf8("overshootSpinBox"));
overshootSpinBox->setEnabled(false);
overshootSpinBox->setMinimumSize(QSize(0, 30));
- overshootSpinBox->setMinimum(-1);
- overshootSpinBox->setSingleStep(0.1);
- overshootSpinBox->setValue(-1);
+ overshootSpinBox->setMinimum(-1.000000000000000);
+ overshootSpinBox->setSingleStep(0.100000000000000);
+ overshootSpinBox->setValue(-1.000000000000000);
formLayout->setWidget(4, QFormLayout::FieldRole, overshootSpinBox);
diff --git a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h
index e914c664d3..a5379bc468 100644
--- a/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h
+++ b/tests/auto/tools/uic/baseline/qpagesetupwidget.ui.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'qpagesetupwidget.ui'
**
-** Created by: Qt User Interface Compiler version 5.9.0
+** Created by: Qt User Interface Compiler version 5.12.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -104,7 +104,7 @@ public:
horizontalLayout_3->setObjectName(QString::fromUtf8("horizontalLayout_3"));
pageWidth = new QDoubleSpinBox(groupBox_2);
pageWidth->setObjectName(QString::fromUtf8("pageWidth"));
- pageWidth->setMaximum(9999.99);
+ pageWidth->setMaximum(9999.989999999999782);
horizontalLayout_3->addWidget(pageWidth);
@@ -115,7 +115,7 @@ public:
pageHeight = new QDoubleSpinBox(groupBox_2);
pageHeight->setObjectName(QString::fromUtf8("pageHeight"));
- pageHeight->setMaximum(9999.99);
+ pageHeight->setMaximum(9999.989999999999782);
horizontalLayout_3->addWidget(pageHeight);
@@ -199,7 +199,7 @@ public:
topMargin = new QDoubleSpinBox(groupBox);
topMargin->setObjectName(QString::fromUtf8("topMargin"));
topMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
- topMargin->setMaximum(999.99);
+ topMargin->setMaximum(999.990000000000009);
gridLayout->addWidget(topMargin, 0, 1, 1, 1);
@@ -212,7 +212,7 @@ public:
leftMargin = new QDoubleSpinBox(groupBox);
leftMargin->setObjectName(QString::fromUtf8("leftMargin"));
leftMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
- leftMargin->setMaximum(999.99);
+ leftMargin->setMaximum(999.990000000000009);
horizontalLayout->addWidget(leftMargin);
@@ -223,7 +223,7 @@ public:
rightMargin = new QDoubleSpinBox(groupBox);
rightMargin->setObjectName(QString::fromUtf8("rightMargin"));
rightMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
- rightMargin->setMaximum(999.99);
+ rightMargin->setMaximum(999.990000000000009);
horizontalLayout->addWidget(rightMargin);
@@ -241,7 +241,7 @@ public:
bottomMargin = new QDoubleSpinBox(groupBox);
bottomMargin->setObjectName(QString::fromUtf8("bottomMargin"));
bottomMargin->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
- bottomMargin->setMaximum(999.99);
+ bottomMargin->setMaximum(999.990000000000009);
gridLayout->addWidget(bottomMargin, 2, 1, 1, 1);
diff --git a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
index 21dc9551d0..9db07f35ac 100644
--- a/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
+++ b/tests/auto/tools/uic/baseline/qtgradienteditor.ui.h
@@ -31,7 +31,7 @@
/********************************************************************************
** Form generated from reading UI file 'qtgradienteditor.ui'
**
-** Created by: Qt User Interface Compiler version 5.0.0
+** Created by: Qt User Interface Compiler version 5.12.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -176,8 +176,8 @@ public:
spinBox1->setGeometry(QRect(279, 69, 73, 23));
spinBox1->setKeyboardTracking(false);
spinBox1->setDecimals(3);
- spinBox1->setMaximum(1);
- spinBox1->setSingleStep(0.01);
+ spinBox1->setMaximum(1.000000000000000);
+ spinBox1->setSingleStep(0.010000000000000);
label2 = new QLabel(QtGradientEditor);
label2->setObjectName(QString::fromUtf8("label2"));
label2->setGeometry(QRect(209, 99, 64, 23));
@@ -186,8 +186,8 @@ public:
spinBox2->setGeometry(QRect(279, 99, 73, 23));
spinBox2->setKeyboardTracking(false);
spinBox2->setDecimals(3);
- spinBox2->setMaximum(1);
- spinBox2->setSingleStep(0.01);
+ spinBox2->setMaximum(1.000000000000000);
+ spinBox2->setSingleStep(0.010000000000000);
label3 = new QLabel(QtGradientEditor);
label3->setObjectName(QString::fromUtf8("label3"));
label3->setGeometry(QRect(209, 129, 64, 23));
@@ -196,8 +196,8 @@ public:
spinBox3->setGeometry(QRect(279, 129, 73, 23));
spinBox3->setKeyboardTracking(false);
spinBox3->setDecimals(3);
- spinBox3->setMaximum(1);
- spinBox3->setSingleStep(0.01);
+ spinBox3->setMaximum(1.000000000000000);
+ spinBox3->setSingleStep(0.010000000000000);
label4 = new QLabel(QtGradientEditor);
label4->setObjectName(QString::fromUtf8("label4"));
label4->setGeometry(QRect(209, 159, 64, 23));
@@ -206,8 +206,8 @@ public:
spinBox4->setGeometry(QRect(279, 159, 73, 23));
spinBox4->setKeyboardTracking(false);
spinBox4->setDecimals(3);
- spinBox4->setMaximum(1);
- spinBox4->setSingleStep(0.01);
+ spinBox4->setMaximum(1.000000000000000);
+ spinBox4->setSingleStep(0.010000000000000);
label5 = new QLabel(QtGradientEditor);
label5->setObjectName(QString::fromUtf8("label5"));
label5->setGeometry(QRect(209, 189, 64, 23));
@@ -216,8 +216,8 @@ public:
spinBox5->setGeometry(QRect(279, 189, 73, 23));
spinBox5->setKeyboardTracking(false);
spinBox5->setDecimals(3);
- spinBox5->setMaximum(1);
- spinBox5->setSingleStep(0.01);
+ spinBox5->setMaximum(1.000000000000000);
+ spinBox5->setSingleStep(0.010000000000000);
gradientStopsWidget = new QtGradientStopsWidget(QtGradientEditor);
gradientStopsWidget->setObjectName(QString::fromUtf8("gradientStopsWidget"));
gradientStopsWidget->setGeometry(QRect(10, 225, 193, 67));
@@ -390,10 +390,10 @@ public:
positionSpinBox->setObjectName(QString::fromUtf8("positionSpinBox"));
positionSpinBox->setKeyboardTracking(false);
positionSpinBox->setDecimals(3);
- positionSpinBox->setMinimum(0);
- positionSpinBox->setMaximum(1);
- positionSpinBox->setSingleStep(0.01);
- positionSpinBox->setValue(0);
+ positionSpinBox->setMinimum(0.000000000000000);
+ positionSpinBox->setMaximum(1.000000000000000);
+ positionSpinBox->setSingleStep(0.010000000000000);
+ positionSpinBox->setValue(0.000000000000000);
vboxLayout1->addWidget(positionSpinBox);
diff --git a/tests/auto/tools/uic/baseline/validators.ui.h b/tests/auto/tools/uic/baseline/validators.ui.h
index 0595cf2037..d0ae777f65 100644
--- a/tests/auto/tools/uic/baseline/validators.ui.h
+++ b/tests/auto/tools/uic/baseline/validators.ui.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'validators.ui'
**
-** Created by: Qt User Interface Compiler version 5.10.0
+** Created by: Qt User Interface Compiler version 5.12.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
@@ -252,9 +252,9 @@ public:
doubleMinVal->setObjectName(QString::fromUtf8("doubleMinVal"));
sizePolicy.setHeightForWidth(doubleMinVal->sizePolicy().hasHeightForWidth());
doubleMinVal->setSizePolicy(sizePolicy);
- doubleMinVal->setMinimum(-100000);
- doubleMinVal->setMaximum(100000);
- doubleMinVal->setValue(0);
+ doubleMinVal->setMinimum(-100000.000000000000000);
+ doubleMinVal->setMaximum(100000.000000000000000);
+ doubleMinVal->setValue(0.000000000000000);
gridLayout1->addWidget(doubleMinVal, 0, 1, 1, 1);
@@ -281,9 +281,9 @@ public:
doubleMaxVal->setObjectName(QString::fromUtf8("doubleMaxVal"));
sizePolicy.setHeightForWidth(doubleMaxVal->sizePolicy().hasHeightForWidth());
doubleMaxVal->setSizePolicy(sizePolicy);
- doubleMaxVal->setMinimum(-100000);
- doubleMaxVal->setMaximum(100000);
- doubleMaxVal->setValue(1000);
+ doubleMaxVal->setMinimum(-100000.000000000000000);
+ doubleMaxVal->setMaximum(100000.000000000000000);
+ doubleMaxVal->setValue(1000.000000000000000);
gridLayout1->addWidget(doubleMaxVal, 1, 1, 1, 1);
diff --git a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
index c8ee2d65a3..838b1f4be6 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
@@ -254,6 +254,7 @@ private slots:
void zeroScale();
void focusItemChangedSignal();
void minimumRenderSize();
+ void focusOnTouch();
// task specific tests below me
void task139710_bspTreeCrash();
@@ -4758,6 +4759,41 @@ void tst_QGraphicsScene::minimumRenderSize()
QVERIFY(smallChild->repaints > smallerGrandChild->repaints);
}
+void tst_QGraphicsScene::focusOnTouch()
+{
+ QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ scene.setSceneRect(0, 0, 100, 100);
+ QGraphicsRectItem *rect = scene.addRect(0, 0, 100, 100);
+ rect->setFlag(QGraphicsItem::ItemIsFocusable, true);
+
+ view.show();
+ QApplication::setActiveWindow(&view);
+ QVERIFY(QTest::qWaitForWindowActive(&view));
+
+ QVERIFY(!rect->hasFocus());
+
+ scene.setFocusOnTouch(false);
+
+ QTouchDevice device;
+ device.setType(QTouchDevice::TouchPad);
+ QList<QTouchEvent::TouchPoint> touchPoints;
+ QTouchEvent::TouchPoint point;
+ point.setScenePos(QPointF(10, 10));
+ point.setState(Qt::TouchPointPressed);
+ touchPoints.append(point);
+ QTouchEvent event(QEvent::TouchBegin, &device, Qt::NoModifier, Qt::TouchPointStates(),
+ touchPoints);
+
+ QApplication::sendEvent(&scene, &event);
+
+ QVERIFY(!rect->hasFocus());
+ scene.setFocusOnTouch(true);
+
+ QApplication::sendEvent(&scene, &event);
+ QVERIFY(rect->hasFocus());
+}
+
void tst_QGraphicsScene::taskQTBUG_15977_renderWithDeviceCoordinateCache()
{
QGraphicsScene scene;
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/images/testimage.png b/tests/auto/widgets/styles/qstylesheetstyle/images/testimage.png
index 06fb34f0d6..a4adc7a47f 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/images/testimage.png
+++ b/tests/auto/widgets/styles/qstylesheetstyle/images/testimage.png
Binary files differ
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/images/testimage@2x.png b/tests/auto/widgets/styles/qstylesheetstyle/images/testimage@2x.png
new file mode 100644
index 0000000000..d55f0c507b
--- /dev/null
+++ b/tests/auto/widgets/styles/qstylesheetstyle/images/testimage@2x.png
Binary files differ
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/resources.qrc b/tests/auto/widgets/styles/qstylesheetstyle/resources.qrc
index 248bf80f50..f523070073 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/resources.qrc
+++ b/tests/auto/widgets/styles/qstylesheetstyle/resources.qrc
@@ -2,5 +2,6 @@
<RCC version="1.0">
<qresource>
<file>images/testimage.png</file>
+ <file>images/testimage@2x.png</file>
</qresource>
</RCC> \ No newline at end of file
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 43aec651fe..f5d9433f70 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -33,6 +33,7 @@
#include <QMetaObject>
#include <private/qstylesheetstyle_p.h>
+#include <private/qhighdpiscaling_p.h>
#include <QtTest/private/qtesthelpers_p.h>
using namespace QTestPrivate;
@@ -101,6 +102,9 @@ private slots:
void styleSheetTargetAttribute();
void unpolish();
+ void highdpiImages_data();
+ void highdpiImages();
+
private:
QColor COLOR(const QWidget& w) {
w.ensurePolished();
@@ -2066,6 +2070,35 @@ void tst_QStyleSheetStyle::unpolish()
QCOMPARE(w.minimumWidth(), 0);
}
+void tst_QStyleSheetStyle::highdpiImages_data()
+{
+ QTest::addColumn<qreal>("screenFactor");
+ QTest::addColumn<QColor>("color");
+
+ QTest::newRow("highdpi") << 2.0 << QColor(0x00, 0xFF, 0x00);
+ QTest::newRow("lowdpi") << 1.0 << QColor(0xFF, 0x00, 0x00);
+}
+
+void tst_QStyleSheetStyle::highdpiImages()
+{
+ QFETCH(qreal, screenFactor);
+ QFETCH(QColor, color);
+
+ QWidget w;
+ QScreen *screen = QGuiApplication::screenAt(w.pos());
+ QHighDpiScaling::setScreenFactor(screen, screenFactor);
+ w.setStyleSheet("QWidget { background-image: url(\":/images/testimage.png\"); }");
+ w.show();
+
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
+ QImage image(w.size(), QImage::Format_ARGB32);
+ w.render(&image);
+ QVERIFY(testForColors(image, color));
+
+ QHighDpiScaling::setScreenFactor(screen, 1.0);
+ QHighDpiScaling::updateHighDpiScaling(); // reset to normal
+}
+
QTEST_MAIN(tst_QStyleSheetStyle)
#include "tst_qstylesheetstyle.moc"