Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.6.1, 5.9.1, 5.11
-
MacOS 10.11 or later
Description
Our program (IGOR Pro) is user-programmable in the IGOR programming language. A programmer can display an Open File dialog to ask the user to choose an input file. This is done using the Open operation. For example:
Open/D/R/M="Choose filter coefficients file" ...
The /M flag allows the programmer to specify a prompt telling the user what the program is looking for.
In OS X 10.10 and before, the prompt appeared in the Open File dialog title bar. As explained at http://stackoverflow.com/questions/36879212/title-bar-missing-in-nsopenpanel, starting with OS X 10.11, Apple removed the title bar from the Open File dialog, so the prompt is no longer visible. This means that, if an IGOR program displays the Open File dialog, the user has no clue as to what the program is looking for. We get a lot of complaints about this from IGOR programmers.
(Strangely, the title bar still appears in the native Save File dialog and does show the caption when called from Qt.)
The Qt Open File dialog, as opposed to the native Open File dialog, still has a title bar and, if we use the Qt dialog, our prompt appears in the title bar, as expected. However, the Qt Open File dialog is missing a lot of features that users like and looks and feels distinctly non-native, so switching to it is not a good option.
In qcocoafiledialoghelper.mm, we have this code:
[mSavePanel setTitle:QCFString::toNSString(options->windowTitle())];
This does no good in the Open File dialog because OS X no longer displays the title in that dialog.
NSSavePanel, on which NSOpenPanel is based, has a message property which is described at https://developer.apple.com/reference/appkit/nssavepanel as "The message text displayed in the save panel". If you set this property, you get a facsimile of a title bar in the Open File dialog and the facsimile displays the specified message.
I would like to see the native implementations of QFileDialog::getOpenFileName changed to set the NSSavePanel message property using the caption parameter rather than setting the title property, since the title is never displayed. The code would look like this:
bool useMessagePropertyForCaption = false; if (mOptions->acceptMode() == QFileDialogOptions::AcceptOpen) { const double NSAppKitVersionNumber10_11 = 1404; // From https://developer.apple.com/library/content/releasenotes/AppKit/RN-AppKit/ if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_11) { // As of OS X 10.11, Apple does not show the title bar in the Open File dialog, so we use the message property instead of the title property useMessagePropertyForCaption = true; } } if (useMessagePropertyForCaption) [mSavePanel setMessage:QCFString::toNSString(options->windowTitle())]; else [mSavePanel setTitle:QCFString::toNSString(options->windowTitle())];
QFileDialog::getExistingDirectory should be changed in the same way because, in OS X 10.11 and later, that dialog also does not have a title bar.
Attachments
Issue Links
- is duplicated by
-
QTBUG-66970 QFileDialog getOpenFilename getSaveFilename functions don't show captions and file filters on macOS
- Closed