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.
AppFlow/CFDStruct/CUIProperty/CUIPropertyWidget.h

39 lines
996 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#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