ImFusion C++ SDK 4.4.0
ImFusion::ProgressDialog Class Reference

#include <ImFusion/GUI/ProgressDialog.h>

QDialog-based progress reporter that shows one QProgressBar for each progress task. More...

Inheritance diagram for ImFusion::ProgressDialog:

Detailed Description

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.
Public Member Functions inherited from ImFusion::Progress
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.
DisplayWidgetm_display = nullptr
std::unordered_map< const Task *, PerTaskUIm_perTaskUIs
std::recursive_mutex m_perTaskUIMutex
QPushButton * m_btnCancel
QVBoxLayout * m_mainLayout
bool m_updateRecursionGuard = false

Member Function Documentation

◆ onTaskAdded()

void ImFusion::ProgressDialog::onTaskAdded ( Task * task)
overrideprotectedvirtual

Function is called whenever a new Task has been created.

Implements ImFusion::Progress.

◆ onTaskUpdated()

void ImFusion::ProgressDialog::onTaskUpdated ( const Task * task)
overrideprotectedvirtual

Function is called whenever the state of a Task has changed and the reporter should update its UI.

Implements ImFusion::Progress.

◆ onTaskRequestsThreadSafety()

bool ImFusion::ProgressDialog::onTaskRequestsThreadSafety ( const Task * task)
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 ImFusion::Progress.

◆ onTaskRemoved()

void ImFusion::ProgressDialog::onTaskRemoved ( const Task * task)
overrideprotectedvirtual

Function is called whenever a Task is about to be destroyed and its pointer will become invalid.

Implements ImFusion::Progress.


The documentation for this class was generated from the following file:
  • ImFusion/GUI/ProgressDialog.h
Search Tab / S to search, Esc to close