Use TableView for debug page.
ClosedPublic

Authored by knauss on May 7 2018, 12:47 PM.

Details

Summary

Tabeview can handle more lines with less RAM, so we can do not eat the
complete RAM while debugging.

Diff Detail

Repository
R199 Akonadi Console
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
knauss created this revision.May 7 2018, 12:47 PM
Restricted Application added a project: KDE PIM. · View Herald TranscriptMay 7 2018, 12:47 PM
Restricted Application added a subscriber: KDE PIM. · View Herald Transcript
knauss requested review of this revision.May 7 2018, 12:47 PM
dvratil requested changes to this revision.May 7 2018, 1:57 PM

Since the view is backed by QStandardItemModel I think it would be better to use appendRow():

auto out = new QStandardItem(QStringLiteral("->"));
out->setForeground(Qt::green);
mModel->appendRow({ new QStandardItem(identifier), out, new QStandardItem(msg.trimmed());

and analogously for the other direction

src/connectionpage.cpp
39–41
mModel->setVerticalHeaderLabels({ QStringLiteral("Sender"), QStringLiteral("Direction"), QStringLiteral("Message") });
This revision now requires changes to proceed.May 7 2018, 1:57 PM
knauss updated this revision to Diff 33756.May 7 2018, 3:01 PM
knauss marked an inline comment as done.

update using setVerticalHeaderLabels.

knauss added a comment.May 7 2018, 3:03 PM

Since the view is backed by QStandardItemModel I think it would be better to use appendRow():

auto out = new QStandardItem(QStringLiteral("->"));
out->setForeground(Qt::green);
mModel->appendRow({ new QStandardItem(identifier), out, new QStandardItem(msg.trimmed());

and analogously for the other direction

well currently the mModel is a pointer to QAbstractItemModel, so this can't be done. I don't know if QStandardItemModel is enough in future, or if we need QAbstractItemModel anyways, if we add a own model class.

knauss updated this revision to Diff 33779.May 7 2018, 4:50 PM

Use QStandardItemModel and make it autoAdjust the size of the rows.

dvratil accepted this revision.May 13 2018, 9:57 AM
This revision is now accepted and ready to land.May 13 2018, 9:57 AM
This revision was automatically updated to reflect the committed changes.