
Originally Posted by
marcel
Sure

.
It was just an on-the-fly example.
Of course you have to forward the other events.
Regards
Well actually the function returns a bool so I did this:
bool MyInstantMessenger
::event (QEvent *e
) {
if(e
->type
() == QEvent::WindowStateChange) {
//Now check to see if the window is minimised
if (isMinimized())
{
e->accept ();
hide ();
}
else e->ignore ();
return true;
}
e->ignore ();
return false;
}
bool MyInstantMessenger::event (QEvent *e)
{
if(e->type() == QEvent::WindowStateChange)
{
//Now check to see if the window is minimised
if (isMinimized())
{
e->accept ();
hide ();
}
else e->ignore ();
return true;
}
e->ignore ();
return false;
}
To copy to clipboard, switch view to plain text mode
But this messes my application, like the widgets are not drawn and the QCloseEvent is not sent anymore. I also tried setting other combinations like ignoring the message instead of accepting it and returning false instead of true but that didn't either.
Would installEventFilter() work too? I'm looking in to it right now...
Bookmarks