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

QCustom3DVolume crashing when creating or setting texture data

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.15.4, 6.1
    • 5.13.0
    • PySide
    • None
    • Python 3.7 (Windows), 3.8 (Linux)
    • Linux/X11, Windows
    • a6dfbb2a72235ecabc7b1d61c085a7d7de3df8d0 (pyside/pyside-setup/dev) fb66cf246ee77a5a3392714f7d4499e8bc445a49 (pyside/pyside-setup/6.1) 967be4ead8781da67b71b177d124764de5fd0aa3 (pyside/tqtc-pyside-setup/5.15)

    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. pyside1362_repro.diff
          0.7 kB
        3. pyside1362_settexture_crash.txt
          119 kB
        4. qt_logo.png
          qt_logo.png
          6 kB

        Issue Links

          For Gerrit Dashboard: PYSIDE-1362
          # Subject Branch Project Status CR V

          Activity

            People

              kleint Friedemann Kleint
              ralv Bruce Leewees
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes