Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-13016

Problem when using QtConcurrent::run with members functions.__NEW__Please not close this without clarify it.

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.7.0
    • Core: QtConcurrent
    • None
    • Window 7 64bit with Visual studio 2010.

      Please not close this Issue without clarify it.

      when use something like this, it working:
      QString string2 ="win7,linux";
      QFuture<void> future=QtConcurrent::run(string2,&QString::resize,100);
      ...

      but it could not work with QString::split.

      You can find a analogous example in Qt Assistant with search condition: <QtConcurrentRun> - Asynchronous Run

      and there's a topic about " Additional API Features Using Member Functions "

      and it's same as what i write:

      // call 'QStringList QString::split(const QString &sep, SplitBehavior behavior, Qt::CaseSensitivity cs) const' in a separate thread
      QString string = ...;
      QFuture<QStringList> future = QtConcurrent::run(string, &QString::split, QString(", "), QString::KeepEmptyParts, Qt::CaseSensitive);
      ...
      QStringList result = future.result();

      but this isn't working.

      so why it work with QString::resize not with QString::split

      because QString::split is an overload functions and resize is not?

      and why the Qt Assistant use an not working split as an example?

      Maybe i got something wrong, i'm really looking forward your answer!

      Thanks.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            earthdomain Earth Domain (Inactive)
            stevetom SteveTom
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes