[PyQt] QTabWidget tabBar refresh?

Maurizio Berti maurizio.berti at gmail.com
Tue May 7 20:15:13 BST 2019


Il giorno mar 7 mag 2019 alle ore 20:11 Matic Kukovec <
kukovecmatic at hotmail.com> ha scritto:

> Sure, here is my working example, as it is a bit more code.
>
> Thanks again
>

I just had a quick look at your code, and it seems like the only issue is
in the Type argument of the QMouseEvent you create at line 113: as the doc
reports, "The type parameter must be one of QEvent::MouseButtonPress,
QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick, or
QEvent::MouseMove"; so, using PolishRequest is wrong: the QTabBar wouldn't
recognize it and then wouldn't react to it in the right way.
After changing it to MouseMove, it works as expected. The only thing you
might need after this is to add a tabBar.update() after the drag.exec_(),
but it might be even better to do an unpolish/polish of the style:

        self.style().unpolish(tabBar)
        self.style().polish(tabBar)

Hope this helps.

Maurizio

-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20190507/b07ba8c0/attachment.html>


More information about the PyQt mailing list