Results 1 to 2 of 2

Thread: How to bind Qml with .H and .CPP?

  1. #1
    Join Date
    Jul 2016
    Posts
    53
    Thanks
    13
    Qt products
    Qt4 Qt5
    Platforms
    Windows Android

    Default How to bind Qml with .H and .CPP?

    Dear All,

    I am creating an mobile app using qt5.7/ESRI ArcGIS Runtime SDK for qt 100.0.0.
    Objective of the project: Display the maps in the mobile devices


    Project Flow:
    Login.qml [Authentication successful] -> MapList.Qml [List the product] -> DisplayMap.Qml [Display the Map]

    As a requirement, I had created an Login.qml and authentication done in .qml itself.
    Now I have to list the map, I created 3 files [MapList.qml/MapList.h/MapList.cpp] But, I don't know how to link the MapList.h and MapList.cpp with MapList.qml, Since I have to write the Events/BusinessLogic in MapList.cpp.
    [similar to .net]

    Am I doing the right approach? If it so, How should MapList.qml must be wired with MapList.h/MapList.cpp ?

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to bind Qml with .H and .CPP?

    You register the C++ type defined in MapList.h/cpp with the QML type system and just instantiate it in MapList.qml.

    Or, if you only ever need a single object of the type and it is not a visual item, you create it in C++ and expose it as a context property on the view's root context.

    Cheers,
    _

Similar Threads

  1. udpsocket cannot bind,
    By saman_artorious in forum Qt Programming
    Replies: 7
    Last Post: 27th October 2013, 10:45
  2. bind MFC Library
    By rock1411 in forum Qt Programming
    Replies: 3
    Last Post: 28th October 2012, 18:50
  3. Bind Table Name at run time..
    By chaaruu in forum Newbie
    Replies: 2
    Last Post: 14th February 2012, 00:39
  4. QSqlQuery bind issue
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 14th February 2011, 00:25
  5. QtConcurrent and boost::bind
    By TheShow in forum Qt Programming
    Replies: 1
    Last Post: 2nd December 2009, 15:47

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.