summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-01-27 13:19:00 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-01-27 14:31:08 +0100
commitbe8c257da9a264994243c120231965ff0008ef09 (patch)
tree15d0d9628d6cb298be120f4804b7e5700b9ca05c /src/corelib/thread/qthread.cpp
parente44de91a2cab6e3c4632523e644fadaa93b89364 (diff)
QThread::setPriority() Warn about invalid parameter on all platforms
InheritPriority may not be set, but the warning only occurs on Windows. Move the warning to the public class. Change-Id: I51d401300f840e4c1396c2c30182e49ed45d60d2 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/thread/qthread.cpp')
-rw-r--r--src/corelib/thread/qthread.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index d3bb372b00..d18056063f 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -614,7 +614,7 @@ void QThread::run()
priority.
The \a priority argument can be any value in the \c
- QThread::Priority enum except for \c InheritPriorty.
+ QThread::Priority enum except for \c InheritPriority.
The effect of the \a priority parameter is dependent on the
operating system's scheduling policy. In particular, the \a priority
@@ -626,6 +626,10 @@ void QThread::run()
*/
void QThread::setPriority(Priority priority)
{
+ if (priority == QThread::InheritPriority) {
+ qWarning("QThread::setPriority: Argument cannot be InheritPriority");
+ return;
+ }
Q_D(QThread);
QMutexLocker locker(&d->mutex);
if (!d->running) {