Qt 4.8
Functions
qlayoutitem.cpp File Reference
#include "qlayout.h"
#include "qapplication.h"
#include "qlayoutengine_p.h"
#include "qmenubar.h"
#include "qtoolbar.h"
#include "qevent.h"
#include "qstyle.h"
#include "qvariant.h"
#include "qwidget_p.h"

Go to the source code of this file.

Functions

static QRect fromLayoutItemRect (QWidgetPrivate *priv, const QRect &rect)
 
static QSize fromLayoutItemSize (QWidgetPrivate *priv, const QSize &size)
 
static QRect toLayoutItemRect (QWidgetPrivate *priv, const QRect &rect)
 
static QSize toLayoutItemSize (QWidgetPrivate *priv, const QSize &size)
 

Function Documentation

◆ fromLayoutItemRect()

static QRect fromLayoutItemRect ( QWidgetPrivate priv,
const QRect rect 
)
inlinestatic

Definition at line 55 of file qlayoutitem.cpp.

Referenced by fromLayoutItemSize(), and QWidgetItem::setGeometry().

56 {
57  return rect.adjusted(priv->leftLayoutItemMargin, priv->topLayoutItemMargin,
59 }
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:431
signed char topLayoutItemMargin
Definition: qwidget_p.h:749
signed char bottomLayoutItemMargin
Definition: qwidget_p.h:751
signed char rightLayoutItemMargin
Definition: qwidget_p.h:750
signed char leftLayoutItemMargin
Definition: qwidget_p.h:748

◆ fromLayoutItemSize()

static QSize fromLayoutItemSize ( QWidgetPrivate priv,
const QSize size 
)
inlinestatic

Definition at line 61 of file qlayoutitem.cpp.

Referenced by QWidgetItem::heightForWidth().

62 {
63  return fromLayoutItemRect(priv, QRect(QPoint(0, 0), size)).size();
64 }
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
static QRect fromLayoutItemRect(QWidgetPrivate *priv, const QRect &rect)
Definition: qlayoutitem.cpp:55
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58

◆ toLayoutItemRect()

static QRect toLayoutItemRect ( QWidgetPrivate priv,
const QRect rect 
)
inlinestatic

Definition at line 66 of file qlayoutitem.cpp.

Referenced by QWidgetItem::geometry(), and toLayoutItemSize().

67 {
68  return rect.adjusted(-priv->leftLayoutItemMargin, -priv->topLayoutItemMargin,
70 }
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:431
signed char topLayoutItemMargin
Definition: qwidget_p.h:749
signed char bottomLayoutItemMargin
Definition: qwidget_p.h:751
signed char rightLayoutItemMargin
Definition: qwidget_p.h:750
signed char leftLayoutItemMargin
Definition: qwidget_p.h:748

◆ toLayoutItemSize()

static QSize toLayoutItemSize ( QWidgetPrivate priv,
const QSize size 
)
inlinestatic

Definition at line 72 of file qlayoutitem.cpp.

Referenced by QWidgetItem::heightForWidth(), QWidgetItem::maximumSize(), QWidgetItem::minimumSize(), QWidgetItem::sizeHint(), and QWidgetItemV2::updateCacheIfNecessary().

73 {
74  return toLayoutItemRect(priv, QRect(QPoint(0, 0), size)).size();
75 }
static QRect toLayoutItemRect(QWidgetPrivate *priv, const QRect &rect)
Definition: qlayoutitem.cpp:66
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58