c++ - Qt : reference to non-static member function must be called -
I am new to Qt, and today I have to code my code from QFuture
To run the tasks.
I have a way that changes the saturation value of QImage
, which gives QPixmap
objects to my QGraphicsView
To pull on It does not work well to use all threads, but obviously it is very intense on the main thread, so I want to move it.
I read some articles about threading in QT, and found that supports V5, it seemed to be perfect for the case of my use, as I thought I had my work down As a snippet I can send it to a new thread:
zero main window :: on_slideSaturation_valueChanged (int value) {QFuture & lt; QPixmap & gt; Future = QtConcurrent :: Run (slider-> Modify edit, value, image); Future.waitForFinished (); Image = future.result (); RenderImageToCanvas (); Modified = true; }
However, I should call the reference to the non-static member function
. This error is calling from my sliders class, I know that I have not declared the method as a static, but when I make it a whole stack of errors - then there is no way that I am using this method Can I pass in my concurrent call without being declared as stable?
slider H
class sliders {public: sliders (); Enum Member {Red, Green, Blue, Brightness, Contrast, Hue, Purple, Lightness}; QPixmap Modify Tritter (Int, QpixSmap); Zero setmember (member, int); Int member (member member); Private: int m_redValue; Int m_greenValue; Int m_blueValue; Int m_brightnessValue; Int m_contrastValue; Int m_hueValue; Int m_saturationValue; Int m_lightnessValue; };
You should call QtConcurrent :: run
this way :
QFuture & lt; QPixmap & gt; Future = QtConcurrent :: Run (Sliders, and Sliders: Modify Compression, Value, Image);
But I think you are using it incorrectly. Your on_slideSaturation_valueChanged
slot, which I believe implements in the main thread, will be blocked until future.waitForFinished ()
returns.
Comments
Post a Comment