Advertisement
Guest User

Untitled

a guest
Jul 11th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 2.54 KB | None | 0 0
  1.     import QtQuick 2.1
  2.     import QtQuick.Controls 1.0
  3.     import QtQuick.Dialogs 1.0
  4.     import QtQuick.Layouts 1.0
  5.      
  6.     import Test 1.0
  7.      
  8.     ApplicationWindow{
  9.         id: root
  10.      
  11.         title: "Color Correction"
  12.      
  13.         color: syspal.window
  14.         width: 1450
  15.         height: 750
  16.         minimumHeight: 750
  17.         minimumWidth: 1400
  18.      
  19.         SystemPalette {id: syspal}
  20.      
  21.         //with Loader, this version would crash
  22.         Component{
  23.             id: compProgressTest
  24.      
  25.             ProgressConnection{
  26.      
  27.             }
  28.         }
  29.      
  30.         Loader{
  31.             id: loader
  32.      
  33.             sourceComponent: null
  34.      
  35.             onStatusChanged: {
  36.                 if(loader.status == Loader.Ready){
  37.                     console.log("Ready")
  38.                 }
  39.             }
  40.         }
  41.      
  42.         Row{
  43.             anchors.fill: parent
  44.      
  45.             Button{
  46.                 text: "reload"
  47.                 onClicked: {
  48.                     loader.sourceComponent = null
  49.                     loader.sourceComponent = compProgressTest
  50.                 }
  51.             }
  52.      
  53.             Button{
  54.                 text: "run"
  55.                 onClicked: {
  56.                     if(loader.status == Loader.Ready){
  57.                         loader.item.addProgressValue()
  58.                     }
  59.                 }
  60.             }
  61.      
  62.             ProgressBar{
  63.                 id: progressBar
  64.      
  65.                 maximumValue: loader.status == Loader.Ready ? loader.item.progressMaximum : 1
  66.                 value: loader.status == Loader.Ready ? loader.item.progressValue : 0
  67.      
  68.                 onValueChanged: {
  69.                     console.log("progress bar value = " + progressBar.value)
  70.                 }
  71.             }
  72.         } //*/
  73.      
  74.         /*
  75.         //without Loader, this version wouldn't crash
  76.         ProgressConnection{
  77.             id: progressConnection
  78.         }
  79.      
  80.         Row{
  81.             anchors.fill: parent
  82.      
  83.             Button{
  84.                 text: "run"
  85.                 onClicked: {
  86.                     progressConnection.addProgressValue()
  87.                 }
  88.             }
  89.      
  90.             ProgressBar{
  91.                 id: progressBar
  92.      
  93.                 maximumValue: progressConnection.progressMaximum
  94.                 value: progressConnection.progressValue
  95.      
  96.                 onValueChanged: {
  97.                     console.log("progress bar value = " + progressBar.value)
  98.                 }
  99.             }
  100.         }//*/
  101.      
  102.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement