QFileDialog
-
Hi,
i'm doing
QString homePath = QDir::currentPath(); QString filename = QFileDialog::getSaveFileName(this, "Enregistrer sous...", homePath, "Configuration (*.xml)"); saveConf(filename); //which create a XML etc... (this function is working)
But here, if I manually close the QFileDialog, what happen ?
I would like to do something like :
if( myQFileDialogIsClosedOrFailedOrWhateverYouWant ){ QMessageBox::warning(......); else saveConf(filename); }
is it possible to do that ?
By the way, is there a problem with QFileDialog on W10 ?
When I use it there's warning like
shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](1) tid(2b88) 80070490 Élément introuvable. CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData]
-
Test this:
if(filename.isEmpty()) QMessageBox::warning(....)
-
Test this:
if(filename.isEmpty()) QMessageBox::warning(....)
-
Hi. Good news...
What about warnings?
I don't know what you mean but you can you QMessageBox... -
Hi. Good news...
What about warnings?
I don't know what you mean but you can you QMessageBox...@HenrikSt.
Sorry I was busy..
these warnings :
shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](3) tid(5f4) 80070490 Élément introuvable. CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData] shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](4) tid(5f4) 80070490 Élément introuvable. CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData]
When I use getSaveFileName(...);
-
@HenrikSt.
Sorry I was busy..
these warnings :
shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](3) tid(5f4) 80070490 Élément introuvable. CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData] shell\comdlg32\fileopensave.cpp(9456)\comdlg32.dll!74260750: (caller: 74253458) ReturnHr[PreRelease](4) tid(5f4) 80070490 Élément introuvable. CallContext:[\PickerModalLoop\InitDialog\FileDialogInitEnterpriseData]
When I use getSaveFileName(...);
@Punt
My French is pretty rudimentary, but "Élément introuvable" is a bit confusing. I don't understand what element can't be found, and somehow this comes fromcomdlg32
...
I think you're safe to ignore these warnings for now, but if you find any strange effects do tell. -
Maybe you cab post your completely code here for understanding the error ?
-
Maybe you cab post your completely code here for understanding the error ?
@HenrikSt.
void myClass::on_pushSaveCom_clicked(){ //On click QPushButton (save my configuration) //set some variable according to my UI QString homePath = QDir::currentPath(); QString path = QFileDialog::getSaveFileName(this, "Enregistrer sous...", homePath, "Configuration (*.xml)"); if(path.isEmpty()) return; saveConf(path); //which create the new XML according to my new value set earlier in this function }
-
@HenrikSt.
void myClass::on_pushSaveCom_clicked(){ //On click QPushButton (save my configuration) //set some variable according to my UI QString homePath = QDir::currentPath(); QString path = QFileDialog::getSaveFileName(this, "Enregistrer sous...", homePath, "Configuration (*.xml)"); if(path.isEmpty()) return; saveConf(path); //which create the new XML according to my new value set earlier in this function }