First of all, you should call hide() or show() on your mainwindow, not on the application.
Supposing you do that, note that while doing this in main (i.e. outside of the event loop), means that you did not even enter the event loop, thus calling show() will probably not work correctly.
Thus, you should implement this functionality in your mainwindow class. I suggest defining two slots, for instance myHide and myShow.
myShow would then:
show();
QTimer::singleShot (5000,
this,
SLOT(myHide
()));
show();
QTimer::singleShot (5000, this, SLOT(myHide()));
To copy to clipboard, switch view to plain text mode
myHide would do something similar but reversed obviously. Furthermore, you should call either myHide or myShow once by yourself.
Bookmarks