以下成员源于类 QSplitter are part of the Qt compatibility layer. We advise against using them in new code.
| enum | ResizeMode { Auto, Stretch, KeepSize, FollowSizeHint } |
| 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 ) |
This enum describes the different resizing behaviors child widgets can have:
| 常量 | 值 | 描述 |
|---|---|---|
QSplitter::Auto
|
3
|
The widget will be resized according to the stretch factors set in its sizePolicy (). |
QSplitter::Stretch
|
0
|
The widget will be resized when the splitter itself is resized. |
QSplitter::KeepSize
|
1
|
QSplitter will try to keep the widget's size unchanged. |
QSplitter::FollowSizeHint
|
2
|
QSplitter will resize the widget when the widget's size hint changes. |
使用 setStretchFactor () 代替。
Use one of the constructors that doesn't take the name argument and then use setObjectName () 代替。
Use one of the constructors that don't take the name argument and then use setObjectName () 代替。
Returns the width of the margin around the contents of the widget.
使用 QWidget::getContentsMargins () 代替。
另请参阅 setMargin () 和 QWidget::getContentsMargins ().
使用 insertWidget (0, widget ) 代替。
使用 addWidget ( widget ) 代替。
使用 setCollapsible ( indexOf ( widget , collapsible )) instead.
Sets the width of the margin around the contents of the widget to margin .
使用 QWidget::setContentsMargins () 代替。
另请参阅 margin () 和 QWidget::setContentsMargins ().
使用 setStretchFactor () 代替。
例如,若有代码像
splitter->setResizeMode(firstChild, QSplitter::KeepSize); splitter->setResizeMode(secondChild, QSplitter::Stretch);
可以把它重写成
splitter->setStretchFactor(splitter->indexOf(firstChild), 0); splitter->setStretchFactor(splitter->indexOf(secondChild), 1);