#include "editor.cpp"
int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QDesktopWidget *screen = QApplication::desktop();
int height = screen->height();
int width = screen->width();
textEditor window;
window.resize(width, height);
window.show();
window.resize(width/2, height);
window.show();
return app.exec();
}
为什么窗户的宽度不会变成一半?
另一方面,如果我像这样反转调整大小的行,我仍然会得到一个完整大小的应用程序。
window.resize(width/2, height);
window.show();
window.resize(width, height);
window.show();