Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. QImage to QPixmap Convertion Parameter Error after QT 6.2 Update at Python
Forum Updated to NodeBB v4.3 + New Features

QImage to QPixmap Convertion Parameter Error after QT 6.2 Update at Python

Scheduled Pinned Locked Moved Unsolved Qt for Python
qt for pythonpython
6 Posts 3 Posters 2.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    msaidbilgehan
    wrote on last edited by
    #1

    Python Version: 3.7
    OS: Windows 10
    QT Version: 6.2

    I was using "QPixmap(qt_image)" to convert from QImage to QPixmap at QT5. After getting updates of QT6, I get error as below;

    TypeError: QPixmap(): argument 1 has unexpected type 'QImage'
    

    So changed usage of typecasting as QPixmap.fromImage(qt_image) and now getting this;

    TypeError: fromImage(QImage, flags: Qt.ImageConversionFlag = Qt.AutoColor): argument 1 has unexpected type 'QImage'
    

    There are some reference links that I used to get information about QT6 QPixmap;

    • doc-snapshots.qt.io - QPixmap
    eyllanescE 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Do you have the same issue with fromImageInPlace ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Do you have the same issue with fromImageInPlace ?

        M Offline
        M Offline
        msaidbilgehan
        wrote on last edited by
        #3

        @SGaist

        Hello and thanks, That is right.

        QPixmap.fromImageInPlace(qt_image)
        AttributeError: type object 'QPixmap' has no attribute 'fromImageInPlace'
        

        I also converted all imports from qt6 to qt5 and there is no issue with typecasting using QPixmap(QImage).

        But I should inform you, my QT APIs are PyQT, not PySide.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Would you mind checking with PySide6 ?

          From the looks of it, there's something wrong going on with PyQt.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • M msaidbilgehan

            Python Version: 3.7
            OS: Windows 10
            QT Version: 6.2

            I was using "QPixmap(qt_image)" to convert from QImage to QPixmap at QT5. After getting updates of QT6, I get error as below;

            TypeError: QPixmap(): argument 1 has unexpected type 'QImage'
            

            So changed usage of typecasting as QPixmap.fromImage(qt_image) and now getting this;

            TypeError: fromImage(QImage, flags: Qt.ImageConversionFlag = Qt.AutoColor): argument 1 has unexpected type 'QImage'
            

            There are some reference links that I used to get information about QT6 QPixmap;

            • doc-snapshots.qt.io - QPixmap
            eyllanescE Offline
            eyllanescE Offline
            eyllanesc
            wrote on last edited by
            #5

            @msaidbilgehan I just tested: qimage = QImage("/path/of/filaname") pixmap = QPixmap(qimage) on PySide6 and PyQt6 (the latest versions available) and it works fine. Could you provide a code that allows me to verify the error?

            If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

            M 1 Reply Last reply
            1
            • eyllanescE eyllanesc

              @msaidbilgehan I just tested: qimage = QImage("/path/of/filaname") pixmap = QPixmap(qimage) on PySide6 and PyQt6 (the latest versions available) and it works fine. Could you provide a code that allows me to verify the error?

              M Offline
              M Offline
              msaidbilgehan
              wrote on last edited by msaidbilgehan
              #6

              @eyllanesc I am sorry but right now I can't. Downgraded from 6 to 5. I will wait for the best stable version of QT. Thanks a lot!

              P.S.: I was using fromImage method which is necessary for my app flow. Not type conversion with the class call (such as QImage() )

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved