Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Make KoInputDevice abstract Qt's TabletDevice and PointerType
Halla Remptbfd658fe92aa
diff --git a/libs/flake/KoInputDevice.cpp b/libs/flake/KoInputDevice.cppindex 466be811ad..4404e15e13 100644--- a/libs/flake/KoInputDevice.cpp+++ b/libs/flake/KoInputDevice.cpp@@ -9,30 +9,30 @@class Q_DECL_HIDDEN KoInputDevice::Private{public:- Private(QTabletEvent::TabletDevice d, QTabletEvent::PointerType p, qint64 id, bool m)- : device(d),- pointer(p),- uniqueTabletId(id),- mouse(m) {+ Private(KoInputDevice::InputDevice d, KoInputDevice::Pointer p, qint64 id, bool m)+ : device(d),+ pointer(p),+ uniqueTabletId(id),+ mouse(m) {}- QTabletEvent::TabletDevice device;- QTabletEvent::PointerType pointer;+ KoInputDevice::InputDevice device;+ KoInputDevice::Pointer pointer;qint64 uniqueTabletId;bool mouse;};-KoInputDevice::KoInputDevice(QTabletEvent::TabletDevice device, QTabletEvent::PointerType pointer, qint64 uniqueTabletId)- : d(new Private(device, pointer, uniqueTabletId, false))+KoInputDevice::KoInputDevice(KoInputDevice::InputDevice device, KoInputDevice::Pointer pointer, qint64 uniqueTabletId)+ : d(new Private(device, pointer, uniqueTabletId, false)){}KoInputDevice::KoInputDevice()- : d(new Private(QTabletEvent::NoDevice, QTabletEvent::UnknownPointer, -1, true))+ : d(new Private(KoInputDevice::InputDevice::Unknown, KoInputDevice::Pointer::Unknown, -1, true)){}KoInputDevice::KoInputDevice(const KoInputDevice &other)- : d(new Private(other.d->device, other.d->pointer, other.d->uniqueTabletId, other.d->mouse))+ : d(new Private(other.d->device, other.d->pointer, other.d->uniqueTabletId, other.d->mouse)){}@@ -42,12 +42,12 @@ KoInputDevice::~KoInputDevice()delete d;}-QTabletEvent::TabletDevice KoInputDevice::device() const+KoInputDevice::InputDevice KoInputDevice::device() const{return d->device;}-QTabletEvent::PointerType KoInputDevice::pointer() const+KoInputDevice::Pointer KoInputDevice::pointer() const{return d->pointer;}@@ -62,14 +62,15 @@ bool KoInputDevice::isMouse() const// sometimes, the system gives us tablet events with NoDevice or UnknownPointer. This is// likely an XInput2 bug. However, assuming that if cannot identify the tablet device we've// actually got a mouse is reasonable. See https://bugs.kde.org/show_bug.cgi?id=283130.- return d->mouse || d->device == QTabletEvent::NoDevice || d->pointer == QTabletEvent::UnknownPointer;+ return d->mouse || d->device == KoInputDevice::InputDevice::Unknown+ || d->pointer == KoInputDevice::Pointer::Unknown;}bool KoInputDevice::operator==(const KoInputDevice &other) const{return d->device == other.d->device && d->pointer == other.d->pointer &&- d->uniqueTabletId == other.d->uniqueTabletId && d->mouse == other.d->mouse;+ d->uniqueTabletId == other.d->uniqueTabletId && d->mouse == other.d->mouse;}KoInputDevice & KoInputDevice::operator=(const KoInputDevice & other)@@ -84,7 +85,7 @@ KoInputDevice & KoInputDevice::operator=(const KoInputDevice & other)// staticKoInputDevice KoInputDevice::invalid(){- KoInputDevice id(QTabletEvent::NoDevice, QTabletEvent::UnknownPointer);+ KoInputDevice id(KoInputDevice::InputDevice::Unknown, KoInputDevice::Pointer::Unknown);return id;}@@ -99,14 +100,14 @@ KoInputDevice KoInputDevice::mouse()// staticKoInputDevice KoInputDevice::stylus(){- KoInputDevice id(QTabletEvent::Stylus, QTabletEvent::Pen);+ KoInputDevice id(KoInputDevice::InputDevice::Stylus, KoInputDevice::Pointer::Pen);return id;}// staticKoInputDevice KoInputDevice::eraser(){- KoInputDevice id(QTabletEvent::Stylus, QTabletEvent::Eraser);+ KoInputDevice id(KoInputDevice::InputDevice::Stylus, KoInputDevice::Pointer::Eraser);return id;}@@ -116,41 +117,36 @@ QDebug operator<<(QDebug dbg, const KoInputDevice &device)dbg.nospace() << "mouse";else {switch (device.pointer()) {- case QTabletEvent::UnknownPointer:+ case KoInputDevice::Pointer::Unknown:dbg.nospace() << "unknown pointer";break;- case QTabletEvent::Pen:+ case KoInputDevice::Pointer::Pen:dbg.nospace() << "pen";break;- case QTabletEvent::Cursor:+ case KoInputDevice::Pointer::Cursor:dbg.nospace() << "cursor";break;- case QTabletEvent::Eraser:+ case KoInputDevice::Pointer::Eraser:dbg.nospace() << "eraser";break;+ default:+ dbg.space() << "Unsupported pointer type";}switch(device.device()) {- case QTabletEvent::NoDevice:+ case KoInputDevice::InputDevice::Unknown:dbg.space() << "no device";break;- case QTabletEvent::Puck:+ case KoInputDevice::InputDevice::Puck:dbg.space() << "puck";break;- case QTabletEvent::Stylus:+ case KoInputDevice::InputDevice::Stylus:dbg.space() << "stylus";break;- case QTabletEvent::Airbrush:+ case KoInputDevice::InputDevice::Airbrush:dbg.space() << "airbrush";break;- case QTabletEvent::FourDMouse:- dbg.space() << "four2mouse";- break;- case QTabletEvent::RotationStylus:- dbg.space() << "rotationstylus";- break;- case QTabletEvent::XFreeEraser:- dbg.space() << "XFreeEraser";- break;+ default:+ dbg.space() << "Unsupported device type";}dbg.space() << "(id: " << device.uniqueTabletId() << ")";}diff --git a/libs/flake/KoInputDevice.h b/libs/flake/KoInputDevice.hindex e464635de8..d79e0dbbbb 100644--- a/libs/flake/KoInputDevice.h+++ b/libs/flake/KoInputDevice.h@@ -13,6 +13,7 @@#include <QHash>#include <QTabletEvent>#include <QDebug>+#include <QFlags>#include <boost/operators.hpp>/**@@ -22,6 +23,161 @@class KRITAFLAKE_EXPORT KoInputDevice : public boost::equality_comparable<KoInputDevice>{public:++ enum class Pointer {+ Unknown = 0,+ Generic = 0x0001, // mouse or similar+ Finger = 0x0002, // touchscreen or pad+ Pen = 0x0004, // stylus on a tablet+ Eraser = 0x0008, // eraser end of a stylus+ Cursor = 0x0010, // digitizer with crosshairs+ AllPointerTypes = 0x7FFF+ };++ enum class InputDevice {+ Unknown = 0x0000,+ Mouse = 0x0001,+ TouchScreen = 0x0002,+ TouchPad = 0x0004,+ Puck = 0x0008,+ Stylus = 0x0010,+ Airbrush = 0x0020,+ Keyboard = 0x1000,+ AllDevices = 0x7FFFFFFF+ };++ static Pointer convertPointerType(QTabletEvent *event)+ {+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))+ switch (event->pointerType()) {+ case QTabletEvent::UnknownPointer: {+ return Pointer::Unknown;+ }+ break;+ case QTabletEvent::Pen: {+ return Pointer::Pen;+ }+ break;+ case QTabletEvent::Cursor: {+ return Pointer::Cursor;+ }+ break;+ case QTabletEvent::Eraser: {+ return Pointer::Eraser;+ }+ default:+ return Pointer::Unknown;+ }+#else+ QPointingDevice::PointerType pointer = event->pointerType();+ switch (pointer) {+ case (QPointingDevice::PointerType::Unknown): {+ return Pointer::Unknown;+ } break;+ case QPointingDevice::PointerType::Generic:{+ return Pointer::Generic;+ } break;+ case QPointingDevice::PointerType::Finger:{+ return Pointer::Finger;+ } break;+ case QPointingDevice::PointerType::Pen:{+ return Pointer::Pen;+ } break;+ case QPointingDevice::PointerType::Eraser:{+ return Pointer::Eraser;+ } break;++ case QPointingDevice::PointerType::Cursor:{+ return Pointer::Cursor;+ } break;+ case QPointingDevice::PointerType::AllPointerTypes:{+ return Pointer::AllPointerTypes;+ } break;+ default:+ return Pointer::Unknown;+ }+#endif+ }++ static InputDevice convertDeviceType(QTabletEvent *event)+ {+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))+ switch (event->deviceType()) {+ case QTabletEvent::NoDevice: {+ return InputDevice::Unknown;+ }+ break;+ case QTabletEvent::Puck: {+ return InputDevice::Puck;+ }+ break;+ case QTabletEvent::Stylus: {+ return InputDevice::Stylus;+ }+ break;+ case QTabletEvent::Airbrush: {+ return InputDevice::Airbrush;+ }+ case QTabletEvent::RotationStylus: {+ // Note: Qt6 no longer has the RotationStylus device type, so we will+ // have to stop supporting it.+ return InputDevice::Stylus;+ }+ default:+ return InputDevice::Unknown;+ }++#else+ QInputDevice::DeviceType deviceType = event->deviceType();+ switch(deviceType) {+ case QInputDevice::DeviceType::Unknown: {+ return InputDevice::Unknown;+ }+ break;+ case QInputDevice::DeviceType::Mouse:{+ return InputDevice::Mouse;+ }+ break;+ case QInputDevice::DeviceType::TouchScreen:+ {+ return InputDevice::TouchScreen;+ }+ break;+ case QInputDevice::DeviceType::TouchPad:+ {+ return InputDevice::TouchPad;+ }+ break;+ case QInputDevice::DeviceType::Puck:+ {+ return InputDevice::Puck;+ }+ break;+ case QInputDevice::DeviceType::Stylus:+ {+ return InputDevice::Stylus;+ }+ break;+ case QInputDevice::DeviceType::Airbrush:+ {+ return InputDevice::Airbrush;+ }+ break;+ case QInputDevice::DeviceType::Keyboard:+ {+ return InputDevice::Keyboard;+ }+ break;+ case QInputDevice::DeviceType::AllDevices:+ {+ return InputDevice::AllDevices;+ }+ default:+ return InputDevice::Unknown;+ }+#endif+ }+/*** Copy constructor.*/@@ -34,7 +190,7 @@ public:* @param pointer the pointer as found on a QTabletEvent* @param uniqueTabletId the uniqueId as found on a QTabletEvent*/- explicit KoInputDevice(QTabletEvent::TabletDevice device, QTabletEvent::PointerType pointer, qint64 uniqueTabletId = -1);+ explicit KoInputDevice(InputDevice device, Pointer pointer, qint64 uniqueTabletId = -1);/*** Constructor for the mouse as input device.@@ -46,12 +202,12 @@ public:/*** Return the tablet device used*/- QTabletEvent::TabletDevice device() const;+ InputDevice device() const;/*** Return the pointer used*/- QTabletEvent::PointerType pointer() const;+ Pointer pointer() const;/*** Return the unique tablet id as registered by QTabletEvents. Note that this@@ -89,10 +245,10 @@ KRITAFLAKE_EXPORT QDebug operator<<(QDebug debug, const KoInputDevice &device);inline uint qHash(const KoInputDevice &key){return qHash(QString(":%1:%2:%3:%4")- .arg(key.device())- .arg(key.pointer())- .arg(key.uniqueTabletId())- .arg(key.isMouse()));+ .arg(int(key.device()))+ .arg(int(key.pointer()))+ .arg(int(key.uniqueTabletId()))+ .arg(int(key.isMouse())));}#endifdiff --git a/libs/flake/KoToolProxy.cpp b/libs/flake/KoToolProxy.cppindex f771d0a08f..ebeb3c7147 100644--- a/libs/flake/KoToolProxy.cpp+++ b/libs/flake/KoToolProxy.cpp@@ -197,7 +197,8 @@ void KoToolProxy::tabletEvent(QTabletEvent *event, const QPointF &point)// We get these events exclusively from KisToolProxy - accept themevent->accept();- KoInputDevice id(event->deviceType(), event->pointerType(), event->uniqueId());+ KoInputDevice id(KoInputDevice::convertDeviceType(event),+ KoInputDevice::convertPointerType(event), event->uniqueId());KoToolManager::instance()->priv()->switchInputDevice(id);KoPointerEvent ev(event, point);diff --git a/libs/flake/tests/TestInputDevice.cpp b/libs/flake/tests/TestInputDevice.cppindex a23af113c4..79787efff2 100644--- a/libs/flake/tests/TestInputDevice.cpp+++ b/libs/flake/tests/TestInputDevice.cpp@@ -11,95 +11,95 @@//Tests so the KoInputDevice created is of tablet typevoid TestInputDevice::testTabletConstructor(){- QTabletEvent::TabletDevice parameterTabletDevice = QTabletEvent::Stylus;- QTabletEvent::PointerType parameterPointerType = QTabletEvent::Eraser;- qint64 parameterUniqueTabletId = 0;- KoInputDevice toTest(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);- bool isMouse = toTest.isMouse();- QVERIFY(!isMouse);+ KoInputDevice::InputDevice parameterTabletDevice = KoInputDevice::InputDevice::Stylus;+ KoInputDevice::Pointer parameterPointerType = KoInputDevice::Pointer::Eraser;+ qint64 parameterUniqueTabletId = 0;+ KoInputDevice toTest(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);+ bool isMouse = toTest.isMouse();+ QVERIFY(!isMouse);}//Tests so the unique tablet ID of the default constructor is -1 like set.void TestInputDevice::testNoParameterConstructor(){- KoInputDevice toTest;- bool isMouse = toTest.isMouse();- qint64 theUniqueTabletId = toTest.uniqueTabletId();- qint64 toCompareWith = -1;- QVERIFY(isMouse);- QCOMPARE(theUniqueTabletId, toCompareWith);+ KoInputDevice toTest;+ bool isMouse = toTest.isMouse();+ qint64 theUniqueTabletId = toTest.uniqueTabletId();+ qint64 toCompareWith = -1;+ QVERIFY(isMouse);+ QCOMPARE(theUniqueTabletId, toCompareWith);}//Tests so the single reference constructor can take both a tablet and a mouse as input device and set it correctlyvoid TestInputDevice::testConstructorWithSingleReference(){- QTabletEvent::TabletDevice parameterTabletDevice = QTabletEvent::Stylus;- QTabletEvent::PointerType parameterPointerType = QTabletEvent::Eraser;- qint64 parameterUniqueTabletId = 0;- KoInputDevice parameterTabletDevice2(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);- KoInputDevice toTest(parameterTabletDevice2);- bool isMouse = toTest.isMouse();- QVERIFY(!isMouse);- KoInputDevice parameterMouseDevice;- toTest = KoInputDevice(parameterMouseDevice);- isMouse = toTest.isMouse();- QVERIFY(isMouse);+ KoInputDevice::InputDevice parameterTabletDevice = KoInputDevice::InputDevice::Stylus;+ KoInputDevice::Pointer parameterPointerType = KoInputDevice::Pointer::Eraser;+ qint64 parameterUniqueTabletId = 0;+ KoInputDevice parameterTabletDevice2(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);+ KoInputDevice toTest(parameterTabletDevice2);+ bool isMouse = toTest.isMouse();+ QVERIFY(!isMouse);+ KoInputDevice parameterMouseDevice;+ toTest = KoInputDevice(parameterMouseDevice);+ isMouse = toTest.isMouse();+ QVERIFY(isMouse);}//tests so the equality operator is workingvoid TestInputDevice::testEqualityCheckOperator(){- QTabletEvent::TabletDevice parameterTabletDevice = QTabletEvent::Stylus;- QTabletEvent::PointerType parameterPointerType = QTabletEvent::Eraser;- qint64 parameterUniqueTabletId = 0;- KoInputDevice parameterTabletDevice2(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);- KoInputDevice toTest(parameterTabletDevice2);- KoInputDevice copy = toTest;- KoInputDevice notSame;- QVERIFY(toTest==copy);- QVERIFY(toTest!=notSame);+ KoInputDevice::InputDevice parameterTabletDevice = KoInputDevice::InputDevice::Stylus;+ KoInputDevice::Pointer parameterPointerType = KoInputDevice::Pointer::Eraser;+ qint64 parameterUniqueTabletId = 0;+ KoInputDevice parameterTabletDevice2(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);+ KoInputDevice toTest(parameterTabletDevice2);+ KoInputDevice copy = toTest;+ KoInputDevice notSame;+ QVERIFY(toTest==copy);+ QVERIFY(toTest!=notSame);}//tests that the device is set properly in the constructorvoid TestInputDevice::testDevice(){- QTabletEvent::TabletDevice parameterTabletDevice = QTabletEvent::Stylus;- QTabletEvent::PointerType parameterPointerType = QTabletEvent::Eraser;- qint64 parameterUniqueTabletId = 0;- KoInputDevice parameterTabletDevice2(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);- KoInputDevice toTest(parameterTabletDevice2);- QTabletEvent::TabletDevice aTabletDevice = toTest.device();+ KoInputDevice::InputDevice parameterTabletDevice = KoInputDevice::InputDevice::Stylus;+ KoInputDevice::Pointer parameterPointerType = KoInputDevice::Pointer::Eraser; ;+ qint64 parameterUniqueTabletId = 0;+ KoInputDevice parameterTabletDevice2(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);+ KoInputDevice toTest(parameterTabletDevice2);+ KoInputDevice::InputDevice aTabletDevice = toTest.device();- QCOMPARE(aTabletDevice, QTabletEvent::Stylus);+ QCOMPARE(aTabletDevice, KoInputDevice::InputDevice::Stylus);}//tests that the PointerType is set correctly by the constructorvoid TestInputDevice::testPointer(){- QTabletEvent::TabletDevice parameterTabletDevice = QTabletEvent::Stylus;- QTabletEvent::PointerType parameterPointerType = QTabletEvent::Eraser;- qint64 parameterUniqueTabletId = 0;- KoInputDevice parameterTabletDevice2(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);- KoInputDevice toTest(parameterTabletDevice2);- QTabletEvent::PointerType aTabletDevice = toTest.pointer();-- QCOMPARE(aTabletDevice, QTabletEvent::Eraser);+ KoInputDevice::InputDevice parameterTabletDevice = KoInputDevice::InputDevice::Stylus;+ KoInputDevice::Pointer parameterPointerType = KoInputDevice::Pointer::Eraser;+ qint64 parameterUniqueTabletId = 0;+ KoInputDevice parameterTabletDevice2(parameterTabletDevice, parameterPointerType, parameterUniqueTabletId);+ KoInputDevice toTest(parameterTabletDevice2);+ KoInputDevice::Pointer aTabletPointer= toTest.pointer();++ QCOMPARE(aTabletPointer, KoInputDevice::Pointer::Eraser);}//verifies that the device returned by the mouse() function is indeed a mouse devicevoid TestInputDevice::testMouse(){- KoInputDevice toTest = KoInputDevice::mouse();- bool isMouse = toTest.isMouse();- QVERIFY(isMouse);+ KoInputDevice toTest = KoInputDevice::mouse();+ bool isMouse = toTest.isMouse();+ QVERIFY(isMouse);}//verifies that the device returned by the stylus() function is indeed a tablet devicevoid TestInputDevice::testStylus(){- KoInputDevice toTest = KoInputDevice::stylus();- bool isMouse = toTest.isMouse();- QVERIFY(!isMouse);+ KoInputDevice toTest = KoInputDevice::stylus();+ bool isMouse = toTest.isMouse();+ QVERIFY(!isMouse);}//verifies that the device returned by the eraser() function is indeed a tablet devicevoid TestInputDevice::testEraser(){- KoInputDevice toTest = KoInputDevice::eraser();- bool isMouse = toTest.isMouse();- QVERIFY(!isMouse);+ KoInputDevice toTest = KoInputDevice::eraser();+ bool isMouse = toTest.isMouse();+ QVERIFY(!isMouse);}diff --git a/libs/ui/kis_paintop_box.cc b/libs/ui/kis_paintop_box.ccindex 3ca4bbf611..dda5718afa 100644--- a/libs/ui/kis_paintop_box.cc+++ b/libs/ui/kis_paintop_box.cc@@ -916,9 +916,9 @@ void KisPaintopBox::slotInputDeviceChanged(const KoInputDevice& inputDevice)//qDebug() << "slotInputDeviceChanged()" << inputDevice.device() << inputDevice.uniqueTabletId();- m_eraserTogglePresetAction->setChecked(inputDevice.pointer() == QTabletEvent::Eraser);- m_eraserSelectPresetAction->setChecked(inputDevice.pointer() == QTabletEvent::Eraser);- m_brushSelectPresetAction->setChecked(inputDevice.pointer() == QTabletEvent::Pen);+ m_eraserTogglePresetAction->setChecked(inputDevice.pointer() == KoInputDevice::Pointer::Eraser);+ m_eraserSelectPresetAction->setChecked(inputDevice.pointer() == KoInputDevice::Pointer::Eraser);+ m_brushSelectPresetAction->setChecked(inputDevice.pointer() == KoInputDevice::Pointer::Pen);m_currTabletToolID = TabletToolID(inputDevice);@@ -929,7 +929,7 @@ void KisPaintopBox::slotInputDeviceChanged(const KoInputDevice& inputDevice)findDefaultPresets();- if (inputDevice.pointer() == QTabletEvent::Eraser) {+ if (inputDevice.pointer() == KoInputDevice::Pointer::Eraser) {preset = rserver->resource("", "", cfg.readEntry<QString>(QString("LastEraser_%1").arg(inputDevice.uniqueTabletId()), m_eraserName));}else {@@ -961,8 +961,8 @@ void KisPaintopBox::slotInputDeviceChanged(const KoInputDevice& inputDevice)void KisPaintopBox::slotToggleEraserPreset(bool usingEraser){- QTabletEvent::TabletDevice dev = QTabletEvent::NoDevice;- QTabletEvent::PointerType ptr = usingEraser ? QTabletEvent::Eraser : QTabletEvent::Pen;+ KoInputDevice::InputDevice dev = KoInputDevice::InputDevice::Unknown;+ KoInputDevice::Pointer ptr = usingEraser ? KoInputDevice::Pointer::Eraser : KoInputDevice::Pointer::Pen;qint64 id = -1;const KoInputDevice inputDevice(dev, ptr, id);slotInputDeviceChanged(inputDevice);@@ -973,8 +973,8 @@ void KisPaintopBox::slotSelectEraserPreset()// automatically select freehand brush tool for these select actionsKoToolManager::instance()->switchToolRequested("KritaShape/KisToolBrush");- QTabletEvent::TabletDevice dev = QTabletEvent::NoDevice;- QTabletEvent::PointerType ptr = QTabletEvent::Eraser;+ KoInputDevice::InputDevice dev = KoInputDevice::InputDevice::Unknown;+ KoInputDevice::Pointer ptr = KoInputDevice::Pointer::Eraser;qint64 id = -1;const KoInputDevice inputDevice(dev, ptr, id);slotInputDeviceChanged(inputDevice);@@ -986,8 +986,8 @@ void KisPaintopBox::slotSelectBrushPreset()// automatically select freehand brush tool for these select actionsKoToolManager::instance()->switchToolRequested("KritaShape/KisToolBrush");- QTabletEvent::TabletDevice dev = QTabletEvent::NoDevice;- QTabletEvent::PointerType ptr = QTabletEvent::Pen;+ KoInputDevice::InputDevice dev = KoInputDevice::InputDevice::Unknown;+ KoInputDevice::Pointer ptr = KoInputDevice::Pointer::Pen;qint64 id = -1;const KoInputDevice inputDevice(dev, ptr, id);slotInputDeviceChanged(inputDevice);@@ -1578,7 +1578,7 @@ void KisPaintopBox::updatePresetConfig()QMapIterator<TabletToolID, TabletToolData> iter(m_tabletToolMap);while (iter.hasNext()) {iter.next();- if ((iter.key().pointer) == QTabletEvent::Eraser) {+ if ((iter.key().pointer) == KoInputDevice::Pointer::Eraser) {cfg.writeEntry(QString("LastEraser_%1").arg(iter.key().uniqueTabletId),iter.value().preset->name());}diff --git a/libs/ui/kis_paintop_box.h b/libs/ui/kis_paintop_box.hindex 0cb94ca392..0017446ce4 100644--- a/libs/ui/kis_paintop_box.h+++ b/libs/ui/kis_paintop_box.h@@ -231,9 +231,9 @@ private:struct TabletToolID {TabletToolID(const KoInputDevice& dev) {// Only the eraser is special, and we don't look at Cursor- pointer = QTabletEvent::Pen;- if (dev.pointer() == QTabletEvent::Eraser) {- pointer = QTabletEvent::Eraser;+ pointer = KoInputDevice::Pointer::Pen;+ if (dev.pointer() == KoInputDevice::Pointer::Eraser) {+ pointer = KoInputDevice::Pointer::Eraser;}uniqueTabletId = dev.uniqueTabletId();}@@ -246,7 +246,7 @@ private:return pointer < id.pointer;}- QTabletEvent::PointerType pointer;+ KoInputDevice::Pointer pointer;qint64 uniqueTabletId;};