mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
refs #911, utility class to easily enable class for load indicator
and used it with CDbLoadOverviewComponent
This commit is contained in:
committed by
Mathew Sutcliffe
parent
cc1fd0e868
commit
24af0f044f
@@ -73,6 +73,10 @@ namespace BlackGui
|
||||
//! Center this load indicator
|
||||
void centerLoadIndicator(const QPoint &middle);
|
||||
|
||||
signals:
|
||||
//! Timed out
|
||||
void timedOut();
|
||||
|
||||
public slots:
|
||||
//! Starts the spin animation.
|
||||
//! \sa stopAnimation isAnimated
|
||||
@@ -116,6 +120,41 @@ namespace BlackGui
|
||||
bool m_displayedWhenStopped = false;
|
||||
QColor m_color = Qt::blue;
|
||||
};
|
||||
|
||||
/**
|
||||
* Enable widgte class for load indicator
|
||||
*/
|
||||
class BLACKGUI_EXPORT CLoadIndicatorEnabled
|
||||
{
|
||||
public:
|
||||
//! Ctor
|
||||
CLoadIndicatorEnabled(QWidget *usingWidget);
|
||||
|
||||
//! Showing load indicator?
|
||||
bool isShowingLoadIndicator() const;
|
||||
|
||||
//! Show load indicator
|
||||
void showLoading(int timeoutMs = -1, bool processEvents = true);
|
||||
|
||||
//! Hide load indicator
|
||||
void hideLoading();
|
||||
|
||||
//! Loading in progress?
|
||||
bool isLoadInProgress() const;
|
||||
|
||||
protected:
|
||||
//! Center load indicator
|
||||
void centerLoadIndicator();
|
||||
|
||||
//! Indicator timed out
|
||||
//! \remark override for usage
|
||||
void virtual indicatorTimedOut();
|
||||
|
||||
QWidget *m_usingWidget = nullptr; //!< widget which uses load indicator
|
||||
CLoadIndicator *m_loadIndicator = nullptr; //!< indicator itself
|
||||
bool m_loadInProgress = false; //!< flag indicating loading
|
||||
int m_indicatorId = -1; //!< last indicator id returned
|
||||
};
|
||||
} // ns
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user