Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1362

QCustom3DVolume crashing when creating or setting texture data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 5.13.0
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      Python 3.7 (Windows), 3.8 (Linux)
    • Platform/s:
      Linux/X11, Windows

      Description

      Trying to rewrite below code from C++ to python I went into trouble with PySide2

      https://github.com/qt/qtdatavis3d/tree/dev/tests/manual/qmlvolume

      I've simplified my code to show the problem:

      from PySide2.QtDataVisualization import QtDataVisualization
      from PySide2.QtGui import QImage
      volume = QtDataVisualization.QCustom3DVolume()
      image = QImage("qt_logo.png")  # sample image from qt examples
      data = volume.createTextureData([image])
      

       The image seems to load fine:

      image
      <PySide2.QtGui.QImage(QSize(256,256), format=QImage::Format_ARGB32,depth=32,devicePixelRatio=1,bytesPerLine=1024, sizeInBytes=262144) at 0x000001F79989B948>
      

      However I have problem with texture creation or setting raw data.

      For PySide2<=5.12.3 I'm getting strange data returned. e.g. length:

      len(data) == ~500 # sometimes 499 or 506
      

      and for PySide2>5.12.3 it crashes:

      Process finished with exit code -1073741819 (0xC0000005)
      

      In Visual Studio, I'm getting message box when running similar code in an app:

      Could not convert to integer 3221225477 (Value was either too large or too small for an Int32)
      

      In the documentation I've found following declaration:

      https://doc.qt.io/qtforpython/PySide2/QtDataVisualization/QtDataVisualization.QCustom3DVolume.html#PySide2.QtDataVisualization.PySide2.QtDataVisualization.QtDataVisualization.QCustom3DVolume.createTextureData

      PySide2.QtDataVisualization.QtDataVisualization.QCustom3DVolume.createTextureData(images)
      Parameters
      images - 
      Return type
      QVector
      

      and in C++

      QVector<uchar> *QCustom3DVolume::createTextureData(const QVector<QImage *> &images)
      

      so I guess argument type is fine.

        Attachments

        1. dice.png
          dice.png
          49 kB
        2. qt_logo.png
          qt_logo.png
          6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            crmaurei Cristian Maureira-Fredes
            Reporter:
            ralv Bruce Leewees
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes