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. Command pattern with QML
Forum Updated to NodeBB v4.3 + New Features

Command pattern with QML

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 3 Posters 1.1k 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.
  • X Offline
    X Offline
    xalam
    wrote on last edited by
    #1

    I want my business logic to be in C++ and front end in QML. I also want do/undo functionality. How can we implement command pattern emanating from QML and disptach to model?

    The problem I see is I don't know if its possible pass back C++ classes between QML and C++ model? Any clues will be deeply appreciated. Thanks.

    1 Reply Last reply
    0
    • shavS Offline
      shavS Offline
      shav
      wrote on last edited by
      #2

      Hi,

      Did you try "QML Plugin":http://doc.qt.io/qt-5/qtqml-modules-cppplugins.html? I think in your case this will be a best way. If you create a QML plugin with logic on C++ you can porting it to another platform.

      If you need to send some datas from QML to C++ you can create a method which you will call from QML. If you need to get datas from C++ you can use method or signal. Please read documentation about QtQuick Plugin for more information.

      Mac OS and iOS Developer

      1 Reply Last reply
      1
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by
        #3

        Did you get a chance to look at how to integrate C++ and QML ? QtAssistant provides good examples for this integration. You will be able to solve your issue.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        2

        • Login

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