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

The TaskbarButton class represents the Windows taskbar button for a top-level window. More...

Collaboration diagram for Qx::TaskbarButton:
[legend]

Public Types

enum  ProgressState {
  Hidden ,
  Busy ,
  Normal ,
  Stopped ,
  Paused
}
 

Public Slots

void clearOverlayIcon ()
 
void resetProgress ()
 
void setOverlayAccessibleDescription (const QString &description)
 
void setOverlayIcon (const QIcon &icon)
 
void setProgressMaximum (int progressMaximum)
 
void setProgressMinimum (int progressMinimum)
 
void setProgressRange (int progressMinimum, int progressMaximum)
 
void setProgressState (TaskbarButton::ProgressState progressState)
 
void setProgressValue (int progressValue)
 

Signals

void progressMaximumChanged (int progressMaximum)
 
void progressMinimumChanged (int progressMinimum)
 
void progressStateChanged (TaskbarButton::ProgressState progressState)
 
void progressValueChanged (int progressValue)
 

Public Member Functions

 TaskbarButton (QObject *parent=nullptr)
 
 ~TaskbarButton ()
 
QString overlayAccessibleDescription () const
 
QIcon overlayIcon () const
 
int progressMaximum () const
 
int progressMinimum () const
 
ProgressState progressState () const
 
int progressValue () const
 
void setWindow (QWindow *window)
 
QWindowwindow () 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

QString overlayAccessibleDescription
 The description of the overlay for accessibility purposes.
 
QIcon overlayIcon
 The overlay icon of the taskbar button.
 
int progressMaximum
 The maximum value of the progress indicator.
 
int progressMinimum
 The minimum value of the progress indicator.
 
ProgressState progressState
 The display state of the progress indicator.
 
int progressValue
 The current value of the progress indicator.
 
QWindowwindow
 The window whose taskbar button is manipulated.
 
- 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 TaskbarButton instance enables one to manipulate the overlay icon, overlay accessibility description, and progress indicator of the taskbar button that its connected window is associated with.

An overlay icon indicates change in the state of an application, whereas a progress indicator shows how time-consuming tasks are progressing.

The following example code illustrates how to use the TaskbarButton class to adjust the look of the taskbar button:

// Create a taskbar button interface
TaskbarButton* button = new TaskbarButton(widget);
// Connect the window to the widgets window
button->setWindow(widget->windowHandle());
// Change the button's overlay icon
button->setOverlayIcon(QIcon(":/loading.png"));
// Change the button's progress indicator
button->setProgressState(Qx::TaskbarButton::ProgressState::Normal);
progress->setValue(50);
Note
QWidget::windowHandle() returns a valid instance of a QWindow only after the widget has been shown. It is therefore recommended to delay the initialization of the TaskbarButton instances until QWidget::showEvent().
Progress:
A progress indicator is used to give the user an indication of the progress of an operation and to reassure them that the application is still running.
The progress indicator uses the concept of steps. It is set up by specifying the minimum and maximum possible step values, and it will display the percentage of steps that have been completed when you later give it the current step value. The percentage is calculated by dividing the progress (progressValue() - progressMinimum()) divided by progressMaximum() - progressMinimum().
The minimum and maximum number of steps can be specified by calling setProgressMinimum() and setProgressMaximum(). The current number of steps is set with setProgressValue(). The progress indicator can be rewound to the beginning with resetProgress().
If progressMinimum and progressMaximum both are set to 0, the indicator state is automatically changed to Busy if it was previously Normal. This is useful when it is not possible to determine the number of steps. The progress state will be returned to normal when non-zero progress range is set and progress changes.
The different progress states of a taskbar button (at 50% progress)
Progress State Appearance
Hidden
Busy
Normal
Stopped
Paused
Note
The final appearance of the progress indicator varies depending on the active Windows theme.

Member Enumeration Documentation

◆ ProgressState

This enum represents the display state of a task bar button's progress indicator.

Enumerator
Hidden 

The progress indicator is hidden.

Busy 

The progress indicator is stylized to indicate progress is indeterminate.

Normal 

The progress indicator is in a normal state.

Stopped 

The progress indicator is stylized to indicate progress has been stopped.

Paused 

The progress indicator is stylized to indicate progress has been paused.

Constructor & Destructor Documentation

◆ TaskbarButton()

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

Constructs a TaskbarButton with the specified parent.

If parent is an instance of QWindow, it is automatically assigned as the taskbar button's window.

◆ ~TaskbarButton()

Qx::TaskbarButton::~TaskbarButton ( )

Destroys the TaskbarButton.

Member Function Documentation

◆ clearOverlayIcon

void Qx::TaskbarButton::clearOverlayIcon ( )
slot

Clears the taskbar button's icon overlay and its description, if any.

◆ overlayAccessibleDescription()

QString Qx::TaskbarButton::overlayAccessibleDescription ( ) const

Returns the taskbar button's current overlay description.

◆ overlayIcon()

QIcon Qx::TaskbarButton::overlayIcon ( ) const

Returns the taskbar button's current icon overlay.

◆ progressMaximum()

int Qx::TaskbarButton::progressMaximum ( ) const

Returns the maximum value of the taskbar button's progress indicator.

◆ progressMaximumChanged

void Qx::TaskbarButton::progressMaximumChanged ( int progressMaximum)
signal

This signal is emitted whenever the taskbar button's maximum progress value changes.

◆ progressMinimum()

int Qx::TaskbarButton::progressMinimum ( ) const

Returns the minimum value of the taskbar button's progress indicator.

◆ progressMinimumChanged

void Qx::TaskbarButton::progressMinimumChanged ( int progressMinimum)
signal

This signal is emitted whenever the taskbar button's minimum progress value changes.

◆ progressState()

TaskbarButton::ProgressState Qx::TaskbarButton::progressState ( ) const

Returns the display state of the taskbar button's progress indicator.

◆ progressStateChanged

void Qx::TaskbarButton::progressStateChanged ( TaskbarButton::ProgressState progressState)
signal

This signal is emitted whenever the taskbar button's progress display state changes.

◆ progressValue()

int Qx::TaskbarButton::progressValue ( ) const

Returns the current value of the taskbar button's progress indicator.

◆ progressValueChanged

void Qx::TaskbarButton::progressValueChanged ( int progressValue)
signal

This signal is emitted whenever the taskbar button's current progress value changes.

◆ resetProgress

void Qx::TaskbarButton::resetProgress ( )
slot

Resets the current value of the taskbar button's progress indicator to the minimum value.

◆ setOverlayAccessibleDescription

void Qx::TaskbarButton::setOverlayAccessibleDescription ( const QString & description)
slot

Sets the taskbar button's icon overlay description to description.

◆ setOverlayIcon

void Qx::TaskbarButton::setOverlayIcon ( const QIcon & icon)
slot

Sets the taskbar button's icon overlay to icon.

◆ setProgressMaximum

void Qx::TaskbarButton::setProgressMaximum ( int progressMaximum)
slot

Sets the maximum value of the taskbar button's progress indicator.

◆ setProgressMinimum

void Qx::TaskbarButton::setProgressMinimum ( int progressMinimum)
slot

Sets the minimum value of the taskbar button's progress indicator.

◆ setProgressRange

void Qx::TaskbarButton::setProgressRange ( int progressMinimum,
int progressMaximum )
slot

Sets the minimum and maximum value of the taskbar button's progress indicator.

◆ setProgressState

void Qx::TaskbarButton::setProgressState ( TaskbarButton::ProgressState progressState)
slot

Sets the display state of the taskbar button's progress indicator.

◆ setProgressValue

void Qx::TaskbarButton::setProgressValue ( int progressValue)
slot

Sets the current value of the taskbar button's progress indicator.

◆ setWindow()

void Qx::TaskbarButton::setWindow ( QWindow * window)

Sets the taskbar button's associated window.

◆ window()

QWindow * Qx::TaskbarButton::window ( ) const

Returns the window that the taskbar button is currently associated with.

Property Documentation

◆ overlayAccessibleDescription

Qx::TaskbarButton::overlayAccessibleDescription
readwrite
See also
overlayIcon

◆ progressMaximum

Qx::TaskbarButton::progressMaximum
readwrite

The default value is 100.

◆ progressMinimum

Qx::TaskbarButton::progressMinimum
readwrite

The default value is 0.

◆ progressState

Qx::TaskbarButton::progressState
readwrite

The default value is ProgressState::Hidden.

◆ progressValue

Qx::TaskbarButton::progressValue
readwrite

The default value is 0.


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