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. Automatically change the width of the editbox and it's parent panel/dialog?
Servers for Qt installer are currently down

Automatically change the width of the editbox and it's parent panel/dialog?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 2 Posters 1.3k 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.
  • O Offline
    O Offline
    opengpu
    wrote on last edited by
    #1

    i want to automatically change the width of the editbox and its parent panel/dialog, and aotumatilly adjust the other controls on that panel/dialog.
    is there any way to do this?

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andreyc
      wrote on last edited by
      #2

      Do you need to resize the controls on a window resize?

      If so, then take a look on "layouts":http://qt-project.org/doc/qt-5/layout.html

      If not then you always can change a size of the widgets using "resize":http://qt-project.org/doc/qt-5/qwidget.html#size-prop method of QWidget

      1 Reply Last reply
      0
      • O Offline
        O Offline
        opengpu
        wrote on last edited by
        #3

        yeh, i know layouts.
        I mean , when i input characters in the editbox, while the characters length increases, the editbox width increases, and the dialog which owns the editbox also increases,
        can these width increase automatically?
        or do i have to change the width always manually?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andreyc
          wrote on last edited by
          #4

          You need to change the widths manually.
          If you use layouts then you need to change the width of dialog only.
          If don't use layouts then you need to change all involved widgets.

          1 Reply Last reply
          0
          • O Offline
            O Offline
            opengpu
            wrote on last edited by
            #5

            thank you
            I think flowLayout is suitable.
            but is there any way to get the whole widht of one row(eg. the 1st row)?
            cause there may be a lable and an editbox and so on in a row.

            1 Reply Last reply
            0
            • O Offline
              O Offline
              opengpu
              wrote on last edited by
              #6

              and what i want is just increase the editbox's width. while the other controls such as lable's width stays unchanged.

              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