Important: Please read the Qt Code of Conduct -

QtCreator - show python or c++ based qml components in visual editor

  • Is that possible to show python-based qml components in visual editor?
    Lets assume I have following component:

    class QmlQImage(QQuickPaintedItem):
        def __init__(self, parent=None):
            self.image_val = QImage()
        def get_image(self):
            return self.image_val
        def set_image(self, val):
            self.image_val = val
        image = Property(int, get_image, set_image)
        def paint(self, painter: PySide2.QtGui.QPainter):
            painter.drawImage(QRect(0, 0, painter.device().height(), painter.device().width()), self.image_val)
    qmlRegisterType(QmlQImage, 'QmlExt', 1, 0, 'QmlQImage')

    and qml file

    import QtQuick 2.0
    import QmlExt 1.0
    QmlQImage {
        width: 256; height: 256

    When trying to edit that qml file I am observing following error:

    Also, is that possible to display c++ based components in QML editor? If yes, can someone provide link how to achieve that?

    Thanks in advance.

Log in to reply