Marc Van Daele
Marc Van Daele

Reputation: 2734

How to let the user change the width of a frame

My Qt4 application has basically two frames, each displaying more or less independent content. The user should be able to make one frame smaller (and the other one bigger)

Much like the behavior in a QTableView where a user can make one column smaller or bigger.

Is there a Qt widget supporting this? If not, any advice on how to implement this?

Upvotes: 0

Views: 37

Answers (1)

alexblae
alexblae

Reputation: 746

Have a look into QtGui.QSplitter (http://pyqt.sourceforge.net/Docs/PyQt4/qsplitter.html). For example

# Add horizontal splitter 
horizontalSplitter = QtGui.QSplitter(QtCore.Qt.Horizontal)

# Add two widgets
horizontalSplitter.addWidget(widget1)
horizontalSplitter.addWidget(widget2)

You get a horizontal splitter that is drag-able. Hope this is what you are looking for.

Upvotes: 2

Related Questions