代码拉取完成,页面将自动刷新
#include "mainwindow.h"
#include "mainscene.h"
#include "controller.h"
#include <QGuiApplication>
#include <QScreen>
#include <QStateMachine>
#include <QFinalState>
#include <QKeyEventTransition>
#include <QDebug>
#include <QTimer>
#include <QPushButton>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
//全屏
QScreen *screen = QGuiApplication::primaryScreen ();
QRect screenRect = screen->geometry();
resize(screenRect.width(),screenRect.height());
setWindowFlags(Qt::WindowStaysOnTopHint|Qt::X11BypassWindowManagerHint|Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground);
mainScene = new MainScene(screenRect,this);
mainView = new QGraphicsView(mainScene,this);
mainView->setWindowFlags(Qt::WindowStaysOnTopHint|Qt::X11BypassWindowManagerHint|Qt::FramelessWindowHint);
mainView->setAttribute(Qt::WA_TranslucentBackground);
mainView->setStyleSheet("background: transparent;border:0px");
setCentralWidget(mainView);
this->controller = new Controller(this);
//this->controller->setGeometry(1920-350,1080-20,106,166);
QPalette pal(this->controller->palette());
pal.setColor(QPalette::Background, QColor(255,255,255, 230));
controller->setAutoFillBackground(true);
controller->setPalette(pal);
this->controller->show();
}
MainWindow::~MainWindow()
{
}
void MainWindow::stopped()
{
qDebug()<<"stopped";
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。