![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GUI/ProgressDialog.h>
QDialog-based progress reporter that shows one QProgressBar for each progress task. More...
QDialog-based progress reporter that shows one QProgressBar for each progress task.
Classes | |
struct | PerTaskUI |
Public Member Functions | |
ProgressDialog (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::FramelessWindowHint) | |
void | setDisplay (DisplayWidget *disp) |
Provide an optional pointer to the DisplayWidget that shall be updated if a progress task asks for it. | |
void | cancelAllTasks () |
void | hideCancelButton () |
Hide the cancel button and disable the ESC keypress handler. | |
void | showCancelButton () |
Show the cancel button and enable the ESC keypress handler. | |
![]() | |
Task | addTask (int numSteps, const std::string &description) |
Create a new progress report for an operation with the given number of steps. | |
Task | addBusyIndicator (const std::string &description) |
Create a busy indicator for an operation but does not have a predefined number of steps. | |
Protected Member Functions | |
bool | event (QEvent *event) override |
void | onTaskAdded (Task *task) override |
Function is called whenever a new Task has been created. | |
void | onTaskUpdated (const Task *task) override |
Function is called whenever the state of a Task has changed and the reporter should update its UI. | |
bool | onTaskRequestsThreadSafety (const Task *task) override |
Function is called by Task::requestThreadSafety() in order to check whether the parent reporter supports concurrent access. | |
void | onTaskRemoved (const Task *task) override |
Function is called whenever a Task is about to be destroyed and its pointer will become invalid. | |
void | addTaskGUI (const Task *task) |
Add a task GUI element. | |
void | updateTaskGUI (const Task *task) |
Updates existing task GUI elements. | |
void | removeTaskGUI (PerTaskUI ui) |
Deletes task GUI elements. | |
void | updateGUI (bool updateDisplay) |
Protected Attributes | |
Timer | m_timer |
Timer for deciding when to process application events. | |
DisplayWidget * | m_display = nullptr |
std::unordered_map< const Task *, PerTaskUI > | m_perTaskUIs |
std::recursive_mutex | m_perTaskUIMutex |
QPushButton * | m_btnCancel |
QVBoxLayout * | m_mainLayout |
bool | m_updateRecursionGuard = false |
|
overrideprotectedvirtual |
Function is called whenever a new Task has been created.
Implements Progress.
|
overrideprotectedvirtual |
Function is called whenever the state of a Task has changed and the reporter should update its UI.
Implements Progress.
|
overrideprotectedvirtual |
Function is called by Task::requestThreadSafety() in order to check whether the parent reporter supports concurrent access.
Implementations are free to ignore this request and return false
. Otherwise they must ensure that subsequent concurrent calls to any of the onTask...()
callbacks are handled correctly without race conditions. Implementations are free to return to a unsynchronized implementation as soon as all multi-threaded tasks have been removed from the reporter.
Implements Progress.
|
overrideprotectedvirtual |
Function is called whenever a Task is about to be destroyed and its pointer will become invalid.
Implements Progress.