Frage

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

War es hilfreich?

Lösung 2

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();
    }
  }
}

Andere Tipps

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top