[SOLVED]QFileDialog: how to choose extension
-
Hi, I need a dialog window to choose where save a file. I'm trying with:
@QString path = QFileDialog::getSaveFileName(this, "Save file", "", "*.txt ;; *.C--" );@
using two different filters for txt and C files (the example is useless but it's just to make you understand!),
my question is:
"can I append the selected filter to my path in order to set the extension?"
in fact if I try to print "path" I get only the file name without extension. -
If understand correctly, you want the filter selected by the user and you would like append the same to your path. Is that correct. If that is the question,
You can get the selected filter using selectedNameFilter(). You can the same to append to your path.
If not give more details to understand your question correctly.
-
yes, it's correct.. But I haven't the "selectedNameFilter()" method!
-
which version of Qt you are using ? I can see this API from at least Qt 4.7
-
Yeah you are right... I don't know why I couldn't see that method before!!!
Thank you!
-
Can you edit your question and put the same to [SOLVED] at the beginning of your question.