1 year ago

#388854

test-img

user662650

How to set status bar for each tab in QTabWidget in PyQt5?

I'm trying to create an application which has two tab widgets and I'm trying to set individual status bars for each of them. Is this even possible?

Because both my tabs represent separate and individual process (threads are going to be used), I would like for them to update their own status bar (which indicates the info of each tab/thread), this would be messy with a single status bar (which I had been using until now). This is my code:

def lister_tab_widget(self):
    self.lister_tab = QtWidgets.QWidget()

    self.tab_widget.addTab(self.lister_tab, "Lister")

    self.lister_tab_layout = QtWidgets.QGridLayout()
    self.lister_tab.setLayout(self.lister_tab_layout)

    ...

    self.lister_status_bar = QtWidgets.QStatusBar(self.lister_tab)
    self.lister_status_bar.showMessage('Testing')

(same for the second tab)

This works but the status bar appears in the tab. I did remove the status bar of the QMainWindow, it looks like this:

enter image description here

Is there any way to atleast move this to the bottom (like the regular QMainWdinow status bar)?

pyqt5

0 Answers

Your Answer

Accepted video resources