lundi 20 avril 2015

ScrollView and Canvas in QML

Good day! I'm trying to display multiple charts in different tabs, using Canvas. The scale of the graphs will be somewhat greater than the actual size of the display, so I want to use ScrollView. Have this code in several files:


TabView {
    id: tabView
    Layout.alignment: Qt.AlignCenter
    Layout.fillWidth: true
    Layout.fillHeight: true

    Tab1 {
        id: tab1



Tab {
    active: true

    function init()

    ScrollView {
        property var plot: _plot
        Plot {
            width: 3000
            id: _plot


Canvas {
    function draw()
        console.log("draw go")
        var ctx = getContext("2d")


    onPaint: {

At some point, the function is called init(). The problem is that when using ScrollView signal Paint is not called, without ScrollView everything works well. Errors in the console does not arise. Qt 5.4.1

Aucun commentaire:

Enregistrer un commentaire