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

#include <qsplitter_p.h>

Public Functions

int getHandleSize (Qt::Orientation orient)
 
int getWidgetSize (Qt::Orientation orient)
 
int pick (const QSize &size, Qt::Orientation orient)
 
 QSplitterLayoutStruct ()
 
 ~QSplitterLayoutStruct ()
 

Public Variables

uint collapsed: 1
 
uint collapsible: 2
 
QSplitterHandlehandle
 
QRect rect
 
int sizer
 
QWidgetwidget
 

Detailed Description

Definition at line 63 of file qsplitter_p.h.

Constructors and Destructors

◆ QSplitterLayoutStruct()

QSplitterLayoutStruct::QSplitterLayoutStruct ( )
inline

Definition at line 73 of file qsplitter_p.h.

73 : sizer(-1), collapsed(false), collapsible(Default), widget(0), handle(0) {}
static const uint Default
Definition: qsplitter_p.h:61
QSplitterHandle * handle
Definition: qsplitter_p.h:71

◆ ~QSplitterLayoutStruct()

QSplitterLayoutStruct::~QSplitterLayoutStruct ( )
inline

Definition at line 74 of file qsplitter_p.h.

74 { delete handle; }
QSplitterHandle * handle
Definition: qsplitter_p.h:71

Functions

◆ getHandleSize()

int QSplitterLayoutStruct::getHandleSize ( Qt::Orientation  orient)

Definition at line 369 of file qsplitter.cpp.

Referenced by QSplitterPrivate::addContribution(), QSplitterPrivate::doMove(), QSplitterPrivate::doResize(), QSplitterPrivate::recalc(), and ~QSplitterLayoutStruct().

370 {
371  return pick(handle->sizeHint(), orient);
372 }
int pick(const QSize &size, Qt::Orientation orient)
Definition: qsplitter_p.h:77
QSize sizeHint() const
Reimplemented Function
Definition: qsplitter.cpp:219
QSplitterHandle * handle
Definition: qsplitter_p.h:71

◆ getWidgetSize()

int QSplitterLayoutStruct::getWidgetSize ( Qt::Orientation  orient)

Definition at line 350 of file qsplitter.cpp.

Referenced by QSplitterPrivate::doResize(), and ~QSplitterLayoutStruct().

351 {
352  if (sizer == -1) {
353  QSize s = widget->sizeHint();
354  const int presizer = pick(s, orient);
355  const int realsize = pick(widget->size(), orient);
356  if (!s.isValid() || (widget->testAttribute(Qt::WA_Resized) && (realsize > presizer))) {
357  sizer = pick(widget->size(), orient);
358  } else {
359  sizer = presizer;
360  }
362  int sf = (orient == Qt::Horizontal) ? p.horizontalStretch() : p.verticalStretch();
363  if (sf > 1)
364  sizer *= sf;
365  }
366  return sizer;
367 }
int pick(const QSize &size, Qt::Orientation orient)
Definition: qsplitter_p.h:77
int horizontalStretch() const
Definition: qsizepolicy.h:144
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
int verticalStretch() const
Definition: qsizepolicy.h:145
QSize size
the size of the widget excluding any window frame
Definition: qwidget.h:165
QSizePolicy sizePolicy
the default layout behavior of the widget
Definition: qwidget.h:171
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QSize sizeHint
the recommended size for the widget
Definition: qwidget.h:195

◆ pick()

int QSplitterLayoutStruct::pick ( const QSize size,
Qt::Orientation  orient 
)
inline

Definition at line 77 of file qsplitter_p.h.

78  { return (orient == Qt::Horizontal) ? size.width() : size.height(); }
int width() const
Returns the width.
Definition: qsize.h:126
int height() const
Returns the height.
Definition: qsize.h:129

Properties

◆ collapsed

uint QSplitterLayoutStruct::collapsed

◆ collapsible

uint QSplitterLayoutStruct::collapsible

Definition at line 69 of file qsplitter_p.h.

Referenced by QSplitterPrivate::collapsible(), and QSplitterPrivate::trans().

◆ handle

QSplitterHandle* QSplitterLayoutStruct::handle

◆ rect

QRect QSplitterLayoutStruct::rect

◆ sizer

int QSplitterLayoutStruct::sizer

◆ widget

QWidget* QSplitterLayoutStruct::widget

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