Introduce old redir program
[lcapit-junk-code.git] / qt-course / exer1-layout / MyWidget.cpp
blobefcb5b2e9c9843e24c61965846e070e3e935d93c
1 #include <QLabel>
2 #include <QPushButton>
3 #include <QVBoxLayout>
4 #include <QHBoxLayout>
6 #include "MyWidget.h"
8 MyWidget::MyWidget(QWidget *parent)
9 : QWidget(parent)
11 const int max = 10;
13 QVBoxLayout *labels = new QVBoxLayout();
14 for (int i = 0; i < max; i++) {
15 m_label = new QLabel("TextLabel", this);
16 labels->addWidget(m_label);
19 QVBoxLayout *buttons = new QVBoxLayout();
20 for (int i = 0; i < max; i++) {
21 m_button = new QPushButton("PushButton", this);
22 buttons->addWidget(m_button);
25 QHBoxLayout *main_layout = new QHBoxLayout(this);
26 main_layout->addItem(labels);
27 main_layout->addItem(buttons);
30 MyWidget::~MyWidget()