Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    Language Bindings
    2
    3
    2931
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      redstoneleo last edited by

      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_())

      @

      1 Reply Last reply Reply Quote 0
      • jazzycamel
        jazzycamel last edited by

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

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

        Hope this helps ;o)

        For the avoidance of doubt:

        1. All my code samples (C++ or Python) are tested before posting
        2. As of 23/03/20, my Python code is formatted to PEP-8 standards using black from the PSF (https://github.com/psf/black)
        1 Reply Last reply Reply Quote 0
        • R
          redstoneleo last edited by

          thanks jazzycamel ,you always help me a lot !

          1 Reply Last reply Reply Quote 0
          • First post
            Last post