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 resize the widgets inside QDialog window when user resize QDialog manually.

How to resize the widgets inside QDialog window when user resize QDialog manually.

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 1.3k 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.
  • A Offline
    A Offline
    Ayush Gupta
    wrote on last edited by
    #1

    I need one help I have one line edit and PushButton in QDialog Window.

    When I try to resize window manually I want that Line Edit show also grow horizontally but currently it is not increasing is size when I am trying to increase the size of QDialog Window.

    The sizePolicy (Horizontal Policy) is already set to Preffered.

    1 Reply Last reply
    0
    • A Ayush Gupta

      @jsulm I am using horizontal layout. No i did not applied to layout to the dialog..

      <layout class="QHBoxLayout" name="horizontalLayout_3">
      <item>
      <spacer name="horizontalSpacer">
      <property name="orientation">
      <enum>Qt::Horizontal</enum>
      </property>
      <property name="sizeHint" stdset="0">
      <size>
      <width>40</width>
      <height>20</height>
      </size>
      </property>
      </spacer>
      </item>
      <item>
      <widget class="QDialogButtonBox" name="KmrcButtonBox">
      <property name="standardButtons">
      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
      </property>
      </widget>
      </item>
      </layout>

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #6

      @Ayush-Gupta said in How to resize the widgets inside QDialog window when user resize QDialog manually.:

      No i did not applied to layout to the dialog

      Then please do...

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • B Offline
        B Offline
        Bonnie
        wrote on last edited by
        #2

        You should use layouts.
        sizePolicy only works when in a layout.

        1 Reply Last reply
        2
        • A Offline
          A Offline
          Ayush Gupta
          wrote on last edited by
          #3

          @Bonnie I am using layout but still it does not works.

          jsulmJ 1 Reply Last reply
          0
          • A Ayush Gupta

            @Bonnie I am using layout but still it does not works.

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #4

            @Ayush-Gupta Then explain/show how you're using layouts. Did you apply layout to the dialog itself?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • A Offline
              A Offline
              Ayush Gupta
              wrote on last edited by
              #5

              @jsulm I am using horizontal layout. No i did not applied to layout to the dialog..

              <layout class="QHBoxLayout" name="horizontalLayout_3">
              <item>
              <spacer name="horizontalSpacer">
              <property name="orientation">
              <enum>Qt::Horizontal</enum>
              </property>
              <property name="sizeHint" stdset="0">
              <size>
              <width>40</width>
              <height>20</height>
              </size>
              </property>
              </spacer>
              </item>
              <item>
              <widget class="QDialogButtonBox" name="KmrcButtonBox">
              <property name="standardButtons">
              <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
              </property>
              </widget>
              </item>
              </layout>

              jsulmJ 1 Reply Last reply
              0
              • A Ayush Gupta

                @jsulm I am using horizontal layout. No i did not applied to layout to the dialog..

                <layout class="QHBoxLayout" name="horizontalLayout_3">
                <item>
                <spacer name="horizontalSpacer">
                <property name="orientation">
                <enum>Qt::Horizontal</enum>
                </property>
                <property name="sizeHint" stdset="0">
                <size>
                <width>40</width>
                <height>20</height>
                </size>
                </property>
                </spacer>
                </item>
                <item>
                <widget class="QDialogButtonBox" name="KmrcButtonBox">
                <property name="standardButtons">
                <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
                </property>
                </widget>
                </item>
                </layout>

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #6

                @Ayush-Gupta said in How to resize the widgets inside QDialog window when user resize QDialog manually.:

                No i did not applied to layout to the dialog

                Then please do...

                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