diff options
author | Mailson Menezes <mailson.menezes@openbossa.org> | 2012-03-07 18:31:57 -0300 |
---|---|---|
committer | Anselmo L. S. Melo <anselmo.melo@openbossa.org> | 2012-03-15 02:08:35 +0100 |
commit | f4b432196c8f06cde25fca1aab6fd14a868ff2dc (patch) | |
tree | e5c77504f20899afb9642e3b54e72e88b20de82a /tests | |
parent | 4b6997cd55a070f405580a8d22b3a249e8637587 (diff) |
Rename QAction to UiAction and move it to utils
Change-Id: I69f04c3316e47bd58dc494d2e4c77bcd15b5117c
Reviewed-by: Anselmo L. S. Melo <anselmo.melo@openbossa.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/action/action.pro | 3 | ||||
-rw-r--r-- | tests/auto/action/qaction/.gitignore | 1 | ||||
-rw-r--r-- | tests/auto/auto.pro | 3 | ||||
-rw-r--r-- | tests/auto/utils/uiaction/.gitignore | 1 | ||||
-rw-r--r-- | tests/auto/utils/uiaction/tst_uiaction.cpp (renamed from tests/auto/action/qaction/tst_qaction.cpp) | 68 | ||||
-rw-r--r-- | tests/auto/utils/uiaction/uiaction.pro (renamed from tests/auto/action/qaction/qaction.pro) | 4 | ||||
-rw-r--r-- | tests/auto/utils/utils.pro | 3 |
7 files changed, 41 insertions, 42 deletions
diff --git a/tests/auto/action/action.pro b/tests/auto/action/action.pro deleted file mode 100644 index 40ad710..0000000 --- a/tests/auto/action/action.pro +++ /dev/null @@ -1,3 +0,0 @@ -TEMPLATE=subdirs -SUBDIRS=\ - qaction \ diff --git a/tests/auto/action/qaction/.gitignore b/tests/auto/action/qaction/.gitignore deleted file mode 100644 index bf81f5b..0000000 --- a/tests/auto/action/qaction/.gitignore +++ /dev/null @@ -1 +0,0 @@ -tst_qaction diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro index 2865d2a..6d6a9ad 100644 --- a/tests/auto/auto.pro +++ b/tests/auto/auto.pro @@ -2,5 +2,4 @@ TEMPLATE = subdirs SUBDIRS += \ utils \ - models \ - action + models diff --git a/tests/auto/utils/uiaction/.gitignore b/tests/auto/utils/uiaction/.gitignore new file mode 100644 index 0000000..ee29bcc --- /dev/null +++ b/tests/auto/utils/uiaction/.gitignore @@ -0,0 +1 @@ +tst_uiaction diff --git a/tests/auto/action/qaction/tst_qaction.cpp b/tests/auto/utils/uiaction/tst_uiaction.cpp index 51123af..2fa7adc 100644 --- a/tests/auto/action/qaction/tst_qaction.cpp +++ b/tests/auto/utils/uiaction/tst_uiaction.cpp @@ -41,6 +41,8 @@ #include <QtTest/QtTest> +#include <UiHelpers/UiAction> +#include <UiHelpers/UiActionGroup> #include <qapplication.h> #include <qevent.h> @@ -49,16 +51,16 @@ #include <qplatformtheme_qpa.h> #include <private/qguiapplication_p.h> -class tst_QAction : public QObject +class tst_UiAction : public QObject { Q_OBJECT public: - tst_QAction(); - virtual ~tst_QAction(); + tst_UiAction(); + virtual ~tst_UiAction(); - void updateState(QActionEvent *e); + // void updateState(QActionEvent *e); public slots: void initTestCase(); @@ -80,21 +82,21 @@ private slots: private: int m_lastEventType; int m_keyboardScheme; - QAction *m_lastAction; - QWidget *m_tstWidget; + UiAction *m_lastAction; + // QWidget *m_tstWidget; }; // Testing get/set functions -void tst_QAction::getSetCheck() +void tst_UiAction::getSetCheck() { - QAction obj1(0); + UiAction obj1(0); // QActionGroup * QAction::actionGroup() // void QAction::setActionGroup(QActionGroup *) - QActionGroup *var1 = new QActionGroup(0); + UiActionGroup *var1 = new UiActionGroup(0); obj1.setActionGroup(var1); QCOMPARE(var1, obj1.actionGroup()); - obj1.setActionGroup((QActionGroup *)0); - QCOMPARE((QActionGroup *)0, obj1.actionGroup()); + obj1.setActionGroup((UiActionGroup *)0); + QCOMPARE((UiActionGroup *)0, obj1.actionGroup()); delete var1; // QMenu * QAction::menu() @@ -106,36 +108,36 @@ void tst_QAction::getSetCheck() QCOMPARE((QMenu *)0, obj1.menu()); delete var2; - QCOMPARE(obj1.priority(), QAction::NormalPriority); - obj1.setPriority(QAction::LowPriority); - QCOMPARE(obj1.priority(), QAction::LowPriority); + QCOMPARE(obj1.priority(), UiAction::NormalPriority); + obj1.setPriority(UiAction::LowPriority); + QCOMPARE(obj1.priority(), UiAction::LowPriority); } -class MyWidget : public QWidget -{ - Q_OBJECT -public: - MyWidget(tst_QAction *tst, QWidget *parent = 0) : QWidget(parent) { this->tst = tst; } - -protected: - virtual void actionEvent(QActionEvent *e) { tst->updateState(e); } - -private: - tst_QAction *tst; -}; - -tst_QAction::tst_QAction() : m_keyboardScheme(QPlatformTheme::WindowsKeyboardScheme) +// class MyWidget : public QWidget +// { +// Q_OBJECT +// public: +// MyWidget(tst_QAction *tst, QWidget *parent = 0) : QWidget(parent) { this->tst = tst; } +// +// protected: +// virtual void actionEvent(QActionEvent *e) { tst->updateState(e); } +// +// private: +// tst_QAction *tst; +// }; + +tst_UiAction::tst_UiAction()// : m_keyboardScheme(QPlatformTheme::WindowsKeyboardScheme) { if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) m_keyboardScheme = theme->themeHint(QPlatformTheme::KeyboardScheme).toInt(); } -tst_QAction::~tst_QAction() +tst_UiAction::~tst_UiAction() { } -void tst_QAction::initTestCase() +void tst_UiAction::initTestCase() { m_lastEventType = 0; m_lastAction = 0; @@ -146,7 +148,7 @@ void tst_QAction::initTestCase() qApp->setActiveWindow(mw); } -void tst_QAction::cleanupTestCase() +void tst_UiAction::cleanupTestCase() { QWidget *testWidget = m_tstWidget; if (testWidget) { @@ -378,5 +380,5 @@ void tst_QAction::task229128TriggeredSignalWhenInActiongroup() QCOMPARE(actionSpy.count(), 1); } -QTEST_MAIN(tst_QAction) -#include "tst_qaction.moc" +QTEST_MAIN(tst_UiAction) +#include "tst_uiaction.moc" diff --git a/tests/auto/action/qaction/qaction.pro b/tests/auto/utils/uiaction/uiaction.pro index e8c9e2d..e543bda 100644 --- a/tests/auto/action/qaction/qaction.pro +++ b/tests/auto/utils/uiaction/uiaction.pro @@ -1,7 +1,7 @@ CONFIG += testcase -TARGET = tst_qaction +TARGET = tst_uiaction QT += testlib uihelpers QT += gui-private core-private widgets -SOURCES += tst_qaction.cpp +SOURCES += tst_uiaction.cpp diff --git a/tests/auto/utils/utils.pro b/tests/auto/utils/utils.pro index 14f244e..81a95e8 100644 --- a/tests/auto/utils/utils.pro +++ b/tests/auto/utils/utils.pro @@ -1,4 +1,5 @@ TEMPLATE=subdirs SUBDIRS=\ uiundogroup \ - uiundostack + uiundostack \ + uiaction |