Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tablet_debugger.cpp File Reference
#include "kis_tablet_debugger.h"
#include <QEvent>
#include <QMessageBox>
#include <QApplication>
#include <kis_debug.h>
#include <kis_config.h>
#include <KisPortingUtils.h>
#include <QGlobalStatic>
#include <klocalizedstring.h>

Go to the source code of this file.

Functions

QString button (const QWheelEvent &ev)
 
template<class T >
QString button (const T &ev)
 
template<class T >
QString buttons (const T &ev)
 
template<class Event >
void dumpBaseParams (QTextStream &s, const Event &ev, const QString &prefix)
 
template<class Event >
void dumpMouseRelatedParams (QTextStream &s, const Event &ev)
 
template<>
void dumpMouseRelatedParams (QTextStream &s, const QWheelEvent &ev)
 
template<class Event >
QString tabletEventToString (const Event &ev, const QString &prefix)
 

Function Documentation

◆ button() [1/2]

QString button ( const QWheelEvent & ev)
inline

Definition at line 24 of file kis_tablet_debugger.cpp.

24 {
25 Q_UNUSED(ev);
26 return "-";
27}

◆ button() [2/2]

template<class T >
QString button ( const T & ev)

Definition at line 30 of file kis_tablet_debugger.cpp.

30 {
31 return QString::number(ev.button());
32}

◆ buttons()

template<class T >
QString buttons ( const T & ev)

Definition at line 35 of file kis_tablet_debugger.cpp.

35 {
36 return QString::number(ev.buttons());
37}

◆ dumpBaseParams()

template<class Event >
void dumpBaseParams ( QTextStream & s,
const Event & ev,
const QString & prefix )

Definition at line 40 of file kis_tablet_debugger.cpp.

41{
42 s << qSetFieldWidth(5) << Qt::left << prefix << Qt::reset << " ";
43 s << qSetFieldWidth(17) << Qt::left << KisTabletDebugger::exTypeToString(ev.type()) << Qt::reset;
44}
static QString exTypeToString(QEvent::Type type)

References KisTabletDebugger::exTypeToString().

◆ dumpMouseRelatedParams() [1/2]

template<class Event >
void dumpMouseRelatedParams ( QTextStream & s,
const Event & ev )

Definition at line 47 of file kis_tablet_debugger.cpp.

48{
49 s << "btn: " << button(ev) << " ";
50 s << "btns: " << buttons(ev) << " ";
51 s << "pos: " << qSetFieldWidth(4) << ev.x() << qSetFieldWidth(0) << "," << qSetFieldWidth(4) << ev.y() << qSetFieldWidth(0) << " ";
52 s << "gpos: " << qSetFieldWidth(4) << ev.globalX() << qSetFieldWidth(0) << "," << qSetFieldWidth(4) << ev.globalY() << qSetFieldWidth(0) << " ";
53}
QString button(const QWheelEvent &ev)
QString buttons(const T &ev)

References button(), and buttons().

◆ dumpMouseRelatedParams() [2/2]

template<>
void dumpMouseRelatedParams ( QTextStream & s,
const QWheelEvent & ev )

Definition at line 56 of file kis_tablet_debugger.cpp.

57{
58 s << "btn: " << button(ev) << " ";
59 s << "btns: " << buttons(ev) << " ";
60 s << "pos: " << qSetFieldWidth(4) << ev.position().x() << qSetFieldWidth(0) << "," << qSetFieldWidth(4) << ev.position().y() << qSetFieldWidth(0) << " ";
61 s << "gpos: " << qSetFieldWidth(4) << ev.globalPosition().x() << qSetFieldWidth(0) << "," << qSetFieldWidth(4) << ev.globalPosition().y() << qSetFieldWidth(0) << " ";
62}

References button(), and buttons().

◆ tabletEventToString()

template<class Event >
QString tabletEventToString ( const Event & ev,
const QString & prefix )

Definition at line 224 of file kis_tablet_debugger.cpp.

225{
226 QString string;
227 QTextStream s(&string);
229
230 dumpBaseParams(s, ev, prefix);
232
233 s << "hires: " << qSetFieldWidth(8) << ev.globalPosF().x() << qSetFieldWidth(0) << "," << qSetFieldWidth(8) << ev.globalPosF().y() << qSetFieldWidth(0) << " ";
234 s << "prs: " << qSetFieldWidth(4) << Qt::fixed << ev.pressure() << Qt::reset << " ";
235
236
239
240 s << "id: " << ev.uniqueId() << " ";
241
242 s << "xTilt: " << ev.xTilt() << " ";
243 s << "yTilt: " << ev.yTilt() << " ";
244 s << "rot: " << ev.rotation() << " ";
245 s << "z: " << ev.z() << " ";
246 s << "tp: " << ev.tangentialPressure() << " ";
247
248 return string;
249}
static QString pointerTypeToString(const QTabletEvent &event)
static QString tabletDeviceToString(const QTabletEvent &event)
void dumpBaseParams(QTextStream &s, const Event &ev, const QString &prefix)
void dumpMouseRelatedParams(QTextStream &s, const Event &ev)
void setUtf8OnStream(QTextStream &stream)

References dumpBaseParams(), dumpMouseRelatedParams(), KisTabletDebugger::pointerTypeToString(), KisPortingUtils::setUtf8OnStream(), and KisTabletDebugger::tabletDeviceToString().