Версия для печати темы

Нажмите сюда для просмотра этой темы в обычном формате

Форум на CrossPlatform.RU _ Qt GUI _ QDialog и список окон

Автор: neneTc 22.4.2010, 12:22

Каждое диалоговое окно, принадлежащее программе, отображается в списке окон как новое. Как не отображать диалоговое окно в списке окон?

Автор: Andrewshkovskii 22.4.2010, 12:28

На панели задач т.е?поставь ему родителя. вроде так не должно.

Автор: neneTc 22.4.2010, 12:34

подскажите, пожалуйста, каким образом выставить родителя?

Автор: Andrewshkovskii 22.4.2010, 12:36

1. При создании и инициализации объекта класса QDialog

Цитата
QDialog::QDialog ( QWidget * parent = 0, Qt::WindowFlags f = 0 )
Constructs a dialog with parent parent.

A dialog is always a top-level widget, but if it has a parent, its default location is centered on top of the parent. It will also share the parent's taskbar entry.

The widget flags f are passed on to the QWidget constructor. If, for example, you don't want a What's This button in the title bar of the dialog, pass Qt::WindowTitleHint | Qt::WindowSystemMenuHint in f.

2. Установить родителя явно через
Цитата
void QWidget::setParent ( QWidget * parent )
Sets the parent of the widget to parent, and resets the window flags. The widget is moved to position (0, 0) in its new parent.

If the new parent widget is in a different window, the reparented widget and its children are appended to the end of the tab chain of the new parent widget, in the same internal order as before. If one of the moved widgets had keyboard focus, setParent() calls clearFocus() for that widget.

If the new parent widget is in the same window as the old parent, setting the parent doesn't change the tab order or keyboard focus.

If the "new" parent widget is the old parent widget, this function does nothing.
Note: The widget becomes invisible as part of changing its parent, even if it was previously visible. You must call show() to make the widget visible again.
Warning: It is very unlikely that you will ever need this function. If you have a widget that changes its content dynamically, it is far easier to use QStackedWidget.


Форум Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)