summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/itemviews
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-06-14 11:56:56 +0200
committerLiang Qi <liang.qi@qt.io>2019-06-14 13:45:18 +0200
commitb1a216649ec064412160638dd00195cd47c567aa (patch)
treea4134415a3849cfb857942e698514be9da18924f /tests/auto/widgets/itemviews
parent2e20ae3c1b57169497f6f3904623be4f5e617e12 (diff)
parent1632786f00875d23c7d111cbb29dedaa35c1c8c2 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
Diffstat (limited to 'tests/auto/widgets/itemviews')
-rw-r--r--tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
index 7fd1822295..dc246c0ebf 100644
--- a/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
+++ b/tests/auto/widgets/itemviews/qitemdelegate/tst_qitemdelegate.cpp
@@ -26,6 +26,7 @@
**
****************************************************************************/
+#include "../../../shared/highdpi.h"
#include <QtTest/QtTest>
@@ -51,6 +52,8 @@
#include <QPlainTextEdit>
#include <QDialog>
+#include <qscreen.h>
+
#include <QtWidgets/private/qabstractitemdelegate_p.h>
Q_DECLARE_METATYPE(QAbstractItemDelegate::EndEditHint)
@@ -223,8 +226,8 @@ private slots:
void dateTextForRole_data();
void dateTextForRole();
-#ifdef QT_BUILD_INTERNAL
private:
+#ifdef QT_BUILD_INTERNAL
struct RoleDelegate : public QItemDelegate
{
QString textForRole(Qt::ItemDataRole role, const QVariant &value, const QLocale &locale)
@@ -234,6 +237,8 @@ private:
}
};
#endif
+
+ const int m_fuzz = int(QGuiApplication::primaryScreen()->devicePixelRatio());
};
@@ -286,8 +291,8 @@ void tst_QItemDelegate::textRectangle()
QFont font;
TestItemDelegate delegate;
QRect result = delegate.textRectangle(0, rect, font, text);
-
- QCOMPARE(result, expected);
+ QVERIFY2(HighDpi::fuzzyCompare(result, expected, m_fuzz),
+ HighDpi::msgRectMismatch(result, expected).constData());
}
void tst_QItemDelegate::sizeHint_data()