initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include "Cevo/FormBase.h"
|
||||
#include "Cevo/Item.h"
|
||||
|
||||
#include <QVector>
|
||||
|
||||
class QLabel;
|
||||
class QWidget;
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class FormItem;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
// Equivalent of FormItem.pas's TFormItem: builds one label+control pair per
|
||||
// ItemField on the fly, based on each field's DataType.
|
||||
class FormItem : public FormBase {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit FormItem(QWidget *parent = nullptr);
|
||||
~FormItem() override;
|
||||
|
||||
Item *item() const { return m_item; }
|
||||
void setItem(Item *value);
|
||||
|
||||
void updateInterface();
|
||||
|
||||
private slots:
|
||||
void onOkClicked();
|
||||
void onControlChanged();
|
||||
|
||||
private:
|
||||
void initControls();
|
||||
void loadData(Item *item);
|
||||
void saveData(Item *item);
|
||||
|
||||
Ui::FormItem *ui;
|
||||
Item *m_item = nullptr;
|
||||
QVector<QWidget *> m_dataControls;
|
||||
QVector<QLabel *> m_dataLabels;
|
||||
};
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user