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

Method sizeHint

kdevplatform/debugger/util/treeview.cpp:48–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48QSize AsyncTreeView::sizeHint() const
49{
50 //Assuming that columns are always resized to fit their contents, return a size that will fit all without a scrollbar
51 QMargins margins = contentsMargins();
52 int horizontalSize = margins.left() + margins.right();
53 for (int i = 0; i < model()->columnCount(); ++i) {
54 horizontalSize += columnWidth(i);
55 }
56 horizontalSize = qMin(horizontalSize, QGuiApplication::primaryScreen()->geometry().width()*3/4);
57 return QSize(horizontalSize, margins.top() + margins.bottom() + sizeHintForRow(0));
58}
59
60void AsyncTreeView::resizeColumns()
61{

Callers

nothing calls this directly

Calls 3

modelFunction · 0.85
topMethod · 0.80
columnCountMethod · 0.45

Tested by

no test coverage detected