diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2011-11-08 18:03:57 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-09 15:28:36 +0100 |
commit | 3c74720f74baa05f19863d7d3310b4d9fe1d2206 (patch) | |
tree | 63627b2a7445def4fc25f57585433e732e90c7d1 /examples/tutorials/threads/movedobject/thread.cpp | |
parent | 767d553fc2e67ef1ab93db2d468a76210531465d (diff) |
Assign function argument to class member, not to itself
The 'worker' function argument shadows the class member of the same
name, and 'worker = worker;' assigns the function argument to itself,
not to the member as intended.
examples/tutorials/threads/movedobject/thread.cpp:69: warning:
explicitly assigning a variable of type 'QObject *' to itself [-Wself-
worker = worker;
~~~~~~ ^ ~~~~~~
Change-Id: If4adf486a86a4ba4e7f7040a7771a70b7dd9aa86
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'examples/tutorials/threads/movedobject/thread.cpp')
-rw-r--r-- | examples/tutorials/threads/movedobject/thread.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/tutorials/threads/movedobject/thread.cpp b/examples/tutorials/threads/movedobject/thread.cpp index d8a17eefe6..5ebd873482 100644 --- a/examples/tutorials/threads/movedobject/thread.cpp +++ b/examples/tutorials/threads/movedobject/thread.cpp @@ -66,7 +66,7 @@ Thread::~Thread() // starts thread, moves worker to this thread and blocks void Thread::launchWorker(QObject *worker) { - worker = worker; + this->worker = worker; start(); worker->moveToThread(this); shutDownHelper->moveToThread(this); |