From f8b043f1d73906be593232cf02aa06e576ae4e27 Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Sun, 6 Sep 2009 07:46:20 +1000 Subject: Fixed "multiple definition of `QTest::mouseActionNames'" error in projects where two separate compilation units include `qtestmouse.h'. --- src/testlib/qtestmouse.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/testlib/qtestmouse.h b/src/testlib/qtestmouse.h index bfa5c25..8b06a29 100644 --- a/src/testlib/qtestmouse.h +++ b/src/testlib/qtestmouse.h @@ -67,7 +67,6 @@ QT_MODULE(Test) namespace QTest { enum MouseAction { MousePress, MouseRelease, MouseClick, MouseDClick, MouseMove }; - const char *mouseActionNames[] = { "MousePress", "MouseRelease", "MouseClick", "MouseDClick", "MouseMove" }; static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1) @@ -115,6 +114,8 @@ namespace QTest } QSpontaneKeyEvent::setSpontaneous(&me); if (!qApp->notify(widget, &me)) { + static const char *mouseActionNames[] = + { "MousePress", "MouseRelease", "MouseClick", "MouseDClick", "MouseMove" }; QString warning = QString::fromLatin1("Mouse event \"%1\" not accepted by receiving widget"); QTest::qWarn(warning.arg(mouseActionNames[static_cast(action)]).toAscii().data()); } -- cgit v0.12