Non-native, customized QFileDialog to have Save button instead of Open?
Hi,
Is there a way to have QFileDialog show Save button instead of Open if it is customized?
I know I could use QFileDialog::getSaveFileName, but in this case I don't know how to add QUrls to sidebar, etc.
Thanks!
Code:
QList<QUrl> sidebarURLs;
sidebarURLs <<
QUrl::fromLocalFile(lastPath
);
fileOpenDialog.setWindowTitle(tr("Save chart file"));
fileOpenDialog.setDirectory(lastPath);
fileOpenDialog.setSidebarUrls(sidebarURLs);
fileOpenDialog.
setOption(QFileDialog::DontUseNativeDialog);
fileOpenDialog.setNameFilter(tr("Chart data (*.chart)"));
Re: Non-native, customized QFileDialog to have Save button instead of Open?
Re: Non-native, customized QFileDialog to have Save button instead of Open?
Thanks! I have also just found it from qfiledialog.cpp source code: 02280 dlg->setAcceptMode(AcceptSave);
:rolleyes: