src/messagelog.cpp

changeset 250
2837b549e616
parent 236
1fa0e1de9f0a
child 264
76a025db4948
equal deleted inserted replaced
249:37d3c819cafa 250:2837b549e616
7 7
8 } 8 }
9 9
10 void MessageLog::addMessage(const Message& message) 10 void MessageLog::addMessage(const Message& message)
11 { 11 {
12 this->beginInsertRows({}, this->messages.size(), this->messages.size()); 12 const int row = static_cast<int>(this->messages.size());
13 this->beginInsertRows({}, row, row);
13 this->messages.push_back(message); 14 this->messages.push_back(message);
14 this->endInsertRows(); 15 this->endInsertRows();
15 } 16 }
16 17
17 QVariant MessageLog::headerData(int section, Qt::Orientation orientation, int role) const 18 QVariant MessageLog::headerData(int section, Qt::Orientation orientation, int role) const
30 } 31 }
31 } 32 }
32 33
33 int MessageLog::rowCount(const QModelIndex&) const 34 int MessageLog::rowCount(const QModelIndex&) const
34 { 35 {
35 return signed_cast(this->messages.size()); 36 return narrow<int>(signed_cast(this->messages.size()));
36 } 37 }
37 38
38 int MessageLog::columnCount(const QModelIndex&) const 39 int MessageLog::columnCount(const QModelIndex&) const
39 { 40 {
40 return NUM_COLUMNS; 41 return NUM_COLUMNS;

mercurial