Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Solved connect() new style syntax return result

    General and Desktop
    7
    23
    610
    Loading More Posts
    • 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.
    • SGaist
      SGaist Lifetime Qt Champion last edited by

      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

      JKSH 1 Reply Last reply Reply Quote 1
      • S
        SimonSchroeder @JonB last edited by

        @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 Reply Quote 0
        • JKSH
          JKSH Moderators @SGaist last edited by JKSH

          @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 Reply Quote 2
          • First post
            Last post