v2.0.0
Loading...
Searching...
No Matches
channellabelpanel.h
Go to the documentation of this file.
1//=============================================================================================================
35
36#ifndef CHANNELLABELPANEL_H
37#define CHANNELLABELPANEL_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "../../disp_global.h"
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QPointer>
50#include <QVector>
51#include <QWidget>
52
53//=============================================================================================================
54// DEFINE NAMESPACE DISPLIB
55//=============================================================================================================
56
57namespace DISPLIB
58{
59
60//=============================================================================================================
61// DISPLIB FORWARD DECLARATIONS
62//=============================================================================================================
63
65
66//=============================================================================================================
77{
78 Q_OBJECT
79
80public:
81 explicit ChannelLabelPanel(QWidget *parent = nullptr);
82
83 void setModel(ChannelDataModel *model);
84
85 //=========================================================================================================
89 void setFirstVisibleChannel(int ch);
90
91 //=========================================================================================================
95 void setVisibleChannelCount(int count);
96
97 //=========================================================================================================
105 void setChannelIndices(const QVector<int> &indices);
106
107 //=========================================================================================================
112 void setHideBadChannels(bool hide);
113
114 //=========================================================================================================
121 void setButterflyMode(bool enabled);
122
123 //=========================================================================================================
131 void setVisibleSampleRange(int firstSample, int lastSample);
132
133 QSize sizeHint() const override;
134 QSize minimumSizeHint() const override;
135
136signals:
137 //=========================================================================================================
142 void channelScrollRequested(int targetFirst);
143 void channelBadToggled(int channelIndex, bool bad);
144
145protected:
146 void paintEvent(QPaintEvent *event) override;
147 void mousePressEvent(QMouseEvent *event) override;
148 void mouseMoveEvent(QMouseEvent *event) override;
149 void mouseReleaseEvent(QMouseEvent *event) override;
150 bool event(QEvent *e) override; // for QEvent::ToolTip
151
152private:
153 QVector<int> effectiveChannelIndices() const;
154
155 QPointer<ChannelDataModel> m_model;
156 int m_firstVisibleChannel = 0;
157 int m_visibleChannelCount = 12;
158
159 QVector<int> m_channelIndices; // empty = identity (all channels)
160 bool m_hideBadChannels = false;
161 bool m_butterflyMode = false;
162 int m_visSampleFirst = 0;
163 int m_visSampleLast = 0;
164
165 bool m_dragging = false;
166 bool m_dragActivated = false;
167 int m_dragStartY = 0;
168 int m_dragStartFirst = 0;
169};
170
171} // namespace DISPLIB
172
173#endif // CHANNELLABELPANEL_H
disp library export/import macros.
#define DISPSHARED_EXPORT
Definition disp_global.h:51
2-D display widgets and visualisation helpers (charts, topography, colour maps).
ChannelDataModel – lightweight data container for ChannelDataView / ChannelRhiView.
void channelScrollRequested(int targetFirst)
void setVisibleSampleRange(int firstSample, int lastSample)
void setChannelIndices(const QVector< int > &indices)
void mouseReleaseEvent(QMouseEvent *event) override
QSize sizeHint() const override
void channelBadToggled(int channelIndex, bool bad)
void mouseMoveEvent(QMouseEvent *event) override
bool event(QEvent *e) override
void paintEvent(QPaintEvent *event) override
QSize minimumSizeHint() const override
void setButterflyMode(bool enabled)
void mousePressEvent(QMouseEvent *event) override
ChannelLabelPanel(QWidget *parent=nullptr)
void setModel(ChannelDataModel *model)