summaryrefslogtreecommitdiffstats
path: root/qt-models/weigthsysteminfomodel.h
blob: 98c11d8149838a9168e5e06f72b07d9d23ae3541 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// SPDX-License-Identifier: GPL-2.0
#ifndef WEIGHTSYSTEMINFOMODEL_H
#define WEIGHTSYSTEMINFOMODEL_H

#include "cleanertablemodel.h"

/* Encapsulate ws_info */
class WSInfoModel : public CleanerTableModel {
	Q_OBJECT
public:
	static WSInfoModel *instance();

	enum Column {
		DESCRIPTION,
		GR
	};
	WSInfoModel();

	/*reimp*/ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
	/*reimp*/ int rowCount(const QModelIndex &parent = QModelIndex()) const;
	/*reimp*/ bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex());
	/*reimp*/ bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
	const QString &biggerString() const;
	void clear();
	void update();
	void updateInfo();

private:
	int rows;
	QString biggerEntry;
};

#endif