dde-control-center
Deepin Control Center
载入中...
搜索中...
未找到
horizontalmodule.h
1//SPDX-FileCopyrightText: 2018 - 2023 UnionTech Software Technology Co., Ltd.
2//
3//SPDX-License-Identifier: GPL-3.0-or-later
4#ifndef HORIZONTALMODULE_H
5#define HORIZONTALMODULE_H
6
7#include "interface/moduleobject.h"
8namespace DCC_NAMESPACE {
9class HorizontalModulePrivate;
11{
12 Q_OBJECT
13public:
14 enum StretchType {
15 NoStretch = 0,
16 LeftStretch = 1,
17 RightStretch = 2,
18 AllStretch = LeftStretch | RightStretch,
19 };
20 explicit HorizontalModule(const QString &name, const QString &displayName, QObject *parent = nullptr);
21 ~HorizontalModule() override;
22
23 void setStretchType(StretchType stretchType);
24 void setSpacing(const int spacing);
25
26 void appendChild(ModuleObject *const module) override;
27 void insertChild(QList<ModuleObject *>::iterator before, ModuleObject *const module) override;
28 void insertChild(const int index, ModuleObject *const module) override;
29 void removeChild(ModuleObject *const module) override;
30 void removeChild(const int index) override;
31
32 void appendChild(ModuleObject *const module, int stretch, Qt::Alignment alignment = Qt::Alignment());
33 void insertChild(QList<ModuleObject *>::iterator before, ModuleObject *const module, int stretch, Qt::Alignment alignment = Qt::Alignment());
34 void insertChild(const int index, ModuleObject *const module, int stretch, Qt::Alignment alignment = Qt::Alignment());
35
36 QWidget *page() override;
37 inline DCC_MODULE_TYPE getClassID() const override { return HORIZONTAL; }
38
39 DCC_DECLARE_PRIVATE(HorizontalModule)
40};
41}
42#endif // HORIZONTALMODULE_H
Definition horizontalmodule.h:11
QWidget * page() override
每次被调均需new新的QWidget
ModuleObject作为规范每个Module的接口,每个Module必须提供其基本的信息
Definition moduleobject.h:66