Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12291

QML - How to append an action to a signal handler?

$
0
0

I have created a custom timer providing a pause function and elapsed time property. When triggered, elapsedTime is incremented by the 'interval' property amount. I already tested it and it works fine.

// CustomTimer.qmlimport QtQuick 2.0Timer {    property double elapsedTimeSec: 0.0    interval: 100    repeat: true    onTriggered: elapsedTimeSec += interval/1000}

I added it into an existing project as an separate QML file. Now I wish to append action to my onTriggered signal-handler to interact and toggle things in my main application. A little code for example:

Rectangle {    Slider {         id: slider        value: 0.2    }    CustomTimer {        onTriggered: slider.value += 0.1        }}

How can I do that without deleting already-existing, internal onTriggered handler (since those are necessary to the timer process)?


Viewing all articles
Browse latest Browse all 12291

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>