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 29 Jul 2021, 22:49 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.

    E J 2 Replies Last reply 29 Jul 2021, 23:02
    0
    • A ActivateTheDroids
      29 Jul 2021, 22:49

      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.

      E Offline
      E Offline
      eyllanesc
      wrote on 29 Jul 2021, 23:02 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
        29 Jul 2021, 22:49

        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.

        J Offline
        J Offline
        JKSH
        Moderators
        wrote on 30 Jul 2021, 01:51 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

        3/3

        30 Jul 2021, 01:51

        • Login

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