|
1 class CurrencyModel : public QAbstractTableModel 2 {
3 public:
4 CurrencyModel(QObject *parent = 0);
5 void setCurrencyMap(const QMap<QString, double> &map);
6 int rowCount(const QModelIndex &parent) const;
7 int columnCount(const QModelIndex &parent) const;
8 QVariant data(const QModelIndex &index, int role) const;
9 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
10 private:
11 QString currencyAt(int offset) const;
12 QMap<QString, double> currencyMap;
13 }; |
|
|