Hi everyone,
I have the following code:
{
if (m_currentPage < 0)
{
setCurrentPage(0);
}
}
…
bool DAppNavigation::setCurrentPage(int aPageIndex)
{
...
// Setup animation
...
QTimer::singleShot(50,
this,
SLOT(startAnimation
()));
// Works well on Win and Android //seqGroup->start(); // Doesn’t work on Android
if (m_previousPage != m_currentPage)
emit pageChanged(m_previousPage, m_currentPage);
return true;
}
void DAppNavigation:: startAnimation ()
{
seqGroup->start();
}
void DAppNavigation::showEvent(QShowEvent *event)
{
if (m_currentPage < 0)
{
setCurrentPage(0);
}
}
…
bool DAppNavigation::setCurrentPage(int aPageIndex)
{
...
// Setup animation
...
QTimer::singleShot(50, this, SLOT(startAnimation ())); // Works well on Win and Android
//seqGroup->start(); // Doesn’t work on Android
if (m_previousPage != m_currentPage)
emit pageChanged(m_previousPage, m_currentPage);
return true;
}
void DAppNavigation:: startAnimation ()
{
seqGroup->start();
}
To copy to clipboard, switch view to plain text mode
I have several buttons that I animate (QPropertyAnimation in a QSequentialAnimationGroup).
When I call the animation directly (seqGroup->start()), the first button stays hidden for the first time, because it's not animated on Android.
After that it works fine.
When I start the animation with QTimer::singleShot() it worrk fine on Android and Windows.
What's the matter? Can anybody explain this?
Bookmarks