I think in lines 6 and 7 you want "windowOpacity", not "windowOpacity()". And it probably should be:
Qt Code:
// orTo copy to clipboard, switch view to plain text mode
since the property name is a QByteArray type. I don't know which version is appropriate; you'll have to check.
Each time you create the new "second" window, that's a memory leak. "second" should be a member variable of MainWindow, and you should create it once in the MainWindow constructor. You haven't given it a size. You should also set its opacity to 0 so that when it is first shown, it is invisible because it is totally transparent. You do not want to hide "parent" in line 15, because that makes it disappear immediately instead of fading out.
As I said in my original post, connect parent's hide() slot to the "animation" finished() signal. This will cause it to actually be hidden when its opacity animation ends (at which point it is totally transparent).
You will find the 5 seconds is much too long for this. 2 - 3 seconds will probably look better and lead to less impatience.
You might also want to disable both widget when you start the dissolve so the user can't click on anything inside them. In the slot connected to the "animation2" finished() signal, you should enable "second".
Bookmarks