Advertisement
Guest User

timer_test_main.qml

a guest
Dec 28th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.34 KB | None | 0 0
  1. import QtQuick 2.2
  2. import QtQuick.Controls 1.1
  3. import "UpdateObject.js" as OutFunc
  4.  
  5. ApplicationWindow {
  6.     id: main_window
  7.     visible: true
  8.     width: 640
  9.     height: 480
  10.     title: qsTr("Hello World")
  11.  
  12.     Rectangle {
  13.         id: main_rect
  14.         objectName: "main_rect"
  15.         anchors.fill: parent
  16.  
  17.         Rectangle {
  18.             id: r1
  19.             anchors.centerIn: parent
  20.  
  21.             Text {
  22.                 id: main_text
  23.                 objectName: "main_text"
  24.                 text: qsTr("Hello World")
  25.                
  26.             }
  27.  
  28.         }
  29.  
  30.         Rectangle {
  31.             id: r2
  32.             anchors.top: r1.bottom
  33.             anchors.topMargin: 5
  34.             ListView {
  35.                 id: main_list
  36.                 objectName: "main_list"
  37.                 delegate: Text {
  38.                     text: "blabla"
  39.                 }
  40.                 //model:3
  41.             }
  42.  
  43.         }
  44.  
  45.         Timer {
  46.             id: position_tracker
  47.             interval: 300
  48.             running: true
  49.             repeat: true
  50.             onTriggered: {
  51.  
  52.                 if (OutFunc.getComponentByName(main_rect,"main_text") != null) {
  53.  
  54.                 } else {
  55.                     console.log("1 main_text = null!");
  56.                 }
  57.  
  58.                     if (OutFunc.getComponentByName(main_rect,"main_text") != null) {
  59.  
  60.                 } else {
  61.                     console.log("2 main_text = null!");
  62.                 }
  63.  
  64.                 if (OutFunc.getComponentByName(main_rect,"main_list") != null) {
  65.  
  66.                 } else {
  67.                     console.log("1 main_list = null!");
  68.                 }
  69.  
  70.                 if (OutFunc.getComponentByName(main_rect,"main_list") != null) {
  71.  
  72.                 } else {
  73.                     console.log("2 main_list = null!");
  74.                 }
  75.             }
  76.         }
  77.  
  78.     }
  79.  
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement