<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">  File "C:\projects\gui\newfiletree.py", line 235, in __create_item</div>
<div>    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>