diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-01-10 17:17:12 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-22 12:12:17 +0100 |
commit | db51ffc0d1fbce85fd542403812fab8783c53e3c (patch) | |
tree | 2e7a051dbf6701b477e4c19de014a44dbaf84c37 /src/plugins/platforms/windows/qwindowskeymapper.cpp | |
parent | a5c288ea5675a382edf0b3ecae42f461a22a7303 (diff) |
Port Windows QPA plugin to new logger API.
Introduce logging categories and change most debug statements
to qCDebug().
Retrieve the filter rules from the environment variable
QT_QPA_VERBOSE (should be removed once the logging framework
offers a more convenient way of configuring).
Replace the old per-category variables controlling verboseness
of the output by a single variable which can be set on the command
line.
Change-Id: Iae55ecdb0e150efd165b7d3e90b371f72853f194
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowskeymapper.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowskeymapper.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/plugins/platforms/windows/qwindowskeymapper.cpp b/src/plugins/platforms/windows/qwindowskeymapper.cpp index 1baea6faff..00782ed050 100644 --- a/src/plugins/platforms/windows/qwindowskeymapper.cpp +++ b/src/plugins/platforms/windows/qwindowskeymapper.cpp @@ -653,16 +653,20 @@ void QWindowsKeyMapper::updatePossibleKeyCodes(unsigned char *kbdBuffer, quint32 ::ToAscii(VK_SPACE, 0, emptyBuffer, reinterpret_cast<LPWORD>(&buffer), 0); ::ToAscii(vk_key, scancode, kbdBuffer, reinterpret_cast<LPWORD>(&buffer), 0); } - - if (QWindowsContext::verboseEvents > 1) { - qDebug("updatePossibleKeyCodes for virtual key = 0x%02x!", vk_key); + if (QWindowsContext::verbose > 1 && lcQpaEvents().isDebugEnabled()) { + QString message; + QDebug debug(&message); + debug <<__FUNCTION__ << " for virtual key = 0x" << hex << vk_key << dec<< '\n'; for (size_t i = 0; i < NumMods; ++i) { - qDebug(" [%d] (%d,0x%02x,'%c') %s", int(i), - keyLayout[vk_key].qtKey[i], - keyLayout[vk_key].qtKey[i], - keyLayout[vk_key].qtKey[i] ? keyLayout[vk_key].qtKey[i] : 0x03, - keyLayout[vk_key].deadkeys & (1<<i) ? "deadkey" : ""); + const quint32 qtKey = keyLayout[vk_key].qtKey[i]; + debug << " [" << i << "] (" << qtKey << ',' + << hex << showbase << qtKey << noshowbase << dec + << ",'" << char(qtKey ? qtKey : 0x03) << "')"; + if (keyLayout[vk_key].deadkeys & (1<<i)) + debug << " deadkey"; + debug << '\n'; } + qCDebug(lcQpaEvents) << message; } } |