-
-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
python code of this workaround of tab text limitation #5
Comments
@nitubhaskar The solution is a QProxyStyle, I have already published it as an answer in Stack Overflow
|
thanks a lot for the code and the quick help. appreciate it. |
Hi, as you told me to upload to github, i have done that here https://github.com/nitubhaskar/uipyqt5/tree/master. Thanks for help. The code to switch UI tab text is in tabwidget file which is imported in mainwindowui file. hence i was not able to make proxystyle work in mainwindow as i couldnt figure out where to add proxy class without affecting other element style. |
@nitubhaskar Your code generates errors, correct and notify me, If you want help from me you will have to provide a workable code, I have not asked you to provide me with your project, if you can not then create another minimum project, in SO we call it MCVE 😄 |
sorry, i will take a look at it. i only changed the website links in it and removed ui files. let me just add those ui files and it will work then. Edit: I have updated them with all the files. i have checked in pycharm and its working. You have to click "Start your free trial" to get to main window and then you can see tabs text issue on left side. |
@nitubhaskar I get the following: If you could make that part jump and throw me into the problem directly it would be great, I'm getting bored 😄 |
sorry, i was keeping window handling flow same if it matters to drawing. Needed to click trial mode to get to main window which i mentioned in previous comment. Oh my, sorry. i just noticed what happened i have removed it now, so you can get to main window right away. |
@nitubhaskar I already saw what the problem is, but to solve it I need you to share the .ui that generates the mainwindow_ui.py together with the .rc |
ok added/updated these files in repo "res.qrc" "res_rc.py" "mainwindow.ui" "mainwindow_ui.py" i had too many images. so i removed many and kept dummy icons for test. thanks |
The problem is in the padding that you use in the tabbar, if you remove them as shown in the following image: You get the following: mainwindow_ui.py
mainwindow.py
|
Ok, i added proxystyle class and this is what i am getting if i remove padding and margin part of css for tab. Text is getting clipped and top 3 buttons lost the style. i dont want to use fusion style as it doesnt provide the windows look. this is supposed to be a windows application. any idea why text is clipped on my side? thanks Edit: also i need the padding because otherwise the tab looks too small. I need to provide the size of tab big enough as theyre the main navigation part of application |
try with |
ya thanks that fixed the text cropping. but i need to have a bigger tab and adding padding is making it bad. should i change rect size of tab manually or any better solution? because on resize with maximum button may not be good idea with manual rect size? Edit: also adding proxystyle is making 3 pushbutton on banner lose its background color. i tried setting it again with
but its not taking effect |
The buttons will be arranged with the following code
With the previous correction it is no longer necessary and for padding use the following:
Output: |
thanks, i didnt know we can add padding in header like that. Only problem i have is i would like to keep the style default which is "windows" i believe. We are trying to maintain our UI similar to other products we have which are designed in C#. So having fusion style throws off the same brand feel. But without using fusion and trying to set "windows" again or without it the top 3 "Upgrade, Report, Help" buttons are coming as white. my stylesheet assigning i did in mainwindow which is before the proxystyle code implementation. so i think its getting overwritten? |
@nitubhaskar Well, I helped him in what he could. If you want very special features that Qt does not offer then you will have to pay an additional cost, and in this case the cost is that you must use the fusion style. 😄 |
ok thanks for help, i was asking since the solution ended with side effect. so didn't want to make a new thread and explain all the previous problems and how it ended at that. But i understand that you don't have to go further. thanks for help EDIT: I found a simple alternative solution to the issue. added an image instead to it. so now it works. thanks for all the help. |
@nitubhaskar |
I was using text and icon in qpushbutton. Now i just removed both and made 1 image with icon and text and added it in stylesheet |
Hey i checked this thread and i tried using this, but problem is i cant make text left aligned as its drawing from center of rectangle. Any way you can help me set it to left alignment? made thread about it here
i am getting this
when i use your code and i get this alignment
when i use this code
can you help please?
The text was updated successfully, but these errors were encountered: