Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Qt dimension

    General and Desktop
    2
    5
    1624
    Loading More Posts
    • 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.
    • B
      blackbelt last edited by

      Coming from android, when I work with graphics element like layout, I can express its width and height in relation to its content (wrap_content). It there something like this in Qt? Or the geometry has to be expressed in pixels?

      1 Reply Last reply Reply Quote 0
      • sierdzio
        sierdzio Moderators last edited by

        Depends whether you talk about QtWidgets or QtQuick UIs. In general - it's pixels. In widgets, when you use layouts, the layout system will calculate everything for you automatically, there is no need to set dimensions explicitly.

        (Z(:^

        1 Reply Last reply Reply Quote 0
        • B
          blackbelt last edited by

          thank you. I am using stuff like QHBoxLayout, QComboBox, etc. what about it

          1 Reply Last reply Reply Quote 0
          • sierdzio
            sierdzio Moderators last edited by

            Then it should be done for you automatically :) If the text in text widgets doesn't wrap around, set the "wordWrap" property to true.

            (Z(:^

            1 Reply Last reply Reply Quote 0
            • B
              blackbelt last edited by

              I will try it. Thank you

              1 Reply Last reply Reply Quote 0
              • First post
                Last post