#include <QApplication>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>
#include <QWidget>
int main(int argc, char *argv[])
{
QApplication app (argc, argv);
QVBoxLayout *hlayout=new QVBoxLayout();
QPushButton *button=new QPushButton("im ok");
QLabel *label = new QLabel("Hello Qt!");
QWidget *window = new QWidget;
window->setWindowTitle("main");
hlayout->addWidget(button);
hlayout->addWidget(label);
window->setLayout(hlayout);
window->setWindowFlags(Qt::FramelessWindowHint);
window->showFullScreen();
return app.exec();
}
run起来后按win+d 组合键,会最小化显示桌面,然后点桌面上任意其他图标,刚才的程序是不是有全屏了?