[PyQt] (no subject)

Baz Walter bazwal at ftml.net
Thu Oct 7 20:12:57 BST 2010


On 07/10/10 19:00, Nate Reid wrote:
>
> Below is a sample program that demonstrates a problem with the updating of a Tab's size when setTabsClosable(false) is dynamically set.
> Run the program as is and add some tabs, and then remove some with either the close box or the 'Remove' button.  When the last tab is shown, you'll see that it remains wide enough to contain the 'X' close button, even though it is not drawn.
>
> Use the 'Toggle Fix" button and add and remove tabs again to see the way the tabs should be redrawn when the 'X' box is removed on the last tab.
>
> I think this is a problem with QT itself. I've tested this running on Qt 4.5.x and 4.6.x
>
> I've tried a QTimer to force an update and that doesn't seem to work in either Python or C++
>
> Has this been fixed in a newer version of Qt, e.g. 4.7.x?

doesn't appear to be. also, your fixTabs method didn't work either.

this does work in qt 4.7, though:

     def fixTabs(self):
         tabBar = self.tw.tabBar()
         position = tabBar.style().styleHint(
             QtGui.QStyle.SH_TabBar_CloseButtonPosition, None, tabBar)
         tabBar.setTabButton(0, position, None)


More information about the PyQt mailing list