Qt 4.8
Public Functions | Properties | List of all members
QLayoutStyleInfo Class Reference

#include <qgraphicslayout_p.h>

Public Functions

qreal defaultSpacing (Qt::Orientation o) const
 
void invalidate ()
 
bool operator!= (const QLayoutStyleInfo &other)
 
bool operator== (const QLayoutStyleInfo &other)
 
qreal perItemSpacing (QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation) const
 
 QLayoutStyleInfo ()
 
 QLayoutStyleInfo (QStyle *style, QWidget *widget)
 
void setDefaultSpacing (Qt::Orientation o, qreal spacing)
 
QStylestyle () const
 
QWidgetwidget () const
 

Properties

qreal m_defaultSpacing [2]
 
QStylem_style
 
QStyleOption m_styleOption
 
bool m_valid
 
QWidgetm_widget
 

Detailed Description

Definition at line 82 of file qgraphicslayout_p.h.

Constructors and Destructors

◆ QLayoutStyleInfo() [1/2]

QLayoutStyleInfo::QLayoutStyleInfo ( )
inline

Definition at line 85 of file qgraphicslayout_p.h.

85 { invalidate(); }

◆ QLayoutStyleInfo() [2/2]

QLayoutStyleInfo::QLayoutStyleInfo ( QStyle style,
QWidget widget 
)
inline

Definition at line 86 of file qgraphicslayout_p.h.

87  : m_valid(true), m_style(style), m_widget(widget)
88  {
89  Q_ASSERT(style);
90  if (widget) //###
91  m_styleOption.initFrom(widget);
94  }
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=0, const QWidget *widget=0) const =0
Returns the value of the given pixel metric.
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void initFrom(const QWidget *w)
Definition: qstyleoption.h:99
QStyleOption m_styleOption

Functions

◆ defaultSpacing()

qreal QLayoutStyleInfo::defaultSpacing ( Qt::Orientation  o) const
inline

Definition at line 111 of file qgraphicslayout_p.h.

Referenced by AnchorData::refreshSizeHints().

111  {
112  return m_defaultSpacing[o - 1];
113  }

◆ invalidate()

void QLayoutStyleInfo::invalidate ( )
inline

Definition at line 96 of file qgraphicslayout_p.h.

Referenced by QLayoutStyleInfo().

96 { m_valid = false; m_style = 0; m_widget = 0; }

◆ operator!=()

bool QLayoutStyleInfo::operator!= ( const QLayoutStyleInfo other)
inline

Definition at line 103 of file qgraphicslayout_p.h.

104  { return !(*this == other); }

◆ operator==()

bool QLayoutStyleInfo::operator== ( const QLayoutStyleInfo other)
inline

Definition at line 101 of file qgraphicslayout_p.h.

102  { return m_style == other.m_style && m_widget == other.m_widget; }

◆ perItemSpacing()

qreal QLayoutStyleInfo::perItemSpacing ( QSizePolicy::ControlType  control1,
QSizePolicy::ControlType  control2,
Qt::Orientation  orientation 
) const
inline

Definition at line 115 of file qgraphicslayout_p.h.

Referenced by AnchorData::refreshSizeHints().

118  {
119  Q_ASSERT(style());
120  return style()->layoutSpacing(control1, control2, orientation, &m_styleOption, widget());
121  }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
int layoutSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=0, const QWidget *widget=0) const
Returns the spacing that should be used between control1 and control2 in a layout.
Definition: qstyle.cpp:2395
QStyle * style() const
QStyleOption m_styleOption
QWidget * widget() const

◆ setDefaultSpacing()

void QLayoutStyleInfo::setDefaultSpacing ( Qt::Orientation  o,
qreal  spacing 
)
inline

Definition at line 106 of file qgraphicslayout_p.h.

Referenced by QGraphicsAnchorLayoutPrivate::styleInfo().

106  {
107  if (spacing >= 0)
108  m_defaultSpacing[o - 1] = spacing;
109  }

◆ style()

QStyle* QLayoutStyleInfo::style ( ) const
inline

◆ widget()

QWidget* QLayoutStyleInfo::widget ( ) const
inline

Properties

◆ m_defaultSpacing

qreal QLayoutStyleInfo::m_defaultSpacing[2]
private

Definition at line 127 of file qgraphicslayout_p.h.

Referenced by defaultSpacing(), QLayoutStyleInfo(), and setDefaultSpacing().

◆ m_style

QStyle* QLayoutStyleInfo::m_style
private

Definition at line 124 of file qgraphicslayout_p.h.

Referenced by invalidate(), operator==(), and style().

◆ m_styleOption

QStyleOption QLayoutStyleInfo::m_styleOption
private

Definition at line 126 of file qgraphicslayout_p.h.

Referenced by perItemSpacing(), and QLayoutStyleInfo().

◆ m_valid

bool QLayoutStyleInfo::m_valid
private

Definition at line 123 of file qgraphicslayout_p.h.

Referenced by invalidate().

◆ m_widget

QWidget* QLayoutStyleInfo::m_widget
private

Definition at line 125 of file qgraphicslayout_p.h.

Referenced by invalidate(), operator==(), and widget().


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