1 Star 0 Fork 0

qinxude/rk3568ui

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
screenmng.cpp 5.22 KB
一键复制 编辑 原始数据 按行查看 历史
qinxude 提交于 2024-09-04 10:52 . update toolbar
#include "screenmng.h"
#include "ui_screenmng.h"
#include <QScrollArea>
ScreenMng::ScreenMng(QWidget *parent) :
QWidget(parent),
ui(new Ui::ScreenMng)
{
ui->setupUi(this);
this->resize(1080,1920);
m_MainScreen = new MainScreen(this);
MainScreenShow();
#ifdef __x86_64__
// 设置QWidget的基本布局
QVBoxLayout *layout = new QVBoxLayout(this);
layout->setSpacing(0);
layout->setContentsMargins(0, 0, 0, 0); // 消除边距
// 创建一个基础的QScrollArea
QScrollArea *scrollArea = new QScrollArea(this);
scrollArea->setWidget(m_MainScreen); // 为滚动区域添加内容
// 添加垂直滚动条
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
layout->addWidget(scrollArea);
#else
this->setWindowFlags(Qt::FramelessWindowHint);
#endif
this->show();//顺序不能放在设置无边框之前,否则主页不显示
// m_DataDictionary = DataDictionary::GetInstance();
// m_TestTimer = new QTimer;
// m_TestTimer->setInterval(1*1000);
// m_TestTimer->start();
m_ToolBar = ToolBar::GetInstance();
m_ScreenSwitchButton = ScreenSwitchButton::GetInstance();
// m_ScreenSwitchButton->setParent(this);
// m_BootScreen = new BootScreen(this);
m_ScreenSwitchButton->SetButtonWidget(7,m_MainScreen);
// m_VideoSetting = new VideoSetting(this);
// m_ScreenSwitchButton->SetButtonWidget(0,m_VideoSetting);
m_CollisionSetting = new CollisionSetting(this);
m_ScreenSwitchButton->SetButtonWidget(3,m_CollisionSetting);
// m_FaceSetting = new FaceSetting(this);
// m_ScreenSwitchButton->SetButtonWidget(1,m_FaceSetting);
m_LimitSetting = new LimitSetting(this);
m_ScreenSwitchButton->SetButtonWidget(2,m_LimitSetting);
connect(m_MainScreen,&MainScreen::showLimitSettingPag,
[&](){
ScreenButtonClicked(m_LimitSetting);
});
// m_SettingSystem = new SettingSystem(this);
// m_ScreenSwitchButton->SetButtonWidget(4,m_SettingSystem);
// m_HelpScreen = new HelpScreen(this);
// m_ScreenSwitchButton->SetButtonWidget(6,m_HelpScreen);
// m_SyncDataToBB = new SyncDataToBB(this);
// m_ScreenSwitchButton->SetButtonWidget(5,m_SyncDataToBB);
// m_Login = new LoginDig(this);
// m_CurrentScreen = m_BootScreen;
// this->show();
// m_BootScreen->show();
// m_FaceIdScreen = new FaceIdScreen(this);
// QTimer::singleShot(1000, this, [=](){
// m_FaceIdScreen->show();
// m_CurrentScreen=m_FaceIdScreen;
// });
// connect(m_TestTimer,SIGNAL(timeout()),
// this,SLOT(MainScreenShow()));
// connect(m_ToolBar,SIGNAL(SettingClicked()),\
// this,SLOT(LoginScreenShow()));
// connect(m_FaceIdScreen,SIGNAL(SettingButtonClicked()),\
// this,SLOT(LoginScreenShow()));
// connect(m_ToolBar,SIGNAL(SettingClicked()),\
// m_MainScreen,SLOT(hide()));
// connect(m_ToolBar,SIGNAL(StartFaceId()),\
// this,SLOT(FaceIdScreenShow()));
// connect(m_ToolBar,SIGNAL(StartFaceId()),\
// m_MainScreen,SLOT(hide()));
// connect(m_FaceIdScreen,SIGNAL(Quite()),\
// this,SLOT(MainScreenShow()));
// connect(m_Login,SIGNAL(LoginPassWord(QString)),\
// this,SLOT(CheckassWord(QString)));
// connect(m_Login,SIGNAL(LoginScreenClose()),\
// this,SLOT(RecoveryScreen()));
connect(m_ScreenSwitchButton,SIGNAL(ButtonClicked(QWidget*)),\
this,SLOT(ScreenButtonClicked(QWidget*)));
}
ScreenMng::~ScreenMng()
{
delete ui;
}
void ScreenMng::MainScreenShow()
{
// // m_TestTimer->stop();
m_CurrentScreen = m_MainScreen;
// // m_BootScreen->hide();
m_MainScreen->show();
}
void ScreenMng::RecoveryScreen()
{
// m_CurrentScreen->show();
}
void ScreenMng::LoginScreenShow()
{
// m_Login->ShowScreen();
// m_FaceIdScreen->hide();
}
void ScreenMng::FaceSettingShow()
{
// ScreenButtonClicked(m_FaceSetting);
}
void ScreenMng::FaceIdScreenShow()
{
// ScreenButtonClicked(m_FaceIdScreen);
}
void ScreenMng::ScreenButtonClicked(QWidget *W)
{
QWidget *Tmp = nullptr;
Tmp = W;
// if(Tmp == m_HelpScreen)
// {
// m_HelpScreen->show();
// return;
// }
if(Tmp != nullptr && W != m_CurrentScreen)
{
ScreenSwitchButton::GetInstance()->Show(W);
m_CurrentScreen->hide();
m_CurrentScreen = Tmp;
m_CurrentScreen->show();
if(W==m_MainScreen)
{
m_ScreenSwitchButton->hide();
}
}
}
void ScreenMng::CheckassWord(QString passw)
{
QString PWMd5 = QCryptographicHash::hash(passw.toLatin1()
,QCryptographicHash::Md5).toHex();
// if(m_DataDictionary->GetSystemData(SYS_PASSWORD_MD5) == PWMd5 || \
// m_DataDictionary->GetSystemData(SYS_SUPER_PASSWORD) == passw){
// if(passw == tr("123456")){
// m_Login->HideScreen();
// if(m_CurrentScreen == m_MainScreen)
// EntrySettingScreen();
// else if(m_CurrentScreen == m_FaceIdScreen)
// FaceSettingShow();
// }else {
// m_Login->LoginFaild();
// }
}
void ScreenMng::EntrySettingScreen()
{
// ScreenButtonClicked(m_VideoSetting);
// ScreenButtonClicked(m_LimitSetting);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/qinxude/rk3568ui.git
[email protected]:qinxude/rk3568ui.git
qinxude
rk3568ui
rk3568ui
master

搜索帮助