<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I apologize, the screenshot for the overriden sizeHint method:</div>
<div class="elementToProof" style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="margin-left: 40px; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
def sizeHint(self):<br>
            return super().sizeHint()*2</div>
<div class="elementToProof" style="margin-left: 0px; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="margin-left: 0px; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
looks actually like this:</div>
<div class="elementToProof" style="margin-left: 0px; font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<img style="max-width: 1062px;" size="16374" contenttype="image/png" data-outlook-trace="F:1|T:1" src="cid:805d4369-2def-4d4e-a248-5c83d839100d"></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Matic Kukovec <kukovecmatic@hotmail.com><br>
<b>Sent:</b> Saturday, April 27, 2024 7:23 PM<br>
<b>To:</b> PyQt@riverbankcomputing.com <pyqt@riverbankcomputing.com><br>
<b>Subject:</b> Re: QTabWidget rendering issue?</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Also note that any 'repaint', 'polish' and 'unpolish' methods on the QTabBar have no effect in the tab-bar in this state,</div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
only clicking on another tab renders it correctly.</div>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Matic Kukovec <kukovecmatic@hotmail.com><br>
<b>Sent:</b> Saturday, April 27, 2024 7:09 PM<br>
<b>To:</b> PyQt@riverbankcomputing.com <pyqt@riverbankcomputing.com><br>
<b>Subject:</b> Re: QTabWidget rendering issue?</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I tried overriding the 'sizeHint' method of the QTabBar with this to see what would happen:</div>
<div class="x_x_elementToProof" style="margin-left:40px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_x_elementToProof" style="margin-left:40px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
def sizeHint(self):<br>
            return super().sizeHint()*2</div>
<div class="x_x_elementToProof" style="margin-left:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div class="x_x_elementToProof" style="margin-left:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
but that only changes the initial tabs to this:</div>
<div class="x_x_elementToProof" style="margin-left:0px; font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<img size="6562" style="max-width:1062px" data-outlook-trace="F:3|T:3" src="cid:261f3337-aab2-47f4-81cc-5debaa2696f9"></div>
<div id="x_x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Matic Kukovec <kukovecmatic@hotmail.com><br>
<b>Sent:</b> Saturday, April 27, 2024 6:50 PM<br>
<b>To:</b> Charles <peacech@gmail.com><br>
<b>Cc:</b> PyQt@riverbankcomputing.com <pyqt@riverbankcomputing.com><br>
<b>Subject:</b> Re: QTabWidget rendering issue?</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div class="x_x_x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Ok, thanks, will do some testing into that direction.</div>
<div id="x_x_x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_x_x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Charles <peacech@gmail.com><br>
<b>Sent:</b> Saturday, April 27, 2024 6:34 PM<br>
<b>To:</b> Matic Kukovec <kukovecmatic@hotmail.com><br>
<b>Cc:</b> PyQt@riverbankcomputing.com <pyqt@riverbankcomputing.com><br>
<b>Subject:</b> Re: QTabWidget rendering issue?</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="x_x_x_x_gmail_default" style="font-family:arial,helvetica,sans-serif; font-size:small">
Maybe QTabWidget does not compute the sizeHint based on the custom font size?<br>
</div>
</div>
<br>
<div class="x_x_x_x_gmail_quote">
<div dir="ltr" class="x_x_x_x_gmail_attr">On Sat, Apr 27, 2024 at 11:12 PM Matic Kukovec <<a href="mailto:kukovecmatic@hotmail.com">kukovecmatic@hotmail.com</a>> wrote:<br>
</div>
<blockquote class="x_x_x_x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px solid rgb(204,204,204); padding-left:1ex">
<div class="x_x_x_x_msg-4961569117981197639">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
This happens even without any styling changes, seen here:</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<img size="34769" style="max-width:1062px" data-outlook-trace="F:4|T:4" src="cid:ii_18f2067d08bcb971f162"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Note that this is a plain vanilla QTabBar, no sub-classing.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Regards,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Matic</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div id="x_x_x_x_m_-4961569117981197639appendonsend"></div>
<hr style="display:inline-block; width:98%">
<div id="x_x_x_x_m_-4961569117981197639divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Matic Kukovec <<a href="mailto:kukovecmatic@hotmail.com" target="_blank">kukovecmatic@hotmail.com</a>><br>
<b>Sent:</b> Saturday, April 27, 2024 12:59 PM<br>
<b>To:</b> <a href="mailto:PyQt@riverbankcomputing.com" target="_blank">PyQt@riverbankcomputing.com</a> <<a href="mailto:pyqt@riverbankcomputing.com" target="_blank">pyqt@riverbankcomputing.com</a>><br>
<b>Subject:</b> QTabWidget rendering issue?</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hi guys,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Specs:</div>
<ul>
<li style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Windows 10 x64</div>
</li><li style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Python 3.12</div>
</li><li style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
PyQt 6.6.1</div>
</li></ul>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
I have a QTabWidget inside a layout and when initial layout is built not all of tabs are rendered.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
The selected tab is rendered as the first tab, but when I select a different tab, all the tabs render correctly,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
here is an example:</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<img size="38763" style="max-width:1072px" data-outlook-trace="F:4|T:4" src="cid:ii_18f2067d089cb971f161"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
As you can see, when the initial layout is rendered the 'systick.c' tab is shown as the first, but in reality</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
the 'main.c' tab should be first, but it only appears after I click any non-current tab.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Any idea of where the problem is?</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Regards,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Matic</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</body>
</html>