The QWidgetItem class is a layout item that represents a widget. More...
Header: | #include <QWidgetItem> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Widgets) target_link_libraries(mytarget PRIVATE Qt6::Widgets) |
qmake: | QT += widgets |
Inherits: | QLayoutItem |
QWidgetItem(QWidget *widget) | |
virtual | ~QWidgetItem() |
virtual QSizePolicy::ControlTypes | controlTypes() const override |
virtual Qt::Orientations | expandingDirections() const override |
virtual QRect | geometry() const override |
virtual bool | hasHeightForWidth() const override |
virtual int | heightForWidth(int w) const override |
virtual bool | isEmpty() const override |
virtual QSize | maximumSize() const override |
virtual QSize | minimumSize() const override |
virtual void | setGeometry(const QRect &rect) override |
virtual QSize | sizeHint() const override |
virtual QWidget * | widget() const override |
Normally, you don't need to use this class directly. Qt's built-in layout managers provide the following functions for manipulating widgets in layouts:
Class | Functions |
---|---|
QBoxLayout | addWidget(), insertWidget(), setStretchFactor() |
QGridLayout | addWidget() |
QStackedLayout | addWidget(), insertWidget(), currentWidget(), setCurrentWidget(), widget() |
See also QLayout, QSpacerItem, and QLayoutItem::widget().
Creates an item containing the given widget.
[virtual]
QWidgetItem::~QWidgetItem()Destructor.
[override virtual]
QSizePolicy::ControlTypes QWidgetItem::controlTypes()
constReimplements: QLayoutItem::controlTypes() const.
Returns the control type associated with the widget for which this size policy applies.
See also QSizePolicy::controlType().
[override virtual]
Qt::Orientations QWidgetItem::expandingDirections()
constReimplements: QLayoutItem::expandingDirections() const.
[override virtual]
QRect QWidgetItem::geometry() constReimplements: QLayoutItem::geometry() const.
See also setGeometry().
[override virtual]
bool QWidgetItem::hasHeightForWidth() constReimplements: QLayoutItem::hasHeightForWidth() const.
[override virtual]
int QWidgetItem::heightForWidth(int w) constReimplements: QLayoutItem::heightForWidth(int) const.
[override virtual]
bool QWidgetItem::isEmpty() constReimplements: QLayoutItem::isEmpty() const.
Returns true
if the widget is hidden; otherwise returns false
.
See also QWidget::isHidden().
[override virtual]
QSize QWidgetItem::maximumSize() constReimplements: QLayoutItem::maximumSize() const.
[override virtual]
QSize QWidgetItem::minimumSize() constReimplements: QLayoutItem::minimumSize() const.
[override virtual]
void QWidgetItem::setGeometry(const QRect
&rect)Reimplements: QLayoutItem::setGeometry(const QRect &r).
See also geometry().
[override virtual]
QSize QWidgetItem::sizeHint() constReimplements: QLayoutItem::sizeHint() const.
[override virtual]
QWidget *QWidgetItem::widget() constReimplements: QLayoutItem::widget() const.
Returns the widget managed by this item.