[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] QTabWidget tabBar refresh?
From:       Matic Kukovec <kukovecmatic () hotmail ! com>
Date:       2019-05-07 19:29:06
Message-ID: VI1PR01MB5344F28D59F69882D3324532D7310 () VI1PR01MB5344 ! eurprd01 ! prod ! exchangelabs ! com
[Download RAW message or body]

Il giorno mar 7 mag 2019 alle ore 20:11 Matic Kukovec <kukovecmatic@hotmail=
.com<mailto:kukovecmatic@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 i=
n the Type argument of the QMouseEvent you create at line 113: as the doc r=
eports, "The type parameter must be one of QEvent::MouseButtonPress, QEvent=
::MouseButtonRelease, QEvent::MouseButtonDblClick, or QEvent::MouseMove"; s=
o, 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 mi=
ght 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!

[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);"> <blockquote style="border-color: rgb(200, 200, 200); border-left: 3px \
solid rgb(200, 200, 200); padding-left: 1ex; margin-left: 0.8ex; color: rgb(102, 102, \
102);"> <div>Il giorno mar 7 mag 2019 alle ore 20:11 Matic Kukovec &lt;<a \
href="mailto:kukovecmatic@hotmail.com">kukovecmatic@hotmail.com</a>&gt; ha \
scritto:</div> <div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div>Sure, here is my working example, as it is a bit more code.</div>
<div><br>
</div>
<div>Thanks again</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div>
<div><br>
</div>
<div>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, \
&quot;The type parameter must be one of QEvent::MouseButtonPress, \
QEvent::MouseButtonRelease, QEvent::MouseButtonDblClick,  or QEvent::MouseMove&quot;; \
so, using&nbsp;PolishRequest is wrong: the QTabBar wouldn't recognize it and then \
wouldn't react to it in the right way.<br> 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:</div> <div><br>
</div>
<div>
<div><font face="monospace, monospace">&nbsp; &nbsp; &nbsp; &nbsp; \
self.style().unpolish(tabBar)</font></div> <div><font face="monospace, \
monospace">&nbsp; &nbsp; &nbsp; &nbsp; self.style().polish(tabBar)</font></div> \
</div> <div><br>
</div>
</div>
Hope this helps.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">Maurizio</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr"><br>
</div>
</div>
</div>
</div>
</div>
</div>
Thanks Mauricio, works like a charm!<br>
</div>
</body>
</html>


[Attachment #4 (unknown)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
https://www.riverbankcomputing.com/mailman/listinfo/pyqt


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic