vandelay
vandelay

Reputation: 2075

QDockWidget, place the tabs on top and insert text

Are there any methods to make the tabs be placed on top? I think it's more suitable. And is there an easy way to name the tabs, maybe add a QLabel.

Below is a picture of how it looks now.

enter image description here

Upvotes: 0

Views: 714

Answers (1)

ekhumoro
ekhumoro

Reputation: 120798

Use setTabPosition to put the tabs at the top for the relevant dock-areas:

mainwindow.setTabPosition(QtCore.Qt.AllDockWidgetAreas, QtGui.QTabWidget.North)

The tab text is taken from the window title, so it can be set like this:

dockwidget.setWindowTitle('Name')

or indirectly via the QDockWidget constructor:

dockwidget = QtGui.QDockWidget('Name', parent)

Upvotes: 2

Related Questions