[Qt-interest] QtConcurrent run issues
Thiago Macieira
thiago at kde.org
Sun Jun 12 23:26:03 CEST 2011
Em Sunday, 12 de June de 2011, às 19:05:10, Cole, Derek escreveu:
> QFuture<void> future = QtConcurrent::run(LoadTilePixmap, this);
>
> This is giving me the following error message:
>
> /home/dcole/IM/work/ext/VC/IMViewer-build-desktop/../IMViewer/imagepixmapite
> m.cpp:106: error: no matching function for call to ‘run(<unresolved
> overloaded function type>, ImagePixmapItem* const)’
>
> I must be doing something wrong – can anyone tell me what it is? Also – I
> have had to include QtConcurrentRun with my code , but according to the
> documentation, I thought this was part of QtConcurrent, and you got it for
> free with QtCore?
The function exists, but you're using the wrong syntax. Note the error
message: it's saying that the first parameter is unresolved. You have to write:
QFuture<void> future = QtConcurrent::run(&ImagePixmapItem::LoadTilePixmap,
this);
Note that this function must be static.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110612/d0538c94/attachment.bin
More information about the Qt-interest-old
mailing list