blob: 8257fb181f9d0d1a8d9ebb65da44d1d8eca3889f (
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
34
|
#include "conversationmodel.h"
#include <QAbstractItemModel>
int ConversationModel::rowCount(const QModelIndex &parent) const
{
qDebug() << conversations.count();
return conversations.count();
}
QVariant ConversationModel::data(const QModelIndex &index, int role) const
{
qDebug() << conversations;
return conversations.at(index.row());
}
void ConversationModel::append(const QString &value)
{
beginInsertRows(QModelIndex(), rowCount(), rowCount());
endInsertRows();
conversations << value;
qDebug() << conversations;
qDebug() << conversations.count();
}
bool ConversationModel::setData(const QModelIndex &index, const QVariant &value,
int role)
{
return false;
}
QStringList ConversationModel::getConversations() const
{
return conversations;
}
|