forked from qt-creator/qt-creator
Debugger: Adjust watcher column size to locals content
Change-Id: Iec6b4478862578397ee2b3953cd06730bd0db121 Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -201,6 +201,7 @@ public:
|
||||
static QString nameForFormat(int format);
|
||||
TypeFormatList typeFormatList(const WatchData &value) const;
|
||||
|
||||
QVariant data(const QModelIndex &idx, int role) const;
|
||||
bool setData(const QModelIndex &idx, const QVariant &value, int role);
|
||||
|
||||
void insertDataItem(const WatchData &data);
|
||||
@@ -850,6 +851,19 @@ QVariant WatchItem::data(int column, int role) const
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
QVariant WatchModel::data(const QModelIndex &idx, int role) const
|
||||
{
|
||||
if (role == BaseTreeView::ExtraIndicesForColumnWidth) {
|
||||
QModelIndexList l;
|
||||
foreach (TreeItem *item, m_watchRoot->children())
|
||||
l.append(indexFromItem(item));
|
||||
foreach (TreeItem *item, m_returnRoot->children())
|
||||
l.append(indexFromItem(item));
|
||||
return QVariant::fromValue(l);
|
||||
}
|
||||
return WatchModelBase::data(idx, role);
|
||||
}
|
||||
|
||||
bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role)
|
||||
{
|
||||
if (!idx.isValid())
|
||||
|
||||
Reference in New Issue
Block a user