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 Updated to NodeBB v4.3 + New Features

How to programmatically resize QProgressDialog

Scheduled Pinned Locked Moved General and Desktop
7 Posts 4 Posters 2.8k 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.
  • X Offline
    X Offline
    xalam
    wrote on 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
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      0
      • X Offline
        X Offline
        xalam
        wrote on 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
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on 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 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
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on 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 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

                • Login

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