Qt6 +python 3.9 QMainWindow + two QFrames split ratio
-
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
-
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
-
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
-
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
@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.
-
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
-
... 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?
-
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
@qtKeith
-
If I have read your post, why do you think I have not?
-
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.
-
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?
-
-
... 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?
@Christian-Ehrlicher thank you Christian.. had not seen that.. will take a look at provide feedback.
-
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
-
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