[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: use QQuickRenderControl
From: Jimmy Girardet <ijkl () netc ! fr>
Date: 2021-01-06 15:17:30
Message-ID: c173aeb6-6434-adc5-939b-7cf27479d9b6 () netc ! fr
[Download RAW message or body]
ok, thanks for your answer.
I'll look in another way then.
Le 06/01/2021 à 15:37, Phil Thompson a écrit :
> On 06/01/2021 13:42, Jimmy Girardet wrote:
>> I can't C++ so I try to guess. There are python example for almost
>> everything so until nowI didn't have this problem. I also looked into
>> the opengl examples
>> (https://github.com/PyQt5/Examples/tree/master/PyQt5/opengl) but it
>> doesn't use QQuickRenderControl.
>>
>> I tried with to follow more the c++ example:
>>
>> class RenderControl(QQuickRenderControl):
>> def __init__(self, w: QWindow):
>> super().__init__()
>> self.m_window = w
>> def renderWindow(self, offset: QPoint = None):
>> if (offset):
>> offset = QPoint(0, 0)
>> return self.m_window
>>
>> and later :
>>
>> self.m_renderControl = RenderControl(self)
>> self.m_quickWindow = QQuickWindow(self.m_renderControl)
>>
>> but still get :
>>
>> File "main.py", line 58, in __init__
>> self.m_quickWindow = QQuickWindow(self.m_renderControl)
>> TypeError: QQuickWindow(parent: QWindow = None): argument 1 has
>> unexpected type 'RenderControl'
>>
>>
>> I really don't know what I could change
>
> My apologies - it was me who was misreading the C++ code!
>
> The C++ code is calling a ctor that is documented in the Qt source
> code as "internal", ie. it is not part of the public API. Therefore it
> isn't exposed by PyQt.
>
> Phil
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic