v2.0.0
Loading...
Searching...
No Matches
channellabelpanel.h
Go to the documentation of this file.
1//=============================================================================================================
17
18#ifndef CHANNELLABELPANEL_H
19#define CHANNELLABELPANEL_H
20
21//=============================================================================================================
22// INCLUDES
23//=============================================================================================================
24
25#include "../../disp_global.h"
26
27//=============================================================================================================
28// QT INCLUDES
29//=============================================================================================================
30
31#include <QPointer>
32#include <QVector>
33#include <QWidget>
34
35//=============================================================================================================
36// DEFINE NAMESPACE DISPLIB
37//=============================================================================================================
38
39namespace DISPLIB
40{
41
42//=============================================================================================================
43// DISPLIB FORWARD DECLARATIONS
44//=============================================================================================================
45
47
48//=============================================================================================================
57{
58 Q_OBJECT
59
60public:
61 explicit ChannelLabelPanel(QWidget* parent = nullptr);
62
63 void setModel(ChannelDataModel* model);
64
65 //=========================================================================================================
71 void setFirstVisibleChannel(int ch);
72
73 //=========================================================================================================
79 void setVisibleChannelCount(int count);
80
81 //=========================================================================================================
89 void setChannelIndices(const QVector<int>& indices);
90
91 //=========================================================================================================
98 void setHideBadChannels(bool hide);
99
100 //=========================================================================================================
107 void setButterflyMode(bool enabled);
108
109 //=========================================================================================================
117 void setVisibleSampleRange(int firstSample, int lastSample);
118
119 QSize sizeHint() const override;
120 QSize minimumSizeHint() const override;
121
122signals:
123 //=========================================================================================================
128 void channelScrollRequested(int targetFirst);
129 void channelBadToggled(int channelIndex, bool bad);
130
131protected:
132 void paintEvent(QPaintEvent* event) override;
133 void mousePressEvent(QMouseEvent* event) override;
134 void mouseMoveEvent(QMouseEvent* event) override;
135 void mouseReleaseEvent(QMouseEvent* event) override;
136 bool event(QEvent* e) override; // for QEvent::ToolTip
137
138private:
139 QVector<int> effectiveChannelIndices() const;
140
141 QPointer<ChannelDataModel> m_model;
142 int m_firstVisibleChannel = 0;
143 int m_visibleChannelCount = 12;
144
145 QVector<int> m_channelIndices; // empty = identity (all channels)
146 bool m_hideBadChannels = false;
147 bool m_butterflyMode = false;
148 int m_visSampleFirst = 0;
149 int m_visSampleLast = 0;
150
151 bool m_dragging = false;
152 bool m_dragActivated = false;
153 int m_dragStartY = 0;
154 int m_dragStartFirst = 0;
155};
156
157} // namespace DISPLIB
158
159#endif // CHANNELLABELPANEL_H
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
2-D display widgets and visualisation helpers (charts, topography, colour maps).
Circular-buffer Qt model exposing a rolling window of the live FIFF stream as a table.
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)