PeriDyno
1.0.0
Loading...
Searching...
No Matches
D:
Peridyno
peridyno
src
Rendering
GUI
QtGUI
LockerButton.cpp
Go to the documentation of this file.
1
#include "
LockerButton.h
"
2
3
#include <QLabel>
4
#include <QVBoxLayout>
5
#include <QLineEdit>
6
#include <QDoubleValidator>
7
8
LockerButton::LockerButton
(QWidget* parent)
9
: QPushButton(parent)
10
{
11
mImageLabel
=
new
QLabel;
12
mImageLabel
->setFixedSize(16, 16);
13
mImageLabel
->setScaledContents(
true
);
14
mImageLabel
->setStyleSheet(
"QLabel{background-color:transparent;}"
);
15
16
mTextLabel
=
new
QLabel;
17
mTextLabel
->setStyleSheet(
"QLabel{background-color:transparent;}"
);
18
//mTextLabel->setFont(QFont("΄σΠ‘", 8, QFont::Black));
19
20
QHBoxLayout* mainLayout =
new
QHBoxLayout;
21
mainLayout->addWidget(
mImageLabel
);
22
mainLayout->addWidget(
mTextLabel
);
23
24
mainLayout->setContentsMargins(0, 0, 0, 0);
25
mainLayout->setSpacing(0);
26
this->setLayout(mainLayout);
27
}
28
29
void
LockerButton::SetImageLabel
(
const
QPixmap& pixmap)
30
{
31
mImageLabel
->setPixmap(pixmap);
32
}
33
34
void
LockerButton::SetTextLabel
(QString text)
35
{
36
mTextLabel
->setText(text);
37
}
38
39
QLabel*
LockerButton::GetImageHandle
()
40
{
41
return
mImageLabel
;
42
}
43
44
QLabel*
LockerButton::GetTextHandle
()
45
{
46
return
mTextLabel
;
47
}
LockerButton.h
LockerButton::mImageLabel
QLabel * mImageLabel
Definition
LockerButton.h:32
LockerButton::SetImageLabel
void SetImageLabel(const QPixmap &pixmap)
Definition
LockerButton.cpp:29
LockerButton::GetImageHandle
QLabel * GetImageHandle()
Definition
LockerButton.cpp:39
LockerButton::mTextLabel
QLabel * mTextLabel
Definition
LockerButton.h:34
LockerButton::LockerButton
LockerButton(QWidget *parent=nullptr)
Definition
LockerButton.cpp:8
LockerButton::GetTextHandle
QLabel * GetTextHandle()
Definition
LockerButton.cpp:44
LockerButton::SetTextLabel
void SetTextLabel(QString text)
Definition
LockerButton.cpp:34
Generated by
1.13.2