Inherit from QBufferDataGenerator

Maxim Okhotskiy <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <CAJ=iu4tBkX82LnYyHAyi+s0U6VWUw6LYVpjb9JC6DOnmB=KCUg@mail.gmail.com>
Hi, I have a difficulty with inheriting from QBufferDataGenerator:
I use python3 and

PyQt5>=5.12
pyqt3d>=5.12
pyopengl

Here's an example.py

from PyQt5.QtCore import *from PyQt5.Qt3DCore import *from
PyQt5.Qt3DRender import *
class SomeDataGenerator(QBufferDataGenerator):
    def __init__(self, some_bytes):
        super().__init__()
        self._bytes = some_bytes

    def __call__(self):
        return self._bytes

    def __eq__(self, other):
        return (self._bytes == other._bytes)

    def __neq__(self, other):
        return not (self._bytes == other._bytes)

    def id(self):
        return functorTypeId(SomeDataGenerator)


someBytes = QByteArray()
someBuffer = QBuffer(QBuffer.VertexBuffer)
someDataGenerator = SomeDataGenerator(someBytes)
someBuffer.setDataGenerator(someDataGenerator)

Run provides the following result:

$ python3 example.py...TypeError:
PyQt5.Qt3DRender.QBufferDataGenerator cannot be instantiated or
sub-classed

-- 
Best regards,
Maxim Okhotskiy

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.