1
votes

When I do hide() on my window, it hides but with taskbar icon. I want to skip hiding tray icon to let me restore it by clicking on it. Is it possible? I don't want use minimize.

user push button -> window hide but he has icons on taskbar (and maybe on systray) and now he can restore it by clicking on taskbar item (or maybe tray icon). I know how to do this working with trayicon but can't get how to stop from hiding taskbar item and all i find is "How to hide taskbar item?".

thanks

2
why you down wnat to use showMinimized? It works actualy as you described.Ruslan F.
minimized do something wrong with event i added by AddFilterEvents. After i make ->show() none is working. I tried many wayskajojeq

2 Answers

0
votes

ShowMinimised() does exactly what your asking for

however if this doesnt work because of some function you have overridden then provide a code sample please

0
votes

I found solution: Maybe someone will need this someday in problems with restore from minimizing using frameless window

void MainWindow::changeEvent( QEvent* e )
{

  if( e->type() == QEvent::WindowStateChange)
  {
    if(this->windowState() & Qt::WindowMinimized )
    {
       //do something after minimize
    }
    else
    {
        setWindowFlags(Qt::Window); //show normal window
        setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);
     //and again frameless. somethign like refreshing frameless windows after minimize
        this->showNormal();
    }
  }
}