diff options
Diffstat (limited to 'src/widgets')
22 files changed, 4 insertions, 898 deletions
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 261039009c..d2c3b2ad0e 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -517,10 +517,8 @@ int QDialog::exec() setResult(0); bool showSystemDialogFullScreen = false; - if (showSystemDialogFullScreen) { - setWindowFlags(windowFlags() | Qt::WindowSoftkeysVisibleHint); + if (showSystemDialogFullScreen) setWindowState(Qt::WindowFullScreen); - } show(); QPointer<QDialog> guard = this; diff --git a/src/widgets/dialogs/qerrormessage.cpp b/src/widgets/dialogs/qerrormessage.cpp index a7c257b300..fa240ccaf3 100644 --- a/src/widgets/dialogs/qerrormessage.cpp +++ b/src/widgets/dialogs/qerrormessage.cpp @@ -66,10 +66,6 @@ extern bool qt_wince_is_mobile(); //defined in qguifunctions_wince.cpp extern bool qt_wince_is_high_dpi(); //defined in qguifunctions_wince.cpp #endif -#if defined(QT_SOFTKEYS_ENABLED) -#include <qaction.h> -#endif - QT_BEGIN_NAMESPACE class QErrorMessagePrivate : public QDialogPrivate @@ -80,9 +76,6 @@ public: QCheckBox * again; QTextEdit * errors; QLabel * icon; -#ifdef QT_SOFTKEYS_ENABLED - QAction *okAction; -#endif QQueue<QPair<QString, QString> > pending; QSet<QString> doNotShow; QSet<QString> doNotShowType; @@ -245,12 +238,6 @@ QErrorMessage::QErrorMessage(QWidget * parent) d->again->setChecked(true); grid->addWidget(d->again, 1, 1, Qt::AlignTop); d->ok = new QPushButton(this); -#ifdef QT_SOFTKEYS_ENABLED - d->okAction = new QAction(d->ok); - d->okAction->setSoftKeyRole(QAction::PositiveSoftKey); - connect(d->okAction, SIGNAL(triggered()), this, SLOT(accept())); - addAction(d->okAction); -#endif #if defined(Q_OS_WINCE) @@ -402,9 +389,6 @@ void QErrorMessagePrivate::retranslateStrings() { again->setText(QErrorMessage::tr("&Show this message again")); ok->setText(QErrorMessage::tr("&OK")); -#ifdef QT_SOFTKEYS_ENABLED - okAction->setText(ok->text()); -#endif } QT_END_NAMESPACE diff --git a/src/widgets/dialogs/qprogressdialog.cpp b/src/widgets/dialogs/qprogressdialog.cpp index fe7aeae558..fbbc4191bc 100644 --- a/src/widgets/dialogs/qprogressdialog.cpp +++ b/src/widgets/dialogs/qprogressdialog.cpp @@ -57,10 +57,6 @@ #include <private/qdialog_p.h> #include <limits.h> -#if defined(QT_SOFTKEYS_ENABLED) -#include <qaction.h> -#endif - QT_BEGIN_NAMESPACE // If the operation is expected to take this long (as predicted by @@ -81,9 +77,6 @@ public: #ifndef QT_NO_SHORTCUT escapeShortcut(0), #endif -#ifdef QT_SOFTKEYS_ENABLED - cancelAction(0), -#endif useDefaultCancelText(false) { } @@ -110,9 +103,6 @@ public: #ifndef QT_NO_SHORTCUT QShortcut *escapeShortcut; #endif -#ifdef QT_SOFTKEYS_ENABLED - QAction *cancelAction; -#endif bool useDefaultCancelText; QPointer<QObject> receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; @@ -443,16 +433,7 @@ void QProgressDialog::setCancelButton(QPushButton *cancelButton) int h = qMax(isVisible() ? height() : 0, sizeHint().height()); resize(w, h); if (cancelButton) -#if !defined(QT_SOFTKEYS_ENABLED) cancelButton->show(); -#else - { - d->cancelAction = new QAction(cancelButton->text(), cancelButton); - d->cancelAction->setSoftKeyRole(QAction::NegativeSoftKey); - connect(d->cancelAction, SIGNAL(triggered()), this, SIGNAL(canceled())); - addAction(d->cancelAction); - } -#endif } /*! @@ -471,9 +452,6 @@ void QProgressDialog::setCancelButtonText(const QString &cancelButtonText) if (!cancelButtonText.isNull()) { if (d->cancel) { d->cancel->setText(cancelButtonText); -#ifdef QT_SOFTKEYS_ENABLED - d->cancelAction->setText(cancelButtonText); -#endif } else { setCancelButton(new QPushButton(cancelButtonText, this)); } diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp index 58aa474368..7f1cb09225 100644 --- a/src/widgets/dialogs/qwizard.cpp +++ b/src/widgets/dialogs/qwizard.cpp @@ -75,10 +75,6 @@ extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp #include <string.h> // for memset() -#ifdef QT_SOFTKEYS_ENABLED -#include "qaction.h" -#endif - QT_BEGIN_NAMESPACE // These fudge terms were needed a few places to obtain pixel-perfect results @@ -565,12 +561,9 @@ public: , maximumWidth(QWIDGETSIZE_MAX) , maximumHeight(QWIDGETSIZE_MAX) { - for (int i = 0; i < QWizard::NButtons; ++i) { + for (int i = 0; i < QWizard::NButtons; ++i) btns[i] = 0; -#ifdef QT_SOFTKEYS_ENABLED - softKeys[i] = 0; -#endif - } + #if !defined(QT_NO_STYLE_WINDOWSVISTA) if (QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA && (QSysInfo::WindowsVersion & QSysInfo::WV_NT_based)) @@ -657,9 +650,6 @@ public: QLabel *titleLabel; QLabel *subTitleLabel; QWizardRuler *bottomRuler; -#ifdef QT_SOFTKEYS_ENABLED - mutable QAction *softKeys[QWizard::NButtons]; -#endif QVBoxLayout *pageVBoxLayout; QHBoxLayout *buttonLayout; @@ -1387,28 +1377,6 @@ bool QWizardPrivate::ensureButton(QWizard::WizardButton which) const if (which < QWizard::NStandardButtons) pushButton->setText(buttonDefaultText(wizStyle, which, this)); -#ifdef QT_SOFTKEYS_ENABLED - QAction *softKey = new QAction(pushButton->text(), pushButton); - QAction::SoftKeyRole softKeyRole; - switch(which) { - case QWizard::NextButton: - case QWizard::FinishButton: - case QWizard::CancelButton: - softKeyRole = QAction::NegativeSoftKey; - break; - case QWizard::BackButton: - case QWizard::CommitButton: - case QWizard::HelpButton: - case QWizard::CustomButton1: - case QWizard::CustomButton2: - case QWizard::CustomButton3: - default: - softKeyRole = QAction::PositiveSoftKey; - break; - } - softKey->setSoftKeyRole(softKeyRole); - softKeys[which] = softKey; -#endif connectButton(which); } return true; @@ -1422,10 +1390,6 @@ void QWizardPrivate::connectButton(QWizard::WizardButton which) const } else { QObject::connect(btns[which], SIGNAL(clicked()), q, SLOT(_q_emitCustomButtonClicked())); } - -#ifdef QT_SOFTKEYS_ENABLED - QObject::connect(softKeys[which], SIGNAL(triggered()), btns[which], SIGNAL(clicked())); -#endif } void QWizardPrivate::updateButtonTexts() @@ -1439,9 +1403,6 @@ void QWizardPrivate::updateButtonTexts() btns[i]->setText(buttonCustomTexts.value(i)); else if (i < QWizard::NStandardButtons) btns[i]->setText(buttonDefaultText(wizStyle, i, this)); -#ifdef QT_SOFTKEYS_ENABLED - softKeys[i]->setText(btns[i]->text()); -#endif } } } @@ -1686,19 +1647,6 @@ void QWizardPrivate::_q_updateButtonStates() } #endif -#ifdef QT_SOFTKEYS_ENABLED - QAbstractButton *wizardButton; - for (int i = 0; i < QWizard::NButtons; ++i) { - wizardButton = btns[i]; - if (wizardButton && !wizardButton->testAttribute(Qt::WA_WState_Hidden)) { - wizardButton->hide(); - q->addAction(softKeys[i]); - } else { - q->removeAction(softKeys[i]); - } - } -#endif - enableUpdates(); } diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 8cb6d70d15..0308fb44a9 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -62,7 +62,6 @@ #include <qaccessible.h> #include <qaccessible2.h> #endif -#include <private/qsoftkeymanager_p.h> #ifndef QT_NO_GESTURE # include <qscroller.h> #endif @@ -95,9 +94,6 @@ QAbstractItemViewPrivate::QAbstractItemViewPrivate() dropIndicatorPosition(QAbstractItemView::OnItem), defaultDropAction(Qt::IgnoreAction), #endif -#ifdef QT_SOFTKEYS_ENABLED - doneSoftKey(0), -#endif autoScroll(true), autoScrollMargin(16), autoScrollCount(0), @@ -139,10 +135,6 @@ void QAbstractItemViewPrivate::init() viewport->setBackgroundRole(QPalette::Base); q->setAttribute(Qt::WA_InputMethodEnabled); - -#ifdef QT_SOFTKEYS_ENABLED - doneSoftKey = QSoftKeyManager::createKeyedAction(QSoftKeyManager::DoneSoftKey, Qt::Key_Back, q); -#endif } void QAbstractItemViewPrivate::setHoverIndex(const QPersistentModelIndex &index) @@ -1611,11 +1603,6 @@ bool QAbstractItemView::event(QEvent *event) case QEvent::FontChange: d->doDelayedItemsLayout(); // the size of the items will change break; -#ifdef QT_SOFTKEYS_ENABLED - case QEvent::LanguageChange: - d->doneSoftKey->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::DoneSoftKey)); - break; -#endif default: break; } @@ -2197,11 +2184,6 @@ void QAbstractItemView::focusOutEvent(QFocusEvent *event) Q_D(QAbstractItemView); QAbstractScrollArea::focusOutEvent(event); d->viewport->update(); - -#ifdef QT_SOFTKEYS_ENABLED - if(!hasEditFocus()) - removeAction(d->doneSoftKey); -#endif } /*! @@ -2226,23 +2208,12 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) if (QApplication::keypadNavigationEnabled()) { if (!hasEditFocus()) { setEditFocus(true); -#ifdef QT_SOFTKEYS_ENABLED - // If we can't keypad navigate to any direction, there is no sense to add - // "Done" softkey, since it basically does nothing when there is - // only one widget in screen - if(QWidgetPrivate::canKeypadNavigate(Qt::Horizontal) - || QWidgetPrivate::canKeypadNavigate(Qt::Vertical)) - addAction(d->doneSoftKey); -#endif return; } } break; case Qt::Key_Back: if (QApplication::keypadNavigationEnabled() && hasEditFocus()) { -#ifdef QT_SOFTKEYS_ENABLED - removeAction(d->doneSoftKey); -#endif setEditFocus(false); } else { event->ignore(); diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index 5fa658d4b0..99d064ddba 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -402,10 +402,6 @@ public: Qt::DropAction defaultDropAction; #endif -#ifdef QT_SOFTKEYS_ENABLED - QAction *doneSoftKey; -#endif - QString keyboardInput; QElapsedTimer keyboardInputTime; diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri index b2f05e3cab..4d3d7c4e0a 100644 --- a/src/widgets/kernel/kernel.pri +++ b/src/widgets/kernel/kernel.pri @@ -33,8 +33,6 @@ HEADERS += \ kernel/qstandardgestures_p.h \ kernel/qgesturerecognizer.h \ kernel/qgesturemanager_p.h \ - kernel/qsoftkeymanager_p.h \ - kernel/qsoftkeymanager_common_p.h \ kernel/qdesktopwidget_qpa_p.h \ kernel/qwidgetwindow_qpa_p.h @@ -59,7 +57,6 @@ SOURCES += \ kernel/qstandardgestures.cpp \ kernel/qgesturerecognizer.cpp \ kernel/qgesturemanager.cpp \ - kernel/qsoftkeymanager.cpp \ kernel/qdesktopwidget.cpp \ kernel/qwidgetsvariant.cpp \ kernel/qapplication_qpa.cpp \ diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp index e835f927d0..64b856ea96 100644 --- a/src/widgets/kernel/qaction.cpp +++ b/src/widgets/kernel/qaction.cpp @@ -81,9 +81,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), - forceEnabledInSoftkeys(false), menuActionSoftkeys(false), iconVisibleInMenu(-1), - menuRole(QAction::TextHeuristicRole), softKeyRole(QAction::NoSoftKey), + menuRole(QAction::TextHeuristicRole), priority(QAction::NormalPriority) { #ifndef QT_NO_SHORTCUT @@ -280,27 +279,7 @@ void QActionPrivate::setShortcutEnabled(bool enable, QShortcutMap &map) File menu in your menubar and the File menu has a submenu, setting the MenuRole for the actions in that submenu have no effect. They will never be moved. */ -#ifndef qdoc -/*! \since 4.6 - \enum QAction::SoftKeyRole - - This enum describes how an action should be placed in the softkey bar. Currently this enum only - has an effect on the Symbian platform. - - \value NoSoftKey This action should not be used as a softkey - \value PositiveSoftKey This action is used to describe a softkey with a positive or non-destructive - role such as Ok, Select, or Options. - \value NegativeSoftKey This action is used to describe a soft ey with a negative or destructive role - role such as Cancel, Discard, or Close. - \value SelectSoftKey This action is used to describe a role that selects a particular item or widget - in the application. - - Actions with a softkey role defined are only visible in the softkey bar when the widget containing - the action has focus. If no widget currently has focus, the softkey framework will traverse up the - widget parent hierarchy looking for a widget containing softkey actions. - */ -#endif /*! Constructs an action with \a parent. If \a parent is an action group the action will be automatically inserted into the group. @@ -1287,34 +1266,6 @@ QAction::MenuRole QAction::menuRole() const return d->menuRole; } -#ifndef qdoc -/*! - \property QAction::softKeyRole - \brief the action's softkey role - \since 4.6 - - This indicates what type of role this action describes in the softkey framework - on platforms where such a framework is supported. Currently this is only - supported on the Symbian platform. - - The softkey role can be changed any time. -*/ -void QAction::setSoftKeyRole(SoftKeyRole softKeyRole) -{ - Q_D(QAction); - if (d->softKeyRole == softKeyRole) - return; - - d->softKeyRole = softKeyRole; - d->sendDataChanged(); -} - -QAction::SoftKeyRole QAction::softKeyRole() const -{ - Q_D(const QAction); - return d->softKeyRole; -} -#endif /*! \property QAction::iconVisibleInMenu \brief Whether or not an action should show an icon in a menu diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h index e149975de7..6a3c0bee68 100644 --- a/src/widgets/kernel/qaction.h +++ b/src/widgets/kernel/qaction.h @@ -66,9 +66,6 @@ class Q_WIDGETS_EXPORT QAction : public QObject Q_DECLARE_PRIVATE(QAction) Q_ENUMS(MenuRole) -#ifndef qdoc - Q_ENUMS(SoftKeyRole) -#endif Q_ENUMS(Priority) Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY changed) Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled) @@ -87,9 +84,6 @@ class Q_WIDGETS_EXPORT QAction : public QObject #endif Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY changed) Q_PROPERTY(MenuRole menuRole READ menuRole WRITE setMenuRole NOTIFY changed) -#ifndef qdoc - Q_PROPERTY(SoftKeyRole softKeyRole READ softKeyRole WRITE setSoftKeyRole NOTIFY changed) -#endif Q_PROPERTY(bool iconVisibleInMenu READ isIconVisibleInMenu WRITE setIconVisibleInMenu NOTIFY changed) Q_PROPERTY(Priority priority READ priority WRITE setPriority) @@ -97,10 +91,6 @@ public: // note this is copied into qplatformmenu.h, which must stay in sync enum MenuRole { NoRole = 0, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, AboutRole, PreferencesRole, QuitRole }; -#ifndef qdoc - enum SoftKeyRole { - NoSoftKey, PositiveSoftKey, NegativeSoftKey, SelectSoftKey }; -#endif enum Priority { LowPriority = 0, NormalPriority = 128, HighPriority = 256}; @@ -178,10 +168,6 @@ public: void setMenuRole(MenuRole menuRole); MenuRole menuRole() const; -#ifndef qdoc - void setSoftKeyRole(SoftKeyRole softKeyRole); - SoftKeyRole softKeyRole() const; -#endif void setIconVisibleInMenu(bool visible); bool isIconVisibleInMenu() const; diff --git a/src/widgets/kernel/qaction_p.h b/src/widgets/kernel/qaction_p.h index 6e25427b31..32c55e6de2 100644 --- a/src/widgets/kernel/qaction_p.h +++ b/src/widgets/kernel/qaction_p.h @@ -106,13 +106,9 @@ public: uint separator : 1; uint fontSet : 1; - //for soft keys management - uint forceEnabledInSoftkeys : 1; - uint menuActionSoftkeys : 1; int iconVisibleInMenu : 3; // Only has values -1, 0, and 1 QAction::MenuRole menuRole; - QAction::SoftKeyRole softKeyRole; QAction::Priority priority; QList<QWidget *> widgets; diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 3e0f803f5d..efa52456e8 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -902,7 +902,6 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis || event->type() == QEvent::Resize || event->type() == QEvent::Move || event->type() == QEvent::LanguageChange - || event->type() == QEvent::UpdateSoftKeys || event->type() == QEvent::InputMethod)) { for (QPostEventList::const_iterator it = postedEvents->constBegin(); it != postedEvents->constEnd(); ++it) { const QPostEvent &cur = *it; @@ -917,8 +916,6 @@ bool QApplication::compressEvent(QEvent *event, QObject *receiver, QPostEventLis ((QMoveEvent *)(cur.event))->p = ((QMoveEvent *)event)->p; } else if (cur.event->type() == QEvent::LanguageChange) { ; - } else if (cur.event->type() == QEvent::UpdateSoftKeys) { - ; } else if ( cur.event->type() == QEvent::InputMethod ) { *(QInputMethodEvent *)(cur.event) = *(QInputMethodEvent *)event; } else { diff --git a/src/widgets/kernel/qsoftkeymanager.cpp b/src/widgets/kernel/qsoftkeymanager.cpp deleted file mode 100644 index 64ee6b0f2e..0000000000 --- a/src/widgets/kernel/qsoftkeymanager.cpp +++ /dev/null @@ -1,270 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 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 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qapplication.h" -#include "qevent.h" -#include "qbitmap.h" -#include "private/qsoftkeymanager_p.h" -#include "private/qaction_p.h" -#include "private/qsoftkeymanager_common_p.h" - -#ifndef QT_NO_SOFTKEYMANAGER -QT_BEGIN_NAMESPACE - -QSoftKeyManager *QSoftKeyManagerPrivate::self = 0; - -QString QSoftKeyManager::standardSoftKeyText(StandardSoftKey standardKey) -{ - QString softKeyText; - switch (standardKey) { - case OkSoftKey: - softKeyText = QSoftKeyManager::tr("Ok"); - break; - case SelectSoftKey: - softKeyText = QSoftKeyManager::tr("Select"); - break; - case DoneSoftKey: - softKeyText = QSoftKeyManager::tr("Done"); - break; - case MenuSoftKey: - softKeyText = QSoftKeyManager::tr("Options"); - break; - case CancelSoftKey: - softKeyText = QSoftKeyManager::tr("Cancel"); - break; - default: - break; - }; - - return softKeyText; -} - -QSoftKeyManager *QSoftKeyManager::instance() -{ - if (!QSoftKeyManagerPrivate::self) - QSoftKeyManagerPrivate::self = new QSoftKeyManager; - - return QSoftKeyManagerPrivate::self; -} - -QSoftKeyManager::QSoftKeyManager() : - QObject(*(new QSoftKeyManagerPrivate), 0) -{ -} - -QAction *QSoftKeyManager::createAction(StandardSoftKey standardKey, QWidget *actionWidget) -{ - QAction *action = new QAction(standardSoftKeyText(standardKey), actionWidget); - QAction::SoftKeyRole softKeyRole = QAction::NoSoftKey; - switch (standardKey) { - case MenuSoftKey: // FALL-THROUGH - QActionPrivate::get(action)->menuActionSoftkeys = true; - case OkSoftKey: - case SelectSoftKey: - case DoneSoftKey: - softKeyRole = QAction::PositiveSoftKey; - break; - case CancelSoftKey: - softKeyRole = QAction::NegativeSoftKey; - break; - } - action->setSoftKeyRole(softKeyRole); - action->setVisible(false); - setForceEnabledInSoftkeys(action); - return action; -} - -/*! \internal - - Creates a QAction and registers the 'triggered' signal to send the given key event to - \a actionWidget as a convenience. - -*/ -QAction *QSoftKeyManager::createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget) -{ -#ifndef QT_NO_ACTION - QScopedPointer<QAction> action(createAction(standardKey, actionWidget)); - - connect(action.data(), SIGNAL(triggered()), QSoftKeyManager::instance(), SLOT(sendKeyEvent())); - connect(action.data(), SIGNAL(destroyed(QObject*)), QSoftKeyManager::instance(), SLOT(cleanupHash(QObject*))); - QSoftKeyManager::instance()->d_func()->keyedActions.insert(action.data(), key); - return action.take(); -#endif //QT_NO_ACTION -} - -void QSoftKeyManager::cleanupHash(QObject *obj) -{ - Q_D(QSoftKeyManager); - QAction *action = qobject_cast<QAction*>(obj); - d->keyedActions.remove(action); -} - -void QSoftKeyManager::sendKeyEvent() -{ - Q_D(QSoftKeyManager); - QAction *action = qobject_cast<QAction*>(sender()); - - if (!action) - return; - - Qt::Key keyToSend = d->keyedActions.value(action, Qt::Key_unknown); - - if (keyToSend != Qt::Key_unknown) - QApplication::postEvent(action->parentWidget(), - new QKeyEvent(QEvent::KeyPress, keyToSend, Qt::NoModifier)); -} - -void QSoftKeyManager::updateSoftKeys() -{ - QSoftKeyManager::instance()->d_func()->pendingUpdate = true; - QEvent *event = new QEvent(QEvent::UpdateSoftKeys); - QApplication::postEvent(QSoftKeyManager::instance(), event); -} - -bool QSoftKeyManager::appendSoftkeys(const QWidget &source, int level) -{ - Q_D(QSoftKeyManager); - bool ret = false; - foreach(QAction *action, source.actions()) { - if (action->softKeyRole() != QAction::NoSoftKey - && (action->isVisible() || isForceEnabledInSofkeys(action))) { - d->requestedSoftKeyActions.insert(level, action); - ret = true; - } - } - return ret; -} - - -static bool isChildOf(const QWidget *c, const QWidget *p) -{ - while (c) { - if (c == p) - return true; - c = c->parentWidget(); - } - return false; -} - -QWidget *QSoftKeyManager::softkeySource(QWidget *previousSource, bool& recursiveMerging) -{ - Q_D(QSoftKeyManager); - QWidget *source = NULL; - if (!previousSource) { - // Initial source is primarily focuswidget and secondarily activeWindow - QWidget *focus = QApplication::focusWidget(); - QWidget *popup = QApplication::activePopupWidget(); - if (popup) { - if (isChildOf(focus, popup)) - source = focus; - else - source = popup; - } - if (!source) { - QWidget *modal = QApplication::activeModalWidget(); - if (modal) { - if (isChildOf(focus, modal)) - source = focus; - else - source = modal; - } - } - if (!source) { - source = focus; - if (!source) - source = QApplication::activeWindow(); - } - } else { - // Softkey merging is based on four criterias - // 1. Implicit merging is used whenever focus widget does not specify any softkeys - bool implicitMerging = d->requestedSoftKeyActions.isEmpty(); - // 2. Explicit merging with parent is used whenever WA_MergeSoftkeys widget attribute is set - bool explicitMerging = previousSource->testAttribute(Qt::WA_MergeSoftkeys); - // 3. Explicit merging with all parents - recursiveMerging |= previousSource->testAttribute(Qt::WA_MergeSoftkeysRecursively); - // 4. Implicit and explicit merging always stops at window boundary - bool merging = (implicitMerging || explicitMerging || recursiveMerging) && !previousSource->isWindow(); - - source = merging ? previousSource->parentWidget() : NULL; - } - return source; -} - -bool QSoftKeyManager::handleUpdateSoftKeys() -{ - Q_D(QSoftKeyManager); - int level = 0; - d->requestedSoftKeyActions.clear(); - bool recursiveMerging = false; - QWidget *source = softkeySource(NULL, recursiveMerging); - d->initialSoftKeySource = source; - while (source) { - if (appendSoftkeys(*source, level)) - ++level; - source = softkeySource(source, recursiveMerging); - } - - d->updateSoftKeys_sys(); - d->pendingUpdate = false; - return true; -} - -void QSoftKeyManager::setForceEnabledInSoftkeys(QAction *action) -{ - QActionPrivate::get(action)->forceEnabledInSoftkeys = true; -} - -bool QSoftKeyManager::isForceEnabledInSofkeys(QAction *action) -{ - return QActionPrivate::get(action)->forceEnabledInSoftkeys; -} - -bool QSoftKeyManager::event(QEvent *e) -{ -#ifndef QT_NO_ACTION - if (e->type() == QEvent::UpdateSoftKeys) - return handleUpdateSoftKeys(); -#endif //QT_NO_ACTION - return false; -} - -QT_END_NAMESPACE -#endif //QT_NO_SOFTKEYMANAGER diff --git a/src/widgets/kernel/qsoftkeymanager_common_p.h b/src/widgets/kernel/qsoftkeymanager_common_p.h deleted file mode 100644 index 27e1b869ae..0000000000 --- a/src/widgets/kernel/qsoftkeymanager_common_p.h +++ /dev/null @@ -1,85 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 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 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSOFTKEYMANAGER_COMMON_P_H -#define QSOFTKEYMANAGER_COMMON_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <private/qobject_p.h> - -QT_BEGIN_HEADER - -#ifndef QT_NO_SOFTKEYMANAGER - -QT_BEGIN_NAMESPACE - -class QSoftKeyManagerPrivate : public QObjectPrivate -{ - Q_DECLARE_PUBLIC(QSoftKeyManager) - -public: - virtual void updateSoftKeys_sys() {} - -protected: - static QSoftKeyManager *self; - QHash<QAction*, Qt::Key> keyedActions; - QMultiHash<int, QAction*> requestedSoftKeyActions; - QWidget *initialSoftKeySource; - bool pendingUpdate; -}; - -QT_END_NAMESPACE - -#endif //QT_NO_SOFTKEYMANAGER - -QT_END_HEADER - -#endif // QSOFTKEYMANAGER_COMMON_P_H diff --git a/src/widgets/kernel/qsoftkeymanager_p.h b/src/widgets/kernel/qsoftkeymanager_p.h deleted file mode 100644 index a80088d33c..0000000000 --- a/src/widgets/kernel/qsoftkeymanager_p.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** 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 Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/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 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 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 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QSOFTKEYMANAGER_P_H -#define QSOFTKEYMANAGER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include <QtCore/qobject.h> -#include "QtWidgets/qaction.h" - -QT_BEGIN_HEADER - -#ifndef QT_NO_SOFTKEYMANAGER -QT_BEGIN_NAMESPACE - -class QSoftKeyManagerPrivate; - -class Q_AUTOTEST_EXPORT QSoftKeyManager : public QObject -{ - Q_OBJECT - Q_DECLARE_PRIVATE(QSoftKeyManager) - -public: - - enum StandardSoftKey { - OkSoftKey, - SelectSoftKey, - DoneSoftKey, - MenuSoftKey, - CancelSoftKey - }; - - static void updateSoftKeys(); - - static QAction *createAction(StandardSoftKey standardKey, QWidget *actionWidget); - static QAction *createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget); - static QString standardSoftKeyText(StandardSoftKey standardKey); - static void setForceEnabledInSoftkeys(QAction *action); - static bool isForceEnabledInSofkeys(QAction *action); - -protected: - bool event(QEvent *e); - -private: - QSoftKeyManager(); - static QSoftKeyManager *instance(); - bool appendSoftkeys(const QWidget &source, int level); - QWidget *softkeySource(QWidget *previousSource, bool& recursiveMerging); - bool handleUpdateSoftKeys(); - -private Q_SLOTS: - void cleanupHash(QObject* obj); - void sendKeyEvent(); - -private: - Q_DISABLE_COPY(QSoftKeyManager) -}; - -QT_END_NAMESPACE -#endif //QT_NO_SOFTKEYMANAGER - -QT_END_HEADER - -#endif //QSOFTKEYMANAGER_P_H diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 07dab9e784..2feb797985 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -77,7 +77,6 @@ #include "private/qstylesheetstyle_p.h" #include "private/qstyle_p.h" #include "qfileinfo.h" -#include "private/qsoftkeymanager_p.h" #include <QtGui/qinputmethod.h> #include <private/qgraphicseffect_p.h> @@ -906,30 +905,6 @@ void QWidget::setAutoFillBackground(bool enabled) \sa QEvent, QPainter, QGridLayout, QBoxLayout - \section1 Softkeys - - Since Qt 4.6, Softkeys are usually physical keys on a device that have a corresponding label or - other visual representation on the screen that is generally located next to its - physical counterpart. They are most often found on mobile phone platforms. In - modern touch based user interfaces it is also possible to have softkeys that do - not correspond to any physical keys. Softkeys differ from other onscreen labels - in that they are contextual. - - In Qt, contextual softkeys are added to a widget by calling addAction() and - passing a \c QAction with a softkey role set on it. When the widget - containing the softkey actions has focus, its softkeys should appear in - the user interface. Softkeys are discovered by traversing the widget - hierarchy so it is possible to define a single set of softkeys that are - present at all times by calling addAction() for a given top level widget. - - On some platforms, this concept overlaps with \c QMenuBar such that if no - other softkeys are found and the top level widget is a QMainWindow containing - a QMenuBar, the menubar actions may appear on one of the softkeys. - - Note: Currently softkeys are only supported on the Symbian Platform. - - \sa addAction(), QAction, QMenuBar - */ QWidgetMapper *QWidgetPrivate::mapper = 0; // widget with wid @@ -7956,9 +7931,6 @@ bool QWidget::event(QEvent *event) } break; case QEvent::FocusIn: -#ifdef QT_SOFTKEYS_ENABLED - QSoftKeyManager::updateSoftKeys(); -#endif focusInEvent((QFocusEvent*)event); d->updateWidgetTransform(); break; @@ -8109,12 +8081,6 @@ bool QWidget::event(QEvent *event) if (w && w->isVisible() && !w->isWindow()) QApplication::sendEvent(w, event); } - -#ifdef QT_SOFTKEYS_ENABLED - if (isWindow()) - QSoftKeyManager::updateSoftKeys(); -#endif - break; } case QEvent::LanguageChange: @@ -8199,9 +8165,6 @@ bool QWidget::event(QEvent *event) case QEvent::ActionAdded: case QEvent::ActionRemoved: case QEvent::ActionChanged: -#ifdef QT_SOFTKEYS_ENABLED - QSoftKeyManager::updateSoftKeys(); -#endif actionEvent((QActionEvent*)event); break; #endif diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp index fcb3a6df03..8c66ec4051 100644 --- a/src/widgets/statemachine/qguistatemachine.cpp +++ b/src/widgets/statemachine/qguistatemachine.cpp @@ -442,9 +442,6 @@ static QEvent *cloneEvent(QEvent *e) break; #endif - case QEvent::UpdateSoftKeys: - return new QEvent(*e); - case QEvent::User: case QEvent::MaxUser: Q_ASSERT_X(false, "cloneEvent()", "not implemented"); diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp index ef908d62c6..f22fc196a2 100644 --- a/src/widgets/widgets/qcombobox.cpp +++ b/src/widgets/widgets/qcombobox.cpp @@ -64,7 +64,6 @@ #include <private/qcombobox_p.h> #include <private/qabstractitemmodel_p.h> #include <private/qabstractscrollarea_p.h> -#include <private/qsoftkeymanager_p.h> #include <qdebug.h> #if defined(Q_WS_MAC) && !defined(QT_NO_EFFECTS) && !defined(QT_NO_STYLE_MAC) #include <private/qcore_mac_p.h> @@ -561,13 +560,6 @@ void QComboBoxPrivateContainer::setItemView(QAbstractItemView *itemView) #endif connect(view, SIGNAL(destroyed()), this, SLOT(viewDestroyed())); - -#ifdef QT_SOFTKEYS_ENABLED - selectAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::SelectSoftKey, Qt::Key_Select, itemView); - cancelAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::CancelSoftKey, Qt::Key_Escape, itemView); - addAction(selectAction); - addAction(cancelAction); -#endif } /*! @@ -617,11 +609,6 @@ void QComboBoxPrivateContainer::changeEvent(QEvent *e) view->setMouseTracking(combo->style()->styleHint(QStyle::SH_ComboBox_ListMouseTracking, &opt, combo) || combo->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, combo)); setFrameStyle(combo->style()->styleHint(QStyle::SH_ComboBox_PopupFrameStyle, &opt, combo)); -#ifdef QT_SOFTKEYS_ENABLED - } else if (e->type() == QEvent::LanguageChange) { - selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey)); - cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey)); -#endif } QWidget::changeEvent(e); diff --git a/src/widgets/widgets/qcombobox_p.h b/src/widgets/widgets/qcombobox_p.h index eaf218283d..c51e6bb388 100644 --- a/src/widgets/widgets/qcombobox_p.h +++ b/src/widgets/widgets/qcombobox_p.h @@ -254,10 +254,6 @@ private: QAbstractItemView *view; QComboBoxPrivateScroller *top; QComboBoxPrivateScroller *bottom; -#ifdef QT_SOFTKEYS_ENABLED - QAction *selectAction; - QAction *cancelAction; -#endif }; class QComboMenuDelegate : public QAbstractItemDelegate diff --git a/src/widgets/widgets/qdialogbuttonbox.cpp b/src/widgets/widgets/qdialogbuttonbox.cpp index d25332a077..f20fc522ba 100644 --- a/src/widgets/widgets/qdialogbuttonbox.cpp +++ b/src/widgets/widgets/qdialogbuttonbox.cpp @@ -255,31 +255,6 @@ static const uint layouts[2][5][14] = } }; -#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION) -class QDialogButtonEnabledProxy : public QObject -{ -public: - QDialogButtonEnabledProxy(QObject *parent, QWidget *src, QAction *trg) : QObject(parent), source(src), target(trg) - { - source->installEventFilter(this); - target->setEnabled(source->isEnabled()); - } - ~QDialogButtonEnabledProxy() - { - source->removeEventFilter(this); - } - bool eventFilter(QObject *object, QEvent *event) - { - if (object == source && event->type() == QEvent::EnabledChange) { - target->setEnabled(source->isEnabled()); - } - return false; - }; -private: - QWidget *source; - QAction *target; -}; -#endif class QDialogButtonBoxPrivate : public QWidgetPrivate { @@ -290,9 +265,6 @@ public: QList<QAbstractButton *> buttonLists[QDialogButtonBox::NRoles]; QHash<QPushButton *, QDialogButtonBox::StandardButton> standardButtonHash; -#ifdef QT_SOFTKEYS_ENABLED - QHash<QAbstractButton *, QAction *> softKeyActions; -#endif Qt::Orientation orientation; QDialogButtonBox::ButtonLayout layoutPolicy; @@ -312,9 +284,6 @@ public: void addButtonsToLayout(const QList<QAbstractButton *> &buttonList, bool reverse); void retranslateStrings(); const char *standardButtonText(QDialogButtonBox::StandardButton sbutton) const; -#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION) - QAction *createSoftKey(QAbstractButton *button, QDialogButtonBox::ButtonRole role); -#endif }; QDialogButtonBoxPrivate::QDialogButtonBoxPrivate(Qt::Orientation orient) @@ -577,62 +546,10 @@ void QDialogButtonBoxPrivate::addButton(QAbstractButton *button, QDialogButtonBo QObject::connect(button, SIGNAL(clicked()), q, SLOT(_q_handleButtonClicked())); QObject::connect(button, SIGNAL(destroyed()), q, SLOT(_q_handleButtonDestroyed())); buttonLists[role].append(button); -#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION) - QAction *action = createSoftKey(button, role); - softKeyActions.insert(button, action); - new QDialogButtonEnabledProxy(action, button, action); -#endif if (doLayout) layoutButtons(); } -#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION) -QAction* QDialogButtonBoxPrivate::createSoftKey(QAbstractButton *button, QDialogButtonBox::ButtonRole role) -{ - Q_Q(QDialogButtonBox); - QAction::SoftKeyRole softkeyRole; - - QAction *action = new QAction(button->text(), button); - - switch (role) { - case ApplyRole: - case AcceptRole: - case YesRole: - case ActionRole: - case HelpRole: - softkeyRole = QAction::PositiveSoftKey; - break; - case RejectRole: - case DestructiveRole: - case NoRole: - case ResetRole: - softkeyRole = QAction::NegativeSoftKey; - break; - default: - break; - } - QObject::connect(action, SIGNAL(triggered()), button, SIGNAL(clicked())); - action->setSoftKeyRole(softkeyRole); - - - QWidget *dialog = 0; - QWidget *p = q; - while (p && !p->isWindow()) { - p = p->parentWidget(); - if ((dialog = qobject_cast<QDialog *>(p))) - break; - } - - if (dialog) { - dialog->addAction(action); - } else { - q->addAction(action); - } - - return action; -} -#endif - void QDialogButtonBoxPrivate::createStandardButtons(QDialogButtonBox::StandardButtons buttons) { uint i = QDialogButtonBox::FirstButton; @@ -724,11 +641,6 @@ void QDialogButtonBoxPrivate::retranslateStrings() if (buttonText) { QPushButton *button = it.key(); button->setText(QDialogButtonBox::tr(buttonText)); -#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION) - QAction *action = softKeyActions.value(button, 0); - if (action) - action->setText(button->text()); -#endif } ++it; } @@ -921,11 +833,6 @@ void QDialogButtonBox::setOrientation(Qt::Orientation orientation) void QDialogButtonBox::clear() { Q_D(QDialogButtonBox); -#ifdef QT_SOFTKEYS_ENABLED - // Delete softkey actions as they have the buttons as parents - qDeleteAll(d->softKeyActions.values()); - d->softKeyActions.clear(); -#endif // Remove the created standard buttons, they should be in the other lists, which will // do the deletion d->standardButtonHash.clear(); @@ -1003,13 +910,6 @@ void QDialogButtonBox::removeButton(QAbstractButton *button) } } } -#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION) - QAction *action = d->softKeyActions.value(button, 0); - if (action) { - d->softKeyActions.remove(button); - delete action; - } -#endif if (!d->internalRemove) button->setParent(0); } @@ -1080,11 +980,6 @@ QPushButton *QDialogButtonBox::addButton(StandardButton button) void QDialogButtonBox::setStandardButtons(StandardButtons buttons) { Q_D(QDialogButtonBox); -#ifdef QT_SOFTKEYS_ENABLED - // Delete softkey actions since they have the buttons as parents - qDeleteAll(d->softKeyActions.values()); - d->softKeyActions.clear(); -#endif // Clear out all the old standard buttons, then recreate them. qDeleteAll(d->standardButtonHash.keys()); d->standardButtonHash.clear(); @@ -1242,38 +1137,9 @@ bool QDialogButtonBox::event(QEvent *event) } if (!hasDefault && firstAcceptButton) firstAcceptButton->setDefault(true); -#ifdef QT_SOFTKEYS_ENABLED - if (dialog) - setFixedSize(0,0); -#endif }else if (event->type() == QEvent::LanguageChange) { d->retranslateStrings(); } -#if defined(QT_SOFTKEYS_ENABLED) && !defined(QT_NO_ACTION) - else if (event->type() == QEvent::ParentChange) { - QWidget *dialog = 0; - QWidget *p = this; - while (p && !p->isWindow()) { - p = p->parentWidget(); - if ((dialog = qobject_cast<QDialog *>(p))) - break; - } - - // If the parent changes, then move the softkeys - for (QHash<QAbstractButton *, QAction *>::const_iterator it = d->softKeyActions.constBegin(); - it != d->softKeyActions.constEnd(); ++it) { - QAction *current = it.value(); - QList<QWidget *> widgets = current->associatedWidgets(); - foreach (QWidget *w, widgets) - w->removeAction(current); - if (dialog) - dialog->addAction(current); - else - addAction(current); - } - } -#endif - return QWidget::event(event); } diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index ffded7839f..fe7e444e86 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -69,7 +69,6 @@ #include "qpushbutton.h" #include <private/qpushbutton_p.h> #include <private/qaction_p.h> -#include <private/qsoftkeymanager_p.h> #include <private/qguiapplication_p.h> QT_BEGIN_NAMESPACE @@ -158,15 +157,6 @@ void QMenuPrivate::init() QObject::connect(platformMenu, SIGNAL(aboutToShow()), q, SIGNAL(aboutToShow())); QObject::connect(platformMenu, SIGNAL(aboutToHide()), q, SIGNAL(aboutToHide())); } - -#ifdef QT_SOFTKEYS_ENABLED - selectAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::SelectSoftKey, Qt::Key_Select, q); - cancelAction = QSoftKeyManager::createKeyedAction(QSoftKeyManager::CancelSoftKey, Qt::Key_Back, q); - selectAction->setPriority(QAction::HighPriority); - cancelAction->setPriority(QAction::HighPriority); - q->addAction(selectAction); - q->addAction(cancelAction); -#endif } int QMenuPrivate::scrollerHeight() const @@ -1674,12 +1664,6 @@ void QMenu::clear() QList<QAction*> acts = actions(); for(int i = 0; i < acts.size(); i++) { -#ifdef QT_SOFTKEYS_ENABLED - Q_D(QMenu); - // Lets not touch to our internal softkey actions - if(acts[i] == d->selectAction || acts[i] == d->cancelAction) - continue; -#endif removeAction(acts[i]); if (acts[i]->parent() == this && acts[i]->d_func()->widgets.isEmpty()) delete acts[i]; @@ -2383,13 +2367,6 @@ QMenu::event(QEvent *e) } return true; #endif -#ifdef QT_SOFTKEYS_ENABLED - case QEvent::LanguageChange: { - d->selectAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::SelectSoftKey)); - d->cancelAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::CancelSoftKey)); - } - break; -#endif default: break; } diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp index f6665cba9a..35c665bb25 100644 --- a/src/widgets/widgets/qmenubar.cpp +++ b/src/widgets/widgets/qmenubar.cpp @@ -70,10 +70,6 @@ extern bool qt_wince_is_mobile(); //defined in qguifunctions_wce.cpp #endif -#ifdef QT_SOFTKEYS_ENABLED -#include <private/qsoftkeymanager_p.h> -#endif - QT_BEGIN_NAMESPACE class QMenuBarExtension : public QToolButton @@ -719,9 +715,6 @@ void QMenuBarPrivate::init() #endif q->setBackgroundRole(QPalette::Button); oldWindow = oldParent = 0; -#ifdef QT_SOFTKEYS_ENABLED - menuBarAction = 0; -#endif handleReparent(); q->setMouseTracking(q->style()->styleHint(QStyle::SH_MenuBar_MouseTracking, 0, q)); @@ -1405,11 +1398,6 @@ void QMenuBar::changeEvent(QEvent *e) || e->type() == QEvent::ApplicationFontChange) { d->itemsDirty = true; d->updateGeometries(); -#ifdef QT_SOFTKEYS_ENABLED - } else if (e->type() == QEvent::LanguageChange) { - if (d->menuBarAction) - d->menuBarAction->setText(QSoftKeyManager::standardSoftKeyText(QSoftKeyManager::MenuSoftKey)); -#endif } QWidget::changeEvent(e); diff --git a/src/widgets/widgets/qmenubar_p.h b/src/widgets/widgets/qmenubar_p.h index 4960c60f83..0f08a4e414 100644 --- a/src/widgets/widgets/qmenubar_p.h +++ b/src/widgets/widgets/qmenubar_p.h @@ -188,9 +188,6 @@ public: void wceRefresh(); bool wceEmitSignals(QList<QWceMenuAction*> actions, uint command); #endif -#ifdef QT_SOFTKEYS_ENABLED - QAction *menuBarAction; -#endif }; #endif // QT_NO_MENUBAR |