diff options
Diffstat (limited to 'src/controls/qquickaction.cpp')
| -rw-r--r-- | src/controls/qquickaction.cpp | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/src/controls/qquickaction.cpp b/src/controls/qquickaction.cpp index 47032aaba..f04b13ab1 100644 --- a/src/controls/qquickaction.cpp +++ b/src/controls/qquickaction.cpp @@ -1,34 +1,37 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Controls module of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL3$ +** $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 http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. +** 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.LGPLv3 included in the +** 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.html. +** 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 later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. +** 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$ ** @@ -48,7 +51,7 @@ QT_BEGIN_NAMESPACE /*! \qmltype Action - \instantiates QQuickAction + \instantiates QQuickAction1 \ingroup applicationwindow \ingroup controls \inqmlmodule QtQuick.Controls @@ -188,7 +191,7 @@ QT_BEGIN_NAMESPACE The corresponding handler is \c onToggled. */ -QQuickAction::QQuickAction(QObject *parent) +QQuickAction1::QQuickAction1(QObject *parent) : QObject(parent) , m_enabled(true) , m_checkable(false) @@ -196,14 +199,14 @@ QQuickAction::QQuickAction(QObject *parent) { } -QQuickAction::~QQuickAction() +QQuickAction1::~QQuickAction1() { setShortcut(QString()); setMnemonicFromText(QString()); setExclusiveGroup(0); } -void QQuickAction::setText(const QString &text) +void QQuickAction1::setText(const QString &text) { if (text == m_text) return; @@ -216,7 +219,7 @@ namespace { bool qShortcutContextMatcher(QObject *o, Qt::ShortcutContext context) { - if (!static_cast<QQuickAction*>(o)->isEnabled()) + if (!static_cast<QQuickAction1*>(o)->isEnabled()) return false; switch (context) { @@ -242,7 +245,7 @@ bool qShortcutContextMatcher(QObject *o, Qt::ShortcutContext context) bool qMnemonicContextMatcher(QObject *o, Qt::ShortcutContext context) { - if (!static_cast<QQuickAction*>(o)->isEnabled()) + if (!static_cast<QQuickAction1*>(o)->isEnabled()) return false; switch (context) { @@ -254,7 +257,7 @@ bool qMnemonicContextMatcher(QObject *o, Qt::ShortcutContext context) w = w->parent(); if (QQuickItem * item = qobject_cast<QQuickItem*>(w)) w = item->window(); - else if (QQuickMenuBase *mb = qobject_cast<QQuickMenuBase *>(w)) { + else if (QQuickMenuBase1 *mb = qobject_cast<QQuickMenuBase1 *>(w)) { QQuickItem *vi = mb->visualItem(); if (vi && vi->isVisible()) w = vi->window(); @@ -275,12 +278,12 @@ bool qMnemonicContextMatcher(QObject *o, Qt::ShortcutContext context) } // namespace -QVariant QQuickAction::shortcut() const +QVariant QQuickAction1::shortcut() const { return m_shortcut.toString(QKeySequence::NativeText); } -void QQuickAction::setShortcut(const QVariant &arg) +void QQuickAction1::setShortcut(const QVariant &arg) { QKeySequence sequence; if (arg.type() == QVariant::Int) @@ -303,7 +306,7 @@ void QQuickAction::setShortcut(const QVariant &arg) emit shortcutChanged(shortcut()); } -void QQuickAction::setMnemonicFromText(const QString &text) +void QQuickAction1::setMnemonicFromText(const QString &text) { QKeySequence sequence = QKeySequence::mnemonic(text); if (m_mnemonic == sequence) @@ -320,7 +323,7 @@ void QQuickAction::setMnemonicFromText(const QString &text) } } -void QQuickAction::setIconSource(const QUrl &iconSource) +void QQuickAction1::setIconSource(const QUrl &iconSource) { if (iconSource == m_iconSource) return; @@ -335,12 +338,12 @@ void QQuickAction::setIconSource(const QUrl &iconSource) emit iconSourceChanged(); } -QString QQuickAction::iconName() const +QString QQuickAction1::iconName() const { return m_iconName; } -void QQuickAction::setIconName(const QString &iconName) +void QQuickAction1::setIconName(const QString &iconName) { if (iconName == m_iconName) return; @@ -350,7 +353,7 @@ void QQuickAction::setIconName(const QString &iconName) emit iconChanged(); } -void QQuickAction::setTooltip(const QString &arg) +void QQuickAction1::setTooltip(const QString &arg) { if (m_tooltip != arg) { m_tooltip = arg; @@ -358,7 +361,7 @@ void QQuickAction::setTooltip(const QString &arg) } } -void QQuickAction::setEnabled(bool e) +void QQuickAction1::setEnabled(bool e) { if (e == m_enabled) return; @@ -367,7 +370,7 @@ void QQuickAction::setEnabled(bool e) emit enabledChanged(); } -void QQuickAction::setCheckable(bool c) +void QQuickAction1::setCheckable(bool c) { if (c == m_checkable) return; @@ -381,7 +384,7 @@ void QQuickAction::setCheckable(bool c) emit toggled(m_checkable); } -void QQuickAction::setChecked(bool c) +void QQuickAction1::setChecked(bool c) { if (c == m_checked) return; @@ -392,12 +395,12 @@ void QQuickAction::setChecked(bool c) emit toggled(m_checked); } -QQuickExclusiveGroup1 *QQuickAction::exclusiveGroup() const +QQuickExclusiveGroup1 *QQuickAction1::exclusiveGroup() const { return m_exclusiveGroup.data(); } -void QQuickAction::setExclusiveGroup(QQuickExclusiveGroup1 *eg) +void QQuickAction1::setExclusiveGroup(QQuickExclusiveGroup1 *eg) { if (m_exclusiveGroup == eg) return; @@ -411,7 +414,7 @@ void QQuickAction::setExclusiveGroup(QQuickExclusiveGroup1 *eg) emit exclusiveGroupChanged(); } -bool QQuickAction::event(QEvent *e) +bool QQuickAction1::event(QEvent *e) { if (!m_enabled) return false; @@ -434,7 +437,7 @@ bool QQuickAction::event(QEvent *e) return true; } -void QQuickAction::trigger(QObject *source) +void QQuickAction1::trigger(QObject *source) { if (!m_enabled) return; |
