QFileDialog > look In as editable entry
-
Hi
You can use
dialog->selectFile("myFileName");To give it a default name for saving.
-
Do you mean when using Qt own dialogs and NOT the OS supplied ones ?
-
-
@mrjj Hey Oh may, yeah my bad!! I should have tested it more before posting... I'm using
saveWidget->setOption(QFileDialog::DontUseNativeDialog, true);
The Qt one just has it as non editable combo box :- (((
Copy paste, I mean in ur
C:\wa\qthttpserver\
to be able to type in there/copy/paste/go to other link etc etc. -
Bump... any idea how to do it with qt widget not native os one?
-
@Dariusz
Hi sorry. It sailed away.
We can always get hold of the live widget via findChildren
and try to set its property to editable. however, it might not work
as you expect as nothing will expect "edit" signals to come from it so not sure it will respond to you pasting stuff there but its worth a shot :) -
@mrjj
I can confirm that it doesn't work. Just tried that. :)
But we can also handle the signals since we are already cheating.QComboBox *combo = saveWidget->findChild<QComboBox*>("lookInCombo", Qt::FindDirectChildrenOnly); combo->setEditable(true); QLineEdit *edit = combo->lineEdit(); connect(edit, &QLineEdit::returnPressed, saveWidget, [=](){ QString newPath = edit->text(); //TODO: verify the text is a valid path or not saveWidget->setDirectory(newPath); });
-
@Bonnie
Hi
Super with the testing. :)So with the usual disclaimer of breaking later on
as code is relying on internal details, its
can actually work ok. \o/How did you find its name ?
dumpObjectTree()?
11/11