-
Notifications
You must be signed in to change notification settings - Fork 0
/
cameratopwidgets.cpp
49 lines (39 loc) · 1.36 KB
/
cameratopwidgets.cpp
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
#include "cameratopwidgets.h"
#include <QHBoxLayout>
#include "global_value.h"
CameraTopWidgets::CameraTopWidgets(QWidget *parent):BaseWidget(parent)
{
// Set background color.
setObjectName("CameraTopWidgets");
setStyleSheet("#CameraTopWidgets{background:rgb(56,58,66)}");
initLayout();
initConnection();
}
void CameraTopWidgets::initLayout()
{
setWindowOpacity(0.1);
setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Fixed);
QHBoxLayout *hmainyout=new QHBoxLayout;
m_btnreturn=new FourStateButton(return_resource_str,this);
m_btnreturn->setFixedSize(return_icon_width,return_icon_height);
QHBoxLayout *lyout1 = new QHBoxLayout;
lyout1->addWidget(m_btnreturn);
lyout1->addStretch(0);
lyout1->setContentsMargins(0,0,0,0);
titleLabel = new QLabel(this);
QFont font = titleLabel->font();
font.setPixelSize(font_size_big);
titleLabel->setFont(font);
titleLabel->setAlignment(Qt::AlignCenter);
hmainyout->addLayout(lyout1,1);
hmainyout->addWidget(titleLabel,1);
hmainyout->addStretch(1);
hmainyout->setContentsMargins(0,0,0,0);
hmainyout->setSpacing(0);
setLayout(hmainyout);
titleLabel->setText(tr("camera"));
}
void CameraTopWidgets::initConnection()
{
connect(m_btnreturn,SIGNAL(clicked(bool)),this,SIGNAL(returnClick()));
}