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. Using namespace in QML
Forum Update on Monday, May 27th 2025

Using namespace in QML

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 914 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.
  • P Offline
    P Offline
    Praveen kk
    wrote on 22 Mar 2016, 06:10 last edited by
    #1

    Hi all, Anybody know how to do this ?

    I have a class which is derived from QQuickPaintedItem, which i used in my QML side for my custom drawing. Say MyGraphicScene.
    and i have another class say BaseShape which is derived from QObject, and have a 'has a' relation ship with my MyGraphicScene class.
    I my case all these class are under the namesapce called MyyApp::MyGraphicApp

    namespace MyyApp
    {
    namesapce MyGraphicApp
    {
    class MyGraphicScene: public QQuickPaintedItem
    {......
    BaseShape* pShape;
    };
    }
    }

    so when i compile this, its fine, but during runtime, my plugin library could not be loaded beacuse of the undefined symbol error, when i remove the name space, everything works fine...
    Can anybody tell me why namespace is not recognize in QML, any solution please, I should go with name space anyway,

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VRonin
      wrote on 22 Mar 2016, 14:15 last edited by
      #2

      How do you register the type in QML?

      "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
      ~Napoleon Bonaparte

      On a crusade to banish setIndexWidget() from the holy land of Qt

      P 1 Reply Last reply 28 Mar 2016, 05:15
      0
      • V VRonin
        22 Mar 2016, 14:15

        How do you register the type in QML?

        P Offline
        P Offline
        Praveen kk
        wrote on 28 Mar 2016, 05:15 last edited by
        #3

        @Praveen-kk said:

        BaseShape

        I have registerd both BaseShape and MyGraphicScene class using qmlRegisterType<>()
        Only problem when using the name space.

        1 Reply Last reply
        0

        1/3

        22 Mar 2016, 06:10

        • Login

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