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

List:       pykde
Subject:    Re: PyQt6 QTreeWidget itemDelegate error?
From:       Matic Kukovec <kukovecmatic () hotmail ! com>
Date:       2022-06-17 22:23:05
Message-ID: VE1PR09MB3280CF4F2B294C9E7013EF5CD7AF9 () VE1PR09MB3280 ! eurprd09 ! prod ! outlook ! com
[Download RAW message or body]

Hi,

Specs: Windows 10 x64, PyQt6.3.1.dev2206051323, Python3.9

I'm getting an error in a QTreeWidget when trying to access a delegate
through self.itemDelegate(index), the error is:

Traceback (most recent call last):
  File "C:\projects\gui\newfiletree.py", line 235, in __create_item
    delegate =3D self.itemDelegate(new_index)
TypeError: itemDelegate(self): too many arguments

This code works in PyQt5 (5.15.4), but not in PyQt6 (6.3.1.dev2206051323).

Am I doing something wrong or is this perhaps a bug?

Thanks,
Matic
Sorry, got it, it's self.itemDelegateForIndex on PyQt6.

Matic

[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">
<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);" \
itemscope="" itemtype="https://schemas.microsoft.com/QuotedText"> <span \
class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">Hi,</span>
 <div class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
<br> </div>
<div class="x_elementToProof" \
                style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
                
Specs: Windows 10 x64, PyQt6.3.1.dev2206051323, Python3.9<br>
</div>
<div class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
<br> </div>
<div class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> I'm \
getting an error in a <i><b>QTreeWidget </b></i>when trying to access a \
delegate</div> <div class="x_elementToProof elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
through <i><b>self.itemDelegate(index)</b></i>, the error is:</div> <div \
class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
<div><br> </div>
<div>Traceback (most recent call last):</div>
<div class="x_elementToProof">&nbsp; File &quot;C:\projects\gui\newfiletree.py&quot;, \
line 235, in __create_item</div> <div>&nbsp; &nbsp; delegate = \
self.itemDelegate(new_index)</div> </div>
<div class="x_elementToProof" \
                style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
                
TypeError: itemDelegate(self): too many arguments</div>
<div class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
<br> </div>
<div class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
This code works in PyQt5 (5.15.4), but not in PyQt6 (6.3.1.dev2206051323).</div> <div \
class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
<br> </div>
<div class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> Am \
I doing something wrong or is this perhaps a bug?</div> <div class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
<br> </div>
<div class="x_elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
Thanks, <br> </div>
<div class="x_elementToProof elementToProof" \
style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)"> \
<span>Matic</span></div> </blockquote>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> Sorry, got it, it's<span class="name"> \
<i><b>self</b></i>.<i><b>itemDelegateForIndex</b></i></span><span style="font-weight: \
normal; font-size: 12pt;"> on PyQt6</span>.<br> </div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> <div><br>
</div>
<div>Matic<br>
</div>
</div>
<div id="appendonsend"></div>
</body>
</html>



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

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