From 38cf346bd70de6aaabfbf66ba159919591ce9098 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 7 Oct 2019 11:19:01 +0200 Subject: QMacStyle::drawControl - lift the pool declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit out of switch/case - can help in case some NSControl is using autorelease and an application is calling drawControl too often. Fixes: QTBUG-78761 Change-Id: I2b55d533f52db16703dcc965920f4316fdf76734 Reviewed-by: Tor Arne Vestbø --- src/plugins/styles/mac/qmacstyle_mac.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins') diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index b2bcdb3e5b..0a216e540d 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3462,6 +3462,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter { Q_D(const QMacStyle); const AppearanceSync sync; + const QMacAutoReleasePool pool; QMacCGContext cg(p); QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr; d->resolveCurrentNSView(window); @@ -4326,7 +4327,6 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter break; case CE_ProgressBarContents: if (const QStyleOptionProgressBar *pb = qstyleoption_cast(opt)) { - QMacAutoReleasePool pool; const bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0); const bool vertical = pb->orientation == Qt::Vertical; const bool inverted = pb->invertedAppearance; -- cgit v1.2.3 From 6906b0647a2e1389a9eeeef0dd0f6354c9dd4206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sat, 5 Oct 2019 13:28:55 +0200 Subject: macOS: Pass required parameters to NSOpenSavePanelDelegate callbacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0e0322734a077e4ee948128f3ba6c074514ccbb9 Reviewed-by: Volker Hilsheimer Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 5f32400af0..03677ef0bc 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -214,7 +214,7 @@ static QString strippedText(QString s) NSString *filepath = info.filePath().toNSString(); NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()]; bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) - || [self panel:nil shouldEnableURL:url]; + || [self panel:mOpenPanel shouldEnableURL:url]; [self updateProperties]; [mSavePanel setNameFieldStringValue:selectable ? info.fileName().toNSString() : @""]; @@ -233,7 +233,7 @@ static QString strippedText(QString s) NSString *filepath = info.filePath().toNSString(); NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()]; bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) - || [self panel:nil shouldEnableURL:url]; + || [self panel:mSavePanel shouldEnableURL:url]; [mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]]; [mSavePanel setNameFieldStringValue:selectable ? info.fileName().toNSString() : @""]; @@ -263,7 +263,7 @@ static QString strippedText(QString s) NSString *filepath = info.filePath().toNSString(); NSURL *url = [NSURL fileURLWithPath:filepath isDirectory:info.isDir()]; bool selectable = (mOptions->acceptMode() == QFileDialogOptions::AcceptSave) - || [self panel:nil shouldEnableURL:url]; + || [self panel:mSavePanel shouldEnableURL:url]; [self updateProperties]; [mSavePanel setDirectoryURL: [NSURL fileURLWithPath:mCurrentDir]]; -- cgit v1.2.3