Pyqt5 Class References: Detailed Description
Pyqt5 Class References: Detailed Description
Class QtWidget
https://het.as.utexas.edu/HET/Software/PyQt/qwidget.html#details
The QWidget class is the base class of all user interface objects.
Inherits QObject and QPaintDevice.
Methods(not all methods)
addAction (self, QAction action)
addActions (self, list-of-QAction actions)
setFocus (self)
setFocus (self, Qt.FocusReason reason)
setMask (self, QBitmap)
setMask (self, QRegion)
setMaximumHeight (self, int maxh)
setMaximumSize (self, int maxw, int maxh)
setMaximumSize (self, QSize s)
setMaximumWidth (self, int maxw)
setMinimumHeight (self, int minh)
setMinimumSize (self, int minw, int minh)
setMinimumSize (self, QSize s)
setMinimumWidth (self, int minw)
Detailed Description
The QWidget class is the base class of all user interface objects.
The widget is the atom of the user interface: it receives mouse, keyboard and other
events from the window system, and paints a representation of itself on the screen.
Every widget is rectangular, and they are sorted in a Z-order. A widget is clipped by
its parent and by the widgets in front of it.
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). In Qt, QMainWindow and the
various subclasses of QDialog are the most common window types.
1. QWidget *parent = 0 is the parent of the new widget. If it is 0 (the default),
the new widget will be a window. If not, it will be a child of parent, and be
constrained by parent's geometry (unless you specify Qt.Window as
window flag).
2. Qt.WindowFlags f = 0 (where available) sets the window flags; the default
is suitable for almost all widgets, but to get, for example, a window without
a window system frame, you must use special flags.
QWidget has many member functions, but some of them have little direct
functionality; for example, QWidget has a font property, but never uses this itself.
There are many subclasses which provide real functionality, such
as QLabel, QPushButton, QListWidget, and QTabWidget.
Non-window widgets are child widgets, displayed within their parent widgets. Most
widgets in Qt are mainly useful as child widgets. For example, it is possible to display
button as a top-level window, but most people prefer to put their buttons inside other