View Full Version : How to write file in the selected path.
merry
19th July 2007, 07:03
Hi all
Me working on Qt4.2 for MAC O.S
Can anybody tells me that how can I write my own file in the selected path from the QFiledialog through Qt Programming;
Thanx
merry
19th July 2007, 07:30
Hi
For eg.
FILE *fh = NULL;
fh=fopen("/path","wb+");
the above file named "path" is created in the harddisk.
but I want to create this file on that path selected by me using QFiledialog which is stored in a string.
QString m_dir = QFileDialog::getExistingDirectory(this, tr("Open Directory"),
"/home",
QFileDialog::ShowDirsOnly
|QFileDialog::DontResolveSymlinks);
vishal.chauhan
19th July 2007, 07:34
Hi,
you can do like this.
QString FileName= QFileDialog::getSaveFileName(this,"",Save","YrFileName","");
fopen((const char*)FileName.toAscii() ,"wb+")
It will save the file YrFileName to the selected Path
QFile - do I need to say more? :)
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.