1 Star 0 Fork 0

tongy boys/material-pri

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
qtmaterialbadge.h 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef QTMATERIALBADGE_H
#define QTMATERIALBADGE_H
#include "qtmaterialwidgets.h"
#include "lib/qtmaterialoverlaywidget.h"
#include <QIcon>
class QtMaterialBadgePrivate;
class QTMATERIALWIDGETS_EXPORT QtMaterialBadge : public QtMaterialOverlayWidget
{
Q_OBJECT
Q_PROPERTY(QString text READ text WRITE setText)
Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor)
Q_PROPERTY(QPointF relativePosition READ relativePosition WRITE setRelativePosition)
public:
explicit QtMaterialBadge(QWidget *parent = nullptr);
explicit QtMaterialBadge(const QIcon &icon, QWidget *parent = nullptr);
explicit QtMaterialBadge(const QString &text, QWidget *parent = nullptr);
~QtMaterialBadge() override;
const QString &text() const;
void setText(const QString &text);
const QIcon &icon() const;
void setIcon(const QIcon &icon);
const QPointF &relativePosition() const;
void setRelativePosition(const QPointF &pos);
void setRelativePosition(qreal x, qreal y);
bool useThemeColors() const;
void setUseThemeColors(bool value);
QColor textColor() const;
void setTextColor(const QColor &color);
QColor backgroundColor() const;
void setBackgroundColor(const QColor &color);
protected:
const QScopedPointer<QtMaterialBadgePrivate> d_ptr;
int getDiameter() const;
private:
Q_DISABLE_COPY(QtMaterialBadge)
Q_DECLARE_PRIVATE(QtMaterialBadge)
// QWidget interface
public:
QSize sizeHint() const override;
protected:
void paintEvent(QPaintEvent *event) override;
};
#endif // QTMATERIALBADGE_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/tongynj/material-pri.git
git@gitee.com:tongynj/material-pri.git
tongynj
material-pri
material-pri
master

搜索帮助