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. connect() new style syntax return result
QtWS25 Last Chance

connect() new style syntax return result

Scheduled Pinned Locked Moved Solved General and Desktop
23 Posts 7 Posters 2.8k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #21

    And IIRC, the "old" system is also what allows for things like QML to work its magic.

    The porting of the example is a good idea. The documentation team would be happy to get some help with that so you are more than welcome to submit patches. I think there are tasks related to that on the bug tracker to help organise.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    JKSHJ 1 Reply Last reply
    1
    • JonBJ JonB

      @J-Hilk
      I asked an intentional question: I know you to be a good citizen, so do you check all your new-style connect()s at runtime? I should like to know....

      S Offline
      S Offline
      SimonSchroeder
      wrote on last edited by
      #22

      @JonB said in connect() new style syntax return result:

      so do you check all your new-style connect()s at runtime?

      I have never written any checks and never seen any checks in any source code. In normal circumstances connects should be well structured and not occur everywhere in your source code. Connects for general QActions (menus, toolbars, etc.) we connect once at startup. When dialogs are constructed, we connect in the constructor (or the functions that creates a small dialog on demand). Rarely don't we have the object we'd like to connect. Then, there would not be any failures in connects when they succeded compiling in the new syntax. We still have a lot of old connects where it compiles even if the signal or slot name is wrong. However, Qt writes it out to the command line and this is where we catch these errors. So, in all our scenarios either the connect always succeeds or always fails. It does not depend on any runtime behaviour. This means, once a connect is known to work, we can forget about it.

      1 Reply Last reply
      0
      • SGaistS SGaist

        And IIRC, the "old" system is also what allows for things like QML to work its magic.

        The porting of the example is a good idea. The documentation team would be happy to get some help with that so you are more than welcome to submit patches. I think there are tasks related to that on the bug tracker to help organise.

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by JKSH
        #23

        @SGaist said in connect() new style syntax return result:

        And IIRC, the "old" system is also what allows for things like QML to work its magic.

        Correct. The old syntax lets us make connections between C++ code and QML code.

        It also supports dynamic meta objects which the new syntax can't support: https://www.qtdeveloperdays.com/sites/default/files/QtDevDays2014US-DIY-moc.pdf (useful for language bindings)

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        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