Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. [Solved]QProgressBar on QstatusBar : how to remove the 2 little vertical lines on either side of the QprogressBar ?
QtWS25 Last Chance

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

Scheduled Pinned Locked Moved Language Bindings
3 Posts 2 Posters 3.2k Views
  • 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 Offline
    R Offline
    redstoneleo
    wrote on last edited by
    #1

    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
    0
    • jazzycamelJ Offline
      jazzycamelJ Offline
      jazzycamel
      wrote on last edited by
      #2

      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
      0
      • R Offline
        R Offline
        redstoneleo
        wrote on last edited by
        #3

        thanks jazzycamel ,you always help me a lot !

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved