summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-08-04 09:04:15 (GMT)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>2010-08-04 09:04:15 (GMT)
commitad8f35ca1516103d6226d378cf080fb5f5f5f515 (patch)
tree243562935637dd35b44123aba82f5ed4831cbc9c /src/gui/dialogs
parentb0965cd049997283976c132fceb9727b6582ca49 (diff)
downloadQt-ad8f35ca1516103d6226d378cf080fb5f5f5f515.zip
Qt-ad8f35ca1516103d6226d378cf080fb5f5f5f515.tar.gz
Qt-ad8f35ca1516103d6226d378cf080fb5f5f5f515.tar.bz2
Cocoa: Showing a QFontDialog first shows it in the bottom-left corner
The reason it does this, is because we set up a parent child relationship on the dialog. And when doing so, Cocoa shows the dialog. So we need to delay setting up this until after we have set the dialog geometry Task-number: QTBUG-9198 Reviewed-by: prasanth
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qfontdialog_mac.mm11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/dialogs/qfontdialog_mac.mm b/src/gui/dialogs/qfontdialog_mac.mm
index bb8ef3f..9c63dfa 100644
--- a/src/gui/dialogs/qfontdialog_mac.mm
+++ b/src/gui/dialogs/qfontdialog_mac.mm
@@ -131,6 +131,7 @@ const int StyleMask = NSTitledWindowMask | NSClosableWindowMask | NSResizableWin
- (QFont)qtFont;
- (void)finishOffWithCode:(NSInteger)result;
- (void)cleanUpAfterMyself;
+- (void)setSubwindowStacking;
@end
static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
@@ -187,6 +188,12 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
[cancelButton setTarget:self];
}
+ mQtFont = new QFont();
+ return self;
+}
+
+- (void)setSubwindowStacking
+{
#ifdef QT_MAC_USE_COCOA
// Stack the native dialog in front of its parent, if any:
QFontDialog *q = mPriv->fontDialog();
@@ -199,9 +206,6 @@ static QFont qfontForCocoaFont(NSFont *cocoaFont, const QFont &resolveFont)
}
}
#endif
-
- mQtFont = new QFont();
- return self;
}
- (void)dealloc
@@ -610,6 +614,7 @@ void QFontDialogPrivate::createNSFontPanelDelegate()
[ourPanel setFrame:frameRect display:NO];
[ourPanel center];
}
+ [del setSubwindowStacking];
NSString *title = @"Select font";
[ourPanel setTitle:title];
}