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.
|
|
|
|
#ifndef CUIPROPERTYWIDGET_H
|
|
|
|
|
#define CUIPROPERTYWIDGET_H
|
|
|
|
|
|
|
|
|
|
#include<QtGlobal>
|
|
|
|
|
#include<QSet>
|
|
|
|
|
#include<QWidget>
|
|
|
|
|
#include "CUIPropertyAPI.h"
|
|
|
|
|
class CUIConfig;
|
|
|
|
|
class QWidget;
|
|
|
|
|
class CUIComponentBaseWidget;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @brief The CUI class 管理类,通过处理config来创建相应的组件并提供服务
|
|
|
|
|
*/
|
|
|
|
|
class CUIPropertyAPI CUIPropertyWidget: public QWidget
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
CUIPropertyWidget(QWidget* parent = nullptr, CUIConfig* conf = nullptr);
|
|
|
|
|
void buildUI();
|
|
|
|
|
void check();
|
|
|
|
|
QWidget* getUI();
|
|
|
|
|
QString getProperty(QString s);
|
|
|
|
|
|
|
|
|
|
void autoArrangeWidgets();
|
|
|
|
|
private:
|
|
|
|
|
CUIConfig* conf;
|
|
|
|
|
// 根据配置生成的视图
|
|
|
|
|
CUIComponentBaseWidget* m_mainWidget = nullptr;
|
|
|
|
|
// 子组件配置
|
|
|
|
|
QVector<CUIPropertyWidget*> subCUI;
|
|
|
|
|
// 具有label标签的类型,需要处理长度统一
|
|
|
|
|
const QSet<QString> haveLabelType = {"LineEdit", "ComboBox"};
|
|
|
|
|
qint32 getMaxLabelWidth();
|
|
|
|
|
void setLabelWidth(qint32 width);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // CUIPROPERTYWIDGET_H
|