Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Arduino analog input to QT Gauge.
Forum Updated to NodeBB v4.3 + New Features

Arduino analog input to QT Gauge.

Scheduled Pinned Locked Moved Unsolved General and Desktop
25 Posts 2 Posters 10.5k Views 2 Watching
  • 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #21

    What's that newValue ?

    You seem to be trying to use a SerialPort object but you are currently accessing it's class (or Type in QML).

    You either need to create a SerialPort object in QML or give an instance from it to the engine.

    Did you already read the QML CPP integration chapter of Qt's documentation ?

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    0
    • S Offline
      S Offline
      StevieGardiner
      wrote on last edited by
      #22

      I tried to create an object by doing;

      import QtQuick 2.5
      import QtQuick.Window 2.2
      import QtQuick.Extras 1.4
      import QtQuick.Controls 2.0
      import SerialPortlib 1.0
      
      Window {
          visible: true
          width: 640
          height: 480
          id: gauge
      
          SerialPort{
              OnOil_pressure_volt_Changed:(console.log(newValue));
          }
      }
      
      
      

      with no joy, is this what your referring too?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #23

        Your QML slot name is wrong.

        AFAIK it should be onOil_pressure_volt_changed Note that Qt's naming style is camelCase, that might help you match your code with the documentation.

        You should maybe take a look at http://qmlbook.org

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • S Offline
          S Offline
          StevieGardiner
          wrote on last edited by
          #24

          Ahh thank you, that was an interesting read, ive achieved what I wanted.

          1 Reply Last reply
          1
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #25

            Great !

            In that case, please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            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