Results 1 to 3 of 3

Thread: Syntax issue with placing text inside a QProgressBar

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2017
    Qt products

    Default Syntax issue with placing text inside a QProgressBar

    I have a working Q Progress Bar with the percentage completion showing out to the right. I would like to add the text "Loading files" to the inside of the bar. In looking at the message boards for info, I found the following, which I think may do what I need (but have not tested):
    Found code:
    Qt Code:
    1. progressBar.setFormat("Loading...");
    2. progressBar.setAlignment(Qt::AlignCenter);
    To copy to clipboard, switch view to plain text mode 

    My code is this:
    Qt Code:
    1. self.ui.progressbar.setFormat('Loading files . . .')
    2. self.ui.progressbar.setAlignment(xxxxxxxxxxx)
    To copy to clipboard, switch view to plain text mode 

    I need help in translating the second line of the code I found into the format I need, ie., what do I put where the XXXXXXX are showing in my code? PyCharm, my IDE, gave me hints of what to put where the x's are like "Qt_Alignment=" but I don't know what else to put after the =
    Last edited by dennisvz; 8th December 2019 at 21:53.

Similar Threads

  1. Issue placing a QOpenGLWidget in a QDockWidget
    By sandytf in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2015, 14:11
  2. Issue in placing the QGraphicsItems into QGraphicsLayout
    By aditya.kaole in forum Qt Programming
    Replies: 4
    Last Post: 9th September 2010, 07:33
  3. Building QT Staticly issue [The syntax of the command is incorrect.]
    By originof in forum Installation and Deployment
    Replies: 2
    Last Post: 13th August 2010, 13:21
  4. Replies: 4
    Last Post: 11th May 2010, 17:33
  5. compile issue, syntax i guess, but can't find it
    By incapacitant in forum Newbie
    Replies: 16
    Last Post: 29th March 2006, 20:32

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.