PyQt Basic Widgets PyQt QSplitter Widget - PyQt

What is PyQt QSplitter Widget?

That is every other superior layout manager which permits the size of child widgets to be modified dynamically through dragging the limits among them. The Splitter manage presents a manage that can be dragged to resize the controls.

The widgets in a QSplitter item are laid horizontally by default although the orientation may be changed to Qt.Vertical.

Following are the techniques and signals of QSplitter class –

S.No.

Methods & Description

1

addWidget()

Adds the widget to splitter’s layout

2

indexOf()

Returns the index of the widget in the layout

3

insetWidget()

Inserts a widget at the specified index

4

setOrientation()

Sets the layout of splitter to Qt.Horizontal or Qt.Vertical

5

setSizes()

Sets the initial size of each widget

6

count()

Returns the number of widgets in splitter widget

splitterMoved() is the only signal emitted through QSplitter object whenever the splitter manage is dragged.

Example

The following example has a splitter object, splitter1, wherein a frame and QTextEdit object are horizontally introduced.

This splitter object splitter1 and a bottom frame item are introduced in another splitter, splitter2, vertically. The item splitters is finally introduced in the top level window.

The complete code is as follows –

The above code produces the following output –

PyQt - QSplitter Widget

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

PyQt Topics