Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Align text left and center in QProgressBar?
Forum Updated to NodeBB v4.3 + New Features

Align text left and center in QProgressBar?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 1.4k 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.
  • F Offline
    F Offline
    Fuchsiaff
    wrote on last edited by
    #1

    I have a progress bar where I want the text to be in the left side and centered height wise, not width wise.

    I tried this:

    self.ram = QProgressBar(self)
    self.ram.setAlignment(Qt.AlignLeft | Qt.
    self.ram.setFixedWidth(
    self.ram.setValue(100)
    

    But that doesn't give me the results wanted.

    Is it even possible?
    I'm looking for results like this: 0_1541797064950_14232c5c-d518-45b1-b2db-277febd07e0e-image.png

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      setAlignment, as stated, in the doc, is for the progress bar alignment.

      If you want to change the text position, you should look into QProxyStyle.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2

      • Login

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