OfficeAssistant_Win10/OfficeAssistant_msvc/mainwindow.cpp

35 lines
809 B
C++
Raw Normal View History

2023-07-26 19:48:14 +08:00
//
// Created by HW on 2023/07/26.
//
// You may need to build the project (run Qt uic code generator) to get "ui_MainWindow.h" resolved
#include "mainwindow.h"
#include "ui_MainWindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
QDesktopWidget* desktopWidget = QApplication::desktop();
QRect deskRect = desktopWidget->availableGeometry();
2023-07-30 10:26:41 +08:00
//delete desktopWidget;
2023-07-26 19:48:14 +08:00
mainWindowLayout=new MainWindowLayout(this);
setCentralWidget(mainWindowLayout);
2023-07-27 13:44:54 +08:00
if(deskRect.width()*scale>1920){
resize(1600,1080);
2023-07-30 18:57:41 +08:00
//this->setMaximumWidth(1600);
2023-07-27 13:44:54 +08:00
}else{
resize(800, 540);
2023-07-30 18:57:41 +08:00
//this->setMaximumWidth(800);
2023-07-27 13:44:54 +08:00
}
2023-07-26 19:48:14 +08:00
}
MainWindow::~MainWindow() {
delete mainWindowLayout;
delete ui;
}