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. Create a custom component with QML and use it in a c++ project
QtWS25 Last Chance

Create a custom component with QML and use it in a c++ project

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
can busgauge qmlc++ qtproject
3 Posts 2 Posters 1.8k 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.
  • T Offline
    T Offline
    TMJJ
    wrote on last edited by
    #1

    Hi all,

    I will shortly explain my project:
    At the moment I have build an application which reads values from a CAN-bus of an home made electric car. So for example I want visualize the RPM of the motor. For this I made a simple QLCDnumber (which look really boring to be honest ;) ) .

    Now when I search the Internet I find a lot of nice gauges written in QML.
    I would like to make one my self, but first I want to know how to implement those QML's into my c++ project. I can't seem to find a correct way to do this. Or if it is even possible.
    Is this the correct way I want to do this kind of things? Or should I use a different approach?

    I hope somebody can push me into the correct way (or even give me an example or tutorial).

    Kind regards,
    Toon Mertens

    C 1 Reply Last reply
    0
    • T TMJJ

      Hi all,

      I will shortly explain my project:
      At the moment I have build an application which reads values from a CAN-bus of an home made electric car. So for example I want visualize the RPM of the motor. For this I made a simple QLCDnumber (which look really boring to be honest ;) ) .

      Now when I search the Internet I find a lot of nice gauges written in QML.
      I would like to make one my self, but first I want to know how to implement those QML's into my c++ project. I can't seem to find a correct way to do this. Or if it is even possible.
      Is this the correct way I want to do this kind of things? Or should I use a different approach?

      I hope somebody can push me into the correct way (or even give me an example or tutorial).

      Kind regards,
      Toon Mertens

      C Offline
      C Offline
      c64zottel
      wrote on last edited by
      #2

      @TMJJ You can start here: http://doc.qt.io/qt-5/qtqml-cppintegration-topic.html

      There are millions of source. Just google or take a look at qt-creators' example list.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TMJJ
        wrote on last edited by
        #3

        Hi,

        Thanks for the quick answer. Now I understand I didn't asked my question correctly.
        I know it is possible to do this, but I actually want to combine a qml into my .ui widget.
        I finally found a tutorial for this (https://www.ics.com/blog/combining-qt-widgets-and-qml-qwidgetcreatewindowcontainer). It says it is only possible to do this from qt 5.0. For my embedded system I'm working with 4.7. So this isn't possible for me.

        Kind regards

        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