Qt 4.8
Public Functions | Private Functions | List of all members
QDockWidgetItem Class Reference

#include <qdockwidget_p.h>

Inheritance diagram for QDockWidgetItem:
QWidgetItem QLayoutItem

Public Functions

QSize maximumSize () const
 Reimplemented Function More...
 
QSize minimumSize () const
 Reimplemented Function More...
 
 QDockWidgetItem (QDockWidget *dockWidget)
 
QSize sizeHint () const
 Reimplemented Function More...
 
- Public Functions inherited from QWidgetItem
Qt::Orientations expandingDirections () const
 Reimplemented Function More...
 
QRect geometry () const
 Reimplemented Function More...
 
bool hasHeightForWidth () const
 Reimplemented Function More...
 
int heightForWidth (int) const
 Reimplemented Function More...
 
bool isEmpty () const
 Returns true if the widget is hidden; otherwise returns false. More...
 
 QWidgetItem (QWidget *w)
 Creates an item containing the given widget. More...
 
void setGeometry (const QRect &)
 Reimplemented Function More...
 
virtual QWidgetwidget ()
 Returns the widget managed by this item. More...
 
- Public Functions inherited from QLayoutItem
Qt::Alignment alignment () const
 Returns the alignment of this item. More...
 
QSizePolicy::ControlTypes controlTypes () const
 Returns the control type(s) for the layout item. More...
 
virtual void invalidate ()
 Invalidates any cached information in this layout item. More...
 
virtual QLayoutlayout ()
 If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned. More...
 
virtual int minimumHeightForWidth (int) const
 Returns the minimum height this widget needs for the given width, w. More...
 
 QLayoutItem (Qt::Alignment alignment=0)
 Constructs a layout item with an alignment. More...
 
void setAlignment (Qt::Alignment a)
 Sets the alignment of this item to alignment. More...
 
virtual QSpacerItemspacerItem ()
 If this item is a QSpacerItem, it is returned as a QSpacerItem; otherwise 0 is returned. More...
 
virtual ~QLayoutItem ()
 Destroys the QLayoutItem. More...
 

Private Functions

QLayoutItemdockWidgetChildItem () const
 
QDockWidgetLayoutdockWidgetLayout () const
 

Additional Inherited Members

- Protected Variables inherited from QWidgetItem
QWidgetwid
 
- Protected Variables inherited from QLayoutItem
Qt::Alignment align
 

Detailed Description

Definition at line 175 of file qdockwidget_p.h.

Constructors and Destructors

◆ QDockWidgetItem()

QDockWidgetItem::QDockWidgetItem ( QDockWidget dockWidget)

Definition at line 542 of file qdockwidget.cpp.

Referenced by QDockWidgetPrivate::startDrag().

543  : QWidgetItem(dockWidget)
544 {
545 }
QWidgetItem(QWidget *w)
Creates an item containing the given widget.
Definition: qlayoutitem.h:127

Functions

◆ dockWidgetChildItem()

QLayoutItem * QDockWidgetItem::dockWidgetChildItem ( ) const
inlineprivate

Definition at line 188 of file qdockwidget_p.h.

Referenced by maximumSize(), minimumSize(), and sizeHint().

189 {
191  return layout->itemForRole(QDockWidgetLayout::Content);
192  return 0;
193 }
QDockWidgetLayout * dockWidgetLayout() const
virtual QLayout * layout()
If this item is a QLayout, it is returned as a QLayout; otherwise 0 is returned.

◆ dockWidgetLayout()

QDockWidgetLayout * QDockWidgetItem::dockWidgetLayout ( ) const
inlineprivate

Definition at line 195 of file qdockwidget_p.h.

Referenced by maximumSize(), minimumSize(), and sizeHint().

196 {
197  QWidget *w = const_cast<QDockWidgetItem*>(this)->widget();
198  if (w != 0)
199  return qobject_cast<QDockWidgetLayout*>(w->layout());
200  return 0;
201 }
T qobject_cast(QObject *object)
Definition: qobject.h:375
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
virtual QWidget * widget()
Returns the widget managed by this item.
QLayout * layout() const
Returns the layout manager that is installed on this widget, or 0 if no layout manager is installed...
Definition: qwidget.cpp:10073

◆ maximumSize()

QSize QDockWidgetItem::maximumSize ( ) const
virtual

Reimplemented Function

Reimplemented from QWidgetItem.

Definition at line 555 of file qdockwidget.cpp.

556 {
557  if (QLayoutItem *item = dockWidgetChildItem()) {
558  return dockWidgetLayout()->sizeFromContent(item->maximumSize(), false);
559  } else {
561  }
562 }
QSize sizeFromContent(const QSize &content, bool floating) const
#define QWIDGETSIZE_MAX
Defines the maximum size for a QWidget object.
Definition: qwidget.h:1087
QLayoutItem * dockWidgetChildItem() const
QDockWidgetLayout * dockWidgetLayout() const
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ minimumSize()

QSize QDockWidgetItem::minimumSize ( ) const
virtual

Reimplemented Function

Reimplemented from QWidgetItem.

Definition at line 547 of file qdockwidget.cpp.

548 {
549  QSize widgetMin(0, 0);
550  if (QLayoutItem *item = dockWidgetChildItem())
551  widgetMin = item->minimumSize();
552  return dockWidgetLayout()->sizeFromContent(widgetMin, false);
553 }
QSize sizeFromContent(const QSize &content, bool floating) const
QLayoutItem * dockWidgetChildItem() const
QDockWidgetLayout * dockWidgetLayout() const
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ sizeHint()

QSize QDockWidgetItem::sizeHint ( ) const
virtual

Reimplemented Function

Reimplemented from QWidgetItem.

Definition at line 565 of file qdockwidget.cpp.

566 {
567  if (QLayoutItem *item = dockWidgetChildItem()) {
568  return dockWidgetLayout()->sizeFromContent(item->sizeHint(), false);
569  } else {
570  return QWidgetItem::sizeHint();
571  }
572 }
QSize sizeFromContent(const QSize &content, bool floating) const
QSize sizeHint() const
Reimplemented Function
QLayoutItem * dockWidgetChildItem() const
QDockWidgetLayout * dockWidgetLayout() const
The QLayoutItem class provides an abstract item that a QLayout manipulates.
Definition: qlayoutitem.h:64

The documentation for this class was generated from the following files: