diff options
Diffstat (limited to 'src/widgets/kernel/qaction.cpp')
-rw-r--r-- | src/widgets/kernel/qaction.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index dbec689efa..72d6fffefd 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -45,10 +45,10 @@ #include "qapplication.h" #include "qevent.h" #include "qlist.h" -#include "qdebug.h" #include <private/qshortcutmap_p.h> #include <private/qapplication_p.h> #include <private/qmenu_p.h> +#include <private/qdebug_p.h> #define QAPP_CHECK(functionName) \ if (Q_UNLIKELY(!qApp)) { \ @@ -1302,6 +1302,31 @@ bool QAction::isIconVisibleInMenu() const return d->iconVisibleInMenu; } +#ifndef QT_NO_DEBUG_STREAM +Q_WIDGETS_EXPORT QDebug operator<<(QDebug d, const QAction *action) +{ + QDebugStateSaver saver(d); + d.nospace(); + d << "QAction(" << static_cast<const void *>(action); + if (action) { + d << " text=" << action->text(); + if (!action->toolTip().isEmpty()) + d << " toolTip=" << action->toolTip(); + if (action->isCheckable()) + d << " checked=" << action->isChecked(); + if (!action->shortcut().isEmpty()) + d << " shortcut=" << action->shortcut(); + d << " menuRole="; + QtDebugUtils::formatQEnum(d, action->menuRole()); + d << " visible=" << action->isVisible(); + } else { + d << '0'; + } + d << ')'; + return d; +} +#endif // QT_NO_DEBUG_STREAM + QT_END_NAMESPACE #include "moc_qaction.cpp" |