Qx v0.7
Qt Extensions Library
|
The GroupedProgressManager class produces an overall progress value from a collection of progress groups. More...
Signals | |
void | groupMaximumChanged (Qx::ProgressGroup *group, quint64 maximum) |
void | groupValueChanged (Qx::ProgressGroup *group, quint64 value) |
void | progressUpdated (quint64 currentValue) |
void | valueChanged (quint64 value) |
Public Member Functions | |
GroupedProgressManager (QObject *parent=nullptr) | |
ProgressGroup * | addGroup (const QString &name) |
void | addGroup (ProgressGroup *progressGroup) |
ProgressGroup * | group (const QString &name) |
quint64 | maximum () const |
void | removeGroup (const QString &name) |
quint64 | value () const |
Properties | |
quint64 | maximum |
The maximum value of the grouped progress manager. | |
quint64 | value |
The current value of the grouped progress manager. | |
A GroupedProgressManager is used to convert the relative percent completion of an arbitrary number of progress groups into a total completion value in accordance with their weights.
The weighting of each progress group can be used to limit a group's contribution towards overall progress to a certain proportion, regardless of that individual group's number of steps.
The above example shows how even though the progress group "File Copies" is 50% complete, the progress reported by the grouped progress manager is only 15%, because the weighting of both groups dictates that "File Copies" only accounts for 3/(7 + 3) = 0.3
(or 30%) of overall progress.
A grouped progress manager always reports overall progress as a value from 0
to 100
.
|
explicit |
Constructs a GroupedProgressManager with the specified parent.
ProgressGroup * Qx::GroupedProgressManager::addGroup | ( | const QString & | name | ) |
Adds a new progress group with the given name to the manager.
If a group with that name already exists, it will be replaced.
void Qx::GroupedProgressManager::addGroup | ( | ProgressGroup * | progressGroup | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds progress group progressGroup to the manager.
If a group with the same name is already present, it will be replaced.
ProgressGroup * Qx::GroupedProgressManager::group | ( | const QString & | name | ) |
Returns a pointer to the progress group with the given name, or nullptr
if it does not exist within the manager.
|
signal |
This signal is emitted whenever a managed group's maximum value changes. The group parameter will contain a pointer to the group whose maximum changed, while maximum will contain the new maximum.
|
signal |
This signal is emitted whenever a managed group's value changes. The group parameter will contain a pointer to the group whose value changed, while value will contain the new value.
quint64 Qx::GroupedProgressManager::maximum | ( | ) | const |
Returns the maximum value of the manager.
This function will always return 100
, and exists as a convenience method so that user code does not need to remember this.
|
signal |
This signal is emitted whenever the progress of any group handled by the manager changes, even if the change was too small to affect the weighted sum of the manager itself.
currentValue will contain the current value of the manager, which may not differ from the last time this signal was emitted.
This is useful if you need to be notified when progress has changed by any amount whatsoever.
void Qx::GroupedProgressManager::removeGroup | ( | const QString & | name | ) |
Removes the group named name from the manager, if present.
quint64 Qx::GroupedProgressManager::value | ( | ) | const |
Returns the current value of the manager.
|
signal |
This signal is emitted whenever the grouped progress manager's current value changes.
|
read |
This value is always 100.
|
read |
This value will always be between 0
and 100
.
The default is 0
.