mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-13 17:43:59 +02:00
* LoadingSpinner requires a parent and should install an event-filter on its parent.
This commit is contained in:
@@ -39,6 +39,7 @@ AnimatedSpinner::AnimatedSpinner( QWidget* parent )
|
|||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
AnimatedSpinner::AnimatedSpinner( const QSize& size, QWidget *parent )
|
AnimatedSpinner::AnimatedSpinner( const QSize& size, QWidget *parent )
|
||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, m_showHide( new QTimeLine )
|
, m_showHide( new QTimeLine )
|
||||||
@@ -275,6 +276,8 @@ LoadingSpinner::LoadingSpinner( QAbstractItemView* parent )
|
|||||||
: AnimatedSpinner( parent )
|
: AnimatedSpinner( parent )
|
||||||
, m_parent( parent )
|
, m_parent( parent )
|
||||||
{
|
{
|
||||||
|
installEventFilter( m_parent );
|
||||||
|
|
||||||
if ( m_parent->model() )
|
if ( m_parent->model() )
|
||||||
{
|
{
|
||||||
connect( m_parent->model(), SIGNAL( loadingStarted() ), SLOT( fadeIn() ), Qt::UniqueConnection );
|
connect( m_parent->model(), SIGNAL( loadingStarted() ), SLOT( fadeIn() ), Qt::UniqueConnection );
|
||||||
|
@@ -52,7 +52,7 @@ public:
|
|||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
|
|
||||||
QPixmap pixmap() const { return m_pixmap; }
|
QPixmap pixmap() const { return m_pixmap; }
|
||||||
|
|
||||||
void setAutoCenter( bool enabled ) { m_autoCenter = enabled; }
|
void setAutoCenter( bool enabled ) { m_autoCenter = enabled; }
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@@ -98,8 +98,8 @@ class DLLEXPORT LoadingSpinner : public AnimatedSpinner
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit LoadingSpinner( QAbstractItemView* parent = 0 ); // widget mode
|
explicit LoadingSpinner( QAbstractItemView* parent ); // widget mode
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void onViewModelChanged();
|
void onViewModelChanged();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user