CuteLogger
Fast and simple logging solution for Qt based applications
editmarkerwidget.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 EDITMARKERWIDGET_H
19 #define EDITMARKERWIDGET_H
20 
21 #include <QWidget>
22 
23 class QLabel;
24 class QLineEdit;
25 class QPushButton;
26 class TimeSpinBox;
27 
28 class EditMarkerWidget : public QWidget
29 {
30  Q_OBJECT
31 
32 public:
33  EditMarkerWidget(QWidget *parent);
34  EditMarkerWidget(QWidget *parent, const QString& text, const QColor& color, int start, int end, int maxEnd);
35  virtual ~EditMarkerWidget();
36  QString getText();
37  QColor getColor();
38  int getStart();
39  int getEnd();
40  void setValues(const QString& text, const QColor& color, int start, int end, int maxEnd);
41 
42 signals:
43  void valuesChanged();
44 
45 private slots:
46  void on_colorButton_clicked();
47  void on_startSpinner_valueChanged(int);
48  void on_endSpinner_valueChanged(int);
49 
50 private:
51  void updateDuration();
52 
53  QLineEdit* m_textField;
54  QPushButton* m_colorButton;
55  QLabel* m_colorLabel;
56  TimeSpinBox* m_startSpinner;
57  TimeSpinBox* m_endSpinner;
58  QLabel* m_durationLabel;
59 };
60 
61 #endif // EDITMARKERWIDGET_H