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. How to use it ? can any body give simple example for it ?
Qt 6.11 is out! See what's new in the release blog

How to use it ? can any body give simple example for it ?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 353 Views 1 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.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by Qt embedded developer
    #1

    Re: what is benefits of using qmlRegisterSingletonType ?

    I want to understand below things :

    1. qmlRegisterSingletonType
    2. qmlRegisterUncreatableType
    3. qmlRegisterType

    I want to learn how to use it ? can anybody provide simple application for it ?

    S 1 Reply Last reply
    0
    • Q Qt embedded developer

      Re: what is benefits of using qmlRegisterSingletonType ?

      I want to understand below things :

      1. qmlRegisterSingletonType
      2. qmlRegisterUncreatableType
      3. qmlRegisterType

      I want to learn how to use it ? can anybody provide simple application for it ?

      S Offline
      S Offline
      Sajjad Ali
      wrote on last edited by
      #2

      @Qt-embedded-developer Hello,

      Warning: I have 2 weeks experience in Qt stuff.

      What's the benefit?
      It is helpful to expose your C++ objects to QML. For example, you made a class in C++ that holds and do stuff on Student Data. Now you want to display this data. You will create an object. Then QML, which is UI stuff don't know about this object. So, to make it aware of this object you will use these things. Once your object is there you can use it to display data of student.

      Some readings: (Examples+Syntax)

      • For qmlRegisterSingletonType please read https://doc.qt.io/qt-6/qqmlengine.html#qmlRegisterSingletonType
      • For qmlRegisterUncreatableType please read https://doc.qt.io/qt-6/qqmlengine.html#qmlRegisterUncreatableType
      • For qmlRegisterType please read https://doc.qt.io/qt-6/qqmlengine.html#qmlRegisterType

      I hope it helps :)

      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