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. How to programmatically resize QProgressDialog
Forum Update on Monday, May 27th 2025

How to programmatically resize QProgressDialog

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 2.8k 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.
  • X Offline
    X Offline
    xalam
    wrote on 17 Feb 2015, 21:43 last edited by
    #1

    I create QProgressDialog but from parent window but I would like the default size to be be little bigger than what it comes up with. How can I change that?

    @ progress = (QSharedPointer<QProgressDialog>) new QProgressDialog("Creating files...", "Cancel", 1, numFiles, this, Qt::Dialog) ;
    progress->setAutoClose( false );
    progress->setMinimumDuration(0);
    progress->setWindowModality(Qt::WindowModal);
    progress->setModal( true );
    progress->setAutoReset( false );@

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 18 Feb 2015, 07:32 last edited by
      #2

      @
      progress->resize(progress->size() + QSize(20. 20));
      @

      (Z(:^

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xalam
        wrote on 18 Feb 2015, 16:02 last edited by
        #3

        That somehow doesn't compile! I had to do the following along similar lines as you did but I don't know why your line doesn't compile:

        @ QSize size = progress->size(); //+ QSize(20. 20);
        size.setWidth( size.width() + 180);
        progress->resize( size );@

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 18 Feb 2015, 21:59 last edited by
          #4

          Hi,

          What error did you got ?

          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
          0
          • E Offline
            E Offline
            euchkatzl
            wrote on 19 Feb 2015, 10:46 last edited by
            #5

            The problem is the point in the QSize constructor.

            Try using comma instead:
            @progress->resize(progress->size() + QSize(20, 20));@

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 19 Feb 2015, 10:50 last edited by
              #6

              [quote author="euchkatzl" date="1424342793"]The problem is the point in the QSize constructor.[/quote]

              Oops, indeed, a typo. My bad.

              (Z(:^

              1 Reply Last reply
              0
              • X Offline
                X Offline
                xalam
                wrote on 20 Feb 2015, 17:58 last edited by
                #7

                Yes that was it! I just copy/pasted it and didn't realize it should be comma but that fixed it.

                1 Reply Last reply
                0

                6/7

                19 Feb 2015, 10:50

                • Login

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