So i think i'll need
class ListModel : public QAbstractListModel
To copy to clipboard, switch view to plain text mode
but the problem is - i still don't know how to implement it. I think I will need to pass an array to this model, which will create elements using that array.
I don't know how to write that, right now i have this declaration:
{
Q_OBJECT
public:
private:
};
class ListModel : public QAbstractListModel
{
Q_OBJECT
public:
ListModel(const QString array[20][3], QObject *parent = 0)
: QAbstractListModel(parent), str(array[20][3]){}
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role) const;
private:
QString str;
};
To copy to clipboard, switch view to plain text mode
But i cannot get to strings inside that array. In fact i don't think anything here is written right...
Can someone tell me what?
Bookmarks