1 Star 0 Fork 0

tongy boys/material-pri

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
qtmaterialdialog_internal.h 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef QTMATERIALDIALOG_INTERNAL_H
#define QTMATERIALDIALOG_INTERNAL_H
#include <QWidget>
class QStackedLayout;
class QtMaterialDialog;
class QtMaterialDialogWindow;
class QtMaterialDialogProxy : public QWidget
{
Q_OBJECT
Q_PROPERTY(qreal opacity WRITE setOpacity READ opacity)
enum TransparencyMode
{
Transparent,
SemiTransparent,
Opaque,
};
public:
QtMaterialDialogProxy(QtMaterialDialogWindow *source, QStackedLayout *layout, QtMaterialDialog *dialog, QWidget *parent = nullptr);
~QtMaterialDialogProxy() override;
void setOpacity(qreal opacity);
inline qreal opacity() const;
public slots:
void makeOpaque();
void makeTransparent();
public:
QSize sizeHint() const override;
protected:
bool event(QEvent *event) override;
void paintEvent(QPaintEvent *event) override;
private:
Q_DISABLE_COPY(QtMaterialDialogProxy)
QtMaterialDialogWindow *const m_source;
QStackedLayout *const m_layout;
QtMaterialDialog *const m_dialog;
qreal m_opacity;
TransparencyMode m_mode;
};
inline qreal QtMaterialDialogProxy::opacity() const
{
return m_opacity;
}
class QtMaterialDialogWindow : public QWidget
{
Q_OBJECT
Q_PROPERTY(int offset WRITE setOffset READ offset)
public:
explicit QtMaterialDialogWindow(QtMaterialDialog *dialog, QWidget *parent = nullptr);
~QtMaterialDialogWindow() override;
void setOffset(int offset);
int offset() const;
protected:
void paintEvent(QPaintEvent *event) override;
private:
Q_DISABLE_COPY(QtMaterialDialogWindow)
QtMaterialDialog *const m_dialog;
};
#endif // QTMATERIALDIALOG_INTERNAL_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

搜索帮助