Results 1 to 2 of 2

Thread: Change position (X/Y coordinates) the progress bar in a QProgressDialog

  1. #1
    Join Date
    Aug 2017
    Posts
    2
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Android Maemo/MeeGo

    Post Change position (X/Y coordinates) the progress bar in a QProgressDialog

    Hello all,

    I am new to Qt programming.

    In my project, I am using standard QProgressDialog. But the progress bar inside that dialog is aligned at the bottom section along with a Cancel button. I want to move the progress bar or the button to some distance from each other.

    I tried with

    findChildren<QProgressBar>().move(5,10);

    but it doesn't work.

    Does anybody knows how to approach it and find a solution.

    Many thanks in advance!

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Change position (X/Y coordinates) the progress bar in a QProgressDialog

    The QProgressBar's position and size are almost certainly under the control of a QLayout within the dialog, and therefore cannot be moved or sized manually. If you don't like the default arrangement, then your only option is probably to implement your own progress dialog that is laid out according to your preferences.

    You *might* be able to add space between the progress bar and the cancel button by retrieving the QLayout from the dialog, finding the index of the QProgressBar within the layout, and then adding a QSpacerItem after that index. But that's just a guess and seems like a distraction to getting work done on what your project is really about.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. change progress bar value from a thread
    By xbehzad in forum Qt Programming
    Replies: 5
    Last Post: 30th November 2016, 16:26
  2. Replies: 1
    Last Post: 25th July 2013, 06:27
  3. progress bar text position
    By Annihilator in forum Qt Programming
    Replies: 1
    Last Post: 11th April 2012, 15:51
  4. set QProgressDialog. progress indicator color?
    By Gokulnathvc in forum Newbie
    Replies: 3
    Last Post: 15th March 2012, 10:47
  5. Replies: 3
    Last Post: 8th February 2012, 01:57

Tags for this Thread

Bookmarks

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.