[Solved]QProgressBar on QstatusBar : how to remove the 2 little vertical lines on either side of the QprogressBar ?



  • I add a QprogressBar following a Qlable to the QstatusBar by the following code ,but the QprogressBar is lined with 2 little vertical lines .
    I wonder how to remove the 2 vertical lines ?
    @
    import sys
    from PyQt4.QtGui import *
    from PyQt4.QtCore import *

    class MainWindow(QMainWindow):

    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.resize(800, 600)
        
        self.lb=QLabel('finding resource   ')
        
        self.pb = QProgressBar()
        self.pb.setRange(0, 0)
    

    self.pb.setTextVisible(False)

        self.statusBar().addPermanentWidget(self.lb)
        self.statusBar().addPermanentWidget(self.pb, 1)
    

    if name == "main":
    app = QApplication(sys.argv)

    ui = MainWindow()
    ui.show()
    

    sys.exit(app.exec_())

    @



  • Its just the Windows style which can be changed as follows:

    @
    self.statusBar().setStyleSheet("QStatusBar::item {border: none;}")
    @

    Hope this helps ;o)



  • thanks jazzycamel ,you always help me a lot !


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.