DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dlabel.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DLABEL_H
6#define DLABEL_H
7
8#include <dobject.h>
9#include <dstyle.h>
10#include <dtkwidget_global.h>
11
12#include <QLabel>
13
14DWIDGET_BEGIN_NAMESPACE
15
16class DLabelPrivate;
17class LIBDTKWIDGETSHARED_EXPORT DLabel : public QLabel, public DTK_CORE_NAMESPACE::DObject
18{
19 Q_OBJECT
20 Q_DISABLE_COPY(DLabel)
21 D_DECLARE_PRIVATE(DLabel)
22public:
23 explicit DLabel(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
24 DLabel(const QString &text, QWidget *parent = nullptr);
25 ~DLabel();
26
27 void setForegroundRole(QPalette::ColorRole role);
28 void setForegroundRole(DPalette::ColorType color);
29 void setElideMode(Qt::TextElideMode elideMode);
30 Qt::TextElideMode elideMode() const;
31
32protected:
33 DLabel(DLabelPrivate &dd, QWidget *parent = nullptr);
34
35 void initPainter(QPainter *painter) const override;
36 void paintEvent(QPaintEvent *event) override;
37};
38
39DWIDGET_END_NAMESPACE
40
41#endif // DLABEL_H
Definition dlabel_p.h:16
DLabel一个重新实现的 QLabel。
Definition dlabel.h:18