36 lines
892 B
C++
36 lines
892 B
C++
|
#include "widget.h"
|
||
|
#include "mywidget2.h"
|
||
|
#include "widget3.h"
|
||
|
|
||
|
#include <QApplication>
|
||
|
#include <QScreen>
|
||
|
#include <QDebug>
|
||
|
|
||
|
int main(int argc, char *argv[])
|
||
|
{
|
||
|
QApplication a(argc, argv);
|
||
|
// Widget w;
|
||
|
|
||
|
// 设置窗口的标题、初始大小、固定的最大宽和高
|
||
|
// w.setWindowTitle("标题");
|
||
|
// w.resize(1200,900);
|
||
|
// w.setFixedSize(600,400);
|
||
|
|
||
|
// 获取主屏幕
|
||
|
// QScreen *desktop = QApplication::primaryScreen();
|
||
|
// QRect screenGeometry = desktop->geometry();
|
||
|
// int screenWidth = screenGeometry.width();
|
||
|
// int screenHeight = screenGeometry.height();
|
||
|
// // 获取屏幕信息
|
||
|
// qDebug() << "屏幕宽度:" << screenWidth;
|
||
|
// qDebug() << "屏幕高度:" << screenHeight;
|
||
|
|
||
|
|
||
|
// MyWidget2 w2; // 修改为新增的 MyWidget2 类
|
||
|
|
||
|
Widget3 w3;
|
||
|
|
||
|
w3.show();
|
||
|
return a.exec();
|
||
|
}
|