Compatibility Members for QSplitter

The following members of class QSplitterare part of the Qt compatibility layer. We advise against using them in new code.

Public Types

enum ResizeMode { Auto, Stretch, KeepSize, FollowSizeHint }

Public Functions

QSplitter(QWidget * parent, const char * name)
QSplitter(Qt::Orientation orientation, QWidget * parent, const char * name)
int margin() const
void moveToFirst(QWidget * widget)
void moveToLast(QWidget * widget)
void setCollapsible(QWidget * widget, bool collapsible)
void setMargin(int margin)
void setResizeMode(QWidget * widget, ResizeMode mode)
  • 57 public functions inherited from QWidget
  • 8 public functions inherited from QObject
  • 8 public functions inherited from QPaintDevice

Member Type Documentation

enum QSplitter::ResizeMode

This enum describes the different resizing behaviors child widgets can have:

QSplitter::Auto3The widget will be resized according to the stretch factors set in its sizePolicy().
QSplitter::Stretch0The widget will be resized when the splitter itself is resized.
QSplitter::KeepSize1QSplitter will try to keep the widget's size unchanged.
QSplitter::FollowSizeHint2QSplitter will resize the widget when the widget's size hint changes.

Use setStretchFactor() instead.

Member Function Documentation

QSplitter::QSplitter(QWidget * parent, const char * name)

Use one of the constructors that doesn't take the name argument and then use setObjectName() instead.

QSplitter::QSplitter(Qt::Orientation orientation, QWidget * parent, const char * name)

Use one of the constructors that don't take the name argument and then use setObjectName() instead.

int QSplitter::margin() const

Returns the width of the margin around the contents of the widget.

Use QWidget::getContentsMargins() instead.

See also setMargin() and QWidget::getContentsMargins().

void QSplitter::moveToFirst(QWidget * widget)

Use insertWidget(0, widget) instead.

void QSplitter::moveToLast(QWidget * widget)

Use addWidget(widget) instead.

void QSplitter::setCollapsible(QWidget * widget, bool collapsible)

Use setCollapsible(indexOf(widget, collapsible)) instead.

void QSplitter::setMargin(int margin)

Sets the width of the margin around the contents of the widget to margin.

Use QWidget::setContentsMargins() instead.

See also margin() and QWidget::setContentsMargins().

void QSplitter::setResizeMode(QWidget * widget, ResizeMode mode)

Use setStretchFactor() instead.

For example, if you have code like

splitter->setResizeMode(firstChild, QSplitter::KeepSize);
splitter->setResizeMode(secondChild, QSplitter::Stretch);

you can rewrite it as

splitter->setStretchFactor(splitter->indexOf(firstChild), 0);
splitter->setStretchFactor(splitter->indexOf(secondChild), 1);

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.