This repository was archived by the owner on Nov 10, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +46
-40
lines changed Expand file tree Collapse file tree 6 files changed +46
-40
lines changed Original file line number Diff line number Diff line change 66QT += widgets
77
88SOURCES = src/main.cpp \
9- src/simple_menu_demonstration .cpp \
9+ src/vertical_box_demonstration .cpp \
1010
11- HEADERS = src/simple_menu_demonstration .h
11+ HEADERS = src/vertical_box_demonstration .h
1212
1313CONFIG -= app_bundle
1414
Original file line number Diff line number Diff line change 11#include < QApplication>
22#include < QWidget>
3- #include " simple_menu_demonstration .h"
3+ #include " vertical_box_demonstration .h"
44
55int main (int argc, char *argv[])
66{
77 QApplication app (argc, argv);
88
9- SimpleMenuDemonstration window;
9+ VerticalBoxDemonstration window;
1010
1111 window.resize (250 , 150 );
12- window.setWindowTitle (" SimpleMenu Demonstration" );
12+ window.setWindowTitle (" VerticalBox Demonstration" );
1313 window.show ();
1414
1515 return app.exec ();
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #include < QVBoxLayout>
2+ #include < QPushButton>
3+ #include " vertical_box_demonstration.h"
4+
5+ VerticalBoxDemonstration::VerticalBoxDemonstration (QWidget *parent)
6+ : QWidget(parent)
7+ {
8+ QVBoxLayout *vbox = new QVBoxLayout (this );
9+ vbox->setSpacing (1 );
10+
11+ QPushButton *settings = new QPushButton (" Settings" , this );
12+ settings->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
13+ QPushButton *accounts = new QPushButton (" Accounts" , this );
14+ accounts->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
15+ QPushButton *loans = new QPushButton (" Loans" , this );
16+ loans->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
17+ QPushButton *cash = new QPushButton (" Cash" , this );
18+ cash->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
19+ QPushButton *debts = new QPushButton (" Debts" , this );
20+ debts->setSizePolicy (QSizePolicy::Expanding, QSizePolicy::Expanding);
21+
22+ vbox->addWidget (settings);
23+ vbox->addWidget (accounts);
24+ vbox->addWidget (loans);
25+ vbox->addWidget (cash);
26+ vbox->addWidget (debts);
27+
28+ setLayout (vbox);
29+ }
Original file line number Diff line number Diff line change 1+ #ifndef VERTICAL_BOX_DEMONSTRATION_H
2+ #define VERTICAL_BOX_DEMONSTRATION_H
3+
4+ #include < QWidget>
5+
6+ class VerticalBoxDemonstration : public QWidget
7+ {
8+ public:
9+ VerticalBoxDemonstration (QWidget *parent = 0 );
10+ };
11+
12+ #endif
You can’t perform that action at this time.
0 commit comments