Qt 4.8
Public Functions | Public Variables | List of all members
QGridLayoutBox Class Reference

#include <qgridlayoutengine_p.h>

Public Functions

void add (const QGridLayoutBox &other, int stretch, qreal spacing)
 
void combine (const QGridLayoutBox &other)
 
void dump (int indent=0) const
 
void normalize ()
 
qrealq_sizes (int which)
 
const qrealq_sizes (int which) const
 
 QGridLayoutBox ()
 

Public Variables

qreal q_maximumSize
 
qreal q_minimumAscent
 
qreal q_minimumDescent
 
qreal q_minimumSize
 
qreal q_preferredSize
 

Detailed Description

Definition at line 139 of file qgridlayoutengine_p.h.

Constructors and Destructors

◆ QGridLayoutBox()

QGridLayoutBox::QGridLayoutBox ( )
inline

Functions

◆ add()

void QGridLayoutBox::add ( const QGridLayoutBox other,
int  stretch,
qreal  spacing 
)

Definition at line 102 of file qgridlayoutengine.cpp.

Referenced by QGridLayoutRowData::totalBox().

103 {
104  Q_ASSERT(q_minimumDescent < 0.0);
105 
106  q_minimumSize += other.q_minimumSize + spacing;
107  q_preferredSize += other.q_preferredSize + spacing;
108  q_maximumSize += ((stretch == 0) ? other.q_preferredSize : other.q_maximumSize) + spacing;
109 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823

◆ combine()

void QGridLayoutBox::combine ( const QGridLayoutBox other)

Definition at line 111 of file qgridlayoutengine.cpp.

Referenced by QGridLayoutEngine::fillRowData().

112 {
115 
118  qreal maxMax;
119  if (q_maximumSize == FLT_MAX && other.q_maximumSize != FLT_MAX)
120  maxMax = other.q_maximumSize;
121  else if (other.q_maximumSize == FLT_MAX && q_maximumSize != FLT_MAX)
122  maxMax = q_maximumSize;
123  else
124  maxMax = qMax(q_maximumSize, other.q_maximumSize);
125 
126  q_maximumSize = qMax(q_minimumSize, maxMax);
128  q_maximumSize);
129 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
Definition: qglobal.h:1219

◆ dump()

void QGridLayoutBox::dump ( int  indent = 0) const

Definition at line 142 of file qgridlayoutengine.cpp.

143 {
144  qDebug("%*sBox (%g <= %g <= %g [%g/%g])", indent, "", q_minimumSize, q_preferredSize,
146 }
Q_CORE_EXPORT void qDebug(const char *,...)

◆ normalize()

void QGridLayoutBox::normalize ( )

Definition at line 131 of file qgridlayoutengine.cpp.

Referenced by QGridLayoutEngine::fillRowData().

132 {
137 
138  Q_ASSERT((q_minimumDescent < 0.0) == (q_minimumAscent < 0.0));
139 }
double qreal
Definition: qglobal.h:1193
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
Definition: qglobal.h:1219

◆ q_sizes() [1/2]

qreal& QGridLayoutBox::q_sizes ( int  which)
inline

Definition at line 160 of file qgridlayoutengine_p.h.

Referenced by compare(), QGridLayoutRowData::distributeMultiCells(), operator==(), and QGridLayoutRowData::stealBox().

161  {
162  qreal *t;
163  switch (which) {
164  case Qt::MinimumSize:
165  t = &q_minimumSize;
166  break;
167  case Qt::PreferredSize:
168  t = &q_preferredSize;
169  break;
170  case Qt::MaximumSize:
171  t = &q_maximumSize;
172  break;
173  case Qt::MinimumDescent:
174  t = &q_minimumDescent;
175  break;
176  case (Qt::MinimumDescent + 1):
177  t = &q_minimumAscent;
178  break;
179  default:
180  t = 0;
181  break;
182  }
183  return *t;
184  }
double qreal
Definition: qglobal.h:1193

◆ q_sizes() [2/2]

const qreal& QGridLayoutBox::q_sizes ( int  which) const
inline

Definition at line 185 of file qgridlayoutengine_p.h.

186  {
187  const qreal *t;
188  switch (which) {
189  case Qt::MinimumSize:
190  t = &q_minimumSize;
191  break;
192  case Qt::PreferredSize:
193  t = &q_preferredSize;
194  break;
195  case Qt::MaximumSize:
196  t = &q_maximumSize;
197  break;
198  case Qt::MinimumDescent:
199  t = &q_minimumDescent;
200  break;
201  case (Qt::MinimumDescent + 1):
202  t = &q_minimumAscent;
203  break;
204  default:
205  t = 0;
206  break;
207  }
208  return *t;
209  }
double qreal
Definition: qglobal.h:1193

Properties

◆ q_maximumSize

qreal QGridLayoutBox::q_maximumSize

◆ q_minimumAscent

qreal QGridLayoutBox::q_minimumAscent

◆ q_minimumDescent

qreal QGridLayoutBox::q_minimumDescent

◆ q_minimumSize

qreal QGridLayoutBox::q_minimumSize

◆ q_preferredSize

qreal QGridLayoutBox::q_preferredSize

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