Skip to content

Commit b8d9b75

Browse files
committed
Fix compilation warnings.
Change-Id: I60ddd54c42ba988d928dd18285128bb24bd04990
1 parent 06373bf commit b8d9b75

File tree

3 files changed

+34
-33
lines changed

3 files changed

+34
-33
lines changed

Qt/Core/pqCheckBoxDelegate.cxx

+11-10
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ struct pqCheckBoxDelegate::pqInternals
7373
QPolygonF ExpandedPolygon;
7474
};
7575

76-
pqCheckBoxDelegate::pqCheckBoxDelegate(QObject *parent)
77-
: QStyledItemDelegate(parent)
76+
pqCheckBoxDelegate::pqCheckBoxDelegate(QObject *_parent)
77+
: QStyledItemDelegate(_parent)
7878
{
7979
this->Internals = new pqInternals();
8080
}
@@ -122,7 +122,7 @@ void pqCheckBoxDelegate::paint(QPainter *painter,
122122
}
123123
}
124124

125-
bool pqCheckBoxDelegate::editorEvent(QEvent *event,
125+
bool pqCheckBoxDelegate::editorEvent(QEvent *_event,
126126
QAbstractItemModel *model,
127127
const QStyleOptionViewItem &option,
128128
const QModelIndex &index)
@@ -133,24 +133,24 @@ bool pqCheckBoxDelegate::editorEvent(QEvent *event,
133133
int checked = d.toInt();
134134
if (checked != pqCheckBoxDelegate::NOT_EXPANDED_DISABLED)
135135
{
136-
if ((event->type() == QEvent::MouseButtonRelease) ||
137-
(event->type() == QEvent::MouseButtonDblClick))
136+
if ((_event->type() == QEvent::MouseButtonRelease) ||
137+
(_event->type() == QEvent::MouseButtonDblClick))
138138
{
139-
QMouseEvent *mouse_event = static_cast<QMouseEvent*>(event);
139+
QMouseEvent *mouse_event = static_cast<QMouseEvent*>(_event);
140140
if (mouse_event->button() != Qt::LeftButton ||
141141
!CheckBoxRect(option).contains(mouse_event->pos()))
142142
{
143143
return false;
144144
}
145-
if (event->type() == QEvent::MouseButtonDblClick)
145+
if (_event->type() == QEvent::MouseButtonDblClick)
146146
{
147147
return true;
148148
}
149149
}
150-
else if (event->type() == QEvent::KeyPress)
150+
else if (_event->type() == QEvent::KeyPress)
151151
{
152-
if (static_cast<QKeyEvent*>(event)->key() != Qt::Key_Space &&
153-
static_cast<QKeyEvent*>(event)->key() != Qt::Key_Select)
152+
if (static_cast<QKeyEvent*>(_event)->key() != Qt::Key_Space &&
153+
static_cast<QKeyEvent*>(_event)->key() != Qt::Key_Select)
154154
{
155155
return false;
156156
}
@@ -163,4 +163,5 @@ bool pqCheckBoxDelegate::editorEvent(QEvent *event,
163163
return model->setData(index, !checked, Qt::EditRole);
164164
}
165165
}
166+
return false;
166167
}

Qt/Core/pqOutputWindowModel.cxx

+22-22
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ namespace
4646
{
4747
const int EXPANDED_ROW_EXTRA = 1;
4848
// WARNING: The string order has to match the order in pqOutputWindow::MessageType
49-
const char* MessageTypeString[] = {"Error", "Warning", "Debug"};
5049
const QStyle::StandardPixmap MessageTypeIcon[] =
5150
{
5251
QStyle::SP_MessageBoxCritical,
@@ -69,7 +68,8 @@ struct pqOutputWindowModel::pqInternals
6968
};
7069

7170
pqOutputWindowModel::pqOutputWindowModel(
72-
QObject *parent, const QList<MessageT>& messages) :
71+
QObject *_parent, const QList<MessageT>& messages) :
72+
QAbstractTableModel(_parent),
7373
Messages(messages),
7474
View(NULL),
7575
Internals(new pqInternals())
@@ -81,33 +81,33 @@ pqOutputWindowModel::~pqOutputWindowModel()
8181
{
8282
}
8383

84-
int pqOutputWindowModel::rowCount(const QModelIndex &parent) const
84+
int pqOutputWindowModel::rowCount(const QModelIndex &_parent) const
8585
{
86-
(void)parent;
86+
(void)_parent;
8787
return this->Rows.size();
8888
}
8989

90-
int pqOutputWindowModel::columnCount(const QModelIndex &parent) const
90+
int pqOutputWindowModel::columnCount(const QModelIndex &_parent) const
9191
{
92-
(void)parent;
92+
(void)_parent;
9393
return COUNT;
9494
}
9595

96-
Qt::ItemFlags pqOutputWindowModel::flags(const QModelIndex & index) const
96+
Qt::ItemFlags pqOutputWindowModel::flags(const QModelIndex & _index) const
9797
{
98-
int r = index.row();
98+
int r = _index.row();
9999
Qt::ItemFlags f;
100100
if (! this->Messages[this->Rows[r]].Location.isEmpty() ||
101-
index.column() != COLUMN_EXPANDED)
101+
_index.column() != COLUMN_EXPANDED)
102102
{
103103
f |= Qt::ItemIsEnabled;
104104
}
105105
return f;
106106
}
107107

108-
QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
108+
QVariant pqOutputWindowModel::data(const QModelIndex &_index, int role) const
109109
{
110-
int r = index.row();
110+
int r = _index.row();
111111
switch(role)
112112
{
113113
case Qt::DisplayRole:
@@ -116,14 +116,14 @@ QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
116116
this->Rows[r] == this->Rows[r - EXPANDED_ROW_EXTRA])
117117
{
118118
// row expansion.
119-
return (index.column() == COLUMN_MESSAGE) ?
119+
return (_index.column() == COLUMN_MESSAGE) ?
120120
this->Messages[this->Rows[r]].Location :
121121
QVariant();
122122
}
123123
else
124124
{
125125
// regular row (not an expansion)
126-
switch (index.column())
126+
switch (_index.column())
127127
{
128128
case COLUMN_EXPANDED:
129129
return this->Messages[this->Rows[r]].Location.isEmpty() ?
@@ -142,7 +142,7 @@ QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
142142
}
143143
case Qt::TextAlignmentRole:
144144
{
145-
if (index.column() == COLUMN_COUNT)
145+
if (_index.column() == COLUMN_COUNT)
146146
{
147147
return Qt::AlignCenter;
148148
}
@@ -152,7 +152,7 @@ QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
152152
{
153153
if ((r - EXPANDED_ROW_EXTRA < 0 ||
154154
this->Rows[r] != this->Rows[r - EXPANDED_ROW_EXTRA]) &&
155-
(index.column() == COLUMN_TYPE))
155+
(_index.column() == COLUMN_TYPE))
156156
{
157157
return this->Internals->Icons[this->Messages[this->Rows[r]].Type];
158158
}
@@ -162,17 +162,17 @@ QVariant pqOutputWindowModel::data(const QModelIndex &index, int role) const
162162
return QVariant();
163163
}
164164

165-
bool pqOutputWindowModel::setData(const QModelIndex & index,
165+
bool pqOutputWindowModel::setData(const QModelIndex & _index,
166166
const QVariant & value, int role)
167167
{
168-
int r = index.row();
168+
int r = _index.row();
169169
if (role == Qt::EditRole)
170170
{
171171
if (r - EXPANDED_ROW_EXTRA < 0 ||
172172
this->Rows[r] != this->Rows[r - EXPANDED_ROW_EXTRA])
173173
{
174174
// regular row (not an expansion)
175-
if (index.column() == COLUMN_EXPANDED)
175+
if (_index.column() == COLUMN_EXPANDED)
176176
{
177177
switch (value.toInt())
178178
{
@@ -233,20 +233,20 @@ void pqOutputWindowModel::clear()
233233
void pqOutputWindowModel::ShowMessages(bool* show)
234234
{
235235
this->clear();
236-
int rowCount = 0;
236+
int _rowCount = 0;
237237
for (int i = 0; i < this->Messages.size(); ++i)
238238
{
239239
for (int j = 0; j < pqOutputWindow::MESSAGE_TYPE_COUNT; ++j)
240240
{
241241
if (show[j] && this->Messages[i].Type == j)
242242
{
243-
++rowCount;
243+
++_rowCount;
244244
break;
245245
}
246246
}
247247
}
248-
this->Rows.reserve(rowCount);
249-
this->beginInsertRows(QModelIndex(), 0, rowCount - 1);
248+
this->Rows.reserve(_rowCount);
249+
this->beginInsertRows(QModelIndex(), 0, _rowCount - 1);
250250
for (int i = 0; i < this->Messages.size(); ++i)
251251
{
252252
for (int j = 0; j < pqOutputWindow::MESSAGE_TYPE_COUNT; ++j)

Qt/Core/pqOutputWindowModel.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class PQCORE_EXPORT pqOutputWindowModel : public QAbstractTableModel
8484
QList<int> Rows; // element is index in Messages,
8585
// when an element is expanded, the index is duplicated
8686
QTableView* View;
87-
class pqInternals;
87+
struct pqInternals;
8888
QScopedPointer<pqInternals> Internals;
8989
};
9090

0 commit comments

Comments
 (0)