Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProgressBar.resize() works only for vertical bars, clips horizontal
Qt 6.12 LTS is out! See what's new in the release blog

QProgressBar.resize() works only for vertical bars, clips horizontal

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 676 Views 1 Watching
  • 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I'm using PyQt5 to make a widget which has dynamically-placed and resized progressbars on top of an image. The problem is, QProgressBar.resize() works fine for vertical progressbars, and clips horizontal ones. In particular, it doesn't produce a square at all if asked to.

    I've been on that issue for hours now, there is no way I'm solving this one on my own it seems. I've got a much bigger code, but I reproduced the problem with the following:

    @class Test(QWidget):
    def init(self):
    super(Test, self).init()
    self.pb = QProgressBar(self);
    self.pb.show()

    def upd(self):
        self.pb.resize(50,50)
    

    gui = Test()
    gui.show()
    gui.upd()@

    This does not produce a square. What is happening?

    Here is what it looks like on the main program:
    !http://i.stack.imgur.com/Y2rHZ.png(Problem on main program)!

    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
    • Unsolved