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. Random changes in height value.
Forum Updated to NodeBB v4.3 + New Features

Random changes in height value.

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 484 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.
  • supergS Offline
    supergS Offline
    superg
    wrote on last edited by
    #1

    One of my classes randomly changes height value when I save. I want it to be 800480, but when I save and re-enter its 800500+ (It can be 518, 544, 600, it really varies in a way that seems random). Now it happened to another class. Why does this happen?
    I don't want to fix its size because the app it's meant to be resizable in different displays.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      @superg said in Random changes in height value.:

      I assume by "class" you mean some sort of Qt widget.

      when I save

      How do you do that?

      when I save and re-enter its 800500+

      How do you retrieve that value and set the widget size?

      supergS 1 Reply Last reply
      1
      • C ChrisW67

        @superg said in Random changes in height value.:

        I assume by "class" you mean some sort of Qt widget.

        when I save

        How do you do that?

        when I save and re-enter its 800500+

        How do you retrieve that value and set the widget size?

        supergS Offline
        supergS Offline
        superg
        wrote on last edited by superg
        #3

        @ChrisW67 I just seen your reply. The bug, I think, still persist. For the time being, I fixed its size and was planning to address it when I finish the whole project.
        The thing is, I save with cmd+s, build and run the code. When I re-enter the .ui of my class, I can see that its size changed. This affects the window's size of the hole app.
        Thank you for your response.

        JonBJ 1 Reply Last reply
        0
        • supergS superg

          @ChrisW67 I just seen your reply. The bug, I think, still persist. For the time being, I fixed its size and was planning to address it when I finish the whole project.
          The thing is, I save with cmd+s, build and run the code. When I re-enter the .ui of my class, I can see that its size changed. This affects the window's size of the hole app.
          Thank you for your response.

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @superg said in Random changes in height value.:

          The thing is, I save with cmd+s, build and run the code. When I re-enter the .ui of my class, I can see that its size changed.

          We don 't know what you mean here. It is not possible that running your code could change what is in the .ui file. You can inspect what is in that file with a text editor, and you can even look at the ui_....h file which is generated from it located in your build output direcrtory.

          supergS 1 Reply Last reply
          0
          • JonBJ JonB

            @superg said in Random changes in height value.:

            The thing is, I save with cmd+s, build and run the code. When I re-enter the .ui of my class, I can see that its size changed.

            We don 't know what you mean here. It is not possible that running your code could change what is in the .ui file. You can inspect what is in that file with a text editor, and you can even look at the ui_....h file which is generated from it located in your build output direcrtory.

            supergS Offline
            supergS Offline
            superg
            wrote on last edited by
            #5

            @JonB It is difficult to explain. I'll try to do it step by step.
            First, to give some context, I'll clarify that this happens to a class called "Menu".
            The size of this Menu is 800x480 (Thats the values that I set and that you can see in the .ui file, below "Geometry"). Inside, there are layouts with buttons for different functions that this menu has to provide, spacers and a few labels. The menu has a vertical layout.
            Now, I'll explain the bug.

            • I run the app. When the program window appears, you can see that the height has changed, it bigger.
            • I re-enter the Menu.ui file, and I see the Height value has changed to 500,600, or a value like that.
            • I try to change it, but when I put the value 480 in Height, It changes to a value bigger. For example 540. I have to break the Manu layout to adjust it again to 480.
            • I break the menu layout and adjust its height again.
            • back to step one.

            It's very weird. For now, I just fixed the menu's size. The app is, for now, meant for a unique display, so I can fix it's size to that displays resolution.

            1 Reply Last reply
            0
            • Christian EhrlicherC Offline
              Christian EhrlicherC Offline
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              When you can't set a lower value then your widgets inside the layout don't allow this (e.g. because their minimum size is to high so they don't fit into the layout)

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              supergS 1 Reply Last reply
              0
              • Christian EhrlicherC Christian Ehrlicher

                When you can't set a lower value then your widgets inside the layout don't allow this (e.g. because their minimum size is to high so they don't fit into the layout)

                supergS Offline
                supergS Offline
                superg
                wrote on last edited by
                #7

                @Christian-Ehrlicher Thanks, I didn't think of that. I'll check later if it does the trick!

                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