67 lines
1.0 KiB
C++
Executable File
67 lines
1.0 KiB
C++
Executable File
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "lts_widgets_export.h"
|
|
|
|
#include <QObject>
|
|
#include <QPointer>
|
|
|
|
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<LtsFramelessDialog> m_waitDlg;
|
|
QWidget *m_parentWidget;
|
|
QPointer<QLabel> m_textLabel;
|
|
|
|
signals:
|
|
|
|
|
|
void accepted();
|
|
|
|
private slots:
|
|
void accept();
|
|
};
|
|
|
|
}
|