OfficeAssistant_Win10/mainwindow.cpp

32 lines
795 B
C++

//
// 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();
if(deskRect.width()>=1920){
resize(1920,1080);
}else if(deskRect.width()>=1333&&deskRect.width()<=1920) {
resize(800, 540);
}
delete desktopWidget;
mainWindowLayout=new MainWindowLayout(this);
setCentralWidget(mainWindowLayout);
}
MainWindow::~MainWindow() {
delete mainWindowLayout;
delete layout;
delete ui;
}