Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# Compatibility Members for QSplitter

The following class members are part of the Qt 3 compatibility layer. They are provided to help you port old code to Qt 4. We strongly advise against using them in new code.

QSplitter class reference

### Public Types

- enum ResizeMode { Stretch, KeepSize, FollowSizeHint, Auto }

### Public Functions

- void setResizeMode ( QWidget * w, ResizeMode mode )

## Member Type Documentation

### enum QSplitter::ResizeMode

`QSplitter::Stretch` |
`QSplitter::KeepSize` |
`QSplitter::FollowSizeHint` |
`QSplitter::Auto` |

## Member Function Documentation

### void QSplitter::setResizeMode ( QWidget * w, ResizeMode mode )

This function tries to simulate the Qt 3.x ResizeMode behavior using QSizePolicy stretch factors. This isn't easy, because the default `ResizeMode` was `Stretch`, not `KeepSize`, whereas the default stetch factor is 0.

So what we do is this: When the user calls setResizeMode() the first time, we iterate through all the child widgets and set their stretch factors to 1. Later on, if children are added (using addWidget()), their stretch factors are also set to 1.

There is just one problem left: Often, setResizeMode() is called before addWidget(), because addWidget() is called from the event loop. In that case, we use a special value, 243, instead of 0 to prevent 0 from being overwritten with 1 in addWidget(). This is a wicked hack, but fortunately it only occurs as a result of calling a `QT_COMPAT` function.