Re: QTabWidget tabBar refresh?

Matic Kukovec <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <VI1PR01MB5344F28D59F69882D3324532D7310@VI1PR01MB5344.eurprd01.prod.exchangelabs.com>
Il giorno mar 7 mag 2019 alle ore 20:11 Matic Kukovec <[email protected]<mailto:[email protected]>> 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

Thanks Mauricio, works like a charm!

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.