QtPdCom  1.5.2
MessageModelUnion.h
Go to the documentation of this file.
1/*****************************************************************************
2 *
3 * Copyright (C) 2009 - 2025 Florian Pose <fp@igh.de>
4 *
5 * This file is part of the QtPdCom library.
6 *
7 * The QtPdCom library is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * The QtPdCom library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
15 * License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with the QtPdCom Library. If not, see <http://www.gnu.org/licenses/>.
19 *
20 ****************************************************************************/
21
22#pragma once
23
24#include "Export.h"
25
26#include <QAbstractTableModel>
27
28#include <memory>
29
30namespace QtPdCom {
31
32class MessageModel;
34class Message;
35
36/****************************************************************************/
37
41class QTPDCOM_PUBLIC MessageModelUnion: public QAbstractTableModel
42{
43 Q_OBJECT
44
45 public:
52 Q_ENUM(Columns)
53
54 explicit MessageModelUnion(QObject *parent = nullptr);
55 virtual ~MessageModelUnion();
56
57 void addSourceModel(QAbstractItemModel *, QString = QString());
58 void removeSourceModel(QAbstractItemModel *);
59
60 void clearSourceModels();
61
62 // from QAbstractItemModel
63 virtual int rowCount(const QModelIndex &) const override;
64 virtual int columnCount(const QModelIndex &) const override;
65 virtual QVariant data(const QModelIndex &, int) const override;
66 virtual QVariant headerData(int, Qt::Orientation, int) const override;
67 virtual Qt::ItemFlags flags(const QModelIndex &) const override;
68 virtual bool canFetchMore(const QModelIndex &) const override;
69 virtual void fetchMore(const QModelIndex &) override;
70
71 signals:
84 void currentMessage(const QtPdCom::Message *message);
85
86 private:
87 struct Q_DECL_HIDDEN Impl;
88 std::unique_ptr<Impl> impl;
89};
90
91/****************************************************************************/
92
93} // namespace QtPdCom
#define QTPDCOM_PUBLIC
Definition Export.h:30
MessageModelUnion(QObject *parent=nullptr)
Constructor.
Definition MessageModelUnion.cpp:136
Proxy model to filter Messages based on their reset time.
Definition MessageModelFilter.h:44
Table model that combines the rows of multiple MessageModels or MessageModelFilters.
Definition MessageModelUnion.h:42
Columns
Definition MessageModelUnion.h:46
@ TimeResetColumn
Definition MessageModelUnion.h:49
@ TimeOccurredColumn
Definition MessageModelUnion.h:48
@ TextColumn
Definition MessageModelUnion.h:47
@ SourceColumn
Definition MessageModelUnion.h:50
std::unique_ptr< Impl > impl
Definition MessageModelUnion.h:88
void currentMessage(const QtPdCom::Message *message)
Emitted, when a new message gets active.
List of Messages.
Definition MessageModel.h:43
Process message.
Definition Message.h:39
Definition BroadcastModel.h:32
Definition MessageModelUnion.cpp:38