summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselmo L. S. Melo <anselmo.melo@openbossa.org>2012-03-08 17:14:46 -0300
committerLuis Gabriel Lima <luis.gabriel@openbossa.org>2012-03-15 19:21:36 +0100
commitb011eb58b59f4bbee076d5af82dcda73ef591db0 (patch)
treec47b806949e0db62fa79f0165876635e8ecec841
parent3826e025ddf7177bcdc2da93b3b10f4e47cc217e (diff)
Use UiAction in UiUndo* classes
Change-Id: Iba5b293e5359958e418c4248f5acb894e16c9fb9 Reviewed-by: Luis Gabriel Lima <luis.gabriel@openbossa.org>
-rw-r--r--src/utils/uiundogroup.cpp9
-rw-r--r--src/utils/uiundogroup.h6
-rw-r--r--src/utils/uiundostack.cpp13
-rw-r--r--src/utils/uiundostack.h6
-rw-r--r--src/utils/uiundostack_p.h4
-rw-r--r--src/utils/utils.pri18
6 files changed, 33 insertions, 23 deletions
diff --git a/src/utils/uiundogroup.cpp b/src/utils/uiundogroup.cpp
index 12113dd..5c4c1ad 100644
--- a/src/utils/uiundogroup.cpp
+++ b/src/utils/uiundogroup.cpp
@@ -42,6 +42,7 @@
#include "uiundogroup.h"
#include "uiundostack.h"
#include "uiundostack_p.h"
+#include "uiaction.h"
#ifndef QT_NO_UNDOGROUP
@@ -368,7 +369,7 @@ bool UiUndoGroup::isClean() const
#ifndef QT_NO_ACTION
/*!
- Creates an undo QAction object with parent \a parent.
+ Creates an undo UiAction object with parent \a parent.
Triggering this action will cause a call to UiUndoStack::undo() on the active stack.
The text of this action will always be the text of the command which will be undone
@@ -382,7 +383,7 @@ bool UiUndoGroup::isClean() const
\sa createRedoAction() canUndo() UiUndoCommand::text()
*/
-QAction *UiUndoGroup::createUndoAction(QObject *parent, const QString &prefix) const
+UiAction *UiUndoGroup::createUndoAction(QObject *parent, const QString &prefix) const
{
UiUndoAction *result = new UiUndoAction(prefix, parent);
if (prefix.isEmpty())
@@ -399,7 +400,7 @@ QAction *UiUndoGroup::createUndoAction(QObject *parent, const QString &prefix) c
}
/*!
- Creates an redo QAction object with parent \a parent.
+ Creates an redo UiAction object with parent \a parent.
Triggering this action will cause a call to UiUndoStack::redo() on the active stack.
The text of this action will always be the text of the command which will be redone
@@ -413,7 +414,7 @@ QAction *UiUndoGroup::createUndoAction(QObject *parent, const QString &prefix) c
\sa createUndoAction() canRedo() UiUndoCommand::text()
*/
-QAction *UiUndoGroup::createRedoAction(QObject *parent, const QString &prefix) const
+UiAction *UiUndoGroup::createRedoAction(QObject *parent, const QString &prefix) const
{
UiUndoAction *result = new UiUndoAction(prefix, parent);
if (prefix.isEmpty())
diff --git a/src/utils/uiundogroup.h b/src/utils/uiundogroup.h
index d573f99..d687ed9 100644
--- a/src/utils/uiundogroup.h
+++ b/src/utils/uiundogroup.h
@@ -52,7 +52,7 @@ QT_BEGIN_NAMESPACE_UIHELPERS
class UiUndoGroupPrivate;
class UiUndoStack;
-class QAction;
+class UiAction;
#ifndef QT_NO_UNDOGROUP
@@ -71,9 +71,9 @@ public:
UiUndoStack *activeStack() const;
#ifndef QT_NO_ACTION
- QAction *createUndoAction(QObject *parent,
+ UiAction *createUndoAction(QObject *parent,
const QString &prefix = QString()) const;
- QAction *createRedoAction(QObject *parent,
+ UiAction *createRedoAction(QObject *parent,
const QString &prefix = QString()) const;
#endif // QT_NO_ACTION
bool canUndo() const;
diff --git a/src/utils/uiundostack.cpp b/src/utils/uiundostack.cpp
index b7bf7e2..45d7ed4 100644
--- a/src/utils/uiundostack.cpp
+++ b/src/utils/uiundostack.cpp
@@ -43,6 +43,7 @@
#include "uiundostack.h"
#include "uiundogroup.h"
#include "uiundostack_p.h"
+#include "uiaction.h"
#ifndef QT_NO_UNDOCOMMAND
@@ -347,7 +348,7 @@ const UiUndoCommand *UiUndoCommand::child(int index) const
\section1 Undo and Redo Actions
- UiUndoStack provides convenient undo and redo QAction objects, which
+ UiUndoStack provides convenient undo and redo UiAction objects, which
can be inserted into a menu or a toolbar. When commands are undone or
redone, UiUndoStack updates the text properties of these actions
to reflect what change they will trigger. The actions are also disabled
@@ -400,7 +401,7 @@ const UiUndoCommand *UiUndoCommand::child(int index) const
#ifndef QT_NO_ACTION
UiUndoAction::UiUndoAction(const QString &prefix, QObject *parent)
- : QAction(parent)
+ : UiAction(parent)
{
m_prefix = prefix;
}
@@ -864,7 +865,7 @@ QString UiUndoStack::redoText() const
#ifndef QT_NO_ACTION
/*!
- Creates an undo QAction object with the given \a parent.
+ Creates an undo UiAction object with the given \a parent.
Triggering this action will cause a call to undo(). The text of this action
is the text of the command which will be undone in the next call to undo(),
@@ -877,7 +878,7 @@ QString UiUndoStack::redoText() const
\sa createRedoAction(), canUndo(), UiUndoCommand::text()
*/
-QAction *UiUndoStack::createUndoAction(QObject *parent, const QString &prefix) const
+UiAction *UiUndoStack::createUndoAction(QObject *parent, const QString &prefix) const
{
UiUndoAction *result = new UiUndoAction(prefix, parent);
if (prefix.isEmpty())
@@ -894,7 +895,7 @@ QAction *UiUndoStack::createUndoAction(QObject *parent, const QString &prefix) c
}
/*!
- Creates an redo QAction object with the given \a parent.
+ Creates an redo UiAction object with the given \a parent.
Triggering this action will cause a call to redo(). The text of this action
is the text of the command which will be redone in the next call to redo(),
@@ -907,7 +908,7 @@ QAction *UiUndoStack::createUndoAction(QObject *parent, const QString &prefix) c
\sa createUndoAction(), canRedo(), UiUndoCommand::text()
*/
-QAction *UiUndoStack::createRedoAction(QObject *parent, const QString &prefix) const
+UiAction *UiUndoStack::createRedoAction(QObject *parent, const QString &prefix) const
{
UiUndoAction *result = new UiUndoAction(prefix, parent);
if (prefix.isEmpty())
diff --git a/src/utils/uiundostack.h b/src/utils/uiundostack.h
index aadec3a..18f2a6d 100644
--- a/src/utils/uiundostack.h
+++ b/src/utils/uiundostack.h
@@ -52,7 +52,7 @@ QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE_UIHELPERS
-class QAction;
+class UiAction;
class UiUndoCommandPrivate;
class UiUndoStackPrivate;
@@ -115,9 +115,9 @@ public:
QString text(int idx) const;
#ifndef QT_NO_ACTION
- QAction *createUndoAction(QObject *parent,
+ UiAction *createUndoAction(QObject *parent,
const QString &prefix = QString()) const;
- QAction *createRedoAction(QObject *parent,
+ UiAction *createRedoAction(QObject *parent,
const QString &prefix = QString()) const;
#endif // QT_NO_ACTION
diff --git a/src/utils/uiundostack_p.h b/src/utils/uiundostack_p.h
index 1125613..ad6b192 100644
--- a/src/utils/uiundostack_p.h
+++ b/src/utils/uiundostack_p.h
@@ -45,7 +45,7 @@
#include <private/qobject_p.h>
#include <QtCore/qlist.h>
#include <QtCore/qstring.h>
-//#include <QtWidgets/qaction.h>
+#include <UiHelpers/uiaction.h>
#include "uihelpersglobal.h"
#include "uiundostack.h"
@@ -94,7 +94,7 @@ public:
};
#ifndef QT_NO_ACTION
-class UiUndoAction : public QAction
+class UiUndoAction : public UiAction
{
Q_OBJECT
public:
diff --git a/src/utils/utils.pri b/src/utils/utils.pri
index 8d997a6..a10f8b5 100644
--- a/src/utils/utils.pri
+++ b/src/utils/utils.pri
@@ -1,14 +1,22 @@
-### Temporary to build QAction-dependent code
-DEFINES += QT_NO_ACTION
-
INCLUDEPATH += $$PWD
HEADERS += \
$$PWD/uiundostack.h \
$$PWD/uiundogroup.h \
- $$PWD/uiundostack_p.h
+ $$PWD/uiundostack_p.h \
+ $$PWD/uiaction.h \
+ $$PWD/uiactiongroup.h \
+ $$PWD/uiaction_p.h
+
SOURCES += \
$$PWD/uiundogroup.cpp \
- $$PWD/uiundostack.cpp
+ $$PWD/uiundostack.cpp \
+ $$PWD/uiaction.cpp \
+ $$PWD/uiactiongroup.cpp
+
+
+DEFINES += QT_NO_SHORTCUT
+
+INCLUDEPATH += $$PWD