QT 编程总结


一、设置全屏

1、setFixedSize(480,272);+Qt::CustomizeWindowHint风格

2、resize, +Qt::CustomizeWindowHint|Qt::FramelessWindowHint风格

代码: mytest::mytest(QWidget                                     *parent):QDialog(parent,Qt::CustomizeWindowHint|Qt::FramelessWindowHint)
{
QString s="test";
。。。。。。。。。。。。。
setLayout(sourceLayout);
resize(480, 272);
}

2、设置控件全屏
QHBoxLayout *sourceLayout = new QHBoxLayout;
sourceLayout->addWidget( tabWidget );
sourceLayout->setContentsMargins(0,0,0,0);//设置周围的margin

设置前:

QT 编程总结

QT 编程总结

相关内容