Added a second bound property (nExpectedBiddings) & cleaned up the code a little.
This commit is contained in:
@ -12,6 +12,8 @@ class ModelSummary : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY(int rowCount READ rowCount NOTIFY rowCountChanged BINDABLE bindableRowCount)
|
||||
Q_PROPERTY(int nExpectedBiddings READ nExpectedBiddings NOTIFY nExpectedBiddingsChanged BINDABLE
|
||||
bindableNExpectedBiddings)
|
||||
|
||||
public:
|
||||
ModelSummary(shared_ptr<TableModel> model, QObject* parent = nullptr);
|
||||
@ -19,14 +21,21 @@ class ModelSummary : public QObject {
|
||||
|
||||
int rowCount() const;
|
||||
QBindable<int> bindableRowCount();
|
||||
int nExpectedBiddings() const;
|
||||
QBindable<int> bindableNExpectedBiddings();
|
||||
|
||||
signals:
|
||||
void rowCountChanged();
|
||||
|
||||
void nExpectedBiddingsChanged();
|
||||
private:
|
||||
shared_ptr<TableModel> m_model;
|
||||
|
||||
Q_OBJECT_BINDABLE_PROPERTY(ModelSummary, int, m_rowCount, &ModelSummary::rowCountChanged);
|
||||
Q_OBJECT_BINDABLE_PROPERTY(ModelSummary,
|
||||
int,
|
||||
m_nExpectedBiddings,
|
||||
&ModelSummary::nExpectedBiddingsChanged);
|
||||
};
|
||||
|
||||
#endif // MODELSUMMARY_H
|
||||
|
||||
Reference in New Issue
Block a user