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. Qt6 +python 3.9 QMainWindow + two QFrames split ratio

Qt6 +python 3.9 QMainWindow + two QFrames split ratio

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 615 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.
  • Q Offline
    Q Offline
    qtKeith.
    wrote on last edited by
    #1

    hi, the Qframes setGeometry works great after the app is launched... respecting value and resizing according to the ratio set... however on launch, it fails. I cant seem to trigger the sizing/setGeometry of the frames that are split horizontally on screen after window.show().

    so basically its a QMainWindow with two QFrames+ Qscrollbar in a QWidget with QHBoxLayout.

    so for example if the user chooses a 70/30 split... the app on launch should have the top frame take 70% of the space and the bottom frame 30% -

    the user can then mod the ratio with the scrollbar if needed.

    all good except on launch, the frames are 50/50 and not adjusted

    the set geometry function is called on launch and by moving the scrollbar.... and like i said it works very well once i start interacting with the window.... but not on launch

    i saw a QCloseEvent - so I tried searching for QOpenEvent ( but does not exist -or I couldn't find it) - to try to trigger the updates.... and I tried to trigger it on QShowEvent which also fails.

    I am fairly new to qt so I am sure it's something obvious that I cannot seem to figure out !!!

    so is there like a command that updates all the Qwidgets according to their settings on launch ?

    thanks

    eyllanescE 1 Reply Last reply
    0
    • Q qtKeith.

      hi, the Qframes setGeometry works great after the app is launched... respecting value and resizing according to the ratio set... however on launch, it fails. I cant seem to trigger the sizing/setGeometry of the frames that are split horizontally on screen after window.show().

      so basically its a QMainWindow with two QFrames+ Qscrollbar in a QWidget with QHBoxLayout.

      so for example if the user chooses a 70/30 split... the app on launch should have the top frame take 70% of the space and the bottom frame 30% -

      the user can then mod the ratio with the scrollbar if needed.

      all good except on launch, the frames are 50/50 and not adjusted

      the set geometry function is called on launch and by moving the scrollbar.... and like i said it works very well once i start interacting with the window.... but not on launch

      i saw a QCloseEvent - so I tried searching for QOpenEvent ( but does not exist -or I couldn't find it) - to try to trigger the updates.... and I tried to trigger it on QShowEvent which also fails.

      I am fairly new to qt so I am sure it's something obvious that I cannot seem to figure out !!!

      so is there like a command that updates all the Qwidgets according to their settings on launch ?

      thanks

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @qtKeith please provide a verifiable example

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qtKeith.
        wrote on last edited by
        #3

        you again.... i avoid stack cause i cant stand your policies and here you are on qt forum asking for code !!! I truly wonder what you do with people's code...... instead letting users just help each other out from basic explanations !

        My question is not rocket science and I am sure that someone familiar with the the QMainWindow launch would be able to give me direction without seeing code !!

        thank you

        eyllanescE 1 Reply Last reply
        0
        • Q qtKeith.

          you again.... i avoid stack cause i cant stand your policies and here you are on qt forum asking for code !!! I truly wonder what you do with people's code...... instead letting users just help each other out from basic explanations !

          My question is not rocket science and I am sure that someone familiar with the the QMainWindow launch would be able to give me direction without seeing code !!

          thank you

          eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by eyllanesc
          #4

          @qtKeith I don't know who you are but your attitude is arrogant, here we need information (less strict than SO but still necessary). No forum is a code provider. Please read the site's code of conduct.

          What do you think I do with your code? Do you think I will sell it or make any commercial profit? Well no, we need it to 1. show that you have tried since you point out that something is failing so doing a copy-paste shouldn't be complicated, 2. Not to create everything from scratch and thus save me time. 3. For others to use as a base. 4. The idea of the forum is to collaborate, you provide something, others provide something else and thus we help each other.

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          1 Reply Last reply
          0
          • Q Offline
            Q Offline
            qtKeith.
            wrote on last edited by
            #5

            arrogance is not even the question and fabricated by you...... my issue is that you ask for code without any indication that you have read and understood the question..... you immediately ask for code....nothing else.... that's a little arrogant if you ask me..... what makes you think that you will understand the code I have written and have you ever heard of NDA ?

            I have explained in as clearly a fashion as I could and I am respecting the rules by being very polite and very professional.... and you immediately demand something without any sign that you are willing to help. Have you read and understood the question ? and if not just ask to clarify the question... instead of just demanding code..

            the code i have is from several libraries that you don't have so you couldn't make it work even if you wanted to...

            I would suggest that you try to answer the question first indicating that you have some knowledge about the problem.... instead of just demanding code.

            thank you

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

              ... so for example look into the QSplitter documentation to see if there is something which can help you restoring the splitter state instead writing lengthy answers instead providing a minimal, compilable example?

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

              Q 1 Reply Last reply
              0
              • Q qtKeith.

                arrogance is not even the question and fabricated by you...... my issue is that you ask for code without any indication that you have read and understood the question..... you immediately ask for code....nothing else.... that's a little arrogant if you ask me..... what makes you think that you will understand the code I have written and have you ever heard of NDA ?

                I have explained in as clearly a fashion as I could and I am respecting the rules by being very polite and very professional.... and you immediately demand something without any sign that you are willing to help. Have you read and understood the question ? and if not just ask to clarify the question... instead of just demanding code..

                the code i have is from several libraries that you don't have so you couldn't make it work even if you wanted to...

                I would suggest that you try to answer the question first indicating that you have some knowledge about the problem.... instead of just demanding code.

                thank you

                eyllanescE Offline
                eyllanescE Offline
                eyllanesc
                wrote on last edited by
                #7

                @qtKeith

                1. If I have read your post, why do you think I have not?

                2. I will continue my way since it is annoying that users think that this forum serves to request code instead of being a collaborative site.

                3. With your attitude you will probably not get help since many of the other collaborators will ask you the same since it is a basis to try to answer.

                What do other users think? Is it too much to ask for the code that the OP points out that he has?

                If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

                1 Reply Last reply
                1
                • Christian EhrlicherC Christian Ehrlicher

                  ... so for example look into the QSplitter documentation to see if there is something which can help you restoring the splitter state instead writing lengthy answers instead providing a minimal, compilable example?

                  Q Offline
                  Q Offline
                  qtKeith.
                  wrote on last edited by
                  #8

                  @Christian-Ehrlicher thank you Christian.. had not seen that.. will take a look at provide feedback.

                  1 Reply Last reply
                  0
                  • Q Offline
                    Q Offline
                    qtKeith.
                    wrote on last edited by
                    #9

                    hi Christian, just letting you know that I was unable to make it work. so I defaulted to a 50% split and then the user can adjust after open.... with the split 50%, there is no visual 'pop' to 70/30 for the frames. and the user can still set it to 70/30 gradually....

                    what's weird is that i even tried setting the parameter to trigger the valueChange signal after the window opens but it doesnt seem to trigger..... mouse grabbing the scrollbar to change it's value does trigger the signal valueChange.

                    anyways.. I appreciate the suggestion.

                    thanks

                    1 Reply Last reply
                    0
                    • Q Offline
                      Q Offline
                      qtKeith.
                      wrote on last edited by qtKeith.
                      #10

                      was testing designer and i can replicate the issue... looks like its just a limitation maybe ?

                      so basically i added 5 push buttons then set the layout to vertical....

                      starting the ui preview, the buttons stretch out... which is expected.

                      then adding a dock on the left side of the window...

                      changing the padding of X to 50 pushes the dock to the right in design mode as well as setting the width to 500 makes it larger...

                      i cannot seem to change the padding on the push buttons..

                      however when starting the preview, the dock squishes back completely to the left without any padding....

                      I can then stretch it out with the mouse handle to the desired width and the pushbuttons adjust accordingly.

                      similar behavior to my two frames issue.

                      so my assumption is that this is how its suppose to work and I am not able to set the geometry to preset values and still be able to make it fluid once the app starts.

                      the dock also fails on its own after removing the push buttons.... it reverts back to original values on launch

                      cheers

                      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