Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. What does "of" when used with QOverload do?
QtWS25 Last Chance

What does "of" when used with QOverload do?

Scheduled Pinned Locked Moved Unsolved C++ Gurus
qoverloadqofqtimer
3 Posts 3 Posters 989 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.
  • A Offline
    A Offline
    ActivateTheDroids
    wrote on last edited by
    #1

    Hi all,

    I just setup my first QTimer successfully, but I was left with a question when i used this line of code:
    connect(timer, &QTimer::timeout, this, QOverload<>::of(&NfcId::getIdFromSerial));

    What exactly does the QOverload<>::of section of this do? I'm overloading something but its not very clear from Qt's usage guide, and why is of there?

    thanks in advance.

    eyllanescE JKSHJ 2 Replies Last reply
    0
    • A ActivateTheDroids

      Hi all,

      I just setup my first QTimer successfully, but I was left with a question when i used this line of code:
      connect(timer, &QTimer::timeout, this, QOverload<>::of(&NfcId::getIdFromSerial));

      What exactly does the QOverload<>::of section of this do? I'm overloading something but its not very clear from Qt's usage guide, and why is of there?

      thanks in advance.

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on last edited by
      #2

      @ActivateTheDroids See the source code: https://github.com/qt/qtbase/blob/5.15.2/src/corelib/global/qglobal.h#L1246

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      1 Reply Last reply
      0
      • A ActivateTheDroids

        Hi all,

        I just setup my first QTimer successfully, but I was left with a question when i used this line of code:
        connect(timer, &QTimer::timeout, this, QOverload<>::of(&NfcId::getIdFromSerial));

        What exactly does the QOverload<>::of section of this do? I'm overloading something but its not very clear from Qt's usage guide, and why is of there?

        thanks in advance.

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

        @ActivateTheDroids said in What does "of" when used with QOverload do?:

        why is of there?

        Because of limitations in C++11.

        If you have C++14 support, then you don't need of: https://doc.qt.io/qt-5/signalsandslots-syntaxes.html#selecting-overloaded-signals-and-slots

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

        1 Reply Last reply
        4

        • Login

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