diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-02-07 14:04:37 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-15 10:43:20 +0100 |
commit | 760a771fce3758fe34b1f3ce8a22f283bb24b326 (patch) | |
tree | facfdedcfe17c21c8ae2de061ea79f6ff60f3fe1 /src/plugins/platforms/winrt | |
parent | f8dbed12266c42785c1e4758eed05833ec035f33 (diff) |
Consolidate StandardButton, ButtonRole and related static functions
Moving them into QPlatformDialogHelper for the convenience of both
widgets and QtQuick.Dialogs. The main reason is to ensure that
QtQuick.Dialogs does not need to depend on the widgets module, in
order to re-implement the button box concept in a generic dialog.
Change-Id: If400d215338d7cb6dade39d9de60e50b5e7515ef
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/platforms/winrt')
-rw-r--r-- | src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp b/src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp index 1bc3e95f18..e70d06860c 100644 --- a/src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp +++ b/src/plugins/platforms/winrt/qwinrtplatformmessagedialoghelper.cpp @@ -128,9 +128,9 @@ bool QWinRTPlatformMessageDialogHelper::show(Qt::WindowFlags windowFlags, Qt::Wi // If no button is specified we need to create one to get close notification int buttons = options->standardButtons(); if (buttons == 0) - buttons = QMessageDialogOptions::Ok; + buttons = QPlatformDialogHelper::Ok; - for (int i = QMessageDialogOptions::FirstButton; i < QMessageDialogOptions::LastButton; i<<=1) { + for (int i = QPlatformDialogHelper::FirstButton; i < QPlatformDialogHelper::LastButton; i<<=1) { if (buttons & i) { // Add native command const QString label = QGuiApplicationPrivate::platformTheme()->standardButtonText(i); @@ -176,7 +176,7 @@ HRESULT QWinRTPlatformMessageDialogHelper::onInvoked(ABI::Windows::UI::Popups::I command->get_Label(&hLabel); QString label = QString::fromWCharArray(::WindowsGetStringRawBuffer(hLabel, &labelLength)); int buttonId = -1; - for (int i = QMessageDialogOptions::FirstButton; i < QMessageDialogOptions::LastButton; i<<=1) { + for (int i = QPlatformDialogHelper::FirstButton; i < QPlatformDialogHelper::LastButton; i<<=1) { if ( options()->standardButtons() & i ) { if (QGuiApplicationPrivate::platformTheme()->standardButtonText(i) == label) { buttonId = i; @@ -194,8 +194,8 @@ HRESULT QWinRTPlatformMessageDialogHelper::onInvoked(ABI::Windows::UI::Popups::I return S_OK; } - QMessageDialogOptions::StandardButton standardButton = static_cast<QMessageDialogOptions::StandardButton>(buttonId); - QMessageDialogOptions::ButtonRole role = QMessageDialogOptions::buttonRole(standardButton); + QPlatformDialogHelper::StandardButton standardButton = static_cast<QPlatformDialogHelper::StandardButton>(buttonId); + QPlatformDialogHelper::ButtonRole role = QPlatformDialogHelper::buttonRole(standardButton); emit clicked(standardButton, role); return S_OK; } |