Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, March 2002
Stays on top dialog


Message 1 in thread

Hi list, here's a question:

Using Qt 3.0.2.
Why does this dialog doesn't stay on top?

I create a dialog from an already loaded UI file using QWidgetFactory in a
pointer returned by a call to m_pScr->dialog().
I also have a QMainWindow widget which I can get a pointer to by calling
HQApplication::m_pApp->mainWindow().

  WFlags f = WStyle_Customize | WStyle_StaysOnTop;

  int x, y;
  QMainWindow* mw = HQApplication::m_pApp->mainWindow();
  QDialog* dlg = m_pScr->dialog();

  x = mw->width() / 2 - dlg->width() / 2;
  y = mw->height() / 2 - dlg->height() / 2;

  dlg->reparent(NULL, f, QPoint(x, y));

Dialog dlg is put under the maindow widget if I click in the main window
(Windows 2000).

Maxime Asselin
Programmer-Analyst
Research and Development