diff options
| author | crupest <crupest@outlook.com> | 2020-12-30 15:53:16 +0800 | 
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2020-12-30 15:53:16 +0800 | 
| commit | 1e148e88abe8aca881590f4b9d992a2f03587ed7 (patch) | |
| tree | cab1d2a10aa988f09a4821520975f233b3586579 /works | |
| parent | 27de9449aac97c37850672393af45c9d3eb4813c (diff) | |
| download | crupest-1e148e88abe8aca881590f4b9d992a2f03587ed7.tar.gz crupest-1e148e88abe8aca881590f4b9d992a2f03587ed7.tar.bz2 crupest-1e148e88abe8aca881590f4b9d992a2f03587ed7.zip  | |
import(life): ...
Diffstat (limited to 'works')
| -rw-r--r-- | works/life/cpp-practicum/main.cpp | 35 | 
1 files changed, 21 insertions, 14 deletions
diff --git a/works/life/cpp-practicum/main.cpp b/works/life/cpp-practicum/main.cpp index 9244342..14847cc 100644 --- a/works/life/cpp-practicum/main.cpp +++ b/works/life/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(¢ral_area_layout);
 -
 -  main_window.setCentralWidget(¢eral_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(¢er_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();
  }
  | 
