diff options
Diffstat (limited to 'src/gui/kernel/qaction.h')
-rw-r--r-- | src/gui/kernel/qaction.h | 69 |
1 files changed, 20 insertions, 49 deletions
diff --git a/src/gui/kernel/qaction.h b/src/gui/kernel/qaction.h index 8466bc41f7..d805599138 100644 --- a/src/gui/kernel/qaction.h +++ b/src/gui/kernel/qaction.h @@ -1,41 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2020 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the QtGui module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2020 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only #ifndef QACTION_H #define QACTION_H @@ -47,6 +11,7 @@ #include <QtGui/qicon.h> #include <QtCore/qstring.h> #include <QtCore/qvariant.h> +#include <QtCore/qobject.h> QT_REQUIRE_CONFIG(action); @@ -55,10 +20,10 @@ QT_BEGIN_NAMESPACE class QActionEvent; class QActionGroup; class QActionPrivate; +class QMenu; #if QT_DEPRECATED_SINCE(6,0) class QWidget; class QGraphicsWidget; -class QMenu; #endif class Q_GUI_EXPORT QAction : public QObject @@ -68,7 +33,8 @@ class Q_GUI_EXPORT QAction : public QObject Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged FINAL) Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY toggled) - Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged RESET resetEnabled FINAL) + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged + RESET resetEnabled FINAL) 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) @@ -78,14 +44,17 @@ class Q_GUI_EXPORT QAction : public QObject Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY changed) #if QT_CONFIG(shortcut) Q_PROPERTY(QKeySequence shortcut READ shortcut WRITE setShortcut NOTIFY changed) - Q_PROPERTY(Qt::ShortcutContext shortcutContext READ shortcutContext WRITE setShortcutContext NOTIFY changed) + Q_PROPERTY(Qt::ShortcutContext shortcutContext READ shortcutContext WRITE setShortcutContext + NOTIFY changed) Q_PROPERTY(bool autoRepeat READ autoRepeat WRITE setAutoRepeat NOTIFY changed) #endif // QT_CONFIG(shortcut) - Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY changed) + Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole NOTIFY changed) - Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu NOTIFY changed) - Q_PROPERTY(bool shortcutVisibleInContextMenu READ isShortcutVisibleInContextMenu WRITE setShortcutVisibleInContextMenu NOTIFY changed) - Q_PROPERTY(Priority priority READ priority WRITE setPriority) + Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu + NOTIFY changed) + Q_PROPERTY(bool shortcutVisibleInContextMenu READ isShortcutVisibleInContextMenu + WRITE setShortcutVisibleInContextMenu NOTIFY changed) + Q_PROPERTY(Priority priority READ priority WRITE setPriority NOTIFY changed) public: // note this is copied into qplatformmenu.h, which must stay in sync @@ -105,7 +74,7 @@ public: QList<QObject *> associatedObjects() const; #if QT_DEPRECATED_SINCE(6,0) -#ifdef Q_CLANG_QDOC +#ifdef Q_QDOC QWidget *parentWidget() const; QList<QWidget*> associatedWidgets() const; QList<QGraphicsWidget*> associatedGraphicsWidgets() const; @@ -115,6 +84,7 @@ public: QWidget, QMenu, and QGraphicsWidget can be expected to be fully defined. */ template<typename T = QWidget*> + QT_DEPRECATED_VERSION_X_6_0("Use parent() with qobject_cast() instead") T parentWidget() const { auto result = parent(); @@ -124,6 +94,7 @@ public: } template<typename T = QWidget*> + QT_DEPRECATED_VERSION_X_6_0("Use associatedObjects() with qobject_cast() instead") QList<T> associatedWidgets() const { QList<T> result; @@ -133,6 +104,7 @@ public: return result; } template<typename T = QGraphicsWidget*> + QT_DEPRECATED_VERSION_X_6_0("Use associatedObjects() with qobject_cast() instead") QList<T> associatedGraphicsWidgets() const { QList<T> result; @@ -206,8 +178,7 @@ public: void setMenuRole(MenuRole menuRole); MenuRole menuRole() const; -#if QT_DEPRECATED_SINCE(6,0) -#ifdef Q_CLANG_QDOC +#ifdef Q_QDOC QMenu *menu() const; void setMenu(QMenu *menu); #else @@ -222,7 +193,6 @@ public: setMenuObject(m); } #endif -#endif void setIconVisibleInMenu(bool visible); bool isIconVisibleInMenu() const; @@ -250,6 +220,7 @@ Q_SIGNALS: void changed(); void enabledChanged(bool enabled); void checkableChanged(bool checkable); + void visibleChanged(); void triggered(bool checked = false); void hovered(); void toggled(bool); |