CuteLogger
Fast and simple logging solution for Qt based applications
markersdock.h
1/*
2 * Copyright (c) 2021 Meltytech, LLC
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef MARKERSDOCK_H
19#define MARKERSDOCK_H
20
21#include <QDockWidget>
22#include <QItemSelectionModel>
23
24class EditMarkerWidget;
25class MarkerTreeView;
26class MarkersModel;
27class QLineEdit;
28class QSortFilterProxyModel;
29class QToolButton;
30
31class MarkersDock : public QDockWidget
32{
33 Q_OBJECT
34
35public:
36 explicit MarkersDock(QWidget *parent = 0);
37 ~MarkersDock();
38 void setModel(MarkersModel *model);
39
40signals:
41 void seekRequested(int pos);
42 void addRequested();
43 void addAroundSelectionRequested();
44
45public slots:
46 void onMarkerSelectionRequest(int markerIndex);
47
48private slots:
49 void onSelectionChanged(QModelIndex &index);
50 void onRowClicked(const QModelIndex &index);
51 void onAddRequested();
52 void onRemoveRequested();
53 void onClearSelectionRequested();
54 void onRemoveAllRequested();
55 void onSearchChanged();
56 void onColorColumnToggled(bool checked);
57 void onTextColumnToggled(bool checked);
58 void onStartColumnToggled(bool checked);
59 void onEndColumnToggled(bool checked);
60 void onDurationColumnToggled(bool checked);
61 void onRowsInserted(const QModelIndex &parent, int first, int last);
62 void onDataChanged(const QModelIndex &topLeft,
63 const QModelIndex &bottomRight,
64 const QVector<int> &roles = QVector<int>());
65 void onValuesChanged();
66 void onModelReset();
67 void onSortIndicatorChanged(int logicalIndex, Qt::SortOrder order);
68
69private:
70 void enableButtons(bool enable);
71
72 MarkersModel *m_model;
73 QSortFilterProxyModel *m_proxyModel;
74 MarkerTreeView *m_treeView;
75 QToolButton *m_addButton;
76 QToolButton *m_removeButton;
77 QToolButton *m_clearButton;
78 QLineEdit *m_searchField;
79 QToolButton *m_clearSearchButton;
80 EditMarkerWidget *m_editMarkerWidget;
81 bool m_editInProgress;
82};
83
84#endif // MARKERSDOCK_H