Opened 10 years ago
Closed 5 years ago
#298 closed defect (fixed)
QFileSystemModel::directoryLoaded() signal passes a drive root as x: not x:/
Reported by: | KO Myung-Hun | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | Qt 5 |
Component: | General | Version: | 4.7.3 |
Severity: | medium | Keywords: | |
Cc: |
Description
Hi/2
When connecting directoryLoaded() signal, a drive root is passed to a slot as x: not x:/.
Actually, x:/ is passed on Qt for Windows.
For example, see the following code snippets.
QFileSystemModel* model = new QFileSystemModel; connect(model, SIGNAL(directoryLoaded(QString)), this, SLOT(directoryLoaded(QString))); model->setRootPath(""); QTreeView *treeView = new QTreeView; treeView->setModel(model); treeView->setCurrentIndex(model->index(QDir::currentPath()));
And if a current directory is x:/path/to/dir, then slot directoryLoaded() receives a directory in this order.
- x:
- x:/path
- x:/path/to
- x:/path/to/dir
However, on Windows
- x:/
- x:/path
- x:/path/to
- x:/path/to/dir
I think, Windows is right. Because x: is not a fully-qualified path and it means a current directory of x: drive.
Change History (3)
comment:1 by , 8 years ago
Milestone: | Qt Enhanced → Qt4 4.7.3 rerelease |
---|
comment:2 by , 6 years ago
Milestone: | Qt4 4.7.3 rerelease → Qt 5 |
---|
comment:3 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
iirc this is fixed in qt5. if not please open a ticket at https://github.com/bitwiseworks/qtbase-os2
Note:
See TracTickets
for help on using tickets.
Ticket retargeted after milestone closed