Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import QtQuick 2.1
- import QtQuick.Controls 1.0
- import QtQuick.Dialogs 1.0
- import QtQuick.Layouts 1.0
- import Test 1.0
- ApplicationWindow{
- id: root
- title: "Color Correction"
- color: syspal.window
- width: 1450
- height: 750
- minimumHeight: 750
- minimumWidth: 1400
- SystemPalette {id: syspal}
- //with Loader, this version would crash
- Component{
- id: compProgressTest
- ProgressConnection{
- }
- }
- Loader{
- id: loader
- sourceComponent: null
- onStatusChanged: {
- if(loader.status == Loader.Ready){
- console.log("Ready")
- }
- }
- }
- Row{
- anchors.fill: parent
- Button{
- text: "reload"
- onClicked: {
- loader.sourceComponent = null
- loader.sourceComponent = compProgressTest
- }
- }
- Button{
- text: "run"
- onClicked: {
- if(loader.status == Loader.Ready){
- loader.item.addProgressValue()
- }
- }
- }
- ProgressBar{
- id: progressBar
- maximumValue: loader.status == Loader.Ready ? loader.item.progressMaximum : 1
- value: loader.status == Loader.Ready ? loader.item.progressValue : 0
- onValueChanged: {
- console.log("progress bar value = " + progressBar.value)
- }
- }
- } //*/
- /*
- //without Loader, this version wouldn't crash
- ProgressConnection{
- id: progressConnection
- }
- Row{
- anchors.fill: parent
- Button{
- text: "run"
- onClicked: {
- progressConnection.addProgressValue()
- }
- }
- ProgressBar{
- id: progressBar
- maximumValue: progressConnection.progressMaximum
- value: progressConnection.progressValue
- onValueChanged: {
- console.log("progress bar value = " + progressBar.value)
- }
- }
- }//*/
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement