
Originally Posted by
jacek
QPaintEvent doesn't have any flags field or anything you could use to do that. You could try to subclass QPaintEvent and then use dynamic_cast, but that might not be reliable.
if i declare a class-wide flag named "bDrawAnimatedCaption",
void on_AnimationTimer_timeout()
{
do some animation work here
... ...
bDrawAnimatedCaption = true;
update(currentIndex()); //it will trigger paintEvent to update current index
}
{
if(bDrawAnimatedCaption)
{
paint animated cation here
... ...
bDrawAnimatedCaption = false;
}
else
{
}
}
void on_AnimationTimer_timeout()
{
do some animation work here
... ...
bDrawAnimatedCaption = true;
update(currentIndex()); //it will trigger paintEvent to update current index
}
void paintEvent(QPaintEvent *event)
{
if(bDrawAnimatedCaption)
{
paint animated cation here
... ...
bDrawAnimatedCaption = false;
}
else
{
QListView:: paintEvent(event);
}
}
To copy to clipboard, switch view to plain text mode
Are these reliable ?
or is there another solution?
^_^, it just a test, but I hope it can work like this, because i can control the animation more easyer on MyListView side than delegate side.
thank you.
Bookmarks