DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dbaseline.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2015 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DBASELINE_H
6#define DBASELINE_H
7
8#include <QWidget>
9#include <QLabel>
10#include <QHBoxLayout>
11
12#include <dtkwidget_global.h>
13#include <dconstants.h>
14
15DWIDGET_BEGIN_NAMESPACE
16
17class LIBDTKWIDGETSHARED_EXPORT DBaseLine : public QLabel
18{
19 Q_OBJECT
20public:
21 explicit DBaseLine(QWidget *parent = 0);
22
23 void setLeftContent(QWidget *content);
24 void setRightContent(QWidget *content);
25
26 QBoxLayout *leftLayout();
27 QBoxLayout *rightLayout();
28
29 void setLeftMargin(int margin);
30 void setRightMargin(int margin);
31 int leftMargin() const;
32 int rightMargin() const;
33
34private:
35 QHBoxLayout *m_mainLayout = NULL;
36 QHBoxLayout *m_leftLayout= NULL;
37 QHBoxLayout *m_rightLayout = NULL;
38
39 int m_leftMargin = 10;
40 int m_rightMargin = HEADER_RIGHT_MARGIN;
41};
42
43DWIDGET_END_NAMESPACE
44
45#endif // DBASELINE_H
可以使用 DBaseLine 类快速创建具有位于左右两侧的两个控件的行控件.
Definition dbaseline.h:18