PDA

View Full Version : How to create filedialoge for creating new file?



Niamita
27th September 2011, 09:34
Hi all
i am going to create a file dialoge for creating a new file, but i do not find any function for same in QFileDialoge class. As there is a open file dialoge in this class. How to create filedialoge for new file.
Thanks.

Jonny174
27th September 2011, 11:19
bool OK = false;

QString fileName = QInputDialog::getText( 0, QObject::tr("Create File"),
QObject::tr("Input file name:"), QLineEdit::Normal, "", &OK );

if (OK)
{
// Create file
}

wysota
27th September 2011, 11:23
QFileDialog::getSaveFileName()