12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- #ifndef WARNING_H
- #define WARNING_H
- #include <QDialog>
- class OneShadow;
- namespace Ui {
- class Warning;
- }
- class Warning : public QDialog
- {
- Q_OBJECT
- public:
- explicit Warning(QWidget *parent = nullptr);
- ~Warning();
- void setText(const QString& text);
- void setTextWithOneButton(const QString& text); /* 只有一个确定按钮 */
- bool isOk() const { return m_isOk; }
- signals:
- void signal_ok();
- protected:
- void paintEvent(QPaintEvent *event);
- private slots:
- void do_ok();
- private:
- /* 重新设置显示文字的区域大小 */
- void resetLabelSize();
- /* 移动警告图标 */
- void moveWarnICON();
- private:
- Ui::Warning *ui;
- OneShadow* m_shadow = nullptr;
- const int SHADOW_W = 16; /* 阴影的大小 */
- bool m_isOk = false;
- };
- #endif // WARNING_H
|