QHBoxLayout layout new QHBoxLayout QWidget cWidget new QWidget cWidget

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
QHBoxLayout *layout = new QHBoxLayout();
QWidget *cWidget = new QWidget();
cWidget->setLayout(layout);
QVBoxLayout *leftPanel = new QVBoxLayout();
QHBoxLayout *buttonsPanel = new QHBoxLayout();
QListView *lw_Main = new QListView();
lw_Main->setFixedWidth(200);
lw_Main->setGeometry(0, 0, 200, 120);
QPushButton *pb_New = new QPushButton();
pb_New->setText("Добавить");
pb_New->setFixedHeight(25);
QPushButton *pb_Remove = new QPushButton();
pb_Remove->setText("Удалить");
pb_Remove->setFixedHeight(25);
QPushButton *pb_Back = new QPushButton();
pb_Back->setText("Назад к списку");
pb_Back->setFixedHeight(25);
pb_Back->setVisible(false);
QWebView *browser = new QWebView();
leftPanel->addWidget(lw_Main);
buttonsPanel->addWidget(pb_New);
buttonsPanel->addWidget(pb_Remove);
buttonsPanel->addWidget(pb_Back);
leftPanel->addLayout(buttonsPanel);
layout->addLayout(leftPanel);
layout->addWidget(browser);
w.setCentralWidget(cWidget);
w.setMinimumSize(500, 120);