aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-30 15:53:16 +0800
committercrupest <crupest@outlook.com>2020-12-30 15:53:16 +0800
commitda40ea05ecee7e9a8478b672263ed7217cabbed4 (patch)
treedf2d96bd868b835788dd61f26468f9dc3c7a538b
parentb5e90ab268e166541b843dd2653258d5a997c2e2 (diff)
downloadlife-da40ea05ecee7e9a8478b672263ed7217cabbed4.tar.gz
life-da40ea05ecee7e9a8478b672263ed7217cabbed4.tar.bz2
life-da40ea05ecee7e9a8478b672263ed7217cabbed4.zip
...
-rw-r--r--cpp-practicum/main.cpp35
1 files changed, 21 insertions, 14 deletions
diff --git a/cpp-practicum/main.cpp b/cpp-practicum/main.cpp
index 9244342..14847cc 100644
--- a/cpp-practicum/main.cpp
+++ b/cpp-practicum/main.cpp
@@ -1,32 +1,39 @@
+#include "qboxlayout.h"
+#include "qtableview.h"
#include <QApplication>
#include <QHBoxLayout>
#include <QMainWindow>
#include <QPushButton>
+#include <QTableView>
#include <QVBoxLayout>
#include <QWidget>
int main(int argc, char *argv[]) {
QApplication application(argc, argv);
- QMainWindow main_window;
+ QWidget window;
+ QVBoxLayout window_layout;
+ window.setLayout(&window_layout);
- QWidget centeral_area;
- QVBoxLayout central_area_layout;
- centeral_area.setLayout(&central_area_layout);
-
- main_window.setCentralWidget(&centeral_area);
-
- QWidget top_bar;
- QHBoxLayout top_bar_layout;
- top_bar.setLayout(&top_bar_layout);
- central_area_layout.addWidget(&top_bar);
+ QHBoxLayout top_bar;
+ window_layout.addLayout(&top_bar);
QPushButton import_button(QStringLiteral("导入"));
QPushButton export_button(QStringLiteral("导出"));
- top_bar_layout.addWidget(&import_button);
- top_bar_layout.addWidget(&export_button);
+ top_bar.addWidget(&import_button);
+ top_bar.addWidget(&export_button);
+ top_bar.addStretch(1);
+
+ QHBoxLayout center_area;
+ window_layout.addLayout(&center_area);
+
+ QTableView book_view;
+ QTableView vendor_view;
+
+ center_area.addWidget(&book_view);
+ center_area.addWidget(&vendor_view);
- main_window.show();
+ window.show();
return application.exec();
}