@@ -46,7 +46,6 @@ namespace
46
46
{
47
47
const int EXPANDED_ROW_EXTRA = 1 ;
48
48
// WARNING: The string order has to match the order in pqOutputWindow::MessageType
49
- const char * MessageTypeString[] = {" Error" , " Warning" , " Debug" };
50
49
const QStyle::StandardPixmap MessageTypeIcon[] =
51
50
{
52
51
QStyle::SP_MessageBoxCritical,
@@ -69,7 +68,8 @@ struct pqOutputWindowModel::pqInternals
69
68
};
70
69
71
70
pqOutputWindowModel::pqOutputWindowModel (
72
- QObject *parent, const QList<MessageT>& messages) :
71
+ QObject *_parent, const QList<MessageT>& messages) :
72
+ QAbstractTableModel(_parent),
73
73
Messages(messages),
74
74
View(NULL ),
75
75
Internals(new pqInternals())
@@ -81,33 +81,33 @@ pqOutputWindowModel::~pqOutputWindowModel()
81
81
{
82
82
}
83
83
84
- int pqOutputWindowModel::rowCount (const QModelIndex &parent ) const
84
+ int pqOutputWindowModel::rowCount (const QModelIndex &_parent ) const
85
85
{
86
- (void )parent ;
86
+ (void )_parent ;
87
87
return this ->Rows .size ();
88
88
}
89
89
90
- int pqOutputWindowModel::columnCount (const QModelIndex &parent ) const
90
+ int pqOutputWindowModel::columnCount (const QModelIndex &_parent ) const
91
91
{
92
- (void )parent ;
92
+ (void )_parent ;
93
93
return COUNT;
94
94
}
95
95
96
- Qt::ItemFlags pqOutputWindowModel::flags (const QModelIndex & index ) const
96
+ Qt::ItemFlags pqOutputWindowModel::flags (const QModelIndex & _index ) const
97
97
{
98
- int r = index .row ();
98
+ int r = _index .row ();
99
99
Qt::ItemFlags f;
100
100
if (! this ->Messages [this ->Rows [r]].Location .isEmpty () ||
101
- index .column () != COLUMN_EXPANDED)
101
+ _index .column () != COLUMN_EXPANDED)
102
102
{
103
103
f |= Qt::ItemIsEnabled;
104
104
}
105
105
return f;
106
106
}
107
107
108
- QVariant pqOutputWindowModel::data (const QModelIndex &index , int role) const
108
+ QVariant pqOutputWindowModel::data (const QModelIndex &_index , int role) const
109
109
{
110
- int r = index .row ();
110
+ int r = _index .row ();
111
111
switch (role)
112
112
{
113
113
case Qt::DisplayRole:
@@ -116,14 +116,14 @@ QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
116
116
this ->Rows [r] == this ->Rows [r - EXPANDED_ROW_EXTRA])
117
117
{
118
118
// row expansion.
119
- return (index .column () == COLUMN_MESSAGE) ?
119
+ return (_index .column () == COLUMN_MESSAGE) ?
120
120
this ->Messages [this ->Rows [r]].Location :
121
121
QVariant ();
122
122
}
123
123
else
124
124
{
125
125
// regular row (not an expansion)
126
- switch (index .column ())
126
+ switch (_index .column ())
127
127
{
128
128
case COLUMN_EXPANDED:
129
129
return this ->Messages [this ->Rows [r]].Location .isEmpty () ?
@@ -142,7 +142,7 @@ QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
142
142
}
143
143
case Qt::TextAlignmentRole:
144
144
{
145
- if (index .column () == COLUMN_COUNT)
145
+ if (_index .column () == COLUMN_COUNT)
146
146
{
147
147
return Qt::AlignCenter;
148
148
}
@@ -152,7 +152,7 @@ QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
152
152
{
153
153
if ((r - EXPANDED_ROW_EXTRA < 0 ||
154
154
this ->Rows [r] != this ->Rows [r - EXPANDED_ROW_EXTRA]) &&
155
- (index .column () == COLUMN_TYPE))
155
+ (_index .column () == COLUMN_TYPE))
156
156
{
157
157
return this ->Internals ->Icons [this ->Messages [this ->Rows [r]].Type ];
158
158
}
@@ -162,17 +162,17 @@ QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
162
162
return QVariant ();
163
163
}
164
164
165
- bool pqOutputWindowModel::setData (const QModelIndex & index ,
165
+ bool pqOutputWindowModel::setData (const QModelIndex & _index ,
166
166
const QVariant & value, int role)
167
167
{
168
- int r = index .row ();
168
+ int r = _index .row ();
169
169
if (role == Qt::EditRole)
170
170
{
171
171
if (r - EXPANDED_ROW_EXTRA < 0 ||
172
172
this ->Rows [r] != this ->Rows [r - EXPANDED_ROW_EXTRA])
173
173
{
174
174
// regular row (not an expansion)
175
- if (index .column () == COLUMN_EXPANDED)
175
+ if (_index .column () == COLUMN_EXPANDED)
176
176
{
177
177
switch (value.toInt ())
178
178
{
@@ -233,20 +233,20 @@ void pqOutputWindowModel::clear()
233
233
void pqOutputWindowModel::ShowMessages (bool * show)
234
234
{
235
235
this ->clear ();
236
- int rowCount = 0 ;
236
+ int _rowCount = 0 ;
237
237
for (int i = 0 ; i < this ->Messages .size (); ++i)
238
238
{
239
239
for (int j = 0 ; j < pqOutputWindow::MESSAGE_TYPE_COUNT; ++j)
240
240
{
241
241
if (show[j] && this ->Messages [i].Type == j)
242
242
{
243
- ++rowCount ;
243
+ ++_rowCount ;
244
244
break ;
245
245
}
246
246
}
247
247
}
248
- this ->Rows .reserve (rowCount );
249
- this ->beginInsertRows (QModelIndex (), 0 , rowCount - 1 );
248
+ this ->Rows .reserve (_rowCount );
249
+ this ->beginInsertRows (QModelIndex (), 0 , _rowCount - 1 );
250
250
for (int i = 0 ; i < this ->Messages .size (); ++i)
251
251
{
252
252
for (int j = 0 ; j < pqOutputWindow::MESSAGE_TYPE_COUNT; ++j)
0 commit comments