mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-08-22 03:32:10 +00:00
31 lines
1.0 KiB
C++
31 lines
1.0 KiB
C++
#ifndef IPROGRESSNOTIFIERUI_H
|
|
#define IPROGRESSNOTIFIERUI_H
|
|
|
|
#include "UICommon.h"
|
|
#include <Core/IProgressNotifier.h>
|
|
#include <QDialog>
|
|
|
|
// IProgressNotifier subclass for UI classes (dialogs, etc)
|
|
class IProgressNotifierUI : public QDialog, public IProgressNotifier
|
|
{
|
|
public:
|
|
explicit IProgressNotifierUI(QWidget *pParent = 0)
|
|
: QDialog(pParent)
|
|
{}
|
|
|
|
public slots:
|
|
virtual void UpdateUI(const QString& rkTaskDesc, const QString& rkStepDesc, float ProgressPercent) = 0;
|
|
|
|
private:
|
|
virtual void UpdateProgress(const TString& rkTaskDesc, const TString& rkStepDesc, float ProgressPercent) final
|
|
{
|
|
// Defer the function call to make sure UI updates are done on the main thread
|
|
QMetaObject::invokeMethod(this, "UpdateUI", Qt::AutoConnection,
|
|
Q_ARG(QString, TO_QSTRING(rkTaskDesc)),
|
|
Q_ARG(QString, TO_QSTRING(rkStepDesc)),
|
|
Q_ARG(float, ProgressPercent) );
|
|
}
|
|
};
|
|
|
|
#endif // IPROGRESSNOTIFIERUI_H
|