diff options
author | Mailson Menezes <mailson.menezes@openbossa.org> | 2012-03-06 19:27:30 -0300 |
---|---|---|
committer | Anselmo L. S. Melo <anselmo.melo@openbossa.org> | 2012-03-15 02:08:13 +0100 |
commit | 69084ed979d4c2852532a4951c7aa548f55efe64 (patch) | |
tree | cbe25732fb991ea437b61c3803eb057dbf738902 | |
parent | 6eb3f5af9c109bf1ea115c082a0fb3e9983cb1ae (diff) |
Remove unused API
Change-Id: Iabfd90ad2d1960de38844d6c185c9755516bedc6
Reviewed-by: Anselmo L. S. Melo <anselmo.melo@openbossa.org>
-rw-r--r-- | src/action/action.pri | 6 | ||||
-rw-r--r-- | src/action/qaction.cpp | 344 | ||||
-rw-r--r-- | src/action/qaction.h | 78 | ||||
-rw-r--r-- | src/action/qaction_p.h | 33 | ||||
-rw-r--r-- | src/action/qactiongroup.cpp | 83 | ||||
-rw-r--r-- | src/action/qactiongroup.h | 20 |
6 files changed, 285 insertions, 279 deletions
diff --git a/src/action/action.pri b/src/action/action.pri index 178be6c..dff624a 100644 --- a/src/action/action.pri +++ b/src/action/action.pri @@ -1,11 +1,13 @@ INCLUDEPATH += $$PWD HEADERS += \ - $$PWD/qaction.h + $$PWD/qaction.h \ + $$PWD/qactiongroup.h HEADERS += \ $$PWD/qaction_p.h SOURCES += \ - $$PWD/qaction.cpp + $$PWD/qaction.cpp \ + $$PWD/qactiongroup.cpp diff --git a/src/action/qaction.cpp b/src/action/qaction.cpp index 646c076..d6c26c6 100644 --- a/src/action/qaction.cpp +++ b/src/action/qaction.cpp @@ -50,7 +50,7 @@ #include "qdebug.h" #include <private/qshortcutmap_p.h> #include <private/qapplication_p.h> -#include <private/qmenu_p.h> +// #include <private/qmenu_p.h> #define QAPP_CHECK(functionName) \ if (!qApp) { \ @@ -80,7 +80,8 @@ static QString qt_strippedText(QString s) QActionPrivate::QActionPrivate() : group(0), enabled(1), forceDisabled(0), - visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false), + // visible(1), forceInvisible(0), checkable(0), checked(0), separator(0), fontSet(false), + checkable(0), checked(0), forceEnabledInSoftkeys(false), menuActionSoftkeys(false), // iconVisibleInMenu(-1), menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::NoSoftKey), @@ -97,35 +98,35 @@ QActionPrivate::~QActionPrivate() { } -bool QActionPrivate::showStatusText(QWidget *widget, const QString &str) -{ -#ifdef QT_NO_STATUSTIP - Q_UNUSED(widget); - Q_UNUSED(str); -#else - if (QObject *object = widget ? widget : parent) { - QStatusTipEvent tip(str); - QApplication::sendEvent(object, &tip); - return true; - } -#endif - return false; -} +// bool QActionPrivate::showStatusText(QWidget *widget, const QString &str) +// { +// #ifdef QT_NO_STATUSTIP +// Q_UNUSED(widget); +// Q_UNUSED(str); +// #else +// if (QObject *object = widget ? widget : parent) { +// QStatusTipEvent tip(str); +// QApplication::sendEvent(object, &tip); +// return true; +// } +// #endif +// return false; +// } void QActionPrivate::sendDataChanged() { Q_Q(QAction); QActionEvent e(QEvent::ActionChanged, q); - for (int i = 0; i < widgets.size(); ++i) { - QWidget *w = widgets.at(i); - QApplication::sendEvent(w, &e); - } -#ifndef QT_NO_GRAPHICSVIEW - for (int i = 0; i < graphicsWidgets.size(); ++i) { - QGraphicsWidget *w = graphicsWidgets.at(i); - QApplication::sendEvent(w, &e); - } -#endif +// for (int i = 0; i < widgets.size(); ++i) { +// QWidget *w = widgets.at(i); +// QApplication::sendEvent(w, &e); +// } +// #ifndef QT_NO_GRAPHICSVIEW +// for (int i = 0; i < graphicsWidgets.size(); ++i) { +// QGraphicsWidget *w = graphicsWidgets.at(i); +// QApplication::sendEvent(w, &e); +// } +// #endif QApplication::sendEvent(q, &e); emit q->changed(); @@ -376,13 +377,13 @@ QAction::QAction(QActionPrivate &dd, QObject *parent) /*! Returns the parent widget. */ -QWidget *QAction::parentWidget() const -{ - QObject *ret = parent(); - while (ret && !ret->isWidgetType()) - ret = ret->parent(); - return (QWidget*)ret; -} +// QWidget *QAction::parentWidget() const +// { +// QObject *ret = parent(); +// while (ret && !ret->isWidgetType()) +// ret = ret->parent(); +// return (QWidget*)ret; +// } /*! \since 4.2 @@ -390,11 +391,11 @@ QWidget *QAction::parentWidget() const \sa QWidget::addAction(), associatedGraphicsWidgets() */ -QList<QWidget *> QAction::associatedWidgets() const -{ - Q_D(const QAction); - return d->widgets; -} +// QList<QWidget *> QAction::associatedWidgets() const +// { +// Q_D(const QAction); +// return d->widgets; +// } #ifndef QT_NO_GRAPHICSVIEW /*! @@ -403,11 +404,11 @@ QList<QWidget *> QAction::associatedWidgets() const \sa QWidget::addAction(), associatedWidgets() */ -QList<QGraphicsWidget *> QAction::associatedGraphicsWidgets() const -{ - Q_D(const QAction); - return d->graphicsWidgets; -} +// QList<QGraphicsWidget *> QAction::associatedGraphicsWidgets() const +// { +// Q_D(const QAction); +// return d->graphicsWidgets; +// } #endif #ifndef QT_NO_SHORTCUT @@ -573,22 +574,22 @@ bool QAction::autoRepeat() const \sa QAction::setText() QStyle */ -void QAction::setFont(const QFont &font) -{ - Q_D(QAction); - if (d->font == font) - return; - - d->fontSet = true; - d->font = font; - d->sendDataChanged(); -} +// void QAction::setFont(const QFont &font) +// { +// Q_D(QAction); +// if (d->font == font) +// return; +// +// d->fontSet = true; +// d->font = font; +// d->sendDataChanged(); +// } -QFont QAction::font() const -{ - Q_D(const QAction); - return d->font; -} +// QFont QAction::font() const +// { +// Q_D(const QAction); +// return d->font; +// } /*! @@ -597,16 +598,16 @@ QFont QAction::font() const QAction::~QAction() { Q_D(QAction); - for (int i = d->widgets.size()-1; i >= 0; --i) { - QWidget *w = d->widgets.at(i); - w->removeAction(this); - } -#ifndef QT_NO_GRAPHICSVIEW - for (int i = d->graphicsWidgets.size()-1; i >= 0; --i) { - QGraphicsWidget *w = d->graphicsWidgets.at(i); - w->removeAction(this); - } -#endif +// for (int i = d->widgets.size()-1; i >= 0; --i) { +// QWidget *w = d->widgets.at(i); +// w->removeAction(this); +// } +// #ifndef QT_NO_GRAPHICSVIEW +// for (int i = d->graphicsWidgets.size()-1; i >= 0; --i) { +// QGraphicsWidget *w = d->graphicsWidgets.at(i); +// w->removeAction(this); +// } +// #endif if (d->group) d->group->removeAction(this); #ifndef QT_NO_SHORTCUT @@ -686,25 +687,25 @@ QActionGroup *QAction::actionGroup() const \sa QMenu::addAction() */ -QMenu *QAction::menu() const -{ - Q_D(const QAction); - return d->menu; -} +// QMenu *QAction::menu() const +// { +// Q_D(const QAction); +// return d->menu; +// } /*! Sets the menu contained by this action to the specified \a menu. */ -void QAction::setMenu(QMenu *menu) -{ - Q_D(QAction); - if (d->menu) - d->menu->d_func()->setOverrideMenuAction(0); //we reset the default action of any previous menu - d->menu = menu; - if (menu) - menu->d_func()->setOverrideMenuAction(this); - d->sendDataChanged(); -} +// void QAction::setMenu(QMenu *menu) +// { +// Q_D(QAction); +// if (d->menu) +// d->menu->d_func()->setOverrideMenuAction(0); //we reset the default action of any previous menu +// d->menu = menu; +// if (menu) +// menu->d_func()->setOverrideMenuAction(this); +// d->sendDataChanged(); +// } #endif // QT_NO_MENU /*! @@ -716,15 +717,15 @@ void QAction::setMenu(QMenu *menu) \sa QAction::isSeparator() */ -void QAction::setSeparator(bool b) -{ - Q_D(QAction); - if (d->separator == b) - return; - - d->separator = b; - d->sendDataChanged(); -} +// void QAction::setSeparator(bool b) +// { +// Q_D(QAction); +// if (d->separator == b) +// return; +// +// d->separator = b; +// d->sendDataChanged(); +// } /*! Returns true if this action is a separator action; otherwise it @@ -732,11 +733,11 @@ void QAction::setSeparator(bool b) \sa QAction::setSeparator() */ -bool QAction::isSeparator() const -{ - Q_D(const QAction); - return d->separator; -} +// bool QAction::isSeparator() const +// { +// Q_D(const QAction); +// return d->separator; +// } /*! \property QAction::text @@ -823,26 +824,26 @@ QString QAction::text() const \sa setStatusTip() setShortcut() */ -void QAction::setToolTip(const QString &tooltip) -{ - Q_D(QAction); - if (d->tooltip == tooltip) - return; - - d->tooltip = tooltip; - d->sendDataChanged(); -} +// void QAction::setToolTip(const QString &tooltip) +// { +// Q_D(QAction); +// if (d->tooltip == tooltip) +// return; +// +// d->tooltip = tooltip; +// d->sendDataChanged(); +// } -QString QAction::toolTip() const -{ - Q_D(const QAction); - if (d->tooltip.isEmpty()) { - if (!d->text.isEmpty()) - return qt_strippedText(d->text); - // return qt_strippedText(d->iconText); - } - return d->tooltip; -} +// QString QAction::toolTip() const +// { +// Q_D(const QAction); +// if (d->tooltip.isEmpty()) { +// if (!d->text.isEmpty()) +// return qt_strippedText(d->text); +// return qt_strippedText(d->iconText); +// } +// return d->tooltip; +// } /*! \property QAction::statusTip @@ -855,21 +856,21 @@ QString QAction::toolTip() const \sa setToolTip() showStatusText() */ -void QAction::setStatusTip(const QString &statustip) -{ - Q_D(QAction); - if (d->statustip == statustip) - return; - - d->statustip = statustip; - d->sendDataChanged(); -} +// void QAction::setStatusTip(const QString &statustip) +// { +// Q_D(QAction); +// if (d->statustip == statustip) +// return; +// +// d->statustip = statustip; +// d->sendDataChanged(); +// } -QString QAction::statusTip() const -{ - Q_D(const QAction); - return d->statustip; -} +// QString QAction::statusTip() const +// { +// Q_D(const QAction); +// return d->statustip; +// } /*! \property QAction::whatsThis @@ -881,21 +882,21 @@ QString QAction::statusTip() const \sa QWhatsThis Q3StyleSheet */ -void QAction::setWhatsThis(const QString &whatsthis) -{ - Q_D(QAction); - if (d->whatsthis == whatsthis) - return; - - d->whatsthis = whatsthis; - d->sendDataChanged(); -} +// void QAction::setWhatsThis(const QString &whatsthis) +// { +// Q_D(QAction); +// if (d->whatsthis == whatsthis) +// return; +// +// d->whatsthis = whatsthis; +// d->sendDataChanged(); +// } -QString QAction::whatsThis() const -{ - Q_D(const QAction); - return d->whatsthis; -} +// QString QAction::whatsThis() const +// { +// Q_D(const QAction); +// return d->whatsthis; +// } /*! \enum QAction::Priority @@ -1055,7 +1056,8 @@ void QAction::setEnabled(bool b) if (b == d->enabled && b != d->forceDisabled) return; d->forceDisabled = !b; - if (b && (!d->visible || (d->group && !d->group->isEnabled()))) + // if (b && (!d->visible || (d->group && !d->group->isEnabled()))) + if (b && (d->group && !d->group->isEnabled())) return; QAPP_CHECK("setEnabled"); d->enabled = b; @@ -1084,27 +1086,27 @@ bool QAction::isEnabled() const By default, this property is true (actions are visible). */ -void QAction::setVisible(bool b) -{ - Q_D(QAction); - if (b == d->visible && b != d->forceInvisible) - return; - QAPP_CHECK("setVisible"); - d->forceInvisible = !b; - d->visible = b; - d->enabled = b && !d->forceDisabled && (!d->group || d->group->isEnabled()) ; -#ifndef QT_NO_SHORTCUT - d->setShortcutEnabled(d->enabled, qApp->d_func()->shortcutMap); -#endif - d->sendDataChanged(); -} +// void QAction::setVisible(bool b) +// { +// Q_D(QAction); +// if (b == d->visible && b != d->forceInvisible) +// return; +// QAPP_CHECK("setVisible"); +// d->forceInvisible = !b; +// d->visible = b; +// d->enabled = b && !d->forceDisabled && (!d->group || d->group->isEnabled()) ; +// #ifndef QT_NO_SHORTCUT +// d->setShortcutEnabled(d->enabled, qApp->d_func()->shortcutMap); +// #endif +// d->sendDataChanged(); +// } -bool QAction::isVisible() const -{ - Q_D(const QAction); - return d->visible; -} +// bool QAction::isVisible() const +// { +// Q_D(const QAction); +// return d->visible; +// } /*! \reimp @@ -1165,11 +1167,11 @@ QAction::setData(const QVariant &data) \sa statusTip */ -bool -QAction::showStatusText(QWidget *widget) -{ - return d_func()->showStatusText(widget, statusTip()); -} +// bool +// QAction::showStatusText(QWidget *widget) +// { +// return d_func()->showStatusText(widget, statusTip()); +// } /*! Sends the relevant signals for ActionEvent \a event. @@ -1194,9 +1196,9 @@ void QAction::activate(ActionEvent event) } if (!guard.isNull()) emit triggered(d->checked); - } else if (event == Hover) { + }/* else if (event == Hover) { emit hovered(); - } + }*/ } /*! diff --git a/src/action/qaction.h b/src/action/qaction.h index e9fb511..f87c240 100644 --- a/src/action/qaction.h +++ b/src/action/qaction.h @@ -45,7 +45,7 @@ #include "uihelpersglobal.h" #include <QtGui/qkeysequence.h> #include <QtCore/qstring.h> -#include <QtWidgets/qwidget.h> +// #include <QtWidgets/qwidget.h> #include <QtCore/qvariant.h> // #include <QtWidgets/qicon.h> @@ -56,10 +56,10 @@ QT_BEGIN_NAMESPACE_UIHELPERS #ifndef QT_NO_ACTION -class QMenu; +// class QMenu; class QActionGroup; class QActionPrivate; -class QGraphicsWidget; +// class QGraphicsWidget; class UIHELPERS_EXPORT QAction : public QObject { @@ -75,16 +75,16 @@ class UIHELPERS_EXPORT QAction : public QObject // Q_PROPERTY(QIcon icon READ icon WRITE setIcon NOTIFY changed) Q_PROPERTY(QString text READ text WRITE setText NOTIFY changed) // Q_PROPERTY(QString iconText READ iconText WRITE setIconText NOTIFY changed) - Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip NOTIFY changed) - Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip NOTIFY changed) - Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis NOTIFY changed) - Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed) + // Q_PROPERTY(QString toolTip READ toolTip WRITE setToolTip NOTIFY changed) + // Q_PROPERTY(QString statusTip READ statusTip WRITE setStatusTip NOTIFY changed) + // Q_PROPERTY(QString whatsThis READ whatsThis WRITE setWhatsThis NOTIFY changed) + // Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed) #ifndef QT_NO_SHORTCUT Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut NOTIFY changed) Q_PROPERTY(Qt::ShortcutContext shortcutContext READ shortcutContext WRITE setShortcutContext NOTIFY changed) Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat NOTIFY changed) #endif - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY changed) + // Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY changed) Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole NOTIFY changed) Q_PROPERTY(SoftKeyRole softKeyRole READ softKeyRole WRITE setSoftKeyRole NOTIFY changed) // Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu NOTIFY changed) @@ -115,25 +115,25 @@ public: // void setIconText(const QString &text); // QString iconText() const; - void setToolTip(const QString &tip); - QString toolTip() const; + // void setToolTip(const QString &tip); + // QString toolTip() const; - void setStatusTip(const QString &statusTip); - QString statusTip() const; + // void setStatusTip(const QString &statusTip); + // QString statusTip() const; - void setWhatsThis(const QString &what); - QString whatsThis() const; + // void setWhatsThis(const QString &what); + // QString whatsThis() const; void setPriority(Priority priority); Priority priority() const; -#ifndef QT_NO_MENU - QMenu *menu() const; - void setMenu(QMenu *menu); -#endif +// #ifndef QT_NO_MENU +// QMenu *menu() const; +// void setMenu(QMenu *menu); +// #endif - void setSeparator(bool b); - bool isSeparator() const; + // void setSeparator(bool b); + // bool isSeparator() const; #ifndef QT_NO_SHORTCUT void setShortcut(const QKeySequence &shortcut); @@ -150,8 +150,8 @@ public: bool autoRepeat() const; #endif - void setFont(const QFont &font); - QFont font() const; + // void setFont(const QFont &font); + // QFont font() const; void setCheckable(bool); bool isCheckable() const; @@ -163,11 +163,11 @@ public: bool isEnabled() const; - bool isVisible() const; + // bool isVisible() const; enum ActionEvent { Trigger, Hover }; void activate(ActionEvent event); - bool showStatusText(QWidget *widget=0); + // bool showStatusText(QWidget *widget=0); void setMenuRole(MenuRole menuRole); MenuRole menuRole() const; @@ -179,12 +179,12 @@ public: // bool isIconVisibleInMenu() const; - QWidget *parentWidget() const; + // QWidget *parentWidget() const; - QList<QWidget *> associatedWidgets() const; -#ifndef QT_NO_GRAPHICSVIEW - QList<QGraphicsWidget *> associatedGraphicsWidgets() const; // ### suboptimal -#endif + // QList<QWidget *> associatedWidgets() const; +// #ifndef QT_NO_GRAPHICSVIEW +// QList<QGraphicsWidget *> associatedGraphicsWidgets() const; // ### suboptimal +// #endif protected: bool event(QEvent *); @@ -192,36 +192,36 @@ protected: public Q_SLOTS: void trigger() { activate(Trigger); } - void hover() { activate(Hover); } + // void hover() { activate(Hover); } void setChecked(bool); void toggle(); void setEnabled(bool); inline void setDisabled(bool b) { setEnabled(!b); } - void setVisible(bool); + // void setVisible(bool); Q_SIGNALS: void changed(); void triggered(bool checked = false); - void hovered(); + // void hovered(); void toggled(bool); private: Q_DISABLE_COPY(QAction) - friend class QGraphicsWidget; - friend class QWidget; + // friend class QGraphicsWidget; + // friend class QWidget; friend class QActionGroup; - friend class QMenu; - friend class QMenuPrivate; - friend class QMenuBar; - friend class QToolButton; + // friend class QMenu; + // friend class QMenuPrivate; + // friend class QMenuBar; + // friend class QToolButton; #ifdef Q_OS_MAC friend void qt_mac_clear_status_text(QAction *action); #endif }; QT_BEGIN_INCLUDE_NAMESPACE_UIHELPERS -#include <QtWidgets/qactiongroup.h> +#include <UiHelpers/qactiongroup.h> QT_END_INCLUDE_NAMESPACE_UIHELPERS #endif // QT_NO_ACTION diff --git a/src/action/qaction_p.h b/src/action/qaction_p.h index 2f81a4a..e02c4a8 100644 --- a/src/action/qaction_p.h +++ b/src/action/qaction_p.h @@ -53,9 +53,10 @@ // We mean it. // -#include "QtWidgets/qaction.h" -#include "QtWidgets/qmenu.h" -#include "private/qgraphicswidget_p.h" +#include "UiHelpers/qaction.h" +// #include "QtWidgets/qaction.h" +// #include "QtWidgets/qmenu.h" +// #include "private/qgraphicswidget_p.h" #include "private/qobject_p.h" #include "uihelpersglobal.h" @@ -78,15 +79,15 @@ public: return q->d_func(); } - bool showStatusText(QWidget *w, const QString &str); + // bool showStatusText(QWidget *w, const QString &str); QPointer<QActionGroup> group; QString text; // QString iconText; // QIcon icon; - QString tooltip; - QString statustip; - QString whatsthis; + // QString tooltip; + // QString statustip; + // QString whatsthis; #ifndef QT_NO_SHORTCUT QKeySequence shortcut; QList<QKeySequence> alternateShortcuts; @@ -98,14 +99,14 @@ public: Qt::ShortcutContext shortcutContext; uint autorepeat : 1; #endif - QFont font; - QPointer<QMenu> menu; + // QFont font; + // QPointer<QMenu> menu; uint enabled : 1, forceDisabled : 1; - uint visible : 1, forceInvisible : 1; + // uint visible : 1, forceInvisible : 1; uint checkable : 1; uint checked : 1; - uint separator : 1; - uint fontSet : 1; + // uint separator : 1; + // uint fontSet : 1; //for soft keys management uint forceEnabledInSoftkeys : 1; @@ -116,10 +117,10 @@ public: QAction::SoftKeyRole softKeyRole; QAction::Priority priority; - QList<QWidget *> widgets; -#ifndef QT_NO_GRAPHICSVIEW - QList<QGraphicsWidget *> graphicsWidgets; -#endif + // QList<QWidget *> widgets; +// #ifndef QT_NO_GRAPHICSVIEW +// QList<QGraphicsWidget *> graphicsWidgets; +// #endif #ifndef QT_NO_SHORTCUT void redoGrab(QShortcutMap &map); void redoGrabAlternate(QShortcutMap &map); diff --git a/src/action/qactiongroup.cpp b/src/action/qactiongroup.cpp index 70bef43..e211bd8 100644 --- a/src/action/qactiongroup.cpp +++ b/src/action/qactiongroup.cpp @@ -44,27 +44,28 @@ #ifndef QT_NO_ACTION #include "qaction_p.h" -#include "qapplication.h" -#include "qevent.h" +// #include "qapplication.h" +// #include "qevent.h" #include "qlist.h" -QT_BEGIN_NAMESPACE +QT_BEGIN_NAMESPACE_UIHELPERS class QActionGroupPrivate : public QObjectPrivate { Q_DECLARE_PUBLIC(QActionGroup) public: - QActionGroupPrivate() : exclusive(1), enabled(1), visible(1) { } + // QActionGroupPrivate() : exclusive(1), enabled(1), visible(1) { } + QActionGroupPrivate() : exclusive(1), enabled(1) { } QList<QAction *> actions; QPointer<QAction> current; uint exclusive : 1; uint enabled : 1; - uint visible : 1; + // uint visible : 1; private: void _q_actionTriggered(); //private slot void _q_actionChanged(); //private slot - void _q_actionHovered(); //private slot + // void _q_actionHovered(); //private slot }; void QActionGroupPrivate::_q_actionChanged() @@ -93,13 +94,13 @@ void QActionGroupPrivate::_q_actionTriggered() emit q->triggered(action); } -void QActionGroupPrivate::_q_actionHovered() -{ - Q_Q(QActionGroup); - QAction *action = qobject_cast<QAction*>(q->sender()); - Q_ASSERT_X(action != 0, "QWidgetGroup::_q_actionHovered", "internal error"); - emit q->hovered(action); -} +// void QActionGroupPrivate::_q_actionHovered() +// { +// Q_Q(QActionGroup); +// QAction *action = qobject_cast<QAction*>(q->sender()); +// Q_ASSERT_X(action != 0, "QWidgetGroup::_q_actionHovered", "internal error"); +// emit q->hovered(action); +// } /*! \class QActionGroup @@ -181,16 +182,16 @@ QAction *QActionGroup::addAction(QAction* a) d->actions.append(a); QObject::connect(a, SIGNAL(triggered()), this, SLOT(_q_actionTriggered())); QObject::connect(a, SIGNAL(changed()), this, SLOT(_q_actionChanged())); - QObject::connect(a, SIGNAL(hovered()), this, SLOT(_q_actionHovered())); + // QObject::connect(a, SIGNAL(hovered()), this, SLOT(_q_actionHovered())); } if (!a->d_func()->forceDisabled) { a->setEnabled(d->enabled); a->d_func()->forceDisabled = false; } - if (!a->d_func()->forceInvisible) { - a->setVisible(d->visible); - a->d_func()->forceInvisible = false; - } + // if (!a->d_func()->forceInvisible) { + // a->setVisible(d->visible); + // a->d_func()->forceInvisible = false; + // } if (a->isChecked()) d->current = a; QActionGroup *oldGroup = a->d_func()->group; @@ -225,10 +226,10 @@ QAction *QActionGroup::addAction(const QString &text) \sa QAction::setActionGroup() */ -QAction *QActionGroup::addAction(const QIcon &icon, const QString &text) -{ - return new QAction(icon, text, this); -} +// QAction *QActionGroup::addAction(const QIcon &icon, const QString &text) +// { +// return new QAction(icon, text, this); +// } /*! Removes the \a action from this group. The action will have no @@ -244,7 +245,7 @@ void QActionGroup::removeAction(QAction *action) d->current = 0; QObject::disconnect(action, SIGNAL(triggered()), this, SLOT(_q_actionTriggered())); QObject::disconnect(action, SIGNAL(changed()), this, SLOT(_q_actionChanged())); - QObject::disconnect(action, SIGNAL(hovered()), this, SLOT(_q_actionHovered())); + // QObject::disconnect(action, SIGNAL(hovered()), this, SLOT(_q_actionHovered())); action->d_func()->group = 0; } } @@ -335,23 +336,23 @@ QAction *QActionGroup::checkedAction() const \sa QAction::setEnabled() */ -void QActionGroup::setVisible(bool b) -{ - Q_D(QActionGroup); - d->visible = b; - for (QList<QAction*>::Iterator it = d->actions.begin(); it != d->actions.end(); ++it) { - if (!(*it)->d_func()->forceInvisible) { - (*it)->setVisible(b); - (*it)->d_func()->forceInvisible = false; - } - } -} - -bool QActionGroup::isVisible() const -{ - Q_D(const QActionGroup); - return d->visible; -} +// void QActionGroup::setVisible(bool b) +// { +// Q_D(QActionGroup); +// d->visible = b; +// for (QList<QAction*>::Iterator it = d->actions.begin(); it != d->actions.end(); ++it) { +// if (!(*it)->d_func()->forceInvisible) { +// (*it)->setVisible(b); +// (*it)->d_func()->forceInvisible = false; +// } +// } +// } + +// bool QActionGroup::isVisible() const +// { +// Q_D(const QActionGroup); +// return d->visible; +// } /*! \fn void QActionGroup::triggered(QAction *action) @@ -409,7 +410,7 @@ bool QActionGroup::isVisible() const */ -QT_END_NAMESPACE +QT_END_NAMESPACE_UIHELPERS #include "moc_qactiongroup.cpp" diff --git a/src/action/qactiongroup.h b/src/action/qactiongroup.h index 3cff248..c6fe924 100644 --- a/src/action/qactiongroup.h +++ b/src/action/qactiongroup.h @@ -42,25 +42,25 @@ #ifndef QACTIONGROUP_H #define QACTIONGROUP_H -#include <QtWidgets/qaction.h> +#include <UiHelpers/qaction.h> QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE +QT_BEGIN_NAMESPACE_UIHELPERS #ifndef QT_NO_ACTION class QActionGroupPrivate; -class Q_WIDGETS_EXPORT QActionGroup : public QObject +class UIHELPERS_EXPORT QActionGroup : public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QActionGroup) Q_PROPERTY(bool exclusive READ isExclusive WRITE setExclusive) Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible) + // Q_PROPERTY(bool visible READ isVisible WRITE setVisible) public: explicit QActionGroup(QObject* parent); @@ -68,36 +68,36 @@ public: QAction *addAction(QAction* a); QAction *addAction(const QString &text); - QAction *addAction(const QIcon &icon, const QString &text); + // QAction *addAction(const QIcon &icon, const QString &text); void removeAction(QAction *a); QList<QAction*> actions() const; QAction *checkedAction() const; bool isExclusive() const; bool isEnabled() const; - bool isVisible() const; + // bool isVisible() const; public Q_SLOTS: void setEnabled(bool); inline void setDisabled(bool b) { setEnabled(!b); } - void setVisible(bool); + // void setVisible(bool); void setExclusive(bool); Q_SIGNALS: void triggered(QAction *); - void hovered(QAction *); + // void hovered(QAction *); private: Q_DISABLE_COPY(QActionGroup) Q_PRIVATE_SLOT(d_func(), void _q_actionTriggered()) Q_PRIVATE_SLOT(d_func(), void _q_actionChanged()) - Q_PRIVATE_SLOT(d_func(), void _q_actionHovered()) + // Q_PRIVATE_SLOT(d_func(), void _q_actionHovered()) }; #endif // QT_NO_ACTION -QT_END_NAMESPACE +QT_END_NAMESPACE_UIHELPERS QT_END_HEADER |