Adapt to tablet event pointer type changes in Qt6
This commit is contained in:
parent
3c945358fc
commit
31d9aa6914
1 changed files with 15 additions and 0 deletions
|
@ -334,6 +334,7 @@ bool MouseClickEffect::tabletToolEvent(QTabletEvent *event)
|
|||
auto &tabletEvent = m_tabletTools[event->uniqueId()];
|
||||
if (!tabletEvent.m_color.isValid()) {
|
||||
switch (event->pointerType()) {
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
case QTabletEvent::UnknownPointer:
|
||||
case QTabletEvent::Pen:
|
||||
tabletEvent.m_color = MouseClickConfig::color1();
|
||||
|
@ -344,6 +345,20 @@ bool MouseClickEffect::tabletToolEvent(QTabletEvent *event)
|
|||
case QTabletEvent::Cursor:
|
||||
tabletEvent.m_color = MouseClickConfig::color3();
|
||||
break;
|
||||
#else
|
||||
case QPointingDevice::PointerType::Unknown:
|
||||
case QPointingDevice::PointerType::Generic:
|
||||
case QPointingDevice::PointerType::Finger:
|
||||
case QPointingDevice::PointerType::Pen:
|
||||
tabletEvent.m_color = MouseClickConfig::color1();
|
||||
break;
|
||||
case QPointingDevice::PointerType::Eraser:
|
||||
tabletEvent.m_color = MouseClickConfig::color2();
|
||||
break;
|
||||
case QPointingDevice::PointerType::Cursor:
|
||||
tabletEvent.m_color = MouseClickConfig::color3();
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
switch (event->type()) {
|
||||
|
|
Loading…
Reference in a new issue