Krita Source Code Documentation
Loading...
Searching...
No Matches
KoInputDevice.h File Reference
#include "kritaflake_export.h"
#include <QTabletEvent>
#include <QDebug>
#include <QFlags>
#include <boost/operators.hpp>

Go to the source code of this file.

Classes

class  KoInputDevice
 

Functions

KRITAFLAKE_EXPORT QDebug operator<< (QDebug debug, const KoInputDevice &device)
 
uint qHash (const KoInputDevice &key)
 

Function Documentation

◆ operator<<()

KRITAFLAKE_EXPORT QDebug operator<< ( QDebug debug,
const KoInputDevice & device )

Definition at line 114 of file KoInputDevice.cpp.

115{
116 if (device.isMouse())
117 dbg.nospace() << "mouse";
118 else {
119 switch (device.pointer()) {
121 dbg.nospace() << "unknown pointer";
122 break;
124 dbg.nospace() << "pen";
125 break;
127 dbg.nospace() << "cursor";
128 break;
130 dbg.nospace() << "eraser";
131 break;
132 default:
133 dbg.space() << "Unsupported pointer type";
134 }
135 switch(device.device()) {
137 dbg.space() << "no device";
138 break;
140 dbg.space() << "puck";
141 break;
143 dbg.space() << "stylus";
144 break;
146 dbg.space() << "airbrush";
147 break;
148 default:
149 dbg.space() << "Unsupported device type";
150 }
151 dbg.space() << "(id: " << device.uniqueTabletId() << ")";
152 }
153 return dbg.space();
154}
KoInputDevice::InputDevice device
KoInputDevice::Pointer pointer
bool isMouse() const

References KoInputDevice::Airbrush, KoInputDevice::Cursor, KoInputDevice::device, KoInputDevice::Eraser, KoInputDevice::isMouse(), KoInputDevice::Pen, KoInputDevice::pointer, KoInputDevice::Puck, KoInputDevice::Stylus, KoInputDevice::uniqueTabletId, and KoInputDevice::Unknown.

◆ qHash()

uint qHash ( const KoInputDevice & key)
inline

Definition at line 244 of file KoInputDevice.h.

245{
246 return qHash(QString(":%1:%2:%3:%4")
247 .arg(int(key.device()))
248 .arg(int(key.pointer()))
249 .arg(int(key.uniqueTabletId()))
250 .arg(int(key.isMouse())));
251}
uint qHash(const KoInputDevice &key)

References KoInputDevice::device, KoInputDevice::isMouse(), KoInputDevice::pointer, qHash(), and KoInputDevice::uniqueTabletId.