Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.3.1
-
None
-
Windows 8.1 x64
-
8dad3bf2121e3ad5e405665fefa28c4d53192bf7
Description
On Windows, it seems that we have an extra slash when using toString(QUrl::PreferLocalFile)
Shouldn't toString() and toLocalFile() return the same result?
ui->setupUi(this); connect(ui->openFileButton, &QPushButton::clicked, this, [=]() { QString fileName = QFileDialog::getOpenFileName(this, "Open a file"); ui->stringLineEdit->setText(fileName); QUrl url = QUrl::fromLocalFile(fileName); ui->toLocalFileLineEdit->setText(url.toLocalFile()); ui->urlLineEdit->setText(url.toString(QUrl::PreferLocalFile)); });
Produces: