swift
Loading...
Searching...
No Matches
statusmessagelistmodel.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#ifndef SWIFT_GUI_MODELS_STATUSMESSAGELISTMODEL_H
7#define SWIFT_GUI_MODELS_STATUSMESSAGELISTMODEL_H
8
10#include "gui/swiftguiexport.h"
12
13namespace swift::gui::models
14{
19 public CListModelTimestampObjects<swift::misc::CStatusMessageList, true>
20 {
22
23 public:
25 enum Mode
26 {
27 Detailed,
28 DetailedWithOrder,
29 Simplified,
30 SimplifiedWithOrder
31 };
32
34 explicit CStatusMessageListModel(QObject *parent = nullptr);
35
37 ~CStatusMessageListModel() override = default;
38
40 void setMode(Mode mode);
41
43 void setMode(Mode mode, const swift::misc::CStatusMessageList &messages);
44
47
49 QVariant data(const QModelIndex &index, int role) const override;
50
52 bool isSortedByTimestampOrOrder() const;
53
56
57 private:
58 Mode m_mode;
59 };
60} // namespace swift::gui::models
61#endif // SWIFT_GUI_MODELS_STATUSMESSAGELISTMODEL_H
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const final
CStatusMessageListModel(QObject *parent=nullptr)
Constructor.
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.
Status messages, e.g. from Core -> GUI.
Models to be used with views, mainly QTableView.
Q_OBJECTQ_OBJECT
#define SWIFT_GUI_EXPORT
Export a class or function from the library.