add extra info in statusbar

Need help, or want to share a macro? Post here!
Post Reply
awei
Posts: 9
Joined: Sat Jun 06, 2020 2:01 pm

add extra info in statusbar

Post by awei »

Is it possible to add extra-info in statusbar with python script?
Attachments
extra-info.PNG
extra-info.PNG (12.68 KiB) Viewed 1046 times
Last edited by awei on Tue Jul 07, 2020 2:04 am, edited 1 time in total.
hrhassan
Posts: 75
Joined: Mon May 25, 2020 3:25 am

Re: adding extra info in statusbar

Post by hrhassan »

What kind of info are you looking to add?
awei
Posts: 9
Joined: Sat Jun 06, 2020 2:01 pm

Re: adding extra info in statusbar

Post by awei »

hrhassan wrote: Tue Jun 30, 2020 7:39 pm What kind of info are you looking to add?
like processing bar
hrhassan
Posts: 75
Joined: Mon May 25, 2020 3:25 am

Re: adding extra info in statusbar

Post by hrhassan »

awei wrote: Wed Jul 01, 2020 7:27 am
hrhassan wrote: Tue Jun 30, 2020 7:39 pm What kind of info are you looking to add?
like processing bar
I do know that this is a QT concern and in the designer, there is a progress bar available. However, I am unsure how to get it attached to the status bar. If you create a UI file in QT and convert to python, I'm sure there is a way. The navigation style combo view is a python file as well. Anyone?
openBrain
Veteran
Posts: 9019
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: adding extra info in statusbar

Post by openBrain »

There already is a progress bar in the status bar.
You can just get a reference to it then use it. ;)
I'm with my phone now so it's untested code :

Code: Select all

from PySide import QtGui
pb = Gui.getMainWindow().statusBar().findChild(QtGui.QProgressBar)
pb.setValue(pb.maximum()/2)
pb.show()
Edit:and yes, you can virtually add any widget to the status bar with Python.
openBrain
Veteran
Posts: 9019
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: adding extra info in statusbar

Post by openBrain »

hrhassan wrote: Wed Jul 01, 2020 8:00 pm I do know that this is a QT concern and in the designer, there is a progress bar available. However, I am unsure how to get it attached to the status bar. If you create a UI file in QT and convert to python, I'm sure there is a way. The navigation style combo view is a python file as well. Anyone?
This is very confusing. It has no sense to create an UI file to add a widget. And Combo view is coded in C++.
awei
Posts: 9
Joined: Sat Jun 06, 2020 2:01 pm

Re: adding extra info in statusbar

Post by awei »

this is what i want!

Code: Select all

import PySide2

from PySide2 import QtWidgets

pb = pb = PySide2.QtWidgets.QProgressBar()
pb.setValue(pb.maximum()/2)
Gui.getMainWindow().statusBar().addWidget(pb)
pb.show()
thanks all. :)
Attachments
2020-07-02 075628.png
2020-07-02 075628.png (2.97 KiB) Viewed 896 times
Post Reply