From 6177a3026b3392de43a19e5be213baf7b22c9a3c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 1 Jul 2013 16:54:34 +0200 Subject: [PATCH] Windows: Fix the code of the native color dialog. Note: The code is currently #ifdefed out, it is just there to be able to compare QColorDialog to the native dialog. Task-number: QTBUG-32054 Change-Id: I042f6701d1a076480cae56c53ae2d3ad303d37d1 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowsdialoghelpers.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 12dd00f1045..15a00eb5c6f 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -2023,7 +2023,7 @@ void QWindowsNativeColorDialog::exec(HWND owner) qCustomColors[c] = COLORREFToQColor(m_customColors[c]).rgb(); emit accepted(); if (QWindowsContext::verboseDialogs) - qDebug() << '<' << __FUNCTION__ << m_color; + qDebug() << '<' << __FUNCTION__ << *m_color; } else { emit rejected(); } @@ -2044,7 +2044,7 @@ void QWindowsNativeColorDialog::exec(HWND owner) class QWindowsColorDialogHelper : public QWindowsDialogHelperBase { public: - QWindowsColorDialogHelper() {} + QWindowsColorDialogHelper() : m_currentColor(new QColor) {} virtual bool supportsNonModalDialog() { return false; } @@ -2064,6 +2064,8 @@ QWindowsNativeDialogBase *QWindowsColorDialogHelper::createNativeDialog() { QWindowsNativeColorDialog *nativeDialog = new QWindowsNativeColorDialog(m_currentColor); nativeDialog->setWindowTitle(options()->windowTitle()); + connect(nativeDialog, SIGNAL(accepted()), this, SIGNAL(accept())); + connect(nativeDialog, SIGNAL(rejected()), this, SIGNAL(reject())); return nativeDialog; } #endif // USE_NATIVE_COLOR_DIALOG