desktop-widgets: Change Q_UNUSED to no parameter name

C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-05-21 18:09:09 +02:00 committed by Dirk Hohndel
parent e47f6df076
commit e536682b84
12 changed files with 43 additions and 103 deletions

View file

@ -22,10 +22,8 @@
#include <QColor>
#include <QAbstractProxyModel>
QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
QSize DiveListDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const
{
Q_UNUSED(option)
Q_UNUSED(index)
return QSize(50, 22);
}
@ -66,10 +64,8 @@ void StarWidgetsDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
painter->restore();
}
QSize StarWidgetsDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
QSize StarWidgetsDelegate::sizeHint(const QStyleOptionViewItem&, const QModelIndex&) const
{
Q_UNUSED(option)
Q_UNUSED(index)
return minStarSize;
}
@ -107,9 +103,8 @@ struct CurrSelected {
bool ignoreSelection;
} currCombo;
QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
QWidget *ComboBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem&, const QModelIndex &index) const
{
Q_UNUSED(option)
QComboBox *comboDelegate = new QComboBox(parent);
comboDelegate->setModel(model);
comboDelegate->setEditable(true);
@ -220,9 +215,8 @@ bool ComboBoxDelegate::eventFilter(QObject *object, QEvent *event)
return QStyledItemDelegate::eventFilter(object, event);
}
void ComboBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
void ComboBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex&) const
{
Q_UNUSED(index)
QRect defaultRect = option.rect;
defaultRect.setX(defaultRect.x() - 1);
defaultRect.setY(defaultRect.y() - 1);
@ -237,12 +231,8 @@ struct RevertCylinderData {
int size;
} currCylinderData;
void TankInfoDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &thisindex) const
void TankInfoDelegate::setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const
{
Q_UNUSED(model)
Q_UNUSED(editor)
Q_UNUSED(thisindex)
CylindersModel *mymodel = qobject_cast<CylindersModel *>(currCombo.model);
TankInfoModel *tanks = TankInfoModel::instance();
QModelIndexList matches = tanks->match(tanks->index(0, 0), Qt::DisplayRole, currCombo.activeText);
@ -270,19 +260,16 @@ TankInfoDelegate::TankInfoDelegate(QObject *parent) : ComboBoxDelegate(TankInfoM
this, SLOT(reenableReplot(QWidget *, QAbstractItemDelegate::EndEditHint)));
}
void TankInfoDelegate::reenableReplot(QWidget *widget, QAbstractItemDelegate::EndEditHint hint)
void TankInfoDelegate::reenableReplot(QWidget*, QAbstractItemDelegate::EndEditHint)
{
Q_UNUSED(widget)
Q_UNUSED(hint)
MainWindow::instance()->graphics()->setReplot(true);
// FIXME: We need to replot after a cylinder is selected but the replot below overwrites
// the newly selected cylinder.
// MainWindow::instance()->graphics()->replot();
}
void TankInfoDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint)
void TankInfoDelegate::revertModelData(QWidget*, QAbstractItemDelegate::EndEditHint hint)
{
Q_UNUSED(widget)
if (hint == QAbstractItemDelegate::NoHint ||
hint == QAbstractItemDelegate::RevertModelCache) {
CylindersModel *mymodel = qobject_cast<CylindersModel *>(currCombo.model);
@ -310,10 +297,8 @@ TankUseDelegate::TankUseDelegate(QObject *parent) : QStyledItemDelegate(parent)
{
}
QWidget *TankUseDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index) const
QWidget *TankUseDelegate::createEditor(QWidget * parent, const QStyleOptionViewItem&, const QModelIndex&) const
{
Q_UNUSED(option)
Q_UNUSED(index)
QComboBox *comboBox = new QComboBox(parent);
for (int i = 0; i < NUM_GAS_USE; i++)
comboBox->addItem(gettextFromC::instance()->trGettext(cylinderuse_text[i]));
@ -338,9 +323,8 @@ struct RevertWeightData {
int weight;
} currWeight;
void WSInfoDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint)
void WSInfoDelegate::revertModelData(QWidget*, QAbstractItemDelegate::EndEditHint hint)
{
Q_UNUSED(widget)
if (hint == QAbstractItemDelegate::NoHint ||
hint == QAbstractItemDelegate::RevertModelCache) {
WeightModel *mymodel = qobject_cast<WeightModel *>(currCombo.model);
@ -349,12 +333,8 @@ void WSInfoDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::End
}
}
void WSInfoDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &thisindex) const
void WSInfoDelegate::setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const
{
Q_UNUSED(editor)
Q_UNUSED(model)
Q_UNUSED(thisindex)
WeightModel *mymodel = qobject_cast<WeightModel *>(currCombo.model);
WSInfoModel *wsim = WSInfoModel::instance();
QModelIndexList matches = wsim->match(wsim->index(0, 0), Qt::DisplayRole, currCombo.activeText);
@ -389,10 +369,8 @@ QWidget *WSInfoDelegate::createEditor(QWidget *parent, const QStyleOptionViewIte
return editor;
}
void AirTypesDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint)
void AirTypesDelegate::revertModelData(QWidget*, QAbstractItemDelegate::EndEditHint)
{
Q_UNUSED(widget)
Q_UNUSED(hint)
}
void AirTypesDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
@ -407,10 +385,8 @@ AirTypesDelegate::AirTypesDelegate(QObject *parent) : ComboBoxDelegate(GasSelect
{
}
void DiveTypesDelegate::revertModelData(QWidget *widget, QAbstractItemDelegate::EndEditHint hint)
void DiveTypesDelegate::revertModelData(QWidget*, QAbstractItemDelegate::EndEditHint)
{
Q_UNUSED(widget)
Q_UNUSED(hint)
}
void DiveTypesDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
@ -457,9 +433,8 @@ QWidget *DoubleSpinBoxDelegate::createEditor(QWidget *parent, const QStyleOption
return w;
}
LocationFilterDelegate::LocationFilterDelegate(QObject *parent)
LocationFilterDelegate::LocationFilterDelegate(QObject*)
{
Q_UNUSED(parent)
}
void LocationFilterDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &origIdx) const