diff --git a/ComponentBasic/EntityDocks.h b/ComponentBasic/EntityDocks.h index 52afe5d..fe48816 100644 --- a/ComponentBasic/EntityDocks.h +++ b/ComponentBasic/EntityDocks.h @@ -74,7 +74,6 @@ public: void recoveryFrom(const QJsonObject& obj) override; void saveTo(QJsonObject& obj) const override; - void execute(std::shared_ptr map, std::shared_ptr in, QList>& out) override; void execute(std::shared_ptr map, std::shared_ptr in, QList>& out) override; void execute(std::shared_ptr map, std::shared_ptr in, QList>& out) override; diff --git a/SimsWorld/SimsWorld.vcxproj b/SimsWorld/SimsWorld.vcxproj index 292ea58..d2c69f1 100644 --- a/SimsWorld/SimsWorld.vcxproj +++ b/SimsWorld/SimsWorld.vcxproj @@ -99,6 +99,7 @@ + @@ -107,6 +108,9 @@ + + + diff --git a/SimsWorld/SimsWorld.vcxproj.filters b/SimsWorld/SimsWorld.vcxproj.filters index e293b4c..d64144d 100644 --- a/SimsWorld/SimsWorld.vcxproj.filters +++ b/SimsWorld/SimsWorld.vcxproj.filters @@ -46,5 +46,13 @@ Source Files + + Source Files + + + + + Header Files + \ No newline at end of file diff --git a/SimsWorld/TempletAssemble.cpp b/SimsWorld/TempletAssemble.cpp new file mode 100644 index 0000000..9b38e01 --- /dev/null +++ b/SimsWorld/TempletAssemble.cpp @@ -0,0 +1,48 @@ +#include "TempletAssemble.h" +#include +#include +#include +#include +#include +#include + +TempletAssemble::TempletAssemble() + :QWidget(nullptr), + _templet_present(new QListView(this)), + _templet_model(new QStandardItemModel(this)), + _t_add(new QPushButton(u8"添加模板",this)), + _t_remove(new QPushButton(u8"移除模板", this)), + _templet_name(new QLineEdit(this)), + _component_types(new QComboBox(this)), + _comp_add(new QPushButton(u8"添加组件", this)), + _comp_remove(new QPushButton(u8"移除组件", this)), + _component_present(new QListView(this)), + _component_model(new QStandardItemModel(this)), + _apply(new QPushButton(u8"应用", this)) +{ + auto layout = new QVBoxLayout(this); + auto split = new QSplitter(this); + layout->addWidget(split); + + auto left_widget = new QGroupBox(u8"模板列表", this); + split->addWidget(left_widget); + auto llayout = new QGridLayout(left_widget); + llayout->addWidget(_templet_present, 0, 0, 3, 2); + llayout->addWidget(_t_add, 3, 0); + llayout->addWidget(_t_remove, 3, 1); + + + auto right_widget = new QWidget(this); + split->addWidget(right_widget); + auto rlayout = new QGridLayout(right_widget); + rlayout->addWidget(new QLabel(u8"模板名称", this), 0, 0); + rlayout->addWidget(_templet_name, 0, 1, 1, 4); + rlayout->addWidget(new QLabel(u8"组件类型", this), 1, 0); + rlayout->addWidget(_component_types, 1, 1, 1, 2); + rlayout->addWidget(_comp_add, 1, 3); + rlayout->addWidget(_comp_remove, 1, 4); + rlayout->addWidget(_component_present, 2, 0, 3, 5); + rlayout->addWidget(_apply, 5, 0, 1, 5); + + rlayout->setColumnStretch(1, 1); +} diff --git a/SimsWorld/TempletAssemble.h b/SimsWorld/TempletAssemble.h new file mode 100644 index 0000000..9b4fc29 --- /dev/null +++ b/SimsWorld/TempletAssemble.h @@ -0,0 +1,29 @@ +#pragma once +#include +#include +#include +#include +#include + +class TempletAssemble : public QWidget +{ + Q_OBJECT +private: + QListView *const _templet_present; + QStandardItemModel *const _templet_model; + QPushButton *const _t_add, *const _t_remove; + + QLineEdit *const _templet_name; + QComboBox *const _component_types; + QPushButton *const _comp_add, *const _comp_remove; + QListView *const _component_present; + QStandardItemModel *const _component_model; + QPushButton *const _apply; + +public: + TempletAssemble(); + virtual ~TempletAssemble() = default; + + +}; + diff --git a/SimsWorld/main.cpp b/SimsWorld/main.cpp index 3bb7154..ac4a05a 100644 --- a/SimsWorld/main.cpp +++ b/SimsWorld/main.cpp @@ -1,10 +1,15 @@ #include "sims_world.h" +#include "TempletAssemble.h" #include int main(int argc, char *argv[]) { QApplication a(argc, argv); - SimsWorld w; - w.show(); + //SimsWorld w; + //w.show(); + + TempletAssemble tass; + tass.show(); + return a.exec(); }