Save as File dialog for Mac 10.9 using Qt 5.3
In my application i want the Save as dialog as a sheet dialog ,so i make an instance of QFileDialog instead of using the static method getSaveFileName. When i create the instance of QFileDialog i pass all the required parameters correctly, but still when the dialog is display only the first time correct file name is displayed,there after Qt only displays "Untitled" as the file name.Even though i am providing the correct file name.
I am using Qt 5.3
Has anybody faced this issue?
I already saw similar issue mentioned here : https://bugreports.qt.io/browse/QTBUG-36212 , but here again the static method is getting used.
I did some more testing by creating a project in Qt Creator (5.3.1 Clang 5.0 ( Apple ),64 bit ),this project just has QPushButton which on clicked displays the Save as dialog box.
The first time the output is correct:
Second time onwards the file name is always displayed as "Untitled":
My code is quite straight forward:
MainWindow::MainWindow(QWidget *parent) :
QPushButton *pButton = new QPushButton( "Save As..", this );
setCentralWidget( pButton );
QFileDialog *pFile = new QFileDialog
pFile->setAcceptMode( QFileDialog::AcceptSave );
pFile->setWindowModality( Qt::WindowModal );
int statusCode = pFile->exec();
Edit: please use code tags around code sections; Andre