windowHandle() will return NULL;
Unsolved
General and Desktop
-
In manual ,QWidget::windowHandle() returns a valid instance of a QWindow only after the widget has been shown. It is therefore recommended to delay the initialization of the QWinTaskbarButton instances until QWidget::showEvent().
But how to know the time widget has been shown? I didn't override showEvent._taskbarbutton = new QWinTaskbarButton( this); _taskbarbutton->setWindow(windowHandle());
this code will be wrong,because windowHandle() return NULL;
QtWin::enableBlurBehindWindow(this); _taskbarbutton = new QWinTaskbarButton( this); _taskbarbutton->setWindow(windowHandle());
This code will be ok!
So,How to know what time windowHandle()is valid?
thank for your help.[Edit: Added code tags ~kshegunov]
-
Hi,
Then, why not just re-implement the showEvent method ?