Qt 4.8
Public Types | Public Functions | Public Variables | List of all members
QDockAreaLayoutItem Struct Reference

#include <qdockarealayout_p.h>

Public Types

enum  ItemFlags { NoFlags = 0, GapItem = 1, KeepSize = 2 }
 

Public Functions

bool expansive (Qt::Orientation o) const
 
bool hasFixedSize (Qt::Orientation o) const
 
QSize maximumSize () const
 
QSize minimumSize () const
 
QDockAreaLayoutItemoperator= (const QDockAreaLayoutItem &other)
 
 QDockAreaLayoutItem (QLayoutItem *_widgetItem=0)
 
 QDockAreaLayoutItem (QDockAreaLayoutInfo *_subinfo)
 
 QDockAreaLayoutItem (QPlaceHolderItem *_placeHolderItem)
 
 QDockAreaLayoutItem (const QDockAreaLayoutItem &other)
 
QSize sizeHint () const
 
bool skip () const
 
 ~QDockAreaLayoutItem ()
 

Public Variables

uint flags
 
QPlaceHolderItemplaceHolderItem
 
int pos
 
int size
 
QDockAreaLayoutInfosubinfo
 
QLayoutItemwidgetItem
 

Detailed Description

Definition at line 89 of file qdockarealayout_p.h.

Enumerations

◆ ItemFlags

Enumerator
NoFlags 
GapItem 
KeepSize 

Definition at line 91 of file qdockarealayout_p.h.

Constructors and Destructors

◆ QDockAreaLayoutItem() [1/4]

QDockAreaLayoutItem::QDockAreaLayoutItem ( QLayoutItem _widgetItem = 0)

Definition at line 85 of file qdockarealayout.cpp.

◆ QDockAreaLayoutItem() [2/4]

QDockAreaLayoutItem::QDockAreaLayoutItem ( QDockAreaLayoutInfo _subinfo)

Definition at line 90 of file qdockarealayout.cpp.

◆ QDockAreaLayoutItem() [3/4]

QDockAreaLayoutItem::QDockAreaLayoutItem ( QPlaceHolderItem _placeHolderItem)

Definition at line 95 of file qdockarealayout.cpp.

◆ QDockAreaLayoutItem() [4/4]

QDockAreaLayoutItem::QDockAreaLayoutItem ( const QDockAreaLayoutItem other)

Definition at line 100 of file qdockarealayout.cpp.

101  : widgetItem(other.widgetItem), subinfo(0), placeHolderItem(0), pos(other.pos),
102  size(other.size), flags(other.flags)
103 {
104  if (other.subinfo != 0)
105  subinfo = new QDockAreaLayoutInfo(*other.subinfo);
106  else if (other.placeHolderItem != 0)
108 }
QPlaceHolderItem * placeHolderItem
QDockAreaLayoutInfo * subinfo
QLayoutItem * widgetItem

◆ ~QDockAreaLayoutItem()

QDockAreaLayoutItem::~QDockAreaLayoutItem ( )

Definition at line 110 of file qdockarealayout.cpp.

111 {
112  delete subinfo;
113  delete placeHolderItem;
114 }
QPlaceHolderItem * placeHolderItem
QDockAreaLayoutInfo * subinfo

Functions

◆ expansive()

bool QDockAreaLayoutItem::expansive ( Qt::Orientation  o) const

Definition at line 166 of file qdockarealayout.cpp.

Referenced by QDockAreaLayoutInfo::expansive(), and QDockAreaLayoutInfo::fitItems().

167 {
168  if ((flags & GapItem) || placeHolderItem != 0)
169  return false;
170  if (widgetItem != 0)
171  return ((widgetItem->expandingDirections() & o) == o);
172  if (subinfo != 0)
173  return subinfo->expansive(o);
174  return false;
175 }
bool expansive(Qt::Orientation o) const
virtual Qt::Orientations expandingDirections() const =0
Returns whether this layout item can make use of more space than sizeHint().
QPlaceHolderItem * placeHolderItem
QDockAreaLayoutInfo * subinfo
QLayoutItem * widgetItem

◆ hasFixedSize()

bool QDockAreaLayoutItem::hasFixedSize ( Qt::Orientation  o) const

Definition at line 161 of file qdockarealayout.cpp.

Referenced by QDockAreaLayoutInfo::findSeparator(), QDockAreaLayoutInfo::fitItems(), QDockAreaLayoutInfo::paintSeparators(), QDockAreaLayoutInfo::separatorMove(), and QDockAreaLayoutInfo::sizeHint().

162 {
163  return perp(o, minimumSize()) == perp(o, maximumSize());
164 }
QSize maximumSize() const
static int perp(bool vertical, const QSize &size)
QSize minimumSize() const

◆ maximumSize()

QSize QDockAreaLayoutItem::maximumSize ( ) const

Definition at line 149 of file qdockarealayout.cpp.

Referenced by QDockAreaLayoutInfo::fitItems(), hasFixedSize(), QDockAreaLayoutInfo::maximumSize(), realMaxSize(), QDockAreaLayoutInfo::saveState(), QDockAreaLayoutInfo::separatorMove(), and QDockAreaLayoutInfo::sizeHint().

150 {
151  if (widgetItem != 0) {
152  int left, top, right, bottom;
153  widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);
154  return widgetItem->maximumSize()+ QSize(left+right, top+bottom);
155  }
156  if (subinfo != 0)
157  return subinfo->maximumSize();
159 }
#define QWIDGETSIZE_MAX
Defines the maximum size for a QWidget object.
Definition: qwidget.h:1087
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
QSize maximumSize() const
void getContentsMargins(int *left, int *top, int *right, int *bottom) const
Returns the widget&#39;s contents margins for left, top, right, and bottom.
Definition: qwidget.cpp:7509
virtual QSize maximumSize() const =0
Implemented in subclasses to return the maximum size of this item.
QDockAreaLayoutInfo * subinfo
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
QLayoutItem * widgetItem

◆ minimumSize()

QSize QDockAreaLayoutItem::minimumSize ( ) const

Definition at line 137 of file qdockarealayout.cpp.

Referenced by QDockAreaLayoutInfo::fitItems(), hasFixedSize(), QDockAreaLayoutInfo::insertGap(), QDockAreaLayoutInfo::maximumSize(), QDockAreaLayoutInfo::minimumSize(), realMinSize(), QDockAreaLayoutInfo::saveState(), QDockAreaLayoutInfo::separatorMove(), and QDockAreaLayoutInfo::sizeHint().

138 {
139  if (widgetItem != 0) {
140  int left, top, right, bottom;
141  widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);
142  return widgetItem->minimumSize() + QSize(left+right, top+bottom);
143  }
144  if (subinfo != 0)
145  return subinfo->minimumSize();
146  return QSize(0, 0);
147 }
virtual QSize minimumSize() const =0
Implemented in subclasses to return the minimum size of this item.
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void getContentsMargins(int *left, int *top, int *right, int *bottom) const
Returns the widget&#39;s contents margins for left, top, right, and bottom.
Definition: qwidget.cpp:7509
QDockAreaLayoutInfo * subinfo
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
QLayoutItem * widgetItem
QSize minimumSize() const

◆ operator=()

QDockAreaLayoutItem & QDockAreaLayoutItem::operator= ( const QDockAreaLayoutItem other)

Definition at line 192 of file qdockarealayout.cpp.

193 {
194  widgetItem = other.widgetItem;
195  if (other.subinfo == 0)
196  subinfo = 0;
197  else
198  subinfo = new QDockAreaLayoutInfo(*other.subinfo);
199 
200  delete placeHolderItem;
201  if (other.placeHolderItem == 0)
202  placeHolderItem = 0;
203  else
205 
206  pos = other.pos;
207  size = other.size;
208  flags = other.flags;
209 
210  return *this;
211 }
QPlaceHolderItem * placeHolderItem
QDockAreaLayoutInfo * subinfo
QLayoutItem * widgetItem

◆ sizeHint()

QSize QDockAreaLayoutItem::sizeHint ( ) const

Definition at line 177 of file qdockarealayout.cpp.

Referenced by QDockAreaLayoutInfo::fitItems(), and QDockAreaLayoutInfo::sizeHint().

178 {
179  if (placeHolderItem != 0)
180  return QSize(0, 0);
181  if (widgetItem != 0) {
182  int left, top, right, bottom;
183  widgetItem->widget()->getContentsMargins(&left, &top, &right, &bottom);
184  return widgetItem->sizeHint() + QSize(left+right, top+bottom);
185  }
186  if (subinfo != 0)
187  return subinfo->sizeHint();
188  return QSize(-1, -1);
189 }
QPlaceHolderItem * placeHolderItem
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
void getContentsMargins(int *left, int *top, int *right, int *bottom) const
Returns the widget&#39;s contents margins for left, top, right, and bottom.
Definition: qwidget.cpp:7509
virtual QSize sizeHint() const =0
Implemented in subclasses to return the preferred size of this item.
QDockAreaLayoutInfo * subinfo
virtual QWidget * widget()
If this item is a QWidget, it is returned as a QWidget; otherwise 0 is returned.
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
QLayoutItem * widgetItem

◆ skip()

bool QDockAreaLayoutItem::skip ( ) const

Definition at line 116 of file qdockarealayout.cpp.

Referenced by QDockAreaLayout::addDockWidget(), QDockAreaLayoutInfo::apply(), QDockAreaLayoutInfo::findSeparator(), QDockAreaLayoutInfo::fitItems(), QDockAreaLayoutInfo::gapIndex(), QDockAreaLayoutInfo::info(), QDockAreaLayoutInfo::insertGap(), QDockAreaLayoutInfo::itemRect(), QDockAreaLayoutInfo::maximumSize(), QDockAreaLayoutInfo::minimumSize(), QDockAreaLayoutInfo::next(), QDockAreaLayoutInfo::paintSeparators(), QDockAreaLayoutInfo::prev(), realMaxSize(), realMinSize(), QDockAreaLayoutInfo::separatorMove(), QDockAreaLayoutInfo::separatorRect(), QDockAreaLayoutInfo::separatorRegion(), QDockAreaLayoutInfo::sizeHint(), skip(), QDockAreaLayoutInfo::updateSeparatorWidgets(), and QDockAreaLayoutInfo::updateTabBar().

117 {
118  if (placeHolderItem != 0)
119  return true;
120 
121  if (flags & GapItem)
122  return false;
123 
124  if (widgetItem != 0)
125  return widgetItem->isEmpty();
126 
127  if (subinfo != 0) {
128  for (int i = 0; i < subinfo->item_list.count(); ++i) {
129  if (!subinfo->item_list.at(i).skip())
130  return false;
131  }
132  }
133 
134  return true;
135 }
QList< QDockAreaLayoutItem > item_list
virtual bool isEmpty() const =0
Implemented in subclasses to return whether this item is empty, i.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QPlaceHolderItem * placeHolderItem
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QDockAreaLayoutInfo * subinfo
QLayoutItem * widgetItem

Properties

◆ flags

uint QDockAreaLayoutItem::flags

◆ placeHolderItem

QPlaceHolderItem* QDockAreaLayoutItem::placeHolderItem

◆ pos

int QDockAreaLayoutItem::pos

◆ size

int QDockAreaLayoutItem::size

◆ subinfo

QDockAreaLayoutInfo* QDockAreaLayoutItem::subinfo

◆ widgetItem

QLayoutItem* QDockAreaLayoutItem::widgetItem

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