aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Maloney <asmaloney@gmail.com>2017-10-06 14:25:42 -0400
committerAndy Nichols <andy.nichols@qt.io>2017-10-09 08:48:52 +0000
commit6bc67065a243a8042b809c52a579ed0582c7b734 (patch)
tree6f0c4e09ea7f43ff25316147072907ad9690806f
parent0cea22b644881aaa3edb68267153e334b34d23f7 (diff)
Turn on debug logging for simple gamepad example
The example fails silently, so turn on debug logging so we can see what's happening and add a debug message if it fails to find any gamepads. Change-Id: I5ceedc9734836e1a44788c0912c3cbcfbb7cb158 Reviewed-by: Andrea Odetti <mariofutire@gmail.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r--examples/gamepad/simple/gamepadmonitor.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/gamepad/simple/gamepadmonitor.cpp b/examples/gamepad/simple/gamepadmonitor.cpp
index d77b7a7..96626be 100644
--- a/examples/gamepad/simple/gamepadmonitor.cpp
+++ b/examples/gamepad/simple/gamepadmonitor.cpp
@@ -42,13 +42,17 @@
#include <QtGamepad/QGamepad>
#include <QDebug>
+#include <QLoggingCategory>
GamepadMonitor::GamepadMonitor(QObject *parent)
: QObject(parent)
, m_gamepad(0)
{
+ QLoggingCategory::setFilterRules(QStringLiteral("qt.gamepad.debug=true"));
+
auto gamepads = QGamepadManager::instance()->connectedGamepads();
if (gamepads.isEmpty()) {
+ qDebug() << "Did not find any connected gamepads";
return;
}