QMutex const/this conversion issue
-
I am not sure what it is going on here, I have cleaned my project and I can't get this to go away in one of my classes. I have declared a private variable:
@
QMutex _listMutex;
@And then I go to use it:
@
QMutexLocker lock(&_listMutex);
@When I compile this one gives me:
@
SomeFile.cpp:111: error: C2664: 'QMutexLocker::QMutexLocker(QMutex *)' : cannot convert parameter 1 from 'const QMutex *' to 'QMutex *'
Conversion loses qualifiers
@And elsewhere:
@
_listMutex.lock();
...
_listMutex.unlock();
@and this gives me the compile errors:
@
SomeFile.cpp:289: error: C2662: 'QMutex::lock' : cannot convert 'this' pointer from 'const QMutex' to 'QMutex &'
Conversion loses qualifiers
SomeFile.cpp:291: error: C2662: 'QMutex::unlock' : cannot convert 'this' pointer from 'const QMutex' to 'QMutex &'
Conversion loses qualifiers
@Yet I am using this exactly the same way in another class. What is going on?
Thanks.