title: QT QtConcurrent run with overloaded class function
body: <p>I have a class that I use to compress files into different formats. I'm trying to use QtConcurrent to run the compression in the background. With this I have two functions:</p>
  
  <ol>
  <li>Takes file path as a string and compression format</li>
  <li>Takes a vector of file paths and compression format</li>
  </ol>
  
  <p>Issue is I'm getting issues with QtConcurrent not knowing which overloaded function to use. I read <a href="https://stackoverflow.com/questions/40762460/how-to-use-qtconcurrentrun-with-overloaded-function">this stackoverflow</a> which showed using static_cast to explicitly state which method to use. I'm getting stuck with the syntax though since my functions are class functions and not static methods. Can I even use static_cast for this considering these are not static methods?</p>
  
  <p><strong>How I'm calling run:</strong></p>
  
  <pre><code>CompressFile compressor(&amp;m_sysLog); 
  QVector&lt;QString&gt; files;     
  CompressFormat format((CompressFormat)pMsgCast-&gt;get_format()); 
  QtConcurrent::run(&amp;compressor, &amp;CompressFile::compress, files, format);
  </code></pre>
  
  <p><strong>Header for compression class</strong></p>
  
  <pre><code>class CompressFile : public QObject
  {
      Q_OBJECT
  public:
  
  ...
  
  bool compress(QString strFileName, CompressFormat format);            
  bool compress(QVector&lt;QString&gt; strFileList, CompressFormat format);
  
  ...
  }
  </code></pre>
  
  <p>If I remove one of the compress functions it compiles so I know I've narrowed my issue down to this.</p>
  
  <blockquote>
    <p>FileCompressor.cpp:100:74: note:   types ‘T (Class::)(Param1, Param2, Param3, Param4, Param5)const’ and ‘bool (CompressFile::)(QString, CompressFormat)’ have incompatible cv-qualifiers
    FileCompressor.cpp:100:74: note:   could not resolve address from overloaded function ‘&amp; CompressFile::compress’</p>
  </blockquote>