Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.15.16
-
-
0f77aff05 (dev), 41e943aed (6.7), 6c94d77ad (6.6), 4a16ed404 (tqtc/lts-6.5)
Description
To reproduce, open the richtext Text Edit example.
In textedit.cpp, add the following line to TextEdit::fileOpen()
fileDialog.setOption(QFileDialog::DontUseNativeDialog);
Run the example, open a new blank page and open the dialog to select a file.
Navigate to a directory that contains a valid and invalid file to open. The exact filetype does not matter.
Click a valid file once. Double click an invalid file.
This will result in the valid file you clicked being loaded into the Text Edit.
This is not the expected behavior, which would be nothing happening at all.
The customer who opened the related ticket also provided a fix:
Modify 'QTreeView::mouseDoubleClickEvent(QMouseEvent *event)` method (around line 1948 of qtreeview.cpp)
- if (!style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, nullptr, this))
+ if ((!style()>styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, nullptr, this))
&&((d->model->flags(persistent) & Qt::ItemIsEnabled) != 0))
Attachments
Issue Links
- relates to
-
QTBUG-123392 QTreeView item double-click erroneously emits activated on indexes without Qt::ItemIsEnabled
-
- Reported
-