Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to reduce the size of LineEdit and labels when present in a layout.
Qt 6.11 is out! See what's new in the release blog

How to reduce the size of LineEdit and labels when present in a layout.

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 3 Posters 1.1k Views 2 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.
  • K Offline
    K Offline
    kishore_hemmady
    wrote on last edited by
    #1

    I have a lineEdit and Label in a horizontal layout.I want to reduce the width of the lineEdit I tried inserting horizontal spacer in the layout still not able to reduce its width.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

      Hi
      You could set maximumWidth() (on the lineEdit)
      to disallow it to grow over a size.
      You can also set stretch factor if you want to share the space
      in non fix manner.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kishore_hemmady
        wrote on last edited by
        #3

        cant this be done in the design mode?

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kishore_hemmady
          wrote on last edited by
          #4

          I have many labels and lineEdits.I want to align them properly.

          1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi
            Yes it can be done in Designer.
            Its all in the properties.

            1 Reply Last reply
            2
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              From your description, you might be interested in QFormLayout.

              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
              2

              • Login

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