diff options
Diffstat (limited to 'src/gui/kernel/qplatformtheme.cpp')
-rw-r--r-- | src/gui/kernel/qplatformtheme.cpp | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformtheme.cpp b/src/gui/kernel/qplatformtheme.cpp index 3548ec0199..90edf4c49f 100644 --- a/src/gui/kernel/qplatformtheme.cpp +++ b/src/gui/kernel/qplatformtheme.cpp @@ -51,6 +51,7 @@ #include <private/qiconloader_p.h> #include <private/qguiapplication_p.h> #include <qpa/qplatformintegration.h> +#include <qpa/qplatformdialoghelper.h> QT_BEGIN_NAMESPACE @@ -79,6 +80,9 @@ QT_BEGIN_NAMESPACE \value MouseDoubleClickInterval (int) Mouse double click interval in ms, overriding QPlatformIntegration::styleHint. + \value MousePressAndHoldInterval (int) Mouse press and hold interval in ms, + overriding QPlatformIntegration::styleHint. + \value StartDragDistance (int) Start drag distance, overriding QPlatformIntegration::styleHint. @@ -425,6 +429,8 @@ QVariant QPlatformTheme::themeHint(ThemeHint hint) const return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::PasswordMaskDelay); case QPlatformTheme::PasswordMaskCharacter: return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::PasswordMaskCharacter); + case QPlatformTheme::MousePressAndHoldInterval: + return QGuiApplicationPrivate::platformIntegration()->styleHint(QPlatformIntegration::MousePressAndHoldInterval); default: return QPlatformTheme::defaultThemeHint(hint); } @@ -491,6 +497,8 @@ QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint) case DialogSnapToDefaultButton: case ContextMenuOnMouseRelease: return QVariant(false); + case MousePressAndHoldInterval: + return QVariant(800); } return QVariant(); } @@ -620,6 +628,63 @@ QList<QKeySequence> QPlatformTheme::keyBindings(QKeySequence::StandardKey key) c return list; } +/*! + Returns the text of a standard \a button. + + \since 5.3 + \sa QMessageDialogOptions::StandardButton + */ + +QString QPlatformTheme::standardButtonText(int button) const +{ + return QPlatformTheme::defaultStandardButtonText(button); +} + +QString QPlatformTheme::defaultStandardButtonText(int button) +{ + switch (button) { + case QMessageDialogOptions::Ok: + return QCoreApplication::translate("QPlatformTheme", "OK"); + case QMessageDialogOptions::Save: + return QCoreApplication::translate("QPlatformTheme", "Save"); + case QMessageDialogOptions::SaveAll: + return QCoreApplication::translate("QPlatformTheme", "Save All"); + case QMessageDialogOptions::Open: + return QCoreApplication::translate("QPlatformTheme", "Open"); + case QMessageDialogOptions::Yes: + return QCoreApplication::translate("QPlatformTheme", "&Yes"); + case QMessageDialogOptions::YesToAll: + return QCoreApplication::translate("QPlatformTheme", "Yes to &All"); + case QMessageDialogOptions::No: + return QCoreApplication::translate("QPlatformTheme", "&No"); + case QMessageDialogOptions::NoToAll: + return QCoreApplication::translate("QPlatformTheme", "N&o to All"); + case QMessageDialogOptions::Abort: + return QCoreApplication::translate("QPlatformTheme", "Abort"); + case QMessageDialogOptions::Retry: + return QCoreApplication::translate("QPlatformTheme", "Retry"); + case QMessageDialogOptions::Ignore: + return QCoreApplication::translate("QPlatformTheme", "Ignore"); + case QMessageDialogOptions::Close: + return QCoreApplication::translate("QPlatformTheme", "Close"); + case QMessageDialogOptions::Cancel: + return QCoreApplication::translate("QPlatformTheme", "Cancel"); + case QMessageDialogOptions::Discard: + return QCoreApplication::translate("QPlatformTheme", "Discard"); + case QMessageDialogOptions::Help: + return QCoreApplication::translate("QPlatformTheme", "Help"); + case QMessageDialogOptions::Apply: + return QCoreApplication::translate("QPlatformTheme", "Apply"); + case QMessageDialogOptions::Reset: + return QCoreApplication::translate("QPlatformTheme", "Reset"); + case QMessageDialogOptions::RestoreDefaults: + return QCoreApplication::translate("QPlatformTheme", "Restore Defaults"); + default: + break; + } + return QString(); +} + unsigned QPlatformThemePrivate::currentKeyPlatforms() { const uint keyboardScheme = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::KeyboardScheme).toInt(); |