LibrePCB Developers Documentation
WaitingSpinnerWidget Class Referencefinal

A widget drawing a rotating spinner to indicate an ongoing operation. More...

#include <waitingspinnerwidget.h>

Inherits QWidget.

+ Collaboration diagram for WaitingSpinnerWidget:

Public Member Functions

 WaitingSpinnerWidget (QWidget *parent=nullptr) noexcept
 
 WaitingSpinnerWidget (const WaitingSpinnerWidget &other)=delete
 
 ~WaitingSpinnerWidget () noexcept
 
void setColor (const QColor &color) noexcept
 
WaitingSpinnerWidgetoperator= (const WaitingSpinnerWidget &rhs)=delete
 

Protected Member Functions

void showEvent (QShowEvent *e) noexcept override
 
void hideEvent (QHideEvent *e) noexcept override
 
void paintEvent (QPaintEvent *e) noexcept override
 
bool eventFilter (QObject *watched, QEvent *event) noexcept override
 

Private Member Functions

int calculateSize () const noexcept
 
void updateSize () noexcept
 
void updatePosition () noexcept
 

Private Attributes

QColor mColor
 
int mTotalRotations
 
int mCurrentRotation
 
int mCircleDiameter
 
int mDotDiameter
 
int mMargin
 
QScopedPointer< QTimer > mTimer
 
QPointer< QWidget > mEventFilterObject
 

Detailed Description

A widget drawing a rotating spinner to indicate an ongoing operation.

Usage:

  • Pass the widget where the spinner shall be shown as the parent widget to the constructor. Important: Do NOT change the parent afterwards!
  • Call either show(), hide() or setVisible() to make the spinner visible or not.
  • Do not set a widget size or position manually, this is controlled by the widget itself.

Memory management is done by the Qt parent-child mechanism.

Constructor & Destructor Documentation

◆ WaitingSpinnerWidget() [1/2]

WaitingSpinnerWidget ( QWidget *  parent = nullptr)
explicitnoexcept

◆ WaitingSpinnerWidget() [2/2]

WaitingSpinnerWidget ( const WaitingSpinnerWidget other)
delete

◆ ~WaitingSpinnerWidget()

~WaitingSpinnerWidget ( )
noexcept

Member Function Documentation

◆ setColor()

void setColor ( const QColor &  color)
inlinenoexcept

◆ operator=()

WaitingSpinnerWidget & operator= ( const WaitingSpinnerWidget rhs)
delete

◆ showEvent()

void showEvent ( QShowEvent *  e)
overrideprotectednoexcept

◆ hideEvent()

void hideEvent ( QHideEvent *  e)
overrideprotectednoexcept

◆ paintEvent()

void paintEvent ( QPaintEvent *  e)
overrideprotectednoexcept

◆ eventFilter()

bool eventFilter ( QObject *  watched,
QEvent *  event 
)
overrideprotectednoexcept

◆ calculateSize()

int calculateSize ( ) const
privatenoexcept
+ Here is the caller graph for this function:

◆ updateSize()

void updateSize ( )
privatenoexcept
+ Here is the call graph for this function:

◆ updatePosition()

void updatePosition ( )
privatenoexcept

Member Data Documentation

◆ mColor

QColor mColor
private

◆ mTotalRotations

int mTotalRotations
private

◆ mCurrentRotation

int mCurrentRotation
private

◆ mCircleDiameter

int mCircleDiameter
private

◆ mDotDiameter

int mDotDiameter
private

◆ mMargin

int mMargin
private

◆ mTimer

QScopedPointer<QTimer> mTimer
private

◆ mEventFilterObject

QPointer<QWidget> mEventFilterObject
private

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