Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Send a value to output frame like Condole.log() or other with Qhick

Send a value to output frame like Condole.log() or other with Qhick

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
4 Posts 2 Posters 874 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alama
    wrote on last edited by
    #1

    Hello everyone, I'm trying to learn QtQhick, it's happening +/- well, but I would like to know how can I send a value to the application output at the bottom, like Console.log () or Cout , Trace () ..
    Thank in advance :)

    ODБOïO 1 Reply Last reply
    0
    • A Alama

      Hello everyone, I'm trying to learn QtQhick, it's happening +/- well, but I would like to know how can I send a value to the application output at the bottom, like Console.log () or Cout , Trace () ..
      Thank in advance :)

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by ODБOï
      #2

      @Alama hi

      Window {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
      Component.onCompleted : console.log("Hello World ! ")
      }
      

      see here also : https://doc.qt.io/qt-5/qtquick-debugging.html

      a nice book http://qmlbook.github.io/#

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Alama
        wrote on last edited by Alama
        #3

        Hi @LeLev , thank for speedy reply, but it'seem dont work for me, i try this

        color: "lightpink"
        console.log (color)
        

        Just to out values for tests when i problem

        My output frame say: Cannot assign to non-existent property "console"
        Same with c in upper case.. :)
        Im in créator 4.10.1 and my kit is Qt 5.12.5 MSCV 2012 64bit

        Sorry for my English..

        ODБOïO 1 Reply Last reply
        0
        • A Alama

          Hi @LeLev , thank for speedy reply, but it'seem dont work for me, i try this

          color: "lightpink"
          console.log (color)
          

          Just to out values for tests when i problem

          My output frame say: Cannot assign to non-existent property "console"
          Same with c in upper case.. :)
          Im in créator 4.10.1 and my kit is Qt 5.12.5 MSCV 2012 64bit

          Sorry for my English..

          ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by ODБOï
          #4

          @Alama

          console.log (color) this is javascript code, you cant write it just anywhere in the QML document ,
          see here https://doc.qt.io/qt-5/qtqml-javascript-expressions.html

          function getY(){ // define js function
           return 10;
          }
          
          SomeType{
            // console.log()  cant write js code here directly 
            // you 'only' can 'write' the properties names of the SomeType   ex : x, y, height, width, ..... 
            x :  5 // here i assign 5 to x property
            y : getY() // call js function
           width : {return  5*5} // inline js  
          }
          
          //for your example try 
          color: "lightpink"
          Component.onCompleted: console.log("defaut color is : " + color)
          onColorChanged : console.log("color changed to: " + color)
          
          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved