Qx v0.5.8
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 |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (QAnyStringView name, Qt::FindChildOptions options) const const |
T | findChild (Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (QAnyStringView name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
bool | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_CONTEXTLESS_CONNECT QT_NO_CONTEXTLESS_CONNECT | |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Properties | |
quint64 | maximum |
The maximum value of the grouped progress manager. | |
quint64 | value |
The current value of the grouped progress manager. | |
Properties inherited from QObject | |
objectName | |
Additional Inherited Members | |
Static Public Member Functions inherited from QObject | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
Public Attributes inherited from QObject | |
typedef | QObjectList |
Protected Member Functions inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
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
.