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. 'signal slot' v/s direct call
Forum Updated to NodeBB v4.3 + New Features

'signal slot' v/s direct call

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 2.4k 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
    aekam
    wrote on last edited by
    #1

    we often do communication between UI [qml] and backend [c++].
    how one can decide, which is better interface method, like to use signal-slots or other direct call methods, like register method.??

    If you take care of inches, you won't have to worry about miles... :)

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      I would suggest trying to write your backend C++ objects with a property-based API (see Q_PROPERTY macro). Then just bind your QML ui element properties to the backend properties as needed.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0
      • M Offline
        M Offline
        miroslav
        wrote on last edited by
        #3

        Both actually have similar overhead, since both are Qt metaobject calls. The best way is probably to develop a benchmark that executes a lot of operations and measure the execution time.

        Mirko Boehm | mirko@kde.org | KDE e.V.
        FSFE Fellow
        Qt Certified Specialist

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Better is the one which suits you more in a given situation.

          With signals, you can connect a slot on both C++ and QML side, with Q_INVOKABLE you are "tied" to C++. Both uses are, IMO, needed (at least I use them...).

          (Z(:^

          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