Reimplementation Minimize button
Hi Folks,
I try to reimplement the minimize button by doing this in the slot connected to the button
Code:
void MainWindow::slotMinimizeWindow()
{
this->setWindowState(Qt::WindowMinimized);
}
This works pretty well when the window was not full screen.
If the window was full screen (Qt::WindowFullScreen), clicking the task bar restores the window in non full screen state (Qt::WindowNoState). In this case, when minimizing, the window seems to go into an intermediary state corresponding to the previous non full screen state of the window...
Any advice would be appreciated
Re: Reimplementation Minimize button
Slot connected to what button? There's no exposed signal from the standard window minimise/restore/maximize controls (if they are present). What are you trying to do differently from the long accepted norms of behaviour for these window controls?
Re: Reimplementation Minimize button
Sorry, my question was not very clear.
In fact, I have a frameless window with a QPushButton trying to behave like the minimize button. The clicked() signal of the QPushButton is connected to this slot:
Code:
void MainWindow::slotMinimizeWindow()
{
this->setWindowState(Qt::WindowMinimized);
}
Hope this helps to understand my question.
Thanks
Re: Reimplementation Minimize button
I answer myself,
Playing around WindowState is no the correct way to do the thing. Instead I used:
Code:
void MainWindow::slotMinimizeWindow()
{
this->showMinimized();
}
Still learning...
Re: Reimplementation Minimize button
Since showMininized() is a slot, you can probably connect to it directly and don't need your slotMininizeWindow() anymore.
Cheers,
_
Re: Reimplementation Minimize button