Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QmlRegisterType and how to connect signal and slot to its template type
Forum Updated to NodeBB v4.3 + New Features

QmlRegisterType and how to connect signal and slot to its template type

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 570 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.
  • A Offline
    A Offline
    ahmad98
    wrote on last edited by
    #1

    hi,
    i have a class songitemmodeler inherited from QAbstractListModel that fill's a list view in Qml side,
    i want to create another class and implement another tools for my Music Player and register it with setContextProperty(),because i want to use functionality like playing and pausing media in different pages,and with qmlRegisterType it cannot be done,
    so my question is how can i do this? because i use qmlRegisterType and with this,i do not instantiate my songitemmodeler,

    qmlRegisterType<songitemmodeler>("SongFinder",1,0,"Songfinder");
    

    and when i didn't instantiate a class ,i can't connect any of it's signal or slot to another instance of another class?
    is there anyway to expose my songitemmodeler like a singleton?or anyway to connect its signal and slot to another class in constructor or something?
    thank you.

    raven-worxR 1 Reply Last reply
    0
    • A ahmad98

      hi,
      i have a class songitemmodeler inherited from QAbstractListModel that fill's a list view in Qml side,
      i want to create another class and implement another tools for my Music Player and register it with setContextProperty(),because i want to use functionality like playing and pausing media in different pages,and with qmlRegisterType it cannot be done,
      so my question is how can i do this? because i use qmlRegisterType and with this,i do not instantiate my songitemmodeler,

      qmlRegisterType<songitemmodeler>("SongFinder",1,0,"Songfinder");
      

      and when i didn't instantiate a class ,i can't connect any of it's signal or slot to another instance of another class?
      is there anyway to expose my songitemmodeler like a singleton?or anyway to connect its signal and slot to another class in constructor or something?
      thank you.

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @ahmad98 said in QmlRegisterType and how to connect signal and slot to its template type:

      is there anyway to expose my songitemmodeler like a singleton?

      qmlRegisterSingletonType()?

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1

      • Login

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