summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-18 12:54:15 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-18 12:56:26 (GMT)
commita250ca3a3c0b777f274388b9e57a985d7438f8ff (patch)
treed1982717becf41fa1ed5abbed7c0472506152740 /src
parent5f2f444a9d8d80d778053c2af66534d582145055 (diff)
downloadQt-a250ca3a3c0b777f274388b9e57a985d7438f8ff.zip
Qt-a250ca3a3c0b777f274388b9e57a985d7438f8ff.tar.gz
Qt-a250ca3a3c0b777f274388b9e57a985d7438f8ff.tar.bz2
Make TestLib compatible with mingw when gui is not used
The problem is that headers in QTestLib define functions for mouse and key events. Those are causing link errors on all autotests that do "QT -= gui" with mingw (only debug seems to be affected). Reviewed-by: jasplin
Diffstat (limited to 'src')
-rw-r--r--src/testlib/qtestevent.h5
-rw-r--r--src/testlib/qtestkeyboard.h2
-rw-r--r--src/testlib/qtestmouse.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/testlib/qtestevent.h b/src/testlib/qtestevent.h
index a8376ee..dfbba33 100644
--- a/src/testlib/qtestevent.h
+++ b/src/testlib/qtestevent.h
@@ -71,6 +71,7 @@ public:
virtual ~QTestEvent() {}
};
+#ifdef QT_GUI_LIB
class QTestKeyEvent: public QTestEvent
{
public:
@@ -135,6 +136,8 @@ private:
QPoint _pos;
int _delay;
};
+#endif //QT_GUI_LIB
+
class QTestDelayEvent: public QTestEvent
{
@@ -159,6 +162,7 @@ public:
inline void clear()
{ qDeleteAll(*this); QList<QTestEvent *>::clear(); }
+#ifdef QT_GUI_LIB
inline void addKeyClick(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
{ addKeyEvent(QTest::Click, qtKey, modifiers, msecs); }
inline void addKeyPress(Qt::Key qtKey, Qt::KeyboardModifiers modifiers = Qt::NoModifier, int msecs = -1)
@@ -194,6 +198,7 @@ public:
{ append(new QTestMouseEvent(QTest::MouseDClick, button, stateKey, pos, delay)); }
inline void addMouseMove(QPoint pos = QPoint(), int delay=-1)
{ append(new QTestMouseEvent(QTest::MouseMove, Qt::NoButton, 0, pos, delay)); }
+#endif //QT_GUI_LIB
inline void addDelay(int msecs)
{ append(new QTestDelayEvent(msecs)); }
diff --git a/src/testlib/qtestkeyboard.h b/src/testlib/qtestkeyboard.h
index 2e475b2..af81075 100644
--- a/src/testlib/qtestkeyboard.h
+++ b/src/testlib/qtestkeyboard.h
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#ifndef QTESTKEYBOARD_H
+#if !defined(QTESTKEYBOARD_H) && defined(QT_GUI_LIB)
#define QTESTKEYBOARD_H
#if 0
diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h
index 2825c58..7ea927c 100644
--- a/src/testlib/qtestmouse.h
+++ b/src/testlib/qtestmouse.h
@@ -39,7 +39,7 @@
**
****************************************************************************/
-#ifndef QTESTMOUSE_H
+#if !defined(QTESTMOUSE_H) && defined(QT_GUI_LIB)
#define QTESTMOUSE_H
#if 0