1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-09-01 09:53:57 +02:00

let QML initialize before showing it

This commit is contained in:
Michael Zanetti
2012-12-15 17:38:16 +01:00
parent ac576046c9
commit d90a10b51b

View File

@@ -53,7 +53,7 @@
#include <QVBoxLayout>
#include <QMetaMethod>
#include <QApplication>
#define FILTER_TIMEOUT 280
@@ -192,7 +192,7 @@ ViewManager::show( const Tomahawk::dynplaylist_ptr& playlist )
{
if ( !m_dynamicWidgets.contains( playlist ) || m_dynamicWidgets.value( playlist ).isNull() )
{
m_dynamicWidgets[ playlist ] = new Tomahawk::DynamicQmlWidget( playlist, m_stack );
m_dynamicWidgets[ playlist ] = new Tomahawk::DynamicQmlWidget( playlist );
playlist->resolve();
}
@@ -540,7 +540,7 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
emit historyBackAvailable( m_pageHistoryBack.count() );
emit historyForwardAvailable( m_pageHistoryFwd.count() );
qDebug() << "View page shown:" << page->title();
tDebug() << "View page shown:" << page->title();
emit viewPageActivated( page );
if ( page->isTemporaryPage() )
@@ -575,6 +575,8 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
connect( obj, SIGNAL( destroyed( QWidget* ) ), SLOT( onWidgetDestroyed( QWidget* ) ), Qt::UniqueConnection );
}
// Let QML initialize before we call setVisible() on it (happens inside QPageStack)
qApp->processEvents();
m_stack->setCurrentWidget( page->widget() );
updateView();