jason23reg

jason23reg

导航

Application Windows and Dialogs (4.6.3)

A widget that is not embedded in a parent widget is called a window.
Usually, windows have a frame and a title bar, although it is also possible to create windows without such decoration using suitable window flags.

 

QMainWindow and the various subclasses of QDialog are the most common window types.

Primary and Secondary Windows
Any QWidget that has no parent will become a window, and will on most platforms be listed in the desktop's task bar. This is usually only wanted for one window in the application, the primary window.
A QWidget that has a parent can become a window by setting the Qt::WA_Window flag. Depending on the window management system such secondary windows are usually stacked on top of their respective parent window, and not have a task bar entry of their own.

Window Geometry
Including the window frame: x(), y(), frameGeometry(), pos(), move().
Excluding the window frame: geometry(), width(), height(), rect(), size().
The distinction only matters for decorated top-level widgets. For all child widgets, the frame geometry is equal to the widget's client geometry.

X11 Peculiarities
On X11, a window does not have a frame until the window manager decorates it. This happens asynchronously at some point in time after calling QWidget::show() and the first paint event the window receives, or it does not happen at all.
Don't be surprised if you find one where QWidget::frameGeometry() returns wrong results though.

posted on 2010-10-08 18:44  jason23reg  阅读(143)  评论(0编辑  收藏  举报