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. Question about Qt's signals and slots portability?
Qt 6.11 is out! See what's new in the release blog

Question about Qt's signals and slots portability?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 1.3k Views 3 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.
  • G Offline
    G Offline
    greenhouse
    wrote on last edited by
    #1

    Hi,

    If understood it correctly, signals and slots are implemented with macros.
    Then if I write an app that uses signals and slots and an app that uses just the standard c++.
    They both should be equally portable, right? (emit keyword??)

    Regards,
    Mike.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Your assumption is correct. Code that makes use of Qt's extentions to C++ is first transformed to ordinary C++ code using the MOC (meta object compiler) and then compiled to object code by any standard compliant C++ compiler.

      G 1 Reply Last reply
      1
      • ? A Former User

        Your assumption is correct. Code that makes use of Qt's extentions to C++ is first transformed to ordinary C++ code using the MOC (meta object compiler) and then compiled to object code by any standard compliant C++ compiler.

        G Offline
        G Offline
        greenhouse
        wrote on last edited by
        #3

        @Wieland thanks for clarification!

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on last edited by
          #4

          HI and welcome to devnet,

          just to add something to what @Wieland said; you can also use CONFIG+=no_keywords in your .pro file.

          In that case you have to use Q_SIGNALS, Q_SLOTS, Q_EMIT instead signals, slots, emit; this is useful when you use a 3rdparty source code parser which doesn't understand these special Qt keywords.

          Qt suggests to use these macros when you release a public library.

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          G 1 Reply Last reply
          1
          • M mcosta

            HI and welcome to devnet,

            just to add something to what @Wieland said; you can also use CONFIG+=no_keywords in your .pro file.

            In that case you have to use Q_SIGNALS, Q_SLOTS, Q_EMIT instead signals, slots, emit; this is useful when you use a 3rdparty source code parser which doesn't understand these special Qt keywords.

            Qt suggests to use these macros when you release a public library.

            G Offline
            G Offline
            greenhouse
            wrote on last edited by
            #5

            @mcosta thanks! :)

            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