Fading out a QLabel
-
Hi Luca,
Thanks. I'll have a look at it and maybe implement it as a class with some modifications.
However, looking at your code, you're doing about the same I do and I still do not understand why my code is not working as expected.Thanks
McL -
@McLion Hi, have you tried to remove "DeleteWhenStopped" ?
I never used it and by default start() has "KeepWhenStopped".Just to try...
-
wrote on 5 Aug 2015, 11:42 last edited by
I currently have set fixed transparency in designer by adding a styleSheet
"background-color: rgba(160, 160, 160, 200)"
to the label.
Can I animate the a value of the styleSheet? -
wrote on 7 Aug 2015, 08:27 last edited by
.. bump ..
Nobody any idea .. I'm still trying to get this going. -
wrote on 11 Aug 2015, 14:59 last edited by
I'll bump it a gain ... really nobody any idea what I am doing wrong?
-
wrote on 11 Aug 2015, 17:25 last edited by
The code you show has no error. I made a minimal example with just a button and a label.
void MainWindow::on_pushButton_clicked() { QGraphicsOpacityEffect *effect = new QGraphicsOpacityEffect(); ui->label->setGraphicsEffect(effect); QPropertyAnimation *anim = new QPropertyAnimation(effect,"opacity"); anim->setDuration(1000); anim->setStartValue(1.0); anim->setEndValue(0.0); anim->setEasingCurve(QEasingCurve::OutQuad); connect(anim, &QPropertyAnimation::finished, [=]() { ui->label->setText("gone"); }); anim->start(QAbstractAnimation::DeleteWhenStopped); }
The label fades out as expected. Your crash is bred in another place.
-
wrote on 12 Aug 2015, 10:03 last edited by McLion 8 Dec 2015, 10:52
Thanks for trying to help.
I added a new button and a label and tried with your code, except the connect that I changed to:
connect(anim, SIGNAL(finished()),this, SLOT(FadeLivePauseInfoEnded()));
because the compiler did not accept what you posted.When I click the button Qt crashes exactly as before with this on the console:
(!) [ 691: 17.475] --> Caught signal 11 (at 0x24, invalid address) <--
(!!!) *** WARNING [still objects in 'Window Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
-> ref context 0x20018000...
(!!!) *** WARNING [still objects in 'Layer Region Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Layer Context Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!!!) *** WARNING [still objects in 'Surface Pool'] *** [object.c:241 in fusion_object_pool_destroy()]
(!) FUSION_PROPERTY_CEDE --> Input/output error
(!) Direct/Thread: Canceling 'Fusion Dispatch' (709)!Any idea?
-
wrote on 12 Aug 2015, 11:03 last edited by
just clarify:
Did you add a new button and label to your exisiting project or did you create a new project with just a button and a label.
In first case debug your code and find the position which causes the sigsegv and we can further investigate whats going wrong. In second case list your arch, qt-version, compiler, etc. Maybe there“s a known bug.Once again, the code you showed is correct and is not the cause of the sigsegv.
-
wrote on 12 Aug 2015, 11:26 last edited by McLion 8 Dec 2015, 11:26
OK.
Just created a brand new project with only a button and a label, compiled for Windows only, and it works as supposed.
In my current working project I am developing on Windows for eLinux. If I run the code on my Windows devPC it does not crash, but also does not fade the label either. On my eLinux Target, the same code shows the widgets and crashes when I hit the button. -
wrote on 12 Aug 2015, 12:02 last edited by
Further debugging shows that it works in my project on Windows but not when I compile for eLinux.
Must be something that does not work with Qt 4.6.3 with DFB 1.4.3 and Fusion on eLinux.
13/13