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. [SOLVED] Problem to compile with QtConcurrent with msvc2010 and qt 4.8.2
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Problem to compile with QtConcurrent with msvc2010 and qt 4.8.2

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.9k 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.
  • L Offline
    L Offline
    le-roy_a
    wrote on last edited by
    #1

    Hello,

    maybe somebody have an idea about this problem :

    https://bugreports.qt-project.org/browse/QTBUG-26624

    i have put an exemple to try.

    thanks in advance

    1 Reply Last reply
    0
    • A Offline
      A Offline
      akonradwesolutions
      wrote on last edited by
      #2

      Looks like the compiler cannot correctly deduce the template to instantiate. You should give him a little help:

      @QFuture<QVariant> _f = QtConcurrent::run<QVariant>(this, &MJaoWidgetProperty::__render_function, &pA, &pB, true, true);@

      The template parameter for QFuture must be QVariant in your case. You might have to include <QVariant> as well.

      BTW: Inlining MJaoWidgetProperty::__render_function has no effect. The compiler needs to generate an address for the method to call it at runtime, so inlining it is out of the question.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        le-roy_a
        wrote on last edited by
        #3

        thanks you very much, it works.

        Have you an idea why with g++ i have no problem to compile the exemple ?

        1 Reply Last reply
        0
        • A Offline
          A Offline
          akonradwesolutions
          wrote on last edited by
          #4

          QtConcurrent::run() is a static template method with a whole bunch of overloads (at least around 20 as far as i have seen). If you do not specify any template parameters, the compiler must try to find the correct template types based on the parameters you specified. In this case that is certainly no easy task for the compiler. MSVC is - as it seems - not able to implicitly find the right overload, but g++ can. The g++ implementation simply works better in this case.

          1 Reply Last reply
          0
          • L Offline
            L Offline
            le-roy_a
            wrote on last edited by
            #5

            ok thanks you very much.

            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