diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-22 07:24:57 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2016-03-22 07:28:42 +0100 |
commit | a02863234d76abb6c9f289026ae4ea3145924f30 (patch) | |
tree | aef6381d0000a78ba69ac80eb03739b1c8ca5fc3 /src/testlib | |
parent | e77b13621f0057374d83a2b884f03dd2e5b7b88c (diff) | |
parent | e4d79e1fdeb6b26ba0b12b578daacf7cd672b960 (diff) |
Merge remote-tracking branch 'origin/5.7' into dev
Conflicts:
configure
mkspecs/common/wince/qplatformdefs.h
src/plugins/platforms/directfb/qdirectfbbackingstore.cpp
src/plugins/platforms/xcb/qxcbbackingstore.cpp
Change-Id: Ied4d31264a9afca9514b51a7eb1494c28712793c
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/Qt5TestConfigExtras.cmake.in | 5 | ||||
-rw-r--r-- | src/testlib/qtest_gui.h | 6 | ||||
-rw-r--r-- | src/testlib/qtestspontaneevent.h | 11 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/testlib/Qt5TestConfigExtras.cmake.in b/src/testlib/Qt5TestConfigExtras.cmake.in new file mode 100644 index 0000000000..2a575958ae --- /dev/null +++ b/src/testlib/Qt5TestConfigExtras.cmake.in @@ -0,0 +1,5 @@ + +set_property(TARGET Qt5::Test + APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS QT_TESTCASE_BUILDDIR=\\\"\${CMAKE_BINARY_DIR}\\\" +) diff --git a/src/testlib/qtest_gui.h b/src/testlib/qtest_gui.h index fd09c1202f..2faf37f32b 100644 --- a/src/testlib/qtest_gui.h +++ b/src/testlib/qtest_gui.h @@ -55,6 +55,7 @@ #include <QtTest/qtesttouch.h> #include <QtTest/qtestkeyboard.h> +#include <QtGui/qcolor.h> #include <QtGui/qpixmap.h> #include <QtGui/qimage.h> @@ -73,6 +74,11 @@ QT_BEGIN_NAMESPACE namespace QTest { +template<> inline char *toString(const QColor &color) +{ + return qstrdup(color.name().toLocal8Bit().constData()); +} + inline bool qCompare(QIcon const &t1, QIcon const &t2, const char *actual, const char *expected, const char *file, int line) { diff --git a/src/testlib/qtestspontaneevent.h b/src/testlib/qtestspontaneevent.h index f8982325ec..ae10fabd31 100644 --- a/src/testlib/qtestspontaneevent.h +++ b/src/testlib/qtestspontaneevent.h @@ -82,17 +82,10 @@ public: } #endif + // ### Qt 6: remove everything except this function: static inline void setSpontaneous(QEvent *ev) { - // use a union instead of a reinterpret_cast to prevent alignment warnings - union - { - QSpontaneKeyEvent *skePtr; - QEvent *evPtr; - } helper; - - helper.evPtr = ev; - helper.skePtr->setSpontaneous(); + ev->setSpontaneous(); } protected: |