Название: QtConcurrent::run, непонятки Отправлено: Sancho_s_rancho от Сентябрь 09, 2008, 13:55 Хочу считать файл в другом потоке, используя QImageReader
Код: QImageReader imgReader; Цитировать ../Qt/4.4.1/include/QtGui/../../src/gui/image/qimagereader.h: In constructor `QtConcurrent::StoredMemberFunctionCall0<T, Class>::StoredMemberFunctionCall0(T (Class::*)(), const Class&) [with T = QImage, Class = QImageReader]': Что я делаю не так?../Qt/4.4.1/include/QtCore/../../src/corelib/concurrent/qtconcurrentrun.h:169: instantiated from `QFuture<T> QtConcurrent::run(const Class&, T (Class::*)()) [with T = QImage, Class = QImageReader]' image.cpp:53: instantiated from here ../Qt/4.4.1/include/QtGui/../../src/gui/image/qimagereader.h:133: error: `QImageReader::QImageReader(const QImageReader&)' is private ../Qt/4.4.1/include/QtCore/../../src/corelib/concurrent/qtconcurrentstoredfunctioncall.h:120: error: within this context mingw32-make[1]: *** [debug/image.o] Error 1 Название: Re: QtConcurrent::run, непонятки Отправлено: Sancho_s_rancho от Сентябрь 11, 2008, 09:17 Видимо такая бяка происходит при вызове из конструктора.
Название: Re: QtConcurrent::run, непонятки Отправлено: denka от Сентябрь 11, 2008, 09:52 Видимо такая бяка происходит при вызове из конструктора. Видимо читать асистент внимательно надо ;). Цитировать QFuture<T> QtConcurrent::run ( Function function, ... ) Runs function in a separate thread. The thread is taken from the global QThreadPool. Note that the function may not run immediately; the function will only be run when a thread is available. T is the same type as the return value of function. Non-void return values can be accessed via the QFuture::result() function. Note that the QFuture returned by QtConcurrent::run() does not support canceling, pausing, or progress reporting. The QFuture returned can only be used to query for the running/finished status and the return value of the function. Название: Re: QtConcurrent::run, непонятки Отправлено: Sancho_s_rancho от Сентябрь 11, 2008, 12:58 Видимо такая бяка происходит при вызове из конструктора. Видимо читать асистент внимательно надо ;). Цитировать QFuture<T> QtConcurrent::run ( Function function, ... ) Runs function in a separate thread. The thread is taken from the global QThreadPool. Note that the function may not run immediately; the function will only be run when a thread is available. T is the same type as the return value of function. Non-void return values can be accessed via the QFuture::result() function. Note that the QFuture returned by QtConcurrent::run() does not support canceling, pausing, or progress reporting. The QFuture returned can only be used to query for the running/finished status and the return value of the function. |