1、重构组件库;
parent
e9aca257eb
commit
12c7aa2293
@ -1,17 +0,0 @@
|
||||
#ifndef CUICOMMON_H
|
||||
#define CUICOMMON_H
|
||||
|
||||
class QLayout;
|
||||
class QString;
|
||||
class CUIConfig;
|
||||
|
||||
class CUICommon
|
||||
{
|
||||
public:
|
||||
// CUICommon();
|
||||
|
||||
protected:
|
||||
virtual QLayout* appLayout(CUIConfig* conf);
|
||||
};
|
||||
|
||||
#endif // CUICOMMON_H
|
@ -0,0 +1,26 @@
|
||||
#include "CUIComponentBaseContainerWidget.h"
|
||||
#include "CUIConfig.h"
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
CUIComponentBaseContainerWidget::CUIComponentBaseContainerWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
QLayout *CUIComponentBaseContainerWidget::getLayout(CUIConfig *conf)
|
||||
{
|
||||
if (!conf) {
|
||||
return new QVBoxLayout;
|
||||
}
|
||||
QLayout* layout;
|
||||
QString layoutConf = conf->getPropertyValue("layout");
|
||||
if (layoutConf == "QVBoxLayout") {
|
||||
layout = new QVBoxLayout;
|
||||
} else if (layoutConf == "QVBoxLayout") {
|
||||
layout = new QHBoxLayout;
|
||||
} else {
|
||||
layout = new QHBoxLayout;
|
||||
}
|
||||
return layout;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
#ifndef CUICOMPONENTBASECONTAINERWIDGET_H
|
||||
#define CUICOMPONENTBASECONTAINERWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
class CUIConfig;
|
||||
class QLayout;
|
||||
|
||||
class CUIComponentBaseContainerWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CUIComponentBaseContainerWidget(QWidget *parent = nullptr);
|
||||
protected:
|
||||
virtual QLayout* getLayout(CUIConfig* conf);
|
||||
protected:
|
||||
QLayout* m_layout;
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
#endif // CUICOMPONENTBASECONTAINERWIDGET_H
|
@ -0,0 +1,26 @@
|
||||
#include "CUIComponentBaseWidget.h"
|
||||
#include "CUIConfig.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
CUIComponentBaseWidget::CUIComponentBaseWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
}
|
||||
|
||||
QLayout *CUIComponentBaseWidget::getLayout(CUIConfig *conf)
|
||||
{
|
||||
if (!conf) {
|
||||
return new QVBoxLayout;
|
||||
}
|
||||
QLayout* layout;
|
||||
QString layoutConf = conf->getPropertyValue("layout");
|
||||
if (layoutConf == "QVBoxLayout") {
|
||||
layout = new QVBoxLayout;
|
||||
} else if (layoutConf == "QVBoxLayout") {
|
||||
layout = new QHBoxLayout;
|
||||
} else {
|
||||
layout = new QHBoxLayout;
|
||||
}
|
||||
return layout;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
#ifndef CUICOMPONENTBASEWIDGET_H
|
||||
#define CUICOMPONENTBASEWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
class CUIConfig;
|
||||
|
||||
class CUIComponentBaseWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit CUIComponentBaseWidget(QWidget *parent = nullptr);
|
||||
protected:
|
||||
virtual QLayout* getLayout(CUIConfig* conf);
|
||||
|
||||
protected:
|
||||
|
||||
signals:
|
||||
|
||||
};
|
||||
|
||||
#endif // CUICOMPONENTBASEWIDGET_H
|
Loading…
Reference in New Issue