Qx v0.5.7
Qt Extensions Library
Loading...
Searching...
No Matches
Qx::GroupedProgressManager Class Reference

The GroupedProgressManager class produces an overall progress value from a collection of progress groups. More...

Collaboration diagram for Qx::GroupedProgressManager:
[legend]

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)
 
ProgressGroupaddGroup (const QString &name)
 
void addGroup (ProgressGroup *progressGroup)
 
ProgressGroupgroup (const QString &name)
 
quint64 maximum () const
 
void removeGroup (const QString &name)
 
quint64 value () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () 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< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &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 QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () 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
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 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 signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () 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
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

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.

Qx::ProgressGroup* fileGroup = gpm.addGroup("File Copies");
fileGroup->setMaximum(100);
fileGroup->setValue(50); // 50% completion of "File Copies"
fileGroup->setWeight(3);
Qx::ProgressGroup* coolGroup = gpm.addGroup("Cool Stuff");
coolGroup->setMaximum(100);
coolGroup->setValue(0); // 0% completion of "Cool Stuff"
coolGroup->setWeight(7);
quint64 overallProgress = gpm.value(); // overallProgress = 15

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.

See also
ProgressGroup, QProgressBar

Constructor & Destructor Documentation

◆ GroupedProgressManager()

Qx::GroupedProgressManager::GroupedProgressManager ( QObject * parent = nullptr)
explicit

Constructs a GroupedProgressManager with the specified parent.

Member Function Documentation

◆ addGroup() [1/2]

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.

◆ addGroup() [2/2]

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.

◆ group()

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.

◆ groupMaximumChanged

void Qx::GroupedProgressManager::groupMaximumChanged ( Qx::ProgressGroup * group,
quint64 maximum )
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.

See also
ProgressGroup::maximumChanged().

◆ groupValueChanged

void Qx::GroupedProgressManager::groupValueChanged ( Qx::ProgressGroup * group,
quint64 value )
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.

See also
ProgressGroup::valueChanged().

◆ maximum()

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.

◆ progressUpdated

void Qx::GroupedProgressManager::progressUpdated ( quint64 currentValue)
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.

Note
Since this value is recalculated every time a progress group is added to the manager, in manner that may result the value going up and down, it is recommended to not connect this signal to an observer until the manager has been fully initialized for a given use.
See also
valueChanged().

◆ removeGroup()

void Qx::GroupedProgressManager::removeGroup ( const QString & name)

Removes the group named name from the manager, if present.

◆ value()

quint64 Qx::GroupedProgressManager::value ( ) const

Returns the current value of the manager.

◆ valueChanged

void Qx::GroupedProgressManager::valueChanged ( quint64 value)
signal

This signal is emitted whenever the grouped progress manager's current value changes.

Note
Since this value is recalculated every time a progress group is added to the manager, in manner that may result the value going up and down, it is recommended to not connect this signal to an observer until the manager has been fully initialized for a given use.
See also
progressUpdated(), and groupValueChanged().

Property Documentation

◆ maximum

Qx::GroupedProgressManager::maximum
read

This value is always 100.

◆ value

Qx::GroupedProgressManager::value
read

This value will always be between 0 and 100.

The default is 0.


The documentation for this class was generated from the following files: