[Qt-interest] qApp->alert() and alerting my parent window

Oliver Demetz forenbeitraege at oliverdemetz.de
Tue Aug 25 12:22:18 CEST 2009


Hi!

I am developping an app for MS Windows.

My application opens several windows, each one being opened by another 
one, with clean parent-child relarionships.

Say now my MainWidget opens a ChildWidget

MainWidget::openChildWidget()
{
     ChildWidget * w = new ChildWidget;
     w->setWindowFlags(Qt::Window);
     w->setParent(this);
     w->setAttribute(Qt::WA_ShowModal);
     w->show();
}

Ok. Now for some reason, in my ChildWidget the user shall be referred 
back to the MainWidget, which is its parent. But I do not want to close 
the ChildWidget, I just wanna inform the user like : "Its here, in the 
background."

What I found is the static method

     QApplication::alert(QWidget * widget, int msec = 0)

which looks perfect.
But it can just let the taskbar entry flash, not the window bar.

Calling

     qApp->alert(this->parentWidget())

in the ChildWidget does nothing, because the ChildWidget does not have 
an own task bar entry.

Maybe changing the palette of the parent?

Any help is appreciated,
Thanks in advance,
Olli




More information about the Qt-interest-old mailing list