18 CStatusMessageListModel::CStatusMessageListModel(QObject *parent)
21 this->
setSorting(CStatusMessage::IndexUtcTimestamp, Qt::DescendingOrder);
27 (void)QT_TRANSLATE_NOOP(
"ViewStatusMessageList",
"time");
28 (void)QT_TRANSLATE_NOOP(
"ViewStatusMessageList",
"severity");
29 (void)QT_TRANSLATE_NOOP(
"ViewStatusMessageList",
"type");
30 (void)QT_TRANSLATE_NOOP(
"ViewStatusMessageList",
"message");
31 (void)QT_TRANSLATE_NOOP(
"ViewStatusMessageList",
"all categories");
38 case DetailedWithOrder:
39 case Detailed: this->
setMode(messages.
needsOrder() ? Detailed : DetailedWithOrder);
break;
40 case SimplifiedWithOrder:
41 case Simplified: this->
setMode(messages.
needsOrder() ? Simplified : SimplifiedWithOrder);
break;
47 this->
setMode(m_mode, messages);
58 if (p.
isEmpty()) {
return false; }
60 return IOrderable::isAnyOrderIndex(last) || ITimestampBased::isAnyTimestampIndex(last);
77 CColumn col =
CColumn(
"severity", CStatusMessage::IndexSeverityAsIcon);
89 CColumn col =
CColumn(
"severity", CStatusMessage::IndexSeverityAsIcon);
101 if (mode == DetailedWithOrder || mode == SimplifiedWithOrder)
103 this->
setSorting(CStatusMessage::IndexOrder, oldOrder);
105 else { this->
setSorting(CStatusMessage::IndexUtcTimestamp, oldOrder); }
116 if (role == Qt::ToolTipRole)
120 return msg.
toHtml(
false,
false);
static CColumn standardString(const QString &headerName, const swift::misc::CPropertyIndex &propertyIndex, int alignment=CDefaultFormatter::alignDefault())
Get a standard string object formatted column.
void setSortPropertyIndex(const swift::misc::CPropertyIndex &propertyIndex)
Property index used when sorting, option alternative.
static CColumn orderColumn(const swift::misc::CPropertyIndex &propertyIndex=swift::misc::CPropertyIndexRef::GlobalIndexIOrderable, int alignment=CDefaultFormatter::alignRightVCenter())
Get a standard string object formatted column.
void addColumn(const CColumn &column)
Add a column.
virtual const ObjectType & at(const QModelIndex &index) const
Object at row position.
QVariant data(const QModelIndex &index, int role) const
virtual Qt::SortOrder getSortOrder() const
Get sort order.
virtual bool setSorting(const swift::misc::CPropertyIndex &propertyIndex, Qt::SortOrder order=Qt::AscendingOrder)
Sorting.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const final
swift::misc::CPropertyIndexList m_sortTieBreakers
how column values are sorted if equal, if no value is given this is random
swift::misc::CPropertyIndex getSortProperty() const
Sorted by property.
CColumns m_columns
columns metadata
List model for timestamp based objects with offset.
void setMode(Mode mode)
Set mode.
virtual QVariant data(const QModelIndex &index, int role) const
void adjustOrderColumn(const swift::misc::CStatusMessageList &messages)
Adjust order column depending on messages.
static bool sortedByTimestampOrOrder(const swift::misc::CPropertyIndex &p)
Sorted by timestamp or order.
bool isSortedByTimestampOrOrder() const
Currently sorted by timestamp or by order.
QList< int > indexList() const
Index list.
bool isEmpty() const
Empty?
void push_front(const T &value)
Insert as first element.
Streamable status message, e.g.
QString toHtml(bool withIcon, bool withColors) const
To HTML.
Status messages, e.g. from Core -> GUI.
bool needsOrder() const
All order values set or missing some?
Models to be used with views, mainly QTableView.
Free functions in swift::misc.