OpenHantek
Loading...
Searching...
No Matches
datagrid.h
1// SPDX-License-Identifier: GPL-2.0+
2
3#pragma once
4
5#include <QGroupBox>
6#include <QPalette>
7
8class QPushButton;
9class QButtonGroup;
10class QLabel;
11class QGridLayout;
12
13class DataGrid : public QGroupBox
14{
15 Q_OBJECT
16public:
17 explicit DataGrid(QWidget *parent = nullptr);
18
19 struct CursorInfo {
20 QPalette palette;
21 QPushButton *selector;
22 QPushButton *shape;
23 QLabel *deltaXLabel;
24 QLabel *deltaYLabel;
25
26 CursorInfo();
27 void configure(const QString &text, const QColor &bgColor, const QColor &fgColor);
28 };
29
30 unsigned addItem(const QString &text, const QColor &fgColor);
31 void setBackgroundColor(const QColor &bgColor);
32 void configureItem(unsigned index, const QColor &fgColor);
33 void updateInfo(unsigned index, bool visible, const QString &strShape = QString(),
34 const QString &strX = QString(), const QString &strY = QString());
35
36signals:
37 void itemSelected(unsigned index);
38 void itemUpdated(unsigned index);
39
40public slots:
41 void selectItem(unsigned index);
42
43private:
44 QColor backgroundColor;
45 QButtonGroup *cursorsSelectorGroup;
46 QGridLayout *cursorsLayout;
47 std::vector<CursorInfo> items;
48};
Definition datagrid.h:14
Definition datagrid.h:19
QPushButton * shape
The cursor shape.
Definition datagrid.h:22
QLabel * deltaYLabel
The vertical distance between cursors.
Definition datagrid.h:24
QPalette palette
The widget's palette.
Definition datagrid.h:20
QPushButton * selector
The name of the channel.
Definition datagrid.h:21
QLabel * deltaXLabel
The horizontal distance between cursors.
Definition datagrid.h:23