code cleanup
This commit is contained in:
parent
74719b762f
commit
6000bb3ef2
17 changed files with 65 additions and 67 deletions
|
@ -9,12 +9,12 @@ SellerModel::SellerModel(Marketplace* market, QObject* parent)
|
|||
{
|
||||
}
|
||||
|
||||
int SellerModel::rowCount(const QModelIndex& parent) const
|
||||
int SellerModel::rowCount([[maybe_unused]] const QModelIndex& parent) const
|
||||
{
|
||||
return marketplace_->getSellers().size();
|
||||
}
|
||||
|
||||
int SellerModel::columnCount(const QModelIndex& parent) const { return 5; }
|
||||
int SellerModel::columnCount([[maybe_unused]] const QModelIndex& parent) const { return 5; }
|
||||
|
||||
QVariant SellerModel::data(const QModelIndex& index, int role) const
|
||||
{
|
||||
|
@ -92,8 +92,8 @@ bool SellerModel::setData(const QModelIndex& index, const QVariant& value, int r
|
|||
return false;
|
||||
auto iter =
|
||||
std::find_if(marketplace_->getSellers().begin(), marketplace_->getSellers().end(),
|
||||
[&value](const std::unique_ptr<Seller>& seller) {
|
||||
return value.toInt() == seller->getSellerNo();
|
||||
[&value](const std::unique_ptr<Seller>& s) {
|
||||
return value.toInt() == s->getSellerNo();
|
||||
});
|
||||
if (iter != marketplace_->getSellers().end()) {
|
||||
emit duplicateSellerNo(
|
||||
|
|
|
@ -16,7 +16,7 @@ class SellerModel : public QAbstractTableModel
|
|||
virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
||||
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
virtual Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||
virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole);
|
||||
virtual bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
|
||||
virtual bool insertRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
|
||||
virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue