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. How to call QTimer::single shot from a static functiom
Forum Update on Monday, May 27th 2025

How to call QTimer::single shot from a static functiom

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 628 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on 13 Sept 2018, 23:31 last edited by
    #1

    How to call QTimer::single shot from a static functiom

    J 1 Reply Last reply 14 Sept 2018, 00:29
    0
    • Q Qt Enthusiast
      13 Sept 2018, 23:31

      How to call QTimer::single shot from a static functiom

      J Offline
      J Offline
      JKSH
      Moderators
      wrote on 14 Sept 2018, 00:29 last edited by
      #2

      @Qt-Enthusiast said in How to call QTimer::single shot from a static functiom:

      How to call QTimer::single shot from a static functiom

      The same way you call any other function from a static function.

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

      1 Reply Last reply
      2
      • Q Offline
        Q Offline
        Qt Enthusiast
        wrote on 14 Sept 2018, 04:41 last edited by
        #3

        can some one please code

        J 1 Reply Last reply 14 Sept 2018, 05:35
        0
        • Q Qt Enthusiast
          14 Sept 2018, 04:41

          can some one please code

          J Offline
          J Offline
          JKSH
          Moderators
          wrote on 14 Sept 2018, 05:35 last edited by
          #4

          @Qt-Enthusiast said in How to call QTimer::single shot from a static functiom:

          can some one please code

          First, show us how you normally write a static function.

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

          1 Reply Last reply
          7
          • V Offline
            V Offline
            VRonin
            wrote on 14 Sept 2018, 07:15 last edited by VRonin
            #5
            void staticFunction()
            {
            QTimer::singleShot(0,[]()->void{qDebug("Hello World!");});
            }
            

            "La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours"
            ~Napoleon Bonaparte

            On a crusade to banish setIndexWidget() from the holy land of Qt

            1 Reply Last reply
            4

            3/5

            14 Sept 2018, 04:41

            • Login

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