标签: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
标签:vbo win window 按键 垂直 color show add class
原文地址:https://www.cnblogs.com/Blue-Moniter4/p/9528702.html