diff options
author | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-02-23 11:28:17 (GMT) |
---|---|---|
committer | Carlos Manuel Duclos Vergara <carlos.duclos@nokia.com> | 2010-02-23 11:29:43 (GMT) |
commit | 12b1dbb1a0911d421d9e19129291dcd8151c3f50 (patch) | |
tree | 46dfcc2a90e21c1de586c69aefbcdf2235adc27a /src | |
parent | 9629681e7b3d69456bd6c5905c267b3d08b6243f (diff) | |
download | Qt-12b1dbb1a0911d421d9e19129291dcd8151c3f50.zip Qt-12b1dbb1a0911d421d9e19129291dcd8151c3f50.tar.gz Qt-12b1dbb1a0911d421d9e19129291dcd8151c3f50.tar.bz2 |
QColorDialog::open() freezes the app the *second* time it is used on Mac
The problem here is caused by a boolean flag used to prevent recursion.
The flag was set and never reset. This patch resets the flag the moment
open is called.
Task-number: QTBUG-7825
Reviewed-by: Richard Moe Gustavsen
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/dialogs/qcolordialog_mac.mm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/dialogs/qcolordialog_mac.mm b/src/gui/dialogs/qcolordialog_mac.mm index bdcb872..8af0d2b 100644 --- a/src/gui/dialogs/qcolordialog_mac.mm +++ b/src/gui/dialogs/qcolordialog_mac.mm @@ -96,6 +96,7 @@ QT_USE_NAMESPACE - (void)finishOffWithCode:(NSInteger)result; - (void)showColorPanel; - (void)exec; +- (void)setResultSet:(BOOL)result; @end @implementation QCocoaColorPanelDelegate @@ -158,6 +159,11 @@ QT_USE_NAMESPACE [super dealloc]; } +- (void)setResultSet:(BOOL)result +{ + mResultSet = result; +} + - (BOOL)windowShouldClose:(id)window { Q_UNUSED(window); @@ -320,7 +326,7 @@ QT_USE_NAMESPACE } else { mPriv->colorDialog()->accept(); } - } + } } } @@ -433,7 +439,7 @@ void QColorDialogPrivate::openCocoaColorPanel(const QColor &initial, priv:this]; [colorPanel setDelegate:static_cast<QCocoaColorPanelDelegate *>(delegate)]; } - + [delegate setResultSet:false]; setCocoaPanelColor(initial); [static_cast<QCocoaColorPanelDelegate *>(delegate) showColorPanel]; } |