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. Use 'QtConcurrent::run()' with a static member function
Forum Updated to NodeBB v4.3 + New Features

Use 'QtConcurrent::run()' with a static member function

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 4.4k Views 1 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.
  • I Offline
    I Offline
    isaacEnrique
    wrote on last edited by
    #1

    Greetings.

    I want to use 'QtConcurrent::run()' with a static member function of a class that I developed, but it generates a compiler error.

    I read the documentation of this function and review of <QtConcurrentRun>. This explains how to use 'QtConcurrent::run()' with a class member function (and that is how I trying to use it), but do not know if the fact that it is a static member function can affect.

    Thanks in advance for any answers and/or suggestions

    Isaac Pérez
    Programming is understanding.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      A static member function behaves basically like a non-member function (except that you prepend the class scope of course).
      @
      void someNonMemberFunction() {}

      class SomeClass
      {
      public:
      static void someStaticMemberFunction() {}
      };

      QtConcurrent::run(someNonMemberFunction);
      QtConcurrent::run(SomeClass::someStaticMemberFunction);
      @

      1 Reply Last reply
      1

      • Login

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