c++ - Qt::Tool appear too fast when parent restored -
i have qt application, window several child widgets qt::tool windows.
when minimize window , restore on windows 7 child widgets appear immediately, parent window not because of animation.
is there way prevent behavior , make child windows appear after main window?
why don't hide tool windows while main window restoring? can use piece of code , adapt needs:
void mainwindow::changeevent( qevent* e ) { if ( e->type() == qevent::windowstatechange ) { qwindowstatechangeevent* event = static_cast< qwindowstatechangeevent* >( e ); if ( event->oldstate() & qt::windowminimized ) { qdebug() << "the window has been restored!"; } else if ( (event->oldstate() == qt::windownostate) && (this->windowstate() == qt::windowmaximized) ) { qdebug() << "the window has been maximized!"; } } } for example, can start timer amount of time, , have slot connected child tool windows, making them appear wish.
you can play transparency in child tool windows, , emulate main window effects.
as recall, do:
setstylesheet("background:transparent;"); setattribute(qt::wa_translucentbackground); setwindowflags(qt::framelesswindowhint); hope helped!
Comments
Post a Comment