CodePudding user response:
QString fileName=QFileDialog: : getSaveFileName (this, tr (" Save File "),"/home/jana/untitled. PNG",
Tr (" Images (*. PNG *. XPM *. JPG) "));
The file dialog's working directory will be set to dir. If dir includes a file name, The file will be selected. Only files that match The filter are to. The filter selected is set to selectedFilter. The parameters dir, selectedFilter, and The filter may be empty strings. Multiple filters are separated with ';; 'For instance:
CodePudding user response:
I want to the name of the file dialog can read the LineEdit the lines of text information in real timeCodePudding user response:
That still don't use a static method, because the static method is that internal implementation:QFileDialog dialog (args);
Dialog. SetSupportedSchemes (supportedSchemes);
Dialog. SetAcceptMode (AcceptSave);
If (selectedFilter & amp; & ! SelectedFilter - & gt; IsEmpty ())
Dialog. SelectNameFilter (* selectedFilter);
If (dialog. The exec ()==QDialog: : Accepted) {
If (selectedFilter)
* selectedFilter=dialog. SelectedNameFilter ();
Return the dialog. SelectedUrls (). The value (0);
}
Return QUrl ();