File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
qrenderdoc/Widgets/Extended Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ RDTreeWidgetItem::~RDTreeWidgetItem()
260
260
261
261
QVariant RDTreeWidgetItem::data (int column, int role) const
262
262
{
263
- if (column >= m_data->count ())
263
+ if (m_data == NULL || column >= m_data->count ())
264
264
return QVariant ();
265
265
266
266
const QVector<RoleData> &dataVec = (*m_data)[column];
Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ class RDTreeWidgetItem
50
50
inline void setIcon (int column, const QIcon &icon)
51
51
{
52
52
if (column >= m_icons.size ())
53
- return ;
53
+ {
54
+ m_text.resize (column + 1 );
55
+ m_icons.resize (m_text.size ());
56
+ }
54
57
55
58
m_icons[column] = icon;
56
59
dataChanged (column, Qt::DecorationRole);
@@ -94,7 +97,10 @@ class RDTreeWidgetItem
94
97
inline void setText (int column, const QVariant &value)
95
98
{
96
99
if (column >= m_text.size ())
97
- return ;
100
+ {
101
+ m_text.resize (column + 1 );
102
+ m_icons.resize (m_text.size ());
103
+ }
98
104
99
105
m_text[column] = value;
100
106
dataChanged (column, Qt::DisplayRole);
You can’t perform that action at this time.
0 commit comments