码迷,mamicode.com
首页 > 其他好文 > 详细

qt--QVBoxLayout

时间:2018-08-24 11:46:44      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:vbo   win   window   按键   垂直   color   show   add   class   

 1     QWidget *window = new QWidget();
 2     //创建按键,暂无配置slot
 3     QPushButton *button1 = new QPushButton(tr("one"));
 4     QPushButton *button2 = new QPushButton(tr("two"));
 5     QPushButton *button3 = new QPushButton(tr("three"));
 6     QPushButton *button4 = new QPushButton(tr("four"));
 7     QPushButton *button5 = new QPushButton(tr("five"));
 8     //垂直布局
 9     QVBoxLayout *layout = new QVBoxLayout;
10     layout->addWidget(button1);
11     layout->addWidget(button2);
12     layout->addWidget(button3);
13     layout->addWidget(button4);
14     layout->addWidget(button5);
15 
16     window->setLayout(layout);
17     window->show();

//QVBoxLayout(垂直布局) \ QHBoxLayout(水平布局) 继承 QBoxLayout

 

qt--QVBoxLayout

标签:vbo   win   window   按键   垂直   color   show   add   class   

原文地址:https://www.cnblogs.com/Blue-Moniter4/p/9528702.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!