forked from qt-creator/qt-creator
Debugger: Go back to plain QTreeView for tooltips
Nothing of the BaseTreeView functionality is used, and there seems to be a off-by-1 in column width computation leading to unnecessary eliding. Change-Id: I4426070742801864edfdba4c912ad8cc8a15f7bb Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -360,7 +360,7 @@ void ToolTipModel::restoreTreeModel(QXmlStreamReader &r)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class DebuggerToolTipTreeView : public BaseTreeView
|
class DebuggerToolTipTreeView : public QTreeView
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit DebuggerToolTipTreeView(QWidget *parent = 0);
|
explicit DebuggerToolTipTreeView(QWidget *parent = 0);
|
||||||
@@ -386,7 +386,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
DebuggerToolTipTreeView::DebuggerToolTipTreeView(QWidget *parent)
|
DebuggerToolTipTreeView::DebuggerToolTipTreeView(QWidget *parent)
|
||||||
: BaseTreeView(parent)
|
: QTreeView(parent)
|
||||||
{
|
{
|
||||||
setHeaderHidden(true);
|
setHeaderHidden(true);
|
||||||
setEditTriggers(NoEditTriggers);
|
setEditTriggers(NoEditTriggers);
|
||||||
@@ -450,11 +450,12 @@ void DebuggerToolTipTreeView::computeSize()
|
|||||||
reexpand(m->index(0, 0));
|
reexpand(m->index(0, 0));
|
||||||
const int columnCount = m->columnCount();
|
const int columnCount = m->columnCount();
|
||||||
rootDecorated = m->rowCount() > 0;
|
rootDecorated = m->rowCount() > 0;
|
||||||
if (rootDecorated)
|
if (rootDecorated) {
|
||||||
for (int i = 0; i < columnCount; ++i) {
|
for (int i = 0; i < columnCount; ++i) {
|
||||||
resizeColumnToContents(i);
|
resizeColumnToContents(i);
|
||||||
columns += sizeHintForColumn(i);
|
columns += sizeHintForColumn(i);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (columns < 100)
|
if (columns < 100)
|
||||||
columns = 100; // Prevent toolbar from shrinking when displaying 'Previous'
|
columns = 100; // Prevent toolbar from shrinking when displaying 'Previous'
|
||||||
rows += computeHeight(QModelIndex());
|
rows += computeHeight(QModelIndex());
|
||||||
@@ -582,7 +583,7 @@ DebuggerToolTipWidget::DebuggerToolTipWidget()
|
|||||||
|
|
||||||
auto mainLayout = new QVBoxLayout(this);
|
auto mainLayout = new QVBoxLayout(this);
|
||||||
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
mainLayout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
mainLayout->setContentsMargins(1, 1, 1, 1);
|
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
mainLayout->addWidget(toolBar);
|
mainLayout->addWidget(toolBar);
|
||||||
mainLayout->addWidget(treeView);
|
mainLayout->addWidget(treeView);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user