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

#include <qsplitter_p.h>

Inheritance diagram for QSplitterPrivate:
QFramePrivate QWidgetPrivate QObjectPrivate QObjectData

Public Functions

void addContribution (int, int *, int *, bool) const
 
int adjustPos (int, int, int *, int *, int *, int *) const
 
bool collapsible (QSplitterLayoutStruct *) const
 
bool collapsible (int index) const
 
void doMove (bool backwards, int pos, int index, int delta, bool mayCollapse, int *positions, int *widths)
 
void doResize ()
 
QSplitterLayoutStructfindWidget (QWidget *) const
 
int findWidgetJustBeforeOrJustAfter (int index, int delta, int &collapsibleSize) const
 
void getRange (int index, int *, int *, int *, int *) const
 
void init ()
 
QSplitterLayoutStructinsertWidget (int index, QWidget *)
 
void insertWidget_helper (int index, QWidget *widget, bool show)
 
int pick (const QPoint &pos) const
 
int pick (const QSize &s) const
 
 QSplitterPrivate ()
 
void recalc (bool update=false)
 
void setGeo (QSplitterLayoutStruct *s, int pos, int size, bool allowCollapse)
 
void setSizes_helper (const QList< int > &sizes, bool clampNegativeSize=false)
 
void storeSizes ()
 
int trans (const QPoint &pos) const
 
int trans (const QSize &s) const
 
void updateHandles ()
 
- Public Functions inherited from QFramePrivate
void init ()
 
 QFramePrivate ()
 
void updateFrameWidth ()
 Updated the frameWidth parameter. More...
 
void updateStyledFrameWidths ()
 Updates the frame widths from the style. More...
 
- Public Functions inherited from QWidgetPrivate
void _q_showIfNotHidden ()
 
virtual void aboutToDestroy ()
 
void activateChildLayoutsRecursively ()
 
QSize adjustedSize () const
 
void adjustQuitOnCloseAttribute ()
 
QInputContextassignedInputContext () const
 
QPainterbeginSharedPainter ()
 
QWidgetchildAt_helper (const QPoint &, bool) const
 
QWidgetchildAtRecursiveHelper (const QPoint &p, bool, bool includeFrame=false) const
 
QRect clipRect () const
 
QRegion clipRegion () const
 
void clipToEffectiveMask (QRegion &region) const
 
bool close_helper (CloseMode mode)
 
void create_sys (WId window, bool initializeWindow, bool destroyOldWindow)
 
QWindowSurfacecreateDefaultWindowSurface ()
 
QWindowSurfacecreateDefaultWindowSurface_sys ()
 
void createExtra ()
 Creates the widget extra data. More...
 
void createRecursively ()
 
void createSysExtra ()
 
void createTLExtra ()
 
void createTLSysExtra ()
 
void createWinId (WId id=0)
 
void deactivateWidgetCleanup ()
 
void deleteExtra ()
 Deletes the widget extra data. More...
 
void deleteSysExtra ()
 
void deleteTLSysExtra ()
 
void drawWidget (QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter=0, QWidgetBackingStore *backingStore=0)
 
QWidgeteffectiveFocusWidget ()
 
QRect effectiveRectFor (const QRect &rect) const
 
bool endSharedPainter ()
 
void enforceNativeChildren ()
 
QWExtraextraData () const
 
QRect frameStrut () const
 
void getLayoutItemMargins (int *left, int *top, int *right, int *bottom) const
 
const QRegiongetOpaqueChildren () const
 
void handleSoftwareInputPanel (Qt::MouseButton button, bool clickCausedFocus)
 
virtual bool hasHeightForWidth () const
 
void hide_helper ()
 
void hide_sys ()
 Platform-specific part of QWidget::hide(). More...
 
void hideChildren (bool spontaneous)
 
void inheritStyle ()
 
void init (QWidget *desktopWidget, Qt::WindowFlags f)
 
QInputContextinputContext () const
 
void invalidateBuffer (const QRegion &)
 Invalidates the rgn (in widget's coordinates) of the backing store, i.e. More...
 
void invalidateBuffer (const QRect &)
 This function is equivalent to calling invalidateBuffer(QRegion(rect), ...), but is more efficient as it eliminates QRegion operations/allocations and can use the rect more precisely for additional cut-offs. More...
 
void invalidateBuffer_resizeHelper (const QPoint &oldPos, const QSize &oldSize)
 Invalidates the buffer when the widget is resized. More...
 
void invalidateGraphicsEffectsRecursively ()
 
bool isAboutToShow () const
 
bool isBackgroundInherited () const
 
bool isOverlapped (const QRect &) const
 
void lower_sys ()
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QWidgetBackingStoremaybeBackingStore () const
 
QTLWExtramaybeTopData () const
 
void moveRect (const QRect &, int dx, int dy)
 
bool nativeChildrenForced () const
 
QFont naturalWidgetFont (uint inheritedMask) const
 
QPalette naturalWidgetPalette (uint inheritedMask) const
 Returns the palette that the widget w inherits from its ancestors and QApplication::palette. More...
 
void paintBackground (QPainter *, const QRegion &, int flags=DrawAsRoot) const
 
bool paintOnScreen () const
 
void paintSiblingsRecursive (QPaintDevice *pdev, const QObjectList &children, int index, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter, QWidgetBackingStore *backingStore)
 
bool pointInsideRectAndMask (const QPoint &) const
 
QRegion prepareToRender (const QRegion &region, QWidget::RenderFlags renderFlags)
 
void propagatePaletteChange ()
 Propagate this widget's palette to all children, except style sheet widgets, and windows that don't enable window propagation (palettes don't normally propagate to windows). More...
 
 QWidgetPrivate (int version=QObjectPrivateVersion)
 
void raise_sys ()
 
QPaintDeviceredirected (QPoint *offset) const
 
void registerDropSite (bool)
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, bool readyToRender)
 
void render_helper (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void repaint_sys (const QRegion &rgn)
 
void reparentFocusWidgets (QWidget *oldtlw)
 
void resolveFont ()
 Determine which font is implicitly imposed on this widget by its ancestors and QApplication::font, resolve this against its own font (attributes from the implicit font are copied over). More...
 
void resolveLayoutDirection ()
 
void resolveLocale ()
 
void resolvePalette ()
 Determine which palette is inherited from this widget's ancestors and QApplication::palette, resolve this against this widget's palette (attributes from the inherited palette are copied over this widget's palette). More...
 
void restoreRedirected ()
 
void scroll_sys (int dx, int dy)
 
void scroll_sys (int dx, int dy, const QRect &r)
 
void scrollChildren (int dx, int dy)
 
void scrollRect (const QRect &, int dx, int dy)
 
void sendPendingMoveAndResizeEvents (bool recursive=false, bool disableUpdates=false)
 
void sendStartupMessage (const char *message) const
 Platform-specific part of QWidget::show(). More...
 
void setConstraints_sys ()
 
void setCursor_sys (const QCursor &cursor)
 
void setDirtyOpaqueRegion ()
 
void setEnabled_helper (bool)
 
void setFocus_sys ()
 
void setFont_helper (const QFont &font)
 
void setGeometry_sys (int, int, int, int, bool)
 
void setLayoutDirection_helper (Qt::LayoutDirection)
 
void setLayoutItemMargins (int left, int top, int right, int bottom)
 
void setLayoutItemMargins (QStyle::SubElement element, const QStyleOption *opt=0)
 
void setLocale_helper (const QLocale &l, bool forceUpdate=false)
 
void setMask_sys (const QRegion &)
 
bool setMaximumSize_helper (int &maxw, int &maxh)
 
bool setMinimumSize_helper (int &minw, int &minh)
 
void setModal_sys ()
 
void setNetWmWindowTypes ()
 
void setOpaque (bool opaque)
 
void setPalette_helper (const QPalette &)
 
void setParent_sys (QWidget *parent, Qt::WindowFlags)
 
void setRedirected (QPaintDevice *replacement, const QPoint &offset)
 
void setSharedPainter (QPainter *painter)
 
void setStyle_helper (QStyle *newStyle, bool propagate, bool metalHack=false)
 
void setUpdatesEnabled_helper (bool)
 
void setWindowFilePath_helper (const QString &filePath)
 
void setWindowIcon_helper ()
 
void setWindowIcon_sys (bool forceReset=false)
 
void setWindowIconText_helper (const QString &cap)
 
void setWindowIconText_sys (const QString &cap)
 
void setWindowOpacity_sys (qreal opacity)
 
void setWindowRole ()
 
void setWindowTitle_helper (const QString &cap)
 
void setWindowTitle_sys (const QString &cap)
 
void setWinId (WId)
 
QPaintersharedPainter () const
 
void show_helper ()
 
void show_recursive ()
 Makes the widget visible in the isVisible() meaning of the word. More...
 
void show_sys ()
 Platform-specific part of QWidget::show(). More...
 
void showChildren (bool spontaneous)
 
void stackUnder_sys (QWidget *)
 
void subtractOpaqueChildren (QRegion &rgn, const QRect &clipRect) const
 
void subtractOpaqueSiblings (QRegion &source, bool *hasDirtySiblingsAbove=0, bool alsoNonOpaque=false) const
 
void syncBackingStore ()
 
void syncBackingStore (const QRegion &region)
 
QTLWExtratopData () const
 
void unsetCursor_sys ()
 
void updateFont (const QFont &)
 Assign font to this widget, and propagate it to all children, except style sheet widgets (handled differently) and windows that don't enable window propagation. More...
 
void updateFrameStrut ()
 Computes the frame rectangle when needed. More...
 
void updateGeometry_helper (bool forceUpdate)
 
void updateIsOpaque ()
 
void updateIsTranslucent ()
 
void updateSystemBackground ()
 
void updateX11AcceptFocus ()
 
void x11UpdateIsOpaque ()
 
 ~QWidgetPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Public Variables

bool blockChildAdd
 
bool childrenCollapsible: 8
 
bool compatMode: 8
 
bool firstShow: 8
 
int handleWidth
 
QList< QSplitterLayoutStruct * > list
 
bool opaque: 8
 
Qt::Orientation orient
 
QPointer< QRubberBandrubberBand
 
- Public Variables inherited from QFramePrivate
short bottomFrameWidth
 
int frameStyle
 
short frameWidth
 
QRect frect
 
short leftFrameWidth
 
short lineWidth
 
short midLineWidth
 
short rightFrameWidth
 
short topFrameWidth
 
- Public Variables inherited from QWidgetPrivate
QString accessibleDescription
 
QString accessibleName
 
QList< QAction * > actions
 
QPalette::ColorRole bg_role: 8
 
signed char bottomLayoutItemMargin
 
short bottommargin
 
QWidgetData data
 
QRegion dirty
 
uint dirtyOpaqueChildren: 1
 
QWExtraextra
 
QPaintEngineextraPaintEngine
 
QPalette::ColorRole fg_role: 8
 
QWidgetfocus_child
 
QWidgetfocus_next
 
QWidgetfocus_prev
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
QGraphicsEffectgraphicsEffect
 
Qt::HANDLE hd
 
uint high_attributes [4]
 
QPointer< QInputContextic
 
Qt::InputMethodHints imHints
 
uint inDirtyList: 1
 
uint inheritedFontResolveMask
 
uint inheritedPaletteResolveMask
 
uint inheritsInputMethodHints: 1
 
uint inSetParent: 1
 
uint isGLWidget: 1
 
uint isMoved: 1
 
uint isOpaque: 1
 
uint isScrolled: 1
 
QLayoutlayout
 
signed char leftLayoutItemMargin
 
short leftmargin
 
QLocale locale
 
QRegionneedsFlush
 
QRegion opaqueChildren
 
Qt::HANDLE picture
 
const QMetaObjectpolished
 
QPaintDeviceredirectDev
 
QPoint redirectOffset
 
signed char rightLayoutItemMargin
 
short rightmargin
 
QSizePolicy size_policy
 
QString statusTip
 
QString toolTip
 
signed char topLayoutItemMargin
 
short topmargin
 
uint usesDoubleBufferedGLContext: 1
 
QString whatsThis
 
QWidgetItemV2widgetItem
 
QX11Info xinfo
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Public Types inherited from QWidgetPrivate
enum  CloseMode { CloseNoEvent, CloseWithEvent, CloseWithSpontaneousEvent }
 
enum  Direction { DirectionNorth = 0x01, DirectionEast = 0x10, DirectionSouth = 0x02, DirectionWest = 0x20 }
 
enum  DrawWidgetFlags {
  DrawAsRoot = 0x01, DrawPaintOnScreen = 0x02, DrawRecursive = 0x04, DrawInvisible = 0x08,
  DontSubtractOpaqueChildren = 0x10, DontSetCompositionMode = 0x20, DontDrawOpaqueChildren = 0x40, DontDrawNativeChildren = 0x80
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 
- Static Public Functions inherited from QWidgetPrivate
static void adjustFlags (Qt::WindowFlags &flags, QWidget *w=0)
 
static QGraphicsProxyWidgetnearestGraphicsProxyWidget (const QWidget *origin)
 Finds the nearest widget embedded in a graphics proxy widget along the chain formed by this widget and its ancestors. More...
 
static int pointToRect (const QPoint &p, const QRect &r)
 
static QRect screenGeometry (const QWidget *widget)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 
- Static Public Variables inherited from QWidgetPrivate
static QWidgetSetallWidgets = 0
 
static int instanceCounter = 0
 
static QWidgetkeyboardGrabber = 0
 
static QWidgetMappermapper = 0
 
static int maxInstances = 0
 
static QWidgetmouseGrabber = 0
 

Detailed Description

Definition at line 81 of file qsplitter_p.h.

Constructors and Destructors

◆ QSplitterPrivate()

QSplitterPrivate::QSplitterPrivate ( )
inline

Definition at line 85 of file qsplitter_p.h.

85  : rubberBand(0), opaque(true), firstShow(true),
86  childrenCollapsible(true), compatMode(false), handleWidth(0), blockChildAdd(false) {}
bool childrenCollapsible
Definition: qsplitter_p.h:93
QPointer< QRubberBand > rubberBand
Definition: qsplitter_p.h:88

Functions

◆ addContribution()

void QSplitterPrivate::addContribution ( int  index,
int *  min,
int *  max,
bool  mayCollapse 
) const

Definition at line 564 of file qsplitter.cpp.

565 {
567  if (!s->widget->isHidden()) {
568  if (!s->handle->isHidden()) {
569  *min += s->getHandleSize(orient);
570  *max += s->getHandleSize(orient);
571  }
572  if (mayCollapse || !s->collapsed)
573  *min += pick(qSmartMinSize(s->widget));
574 
575  *max += pick(s->widget->maximumSize());
576  }
577 }
QSize maximumSize
the widget&#39;s maximum size in pixels
Definition: qwidget.h:173
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
int getHandleSize(Qt::Orientation orient)
Definition: qsplitter.cpp:369
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
Qt::Orientation orient
Definition: qsplitter_p.h:90
QSplitterHandle * handle
Definition: qsplitter_p.h:71
quint16 index
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ adjustPos()

int QSplitterPrivate::adjustPos ( int  pos,
int  index,
int *  farMin,
int *  min,
int *  max,
int *  farMax 
) const

Definition at line 653 of file qsplitter.cpp.

654 {
655  const int Threshold = 40;
656 
657  getRange(index, farMin, min, max, farMax);
658 
659  if (pos >= *min) {
660  if (pos <= *max) {
661  return pos;
662  } else {
663  int delta = pos - *max;
664  int width = *farMax - *max;
665 
666  if (delta > width / 2 && delta >= qMin(Threshold, width)) {
667  return *farMax;
668  } else {
669  return *max;
670  }
671  }
672  } else {
673  int delta = *min - pos;
674  int width = *min - *farMin;
675 
676  if (delta > width / 2 && delta >= qMin(Threshold, width)) {
677  return *farMin;
678  } else {
679  return *min;
680  }
681  }
682 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
quint16 index
void getRange(int index, int *, int *, int *, int *) const
Definition: qsplitter.cpp:600

◆ collapsible() [1/2]

bool QSplitterPrivate::collapsible ( QSplitterLayoutStruct s) const

Definition at line 684 of file qsplitter.cpp.

685 {
686  if (s->collapsible != Default) {
687  return (bool)s->collapsible;
688  } else {
689  return childrenCollapsible;
690  }
691 }
bool childrenCollapsible
Definition: qsplitter_p.h:93
static const uint Default
Definition: qsplitter_p.h:61

◆ collapsible() [2/2]

bool QSplitterPrivate::collapsible ( int  index) const
inline

Definition at line 116 of file qsplitter_p.h.

117  { return (index < 0 || index >= list.size()) ? true : collapsible(list.at(index)); }
bool collapsible(QSplitterLayoutStruct *) const
Definition: qsplitter.cpp:684
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
quint16 index

◆ doMove()

void QSplitterPrivate::doMove ( bool  backwards,
int  pos,
int  index,
int  delta,
bool  mayCollapse,
int *  positions,
int *  widths 
)

Definition at line 770 of file qsplitter.cpp.

772 {
773  if (index < 0 || index >= list.count())
774  return;
775 
776 #ifdef QSPLITTER_DEBUG
777  qDebug() << "QSplitterPrivate::doMove" << backwards << hPos << index << delta << mayCollapse;
778 #endif
779 
781  QWidget *w = s->widget;
782 
783  int nextId = backwards ? index - delta : index + delta;
784 
785  if (w->isHidden()) {
786  doMove(backwards, hPos, nextId, delta, collapsible(nextId), positions, widths);
787  } else {
788  int hs =s->handle->isHidden() ? 0 : s->getHandleSize(orient);
789 
790  int ws = backwards ? hPos - pick(s->rect.topLeft())
791  : pick(s->rect.bottomRight()) - hPos -hs + 1;
792  if (ws > 0 || (!s->collapsed && !mayCollapse)) {
793  ws = qMin(ws, pick(w->maximumSize()));
794  ws = qMax(ws, pick(qSmartMinSize(w)));
795  } else {
796  ws = 0;
797  }
798  positions[index] = backwards ? hPos - ws : hPos + hs;
799  widths[index] = ws;
800  doMove(backwards, backwards ? hPos - ws - hs : hPos + hs + ws, nextId, delta,
801  collapsible(nextId), positions, widths);
802  }
803 
804 }
QSize maximumSize
the widget&#39;s maximum size in pixels
Definition: qwidget.h:173
bool collapsible(QSplitterLayoutStruct *) const
Definition: qsplitter.cpp:684
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
Q_CORE_EXPORT QTextStream & ws(QTextStream &s)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
int getHandleSize(Qt::Orientation orient)
Definition: qsplitter.cpp:369
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
void doMove(bool backwards, int pos, int index, int delta, bool mayCollapse, int *positions, int *widths)
Definition: qsplitter.cpp:770
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
Q_CORE_EXPORT void qDebug(const char *,...)
QPoint bottomRight() const
Returns the position of the rectangle&#39;s bottom-right corner.
Definition: qrect.h:291
static const QCssKnownValue positions[NumKnownPositionModes - 1]
Definition: qcssparser.cpp:329
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
Qt::Orientation orient
Definition: qsplitter_p.h:90
QSplitterHandle * handle
Definition: qsplitter_p.h:71
quint16 index
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ doResize()

void QSplitterPrivate::doResize ( )

Definition at line 473 of file qsplitter.cpp.

474 {
475  Q_Q(QSplitter);
476  QRect r = q->contentsRect();
477  int n = list.count();
479  int i;
480 
481  bool noStretchFactorsSet = true;
482  for (i = 0; i < n; ++i) {
483  QSizePolicy p = list.at(i)->widget->sizePolicy();
484  int sf = orient == Qt::Horizontal ? p.horizontalStretch() : p.verticalStretch();
485  if (sf != 0) {
486  noStretchFactorsSet = false;
487  break;
488  }
489  }
490 
491  int j=0;
492  for (i = 0; i < n; ++i) {
493  QSplitterLayoutStruct *s = list.at(i);
494 #ifdef QSPLITTER_DEBUG
495  qDebug("widget %d hidden: %d collapsed: %d handle hidden: %d", i, s->widget->isHidden(),
496  s->collapsed, s->handle->isHidden());
497 #endif
498 
499  a[j].init();
500  if (s->handle->isHidden()) {
501  a[j].maximumSize = 0;
502  } else {
503  a[j].sizeHint = a[j].minimumSize = a[j].maximumSize = s->getHandleSize(orient);
504  a[j].empty = false;
505  }
506  ++j;
507 
508  a[j].init();
509  if (s->widget->isHidden() || s->collapsed) {
510  a[j].maximumSize = 0;
511  } else {
512  a[j].minimumSize = pick(qSmartMinSize(s->widget));
513  a[j].maximumSize = pick(s->widget->maximumSize());
514  a[j].empty = false;
515 
516  bool stretch = noStretchFactorsSet;
517  if (!stretch) {
518  QSizePolicy p = s->widget->sizePolicy();
519  int sf = orient == Qt::Horizontal ? p.horizontalStretch() : p.verticalStretch();
520  stretch = (sf != 0);
521  }
522  if (stretch) {
523  a[j].stretch = s->getWidgetSize(orient);
524  a[j].sizeHint = a[j].minimumSize;
525  a[j].expansive = true;
526  } else {
527  a[j].sizeHint = qMax(s->getWidgetSize(orient), a[j].minimumSize);
528  }
529  }
530  ++j;
531  }
532 
533  qGeomCalc(a, 0, n*2, pick(r.topLeft()), pick(r.size()), 0);
534 
535 #ifdef QSPLITTER_DEBUG
536  for (i = 0; i < n*2; ++i) {
537  qDebug("%*s%d: stretch %d, sh %d, minS %d, maxS %d, exp %d, emp %d -> %d, %d",
538  i, "", i,
539  a[i].stretch,
540  a[i].sizeHint,
541  a[i].minimumSize,
542  a[i].maximumSize,
543  a[i].expansive,
544  a[i].empty,
545  a[i].pos,
546  a[i].size);
547  }
548 #endif
549 
550  for (i = 0; i < n; ++i) {
551  QSplitterLayoutStruct *s = list.at(i);
552  setGeo(s, a[i*2+1].pos, a[i*2+1].size, false);
553  }
554 }
QSize maximumSize
the widget&#39;s maximum size in pixels
Definition: qwidget.h:173
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
int getWidgetSize(Qt::Orientation orient)
Definition: qsplitter.cpp:350
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
int getHandleSize(Qt::Orientation orient)
Definition: qsplitter.cpp:369
int horizontalStretch() const
Definition: qsizepolicy.h:144
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
Q_CORE_EXPORT void qDebug(const char *,...)
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int verticalStretch() const
Definition: qsizepolicy.h:145
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
void qGeomCalc(QVector< QLayoutStruct > &chain, int start, int count, int pos, int space, int spacer)
Qt::Orientation orient
Definition: qsplitter_p.h:90
QSizePolicy sizePolicy
the default layout behavior of the widget
Definition: qwidget.h:171
QSplitterHandle * handle
Definition: qsplitter_p.h:71
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void setGeo(QSplitterLayoutStruct *s, int pos, int size, bool allowCollapse)
Definition: qsplitter.cpp:727
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ findWidget()

QSplitterLayoutStruct * QSplitterPrivate::findWidget ( QWidget w) const

Definition at line 806 of file qsplitter.cpp.

807 {
808  for (int i = 0; i < list.size(); ++i) {
809  if (list.at(i)->widget == w)
810  return list.at(i);
811  }
812  return 0;
813 }
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
int size() const
Returns the number of items in the list.
Definition: qlist.h:137

◆ findWidgetJustBeforeOrJustAfter()

int QSplitterPrivate::findWidgetJustBeforeOrJustAfter ( int  index,
int  delta,
int &  collapsibleSize 
) const

Definition at line 579 of file qsplitter.cpp.

580 {
581  if (delta < 0)
582  index += delta;
583  do {
584  QWidget *w = list.at(index)->widget;
585  if (!w->isHidden()) {
586  if (collapsible(list.at(index)))
587  collapsibleSize = pick(qSmartMinSize(w));
588  return index;
589  }
590  index += delta;
591  } while (index >= 0 && index < list.count());
592 
593  return -1;
594 }
bool collapsible(QSplitterLayoutStruct *) const
Definition: qsplitter.cpp:684
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
quint16 index
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ getRange()

void QSplitterPrivate::getRange ( int  index,
int *  farMin,
int *  min,
int *  max,
int *  farMax 
) const

Definition at line 600 of file qsplitter.cpp.

601 {
602  Q_Q(const QSplitter);
603  int n = list.count();
604  if (index <= 0 || index >= n)
605  return;
606 
607  int collapsibleSizeBefore = 0;
608  int idJustBefore = findWidgetJustBeforeOrJustAfter(index, -1, collapsibleSizeBefore);
609 
610  int collapsibleSizeAfter = 0;
611  int idJustAfter = findWidgetJustBeforeOrJustAfter(index, +1, collapsibleSizeAfter);
612 
613  int minBefore = 0;
614  int minAfter = 0;
615  int maxBefore = 0;
616  int maxAfter = 0;
617  int i;
618 
619  for (i = 0; i < index; ++i)
620  addContribution(i, &minBefore, &maxBefore, i == idJustBefore);
621  for (i = index; i < n; ++i)
622  addContribution(i, &minAfter, &maxAfter, i == idJustAfter);
623 
624  QRect r = q->contentsRect();
625  int farMinVal;
626  int minVal;
627  int maxVal;
628  int farMaxVal;
629 
630  int smartMinBefore = qMax(minBefore, pick(r.size()) - maxAfter);
631  int smartMaxBefore = qMin(maxBefore, pick(r.size()) - minAfter);
632 
633  minVal = pick(r.topLeft()) + smartMinBefore;
634  maxVal = pick(r.topLeft()) + smartMaxBefore;
635 
636  farMinVal = minVal;
637  if (minBefore - collapsibleSizeBefore >= pick(r.size()) - maxAfter)
638  farMinVal -= collapsibleSizeBefore;
639  farMaxVal = maxVal;
640  if (pick(r.size()) - (minAfter - collapsibleSizeAfter) <= maxBefore)
641  farMaxVal += collapsibleSizeAfter;
642 
643  if (farMin)
644  *farMin = farMinVal;
645  if (min)
646  *min = minVal;
647  if (max)
648  *max = maxVal;
649  if (farMax)
650  *farMax = farMaxVal;
651 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_Q(Class)
Definition: qglobal.h:2483
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
void addContribution(int, int *, int *, bool) const
Definition: qsplitter.cpp:564
int findWidgetJustBeforeOrJustAfter(int index, int delta, int &collapsibleSize) const
Definition: qsplitter.cpp:579
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
QPoint topLeft() const
Returns the position of the rectangle&#39;s top-left corner.
Definition: qrect.h:288
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ init()

void QSplitterPrivate::init ( )

Definition at line 374 of file qsplitter.cpp.

375 {
376  Q_Q(QSplitter);
378  if (orient == Qt::Vertical)
379  sp.transpose();
380  q->setSizePolicy(sp);
381  q->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
382 }
#define Q_Q(Class)
Definition: qglobal.h:2483
Qt::Orientation orient
Definition: qsplitter_p.h:90
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ insertWidget()

QSplitterLayoutStruct * QSplitterPrivate::insertWidget ( int  index,
QWidget w 
)

Definition at line 924 of file qsplitter.cpp.

925 {
926  Q_Q(QSplitter);
927  QSplitterLayoutStruct *sls = 0;
928  int i;
929  int last = list.count();
930  for (i = 0; i < list.size(); ++i) {
931  QSplitterLayoutStruct *s = list.at(i);
932  if (s->widget == w) {
933  sls = s;
934  --last;
935  break;
936  }
937  }
938  if (index < 0 || index > last)
939  index = last;
940 
941  if (sls) {
942  list.move(i,index);
943  } else {
944  QSplitterHandle *newHandle = 0;
945  sls = new QSplitterLayoutStruct;
946  QString tmp = QLatin1String("qt_splithandle_");
947  tmp += w->objectName();
948  newHandle = q->createHandle();
949  newHandle->setObjectName(tmp);
950  sls->handle = newHandle;
951  sls->widget = w;
952  w->lower();
953  list.insert(index,sls);
954 
955  if (newHandle && q->isVisible())
956  newHandle->show(); // will trigger sending of post events
957 
958 #ifdef QT3_SUPPORT
959  if (compatMode) {
960  int sf = getStretch(sls->widget);
961  if (sf == 243)
962  setStretch(sls->widget, 0);
963  else if (sf == 0)
964  setStretch(sls->widget, 1);
965  }
966 #endif
967  }
968  return sls;
969 }
bool isVisible() const
Definition: qwidget.h:1005
void insert(int i, const T &t)
Inserts value at index position i in the list.
Definition: qlist.h:575
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QSplitterHandle class provides handle functionality of the splitter.
Definition: qsplitter.h:158
void setObjectName(const QString &name)
Definition: qobject.cpp:1112
#define Q_Q(Class)
Definition: qglobal.h:2483
void move(int from, int to)
Moves the item at index position from to index position to.
Definition: qlist.h:628
void lower()
Lowers the widget to the bottom of the parent widget&#39;s stack.
Definition: qwidget.cpp:11939
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void show()
Shows the widget and its child widgets.
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
QSplitterHandle * handle
Definition: qsplitter_p.h:71
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QString objectName() const
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ insertWidget_helper()

void QSplitterPrivate::insertWidget_helper ( int  index,
QWidget widget,
bool  show 
)
Warning
This function is not part of the public interface.

Definition at line 904 of file qsplitter.cpp.

905 {
906  Q_Q(QSplitter);
908  bool needShow = show && q->isVisible() &&
909  !(widget->isHidden() && widget->testAttribute(Qt::WA_WState_ExplicitShowHide));
910  if (widget->parentWidget() != q)
911  widget->setParent(q);
912  if (needShow)
913  widget->show();
914  insertWidget(index, widget);
915  recalc(q->isVisible());
916 }
QWidget * parentWidget() const
Returns the parent of this widget, or 0 if it does not have any parent widget.
Definition: qwidget.h:1035
void setParent(QWidget *parent)
Sets the parent of the widget to parent, and resets the window flags.
Definition: qwidget.cpp:10479
QSplitterLayoutStruct * insertWidget(int index, QWidget *)
Definition: qsplitter.cpp:924
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
void recalc(bool update=false)
Definition: qsplitter.cpp:384
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition: qwidget.h:1041
void show()
Shows the widget and its child widgets.
quint16 index
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

◆ pick() [1/2]

int QSplitterPrivate::pick ( const QPoint pos) const
inline

Definition at line 98 of file qsplitter_p.h.

99  { return orient == Qt::Horizontal ? pos.x() : pos.y(); }
Qt::Orientation orient
Definition: qsplitter_p.h:90
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128

◆ pick() [2/2]

int QSplitterPrivate::pick ( const QSize s) const
inline

Definition at line 100 of file qsplitter_p.h.

101  { return orient == Qt::Horizontal ? s.width() : s.height(); }
int width() const
Returns the width.
Definition: qsize.h:126
Qt::Orientation orient
Definition: qsplitter_p.h:90
int height() const
Returns the height.
Definition: qsize.h:129

◆ recalc()

void QSplitterPrivate::recalc ( bool  update = false)

Definition at line 384 of file qsplitter.cpp.

385 {
386  Q_Q(QSplitter);
387  int n = list.count();
388  /*
389  Splitter handles before the first visible widget or right
390  before a hidden widget must be hidden.
391  */
392  bool first = true;
393  bool allInvisible = n != 0;
394  for (int i = 0; i < n ; ++i) {
395  QSplitterLayoutStruct *s = list.at(i);
396  bool widgetHidden = s->widget->isHidden();
397  if (allInvisible && !widgetHidden && !s->collapsed)
398  allInvisible = false;
399  s->handle->setHidden(first || widgetHidden);
400  if (!widgetHidden)
401  first = false;
402  }
403 
404  if (allInvisible)
405  for (int i = 0; i < n ; ++i) {
406  QSplitterLayoutStruct *s = list.at(i);
407  if (!s->widget->isHidden()) {
408  s->collapsed = false;
409  break;
410  }
411  }
412 
413  int fi = 2 * q->frameWidth();
414  int maxl = fi;
415  int minl = fi;
416  int maxt = QWIDGETSIZE_MAX;
417  int mint = fi;
418  /*
419  calculate min/max sizes for the whole splitter
420  */
421  bool empty = true;
422  for (int j = 0; j < n; j++) {
423  QSplitterLayoutStruct *s = list.at(j);
424 
425  if (!s->widget->isHidden()) {
426  empty = false;
427  if (!s->handle->isHidden()) {
428  minl += s->getHandleSize(orient);
429  maxl += s->getHandleSize(orient);
430  }
431 
432  QSize minS = qSmartMinSize(s->widget);
433  minl += pick(minS);
434  maxl += pick(s->widget->maximumSize());
435  mint = qMax(mint, trans(minS));
436  int tm = trans(s->widget->maximumSize());
437  if (tm > 0)
438  maxt = qMin(maxt, tm);
439  }
440  }
441 
442  if (empty) {
443  if (qobject_cast<QSplitter *>(parent)) {
444  // nested splitters; be nice
445  maxl = maxt = 0;
446  } else {
447  // QSplitter with no children yet
448  maxl = QWIDGETSIZE_MAX;
449  }
450  } else {
451  maxl = qMin<int>(maxl, QWIDGETSIZE_MAX);
452  }
453  if (maxt < mint)
454  maxt = mint;
455 
456  if (update) {
457  if (orient == Qt::Horizontal) {
458  q->setMaximumSize(maxl, maxt);
459  if (q->isWindow())
460  q->setMinimumSize(minl,mint);
461  } else {
462  q->setMaximumSize(maxt, maxl);
463  if (q->isWindow())
464  q->setMinimumSize(mint,minl);
465  }
466  doResize();
467  q->updateGeometry();
468  } else {
469  firstShow = true;
470  }
471 }
QSize maximumSize
the widget&#39;s maximum size in pixels
Definition: qwidget.h:173
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
#define QWIDGETSIZE_MAX
Defines the maximum size for a QWidget object.
Definition: qwidget.h:1087
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
int getHandleSize(Qt::Orientation orient)
Definition: qsplitter.cpp:369
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void setHidden(bool hidden)
Convenience function, equivalent to setVisible(!hidden).
Definition: qwidget.h:495
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
Qt::Orientation orient
Definition: qsplitter_p.h:90
QSplitterHandle * handle
Definition: qsplitter_p.h:71
QObject * parent
Definition: qobject.h:92
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
int trans(const QPoint &pos) const
Definition: qsplitter_p.h:103
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ setGeo()

void QSplitterPrivate::setGeo ( QSplitterLayoutStruct s,
int  pos,
int  size,
bool  allowCollapse 
)

Definition at line 727 of file qsplitter.cpp.

728 {
729  Q_Q(QSplitter);
730  QWidget *w = sls->widget;
731  QRect r;
732  QRect contents = q->contentsRect();
733  if (orient == Qt::Horizontal) {
734  r.setRect(p, contents.y(), s, contents.height());
735  } else {
736  r.setRect(contents.x(), p, contents.width(), s);
737  }
738  sls->rect = r;
739 
740  int minSize = pick(qSmartMinSize(w));
741 
742  if (orient == Qt::Horizontal && q->isRightToLeft())
743  r.moveRight(contents.width() - r.left());
744 
745  if (allowCollapse)
746  sls->collapsed = s <= 0 && minSize > 0 && !w->isHidden();
747 
748  // Hide the child widget, but without calling hide() so that
749  // the splitter handle is still shown.
750  if (sls->collapsed)
751  r.moveTopLeft(QPoint(-r.width()-1, -r.height()-1));
752 
753  w->setGeometry(r);
754 
755  if (!sls->handle->isHidden()) {
756  QSplitterHandle *h = sls->handle;
757  QSize hs = h->sizeHint();
758  int left, top, right, bottom;
759  h->getContentsMargins(&left, &top, &right, &bottom);
760  if (orient==Qt::Horizontal) {
761  if (q->isRightToLeft())
762  p = contents.width() - p + hs.width();
763  h->setGeometry(p-hs.width() - left, contents.y(), hs.width() + left + right, contents.height());
764  } else {
765  h->setGeometry(contents.x(), p-hs.height() - top, contents.width(), hs.height() + top + bottom);
766  }
767  }
768 }
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void moveRight(int pos)
Moves the rectangle horizontally, leaving the rectangle&#39;s right edge at the given x coordinate...
Definition: qrect.h:356
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
The QSplitterHandle class provides handle functionality of the splitter.
Definition: qsplitter.h:158
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
int width() const
Returns the width.
Definition: qsize.h:126
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
QSize sizeHint() const
Reimplemented Function
Definition: qsplitter.cpp:219
void moveTopLeft(const QPoint &p)
Moves the rectangle, leaving the top-left corner at the given position.
Definition: qrect.h:368
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
Qt::Orientation orient
Definition: qsplitter_p.h:90
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
void setRect(int x, int y, int w, int h)
Sets the coordinates of the rectangle&#39;s top-left corner to ({x}, {y}), and its size to the given widt...
Definition: qrect.h:400
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int height() const
Returns the height.
Definition: qsize.h:129
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
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)
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ setSizes_helper()

void QSplitterPrivate::setSizes_helper ( const QList< int > &  sizes,
bool  clampNegativeSize = false 
)

Definition at line 699 of file qsplitter.cpp.

700 {
701  int j = 0;
702 
703  for (int i = 0; i < list.size(); ++i) {
704  QSplitterLayoutStruct *s = list.at(i);
705 
706  s->collapsed = false;
707  s->sizer = sizes.value(j++);
708  if (clampNegativeSize && s->sizer < 0)
709  s->sizer = 0;
710  int smartMinSize = pick(qSmartMinSize(s->widget));
711 
712  // Make sure that we reset the collapsed state.
713  if (s->sizer == 0) {
714  if (collapsible(s) && smartMinSize > 0) {
715  s->collapsed = true;
716  } else {
717  s->sizer = smartMinSize;
718  }
719  } else {
720  if (s->sizer < smartMinSize)
721  s->sizer = smartMinSize;
722  }
723  }
724  doResize();
725 }
bool collapsible(QSplitterLayoutStruct *) const
Definition: qsplitter.cpp:684
Q_GUI_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
T value(int i) const
Returns the value at index position i in the list.
Definition: qlist.h:661
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ storeSizes()

void QSplitterPrivate::storeSizes ( )

Definition at line 556 of file qsplitter.cpp.

557 {
558  for (int i = 0; i < list.size(); ++i) {
559  QSplitterLayoutStruct *sls = list.at(i);
560  sls->sizer = pick(sls->rect.size());
561  }
562 }
QSize size() const
Returns the size of the rectangle.
Definition: qrect.h:309
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QList< QSplitterLayoutStruct * > list
Definition: qsplitter_p.h:89
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
int pick(const QPoint &pos) const
Definition: qsplitter_p.h:98

◆ trans() [1/2]

int QSplitterPrivate::trans ( const QPoint pos) const
inline

Definition at line 103 of file qsplitter_p.h.

104  { return orient == Qt::Vertical ? pos.x() : pos.y(); }
Qt::Orientation orient
Definition: qsplitter_p.h:90
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128

◆ trans() [2/2]

int QSplitterPrivate::trans ( const QSize s) const
inline

Definition at line 105 of file qsplitter_p.h.

106  { return orient == Qt::Vertical ? s.width() : s.height(); }
int width() const
Returns the width.
Definition: qsize.h:126
Qt::Orientation orient
Definition: qsplitter_p.h:90
int height() const
Returns the height.
Definition: qsize.h:129

◆ updateHandles()

void QSplitterPrivate::updateHandles ( )

Definition at line 693 of file qsplitter.cpp.

694 {
695  Q_Q(QSplitter);
696  recalc(q->isVisible());
697 }
#define Q_Q(Class)
Definition: qglobal.h:2483
void recalc(bool update=false)
Definition: qsplitter.cpp:384
The QSplitter class implements a splitter widget.
Definition: qsplitter.h:62

Properties

◆ blockChildAdd

bool QSplitterPrivate::blockChildAdd

Definition at line 96 of file qsplitter_p.h.

◆ childrenCollapsible

bool QSplitterPrivate::childrenCollapsible

Definition at line 93 of file qsplitter_p.h.

◆ compatMode

bool QSplitterPrivate::compatMode

Definition at line 94 of file qsplitter_p.h.

◆ firstShow

bool QSplitterPrivate::firstShow

Definition at line 92 of file qsplitter_p.h.

◆ handleWidth

int QSplitterPrivate::handleWidth

Definition at line 95 of file qsplitter_p.h.

◆ list

QList<QSplitterLayoutStruct *> QSplitterPrivate::list
mutable

Definition at line 89 of file qsplitter_p.h.

◆ opaque

bool QSplitterPrivate::opaque

Definition at line 91 of file qsplitter_p.h.

◆ orient

Qt::Orientation QSplitterPrivate::orient

Definition at line 90 of file qsplitter_p.h.

◆ rubberBand

QPointer<QRubberBand> QSplitterPrivate::rubberBand

Definition at line 88 of file qsplitter_p.h.


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