0

I have this code:

import QtQuick 2.1
import QtQuick.Controls 1.0

Rectangle {
    width: 640
    height: 600
    id: win
    Image
    {
        id: img
        source: "../../../../../Users/Public/Pictures/Sample Pictures/Hydrangeas.jpg"
        width:300
        height:300
    }
    Canvas
    {
        anchors.bottom: parent.bottom
        width:300
        height:300
        id: cnv
        onPaint: {
            var ctx = cnv.getContext('2d');
            ctx.drawImage(img, 0,0,300,300);

        }
    }
    Button {
        text: 'Do it'
        anchors.centerIn: parent
        onClicked: {
            cnv.requestPaint();
        }
    }
}

drawImage works (though terribly slow) until you request it by requestPaint. Then it just crashes the app. Tested on Windows 7, QT 5.1. Just change Image.source to any available image file.

Andrey Kon
  • 747
  • 2
  • 6
  • 16
  • I think it is a bug. I have crash with Qt 5.2 when image link is broken. Can you create a bug report at http://bugreports.qt-project.org ? (I want to attach my log there: http://pastebin.kde.org/plzv6z2je/yd4bcl/raw ) – Kakadu Nov 05 '13 at 19:01
  • https://bugreports.qt-project.org/browse/QTBUG-34714 – Mitch Nov 19 '13 at 08:37

0 Answers0