I want to get directory address
-
Hi
I want to get directory address ( like g:\document\armin\qt ) by getExistingDirectoryUrl.
I don't get error but i don't have any address from directory i did choose.void MainWindow::on_toolButton_clicked() { urll = QFileDialog::getExistingDirectoryUrl(); } void MainWindow::on_pushButton_3_clicked() { ui->label_14->text() = urll.toString(); }
-
Hi
You must tell more about what is not working.
if I run your code it does give me path
Like"file:///C:/Windows/debug"
-
@Armin And what is the problem?Is this urll the same in both slots? Is on_toolButton_clicked() executed before on_pushButton_3_clicked() ? How do you store the file?
-
@jsulm Thank you
For example : you want to determine which where your file be save , so you should determine a directory url , for instance : c:/document/arminfolder
So i use a button which open my directory in windows. but i can't save directory in variable -
@Armin Are you aware that this is wrong?
ui->label_14->text() = urll.toString();
If you want to set text in a label then you need to do:
ui->label_14->setText(urll.toString());
It is all in the documentation.
1/7