You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
59 lines
1.2 KiB
C++
59 lines
1.2 KiB
C++
#ifndef CUI_H
|
|
#define CUI_H
|
|
|
|
#include<QtGlobal>
|
|
#include<QSet>
|
|
#include<QWidget>
|
|
#include "CUIPropertyAPI.h"
|
|
class CUIConfig;
|
|
class QWidget;
|
|
class CUIWidget;
|
|
class CUIGroupBox;
|
|
class CUILineEdit;
|
|
class CUITabWidget;
|
|
class QString;
|
|
class CUIComboBox;
|
|
class CUIPushButton;
|
|
class CUICheckBox;
|
|
class CUIRadioButton;
|
|
class CUIButtonBox;
|
|
class CUIRadioComponent;
|
|
|
|
/**
|
|
* @brief The CUI class 管理类,通过处理config来创建相应的组件并提供服务
|
|
*/
|
|
class CUIPropertyAPI CUI: public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
CUI(QWidget* parent = nullptr, CUIConfig* conf = nullptr);
|
|
// CUI(CUIConfig* conf);
|
|
void buildUI();
|
|
void check();
|
|
QWidget* getUI();
|
|
QString getProperty(QString s);
|
|
|
|
void autoArrangeWidgets();
|
|
private:
|
|
CUIConfig* conf;
|
|
|
|
CUILineEdit* uiLineEdit;
|
|
CUIWidget* uiWidget;
|
|
CUIGroupBox* uiGroupBox;
|
|
CUITabWidget* uiTabWidget;
|
|
CUIComboBox* uiComboBox;
|
|
CUIPushButton* uiPushButton;
|
|
CUICheckBox* uiCheckBox;
|
|
CUIRadioButton* uiRadioButton;
|
|
CUIButtonBox* uiButtonBox;
|
|
CUIRadioComponent* uiRadioComponent;
|
|
|
|
QVector<CUI*> subCUI;
|
|
|
|
const QSet<QString> haveLabelType = {"LineEdit", "ComboBox"};
|
|
qint32 getMaxLabelWidth();
|
|
void setLabelWidth(qint32 width);
|
|
};
|
|
|
|
#endif // CUI_H
|