[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: Signature of StandardItemModel.headerData()
From: Stephen Waterbury <waterbug () pangalactic ! us>
Date: 2023-02-06 16:10:53
Message-ID: 848e33f0-ffb0-b418-0a17-ec6c6f928f32 () pangalactic ! us
[Download RAW message or body]
On 2/6/23 4:48 AM, Phil Thompson wrote:
> On 06/02/2023 02:16, Stephen Waterbury wrote:
>> According to the C++ documentation
>>
>> https://doc.qt.io/archives/qt-5.12/qstandarditemmodel.html#headerData
>>
>> ... it takes 2 positional args (section, orientation) and 1 keyword arg
>> (role). If I call it with the 2 positional args, I get a traceback
>> saying
>>
>> TypeError: headerData() missing 1 required positional argument: 'role'
>>
>> Did pyqt define the 'role' arg as positional? And if so, why?
>
> No.
>
> Please provide a short working example that demonstrates the problem.
>
> Phil
Oops. Creating the SSCCE proved that the signature in pyqt is indeed
correct --
my subclass of QStandardItemModel was the culprit -- it redefined headerData
with "role" as a positional arg. Sheesh, sorry for the noise! :/
[Attachment #3 (text/html)]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><font face="Helvetica, Arial, sans-serif">On 2/6/23 4:48 AM, Phil
Thompson wrote:
<blockquote type="cite">On 06/02/2023 02:16, Stephen Waterbury
wrote:
<br>
<blockquote type="cite">According to the C++ documentation
<br>
<br>
<a class="moz-txt-link-freetext" \
href="https://doc.qt.io/archives/qt-5.12/qstandarditemmodel.html#headerData">https://doc.qt.io/archives/qt-5.12/qstandarditemmodel.html#headerData</a>
<br>
<br>
... it takes 2 positional args (section, orientation) and 1
keyword arg
<br>
(role). If I call it with the 2 positional args, I get a
traceback saying
<br>
<br>
TypeError: headerData() missing 1 required positional
argument: 'role'
<br>
<br>
Did pyqt define the 'role' arg as positional? And if so,
why?
<br>
</blockquote>
<br>
No.
<br>
<br>
Please provide a short working example that demonstrates the
problem.
<br>
<br>
Phil
<br>
</blockquote>
</font><font face="Helvetica, Arial, sans-serif">Oops. Creating
the SSCCE proved that the signature in pyqt is indeed correct --<br>
my subclass of QStandardItemModel was the culprit -- it
redefined headerData<br>
with "role" as a positional arg. Sheesh, sorry for the noise!
:/</font></p>
<p><font face="Helvetica, Arial, sans-serif"><br>
</font></p>
</body>
</html>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic