-
Notifications
You must be signed in to change notification settings - Fork 2
/
aspectratiolabel.h
52 lines (39 loc) · 1.21 KB
/
aspectratiolabel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef ASPECTRATIOLABEL_H
#define ASPECTRATIOLABEL_H
#include "ledindicator.h"
#pragma once
#include <QLabel>
class AspectRatioLabel : public QLabel
{
Q_OBJECT
//----------------------------------------------------------
// Methods
//----------------------------------------------------------
private:
void updateMargins();
public:
explicit AspectRatioLabel(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
void displayLed();
void createLed(const QString&, double, double);
void adapSizeLED(LedIndicator& led, QLabel& impLabel, const QFont& f);
protected:
void resizeEvent(QResizeEvent* event) override;
void moveEvent(QMoveEvent *event) override;
//----------------------------------------------------------
// Slots
//----------------------------------------------------------
public slots:
void setPixmap(const QPixmap& pm);
//----------------------------------------------------------
// Attributes
//----------------------------------------------------------
public:
QVector<LedIndicator*> ledVector;
QVector<QLabel*> impLabel;
private:
int pixmapWidth;
int pixmapHeight;
int xMargin = 0;
int yMargin = 0;
};
#endif // ASPECTRATIOLABEL_H