MCPcopy Create free account
hub / github.com/KDE/kdevelop / resizeEvent

Method resizeEvent

kdevplatform/util/focusedtreeview.cpp:96–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void FocusedTreeView::resizeEvent(QResizeEvent* event)
97{
98 QTreeView::resizeEvent(event);
99
100 // Rewrap lines when the width changes.
101 if (wordWrap() && event->size().width() != event->oldSize().width()) {
102 // fitColumns() calls resizeColumnToContents(), which executes items layout
103 // scheduled here (QTreeView::setWordWrap() also schedules items layout).
104 // Redoing the items layout is necessary for correct rewrapping, but causes a roughly
105 // 5-second-long UI freeze inside QItemDelegate::sizeHint() when the user selects
106 // a 100'000th line of output. The freeze happens because non-uniform row heights (necessary
107 // for word-wrapping) force QTreeView to calculate heights of all items above the selected one.
108 // The number of consecutive resize events does not affect the duration of the resulting UI freeze.
109 scheduleDelayedItemsLayout();
110 // Resizing columns to contents here rewraps lines immediately rather than only after subsequent vertical
111 // scrolling. This is relatively fast and does not noticeably contribute to the UI freeze duration.
112 fitColumns();
113 }
114}
115
116void FocusedTreeView::delayedAutoScrollAndResize()
117{

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected