Details
-
Bug
-
Resolution: Duplicate
-
P1: Critical
-
None
-
6.3.1
-
None
-
Windows 10 21H2
Description
Application crashes when an editing is triggered for an long item and the right border of editor is outside of the view.
Here's the complete demo to produce:
- Run this program
- Double click the first item
- See the crash
There're some ways to "avoid" the crash:
- Scroll to the right before double clicking, or
- Remove the second item, or
- Resize the window so that the entire editor can be shown, or
- Don't set ResizeToContents mode
#include <QDebug> #include <QApplication> #include <QWidget> #include <QVBoxLayout> #include <QTreeView> #include <QPushButton> #include <QHeaderView> #include <QStandardItem> #include <QStandardItemModel> int main(int argc, char** argv) { QApplication app(argc, argv); auto widget = new QWidget; auto box = new QVBoxLayout(widget); auto model = new QStandardItemModel(widget); model->appendRow(QList{ new QStandardItem("Double Click Me! Double Click Me! Double Click Me! Double Click Me!"), new QStandardItem("test"), // comment this line to avoid crash }); auto tree = new QTreeView(widget); box->addWidget(tree); tree->setModel(model); tree->header()->setSectionResizeMode(QHeaderView::ResizeMode::ResizeToContents); widget->show(); return app.exec(); }
Attachments
Issue Links
- duplicates
-
QTBUG-104383 QExpandingLineEdit::resizeToContents crashes conditionally in qBound (since Qt 6.3.0)
- Closed
-
QTBUG-104565 QTableWidgets: crash when double click into table cell end that expands beyond window
- Closed