#pragma once #include "lts_widgets_export.h" #include #include class QLabel; class QWidget; namespace LtsWidgets { class LtsFramelessDialog; class LTSWIDGETS_EXPORT LtsProgressDialogHelper : public QObject { Q_OBJECT public: enum class ReplyResult { Close = 0, Success, Failure, TimeOut, }; explicit LtsProgressDialogHelper(QWidget* parent = nullptr); ~LtsProgressDialogHelper(); bool isShown() const { return !!m_waitDlg; } void setCustomText(const QString& customText = QString()); void setParentWidget(QWidget* newParent); public slots: void slotShowWaitForReplyWindow(); void slotStopWaitForReplyWindow(const LtsWidgets::LtsProgressDialogHelper::ReplyResult& replyResult = ReplyResult::Close, const QString& replyString = QString()); private: QPointer m_waitDlg; QWidget* m_parentWidget; QPointer m_textLabel; signals: void accepted(); private slots: void accept(); }; } // namespace LtsWidgets