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 //=========================================================================================================
69 void setFirstVisibleChannel(int ch);
70
71 //=========================================================================================================
75 void setVisibleChannelCount(int count);
76
77 //=========================================================================================================
85 void setChannelIndices(const QVector<int> &indices);
86
87 //=========================================================================================================
92 void setHideBadChannels(bool hide);
93
94 //=========================================================================================================
101 void setButterflyMode(bool enabled);
102
103 //=========================================================================================================
111 void setVisibleSampleRange(int firstSample, int lastSample);
112
113 QSize sizeHint() const override;
114 QSize minimumSizeHint() const override;
115
116signals:
117 //=========================================================================================================
122 void channelScrollRequested(int targetFirst);
123 void channelBadToggled(int channelIndex, bool bad);
124
125protected:
126 void paintEvent(QPaintEvent *event) override;
127 void mousePressEvent(QMouseEvent *event) override;
128 void mouseMoveEvent(QMouseEvent *event) override;
129 void mouseReleaseEvent(QMouseEvent *event) override;
130 bool event(QEvent *e) override; // for QEvent::ToolTip
131
132private:
133 QVector<int> effectiveChannelIndices() const;
134
135 QPointer<ChannelDataModel> m_model;
136 int m_firstVisibleChannel = 0;
137 int m_visibleChannelCount = 12;
138
139 QVector<int> m_channelIndices; // empty = identity (all channels)
140 bool m_hideBadChannels = false;
141 bool m_butterflyMode = false;
142 int m_visSampleFirst = 0;
143 int m_visSampleLast = 0;
144
145 bool m_dragging = false;
146 bool m_dragActivated = false;
147 int m_dragStartY = 0;
148 int m_dragStartFirst = 0;
149};
150
151} // namespace DISPLIB
152
153#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)