1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

Port away from deprecated event::pos()

Signed-off-by: Juraj Oravec <jurajoravec@mailo.com>
This commit is contained in:
Juraj Oravec 2023-12-17 11:58:58 +01:00
parent 69fa7d48e8
commit 1922ac6cda
Signed by: SGOrava
GPG Key ID: 13660A3F1D9F093B
16 changed files with 50 additions and 50 deletions

View File

@ -397,7 +397,7 @@ void LineEdit::mouseReleaseEvent(QMouseEvent* event)
bool isSelectedText = !selectedText().isEmpty(); bool isSelectedText = !selectedText().isEmpty();
if (wasSelectedText && !isSelectedText) { if (wasSelectedText && !isSelectedText) {
QMouseEvent ev(QEvent::MouseButtonPress, event->pos(), event->button(), QMouseEvent ev(QEvent::MouseButtonPress, event->position(), event->globalPosition(), event->button(),
event->buttons(), event->modifiers()); event->buttons(), event->modifiers());
mousePressEvent(&ev); mousePressEvent(&ev);
} }

View File

@ -91,7 +91,7 @@ void SqueezeLabelV2::resizeEvent(QResizeEvent* event)
void SqueezeLabelV2::mousePressEvent(QMouseEvent* event) void SqueezeLabelV2::mousePressEvent(QMouseEvent* event)
{ {
if (event->buttons() & Qt::LeftButton) { if (event->buttons() & Qt::LeftButton) {
m_dragStart = event->pos(); m_dragStart = event->position().toPoint();
} }
QLabel::mousePressEvent(event); QLabel::mousePressEvent(event);
@ -104,7 +104,7 @@ void SqueezeLabelV2::mouseMoveEvent(QMouseEvent* event)
return; return;
} }
int manhattanLength = (event->pos() - m_dragStart).manhattanLength(); int manhattanLength = (event->position().toPoint() - m_dragStart).manhattanLength();
if (manhattanLength <= QApplication::startDragDistance()) { if (manhattanLength <= QApplication::startDragDistance()) {
return; return;
} }

View File

@ -279,14 +279,14 @@ void BookmarksToolbarButton::mousePressEvent(QMouseEvent* event)
} }
} }
m_dragStartPosition = event->pos(); m_dragStartPosition = event->position().toPoint();
QPushButton::mousePressEvent(event); QPushButton::mousePressEvent(event);
} }
void BookmarksToolbarButton::mouseReleaseEvent(QMouseEvent* event) void BookmarksToolbarButton::mouseReleaseEvent(QMouseEvent* event)
{ {
if (m_bookmark && rect().contains(event->pos())) { if (m_bookmark && rect().contains(event->position().toPoint())) {
Qt::MouseButton button = event->button(); Qt::MouseButton button = event->button();
Qt::KeyboardModifiers modifiers = event->modifiers(); Qt::KeyboardModifiers modifiers = event->modifiers();
@ -311,7 +311,7 @@ void BookmarksToolbarButton::mouseReleaseEvent(QMouseEvent* event)
void BookmarksToolbarButton::mouseMoveEvent(QMouseEvent *event) void BookmarksToolbarButton::mouseMoveEvent(QMouseEvent *event)
{ {
if ((event->pos() - m_dragStartPosition).manhattanLength() < QApplication::startDragDistance()) { if ((event->position().toPoint() - m_dragStartPosition).manhattanLength() < QApplication::startDragDistance()) {
QPushButton::mouseMoveEvent(event); QPushButton::mouseMoveEvent(event);
return; return;
} }

View File

@ -188,7 +188,7 @@ void BookmarksTreeView::mouseMoveEvent(QMouseEvent* event)
if (m_type == BookmarksSidebarViewType) { if (m_type == BookmarksSidebarViewType) {
QCursor cursor = Qt::ArrowCursor; QCursor cursor = Qt::ArrowCursor;
if (event->buttons() == Qt::NoButton) { if (event->buttons() == Qt::NoButton) {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
if (index.isValid() && index.data(BookmarksModel::TypeRole).toInt() == BookmarkItem::Url) { if (index.isValid() && index.data(BookmarksModel::TypeRole).toInt() == BookmarkItem::Url) {
cursor = Qt::PointingHandCursor; cursor = Qt::PointingHandCursor;
} }
@ -202,7 +202,7 @@ void BookmarksTreeView::mousePressEvent(QMouseEvent* event)
QTreeView::mousePressEvent(event); QTreeView::mousePressEvent(event);
if (selectionModel()->selectedRows().count() == 1) { if (selectionModel()->selectedRows().count() == 1) {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
Qt::MouseButtons buttons = event->buttons(); Qt::MouseButtons buttons = event->buttons();
Qt::KeyboardModifiers modifiers = event->modifiers(); Qt::KeyboardModifiers modifiers = event->modifiers();
@ -224,7 +224,7 @@ void BookmarksTreeView::mouseReleaseEvent(QMouseEvent* event)
QTreeView::mouseReleaseEvent(event); QTreeView::mouseReleaseEvent(event);
if (selectionModel()->selectedRows().count() == 1) { if (selectionModel()->selectedRows().count() == 1) {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
if (index.isValid()) { if (index.isValid()) {
BookmarkItem* item = m_model->item(m_filter->mapToSource(index)); BookmarkItem* item = m_model->item(m_filter->mapToSource(index));
@ -242,7 +242,7 @@ void BookmarksTreeView::mouseDoubleClickEvent(QMouseEvent* event)
QTreeView::mouseDoubleClickEvent(event); QTreeView::mouseDoubleClickEvent(event);
if (selectionModel()->selectedRows().count() == 1) { if (selectionModel()->selectedRows().count() == 1) {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
if (index.isValid()) { if (index.isValid()) {
BookmarkItem* item = m_model->item(m_filter->mapToSource(index)); BookmarkItem* item = m_model->item(m_filter->mapToSource(index));

View File

@ -145,7 +145,7 @@ void HistoryTreeView::mouseMoveEvent(QMouseEvent* event)
if (m_type == HistorySidebarViewType) { if (m_type == HistorySidebarViewType) {
QCursor cursor = Qt::ArrowCursor; QCursor cursor = Qt::ArrowCursor;
if (event->buttons() == Qt::NoButton) { if (event->buttons() == Qt::NoButton) {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
if (index.isValid() && !index.data(HistoryModel::IsTopLevelRole).toBool()) { if (index.isValid() && !index.data(HistoryModel::IsTopLevelRole).toBool()) {
cursor = Qt::PointingHandCursor; cursor = Qt::PointingHandCursor;
} }
@ -159,7 +159,7 @@ void HistoryTreeView::mousePressEvent(QMouseEvent* event)
QTreeView::mousePressEvent(event); QTreeView::mousePressEvent(event);
if (selectionModel()->selectedRows().count() == 1) { if (selectionModel()->selectedRows().count() == 1) {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
Qt::MouseButtons buttons = event->buttons(); Qt::MouseButtons buttons = event->buttons();
Qt::KeyboardModifiers modifiers = event->modifiers(); Qt::KeyboardModifiers modifiers = event->modifiers();
@ -181,7 +181,7 @@ void HistoryTreeView::mouseReleaseEvent(QMouseEvent* event)
QTreeView::mouseReleaseEvent(event); QTreeView::mouseReleaseEvent(event);
if (selectionModel()->selectedRows().count() == 1) { if (selectionModel()->selectedRows().count() == 1) {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
if (index.isValid() && !index.data(HistoryModel::IsTopLevelRole).toBool()) { if (index.isValid() && !index.data(HistoryModel::IsTopLevelRole).toBool()) {
const QUrl url = index.data(HistoryModel::UrlRole).toUrl(); const QUrl url = index.data(HistoryModel::UrlRole).toUrl();
@ -199,7 +199,7 @@ void HistoryTreeView::mouseDoubleClickEvent(QMouseEvent* event)
QTreeView::mouseDoubleClickEvent(event); QTreeView::mouseDoubleClickEvent(event);
if (selectionModel()->selectedRows().count() == 1) { if (selectionModel()->selectedRows().count() == 1) {
QModelIndex index = indexAt(event->pos()); QModelIndex index = indexAt(event->position().toPoint());
if (index.isValid() && !index.data(HistoryModel::IsTopLevelRole).toBool()) { if (index.isValid() && !index.data(HistoryModel::IsTopLevelRole).toBool()) {
const QUrl url = index.data(HistoryModel::UrlRole).toUrl(); const QUrl url = index.data(HistoryModel::UrlRole).toUrl();

View File

@ -77,7 +77,7 @@ QPoint QmlMouseEvent::pos() const
if (!m_mouseEvent) { if (!m_mouseEvent) {
return QPoint(-1, -1); return QPoint(-1, -1);
} }
return m_mouseEvent->pos(); return m_mouseEvent->position().toPoint();
} }
QPointF QmlMouseEvent::screenPos() const QPointF QmlMouseEvent::screenPos() const

View File

@ -1387,9 +1387,9 @@ void TabBarHelper::mousePressEvent(QMouseEvent* event)
{ {
event->ignore(); event->ignore();
if (event->buttons() == Qt::LeftButton) { if (event->buttons() == Qt::LeftButton) {
m_pressedIndex = tabAt(event->pos()); m_pressedIndex = tabAt(event->position().toPoint());
if (m_pressedIndex != -1) { if (m_pressedIndex != -1) {
m_dragStartPosition = event->pos(); m_dragStartPosition = event->position().toPoint();
// virtualize selecting tab by click // virtualize selecting tab by click
if (m_pressedIndex == currentIndex() && !m_activeTabBar) { if (m_pressedIndex == currentIndex() && !m_activeTabBar) {
Q_EMIT currentChanged(currentIndex()); Q_EMIT currentChanged(currentIndex());
@ -1403,7 +1403,7 @@ void TabBarHelper::mousePressEvent(QMouseEvent* event)
void TabBarHelper::mouseMoveEvent(QMouseEvent *event) void TabBarHelper::mouseMoveEvent(QMouseEvent *event)
{ {
if (!m_dragInProgress && m_pressedIndex != -1) { if (!m_dragInProgress && m_pressedIndex != -1) {
if ((event->pos() - m_dragStartPosition).manhattanLength() > QApplication::startDragDistance()) { if ((event->position().toPoint() - m_dragStartPosition).manhattanLength() > QApplication::startDragDistance()) {
m_dragInProgress = true; m_dragInProgress = true;
} }
} }
@ -1432,7 +1432,7 @@ void TabBarHelper::mouseMoveEvent(QMouseEvent *event)
return; return;
} }
QRect r = tabRect(m_pressedIndex); QRect r = tabRect(m_pressedIndex);
r.moveLeft(r.x() + (event->pos().x() - m_dragStartPosition.x())); r.moveLeft(r.x() + (event->position().toPoint().x() - m_dragStartPosition.x()));
bool sendEvent = false; bool sendEvent = false;
int diff = r.topRight().x() - tabRect(count() - 1).topRight().x(); int diff = r.topRight().x() - tabRect(count() - 1).topRight().x();
if (diff > 0) { if (diff > 0) {
@ -1444,9 +1444,9 @@ void TabBarHelper::mouseMoveEvent(QMouseEvent *event)
} }
} }
if (sendEvent) { if (sendEvent) {
QPoint pos = event->pos(); QPoint pos = event->position().toPoint();
pos.setX(pos.x() - diff); pos.setX(pos.x() - diff);
QMouseEvent ev(event->type(), pos, event->button(), event->buttons(), event->modifiers()); QMouseEvent ev(event->type(), pos, event->globalPosition(), event->button(), event->buttons(), event->modifiers());
QTabBar::mouseMoveEvent(&ev); QTabBar::mouseMoveEvent(&ev);
} }
} }

View File

@ -500,7 +500,7 @@ void TabBar::mouseDoubleClickEvent(QMouseEvent* event)
return; return;
} }
if (event->buttons() == Qt::LeftButton && emptyArea(event->pos())) { if (event->buttons() == Qt::LeftButton && emptyArea(event->position().toPoint())) {
m_tabWidget->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd, true); m_tabWidget->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd, true);
return; return;
} }
@ -516,8 +516,8 @@ void TabBar::mousePressEvent(QMouseEvent* event)
return; return;
} }
if (event->buttons() == Qt::LeftButton && !emptyArea(event->pos())) { if (event->buttons() == Qt::LeftButton && !emptyArea(event->position().toPoint())) {
m_dragStartPosition = event->pos(); m_dragStartPosition = event->position().toPoint();
} else { } else {
m_dragStartPosition = QPoint(); m_dragStartPosition = QPoint();
} }
@ -537,7 +537,7 @@ void TabBar::mouseMoveEvent(QMouseEvent* event)
if (!m_dragStartPosition.isNull()) { if (!m_dragStartPosition.isNull()) {
int offset = 0; int offset = 0;
const int eventY = event->pos().y(); const int eventY = event->position().toPoint().y();
if (eventY < 0) { if (eventY < 0) {
offset = qAbs(eventY); offset = qAbs(eventY);
} else if (eventY > height()) { } else if (eventY > height()) {
@ -547,7 +547,7 @@ void TabBar::mouseMoveEvent(QMouseEvent* event)
const QPoint global = mapToGlobal(m_dragStartPosition); const QPoint global = mapToGlobal(m_dragStartPosition);
QWidget *w = QApplication::widgetAt(global); QWidget *w = QApplication::widgetAt(global);
if (w) { if (w) {
QMouseEvent mouse(QEvent::MouseButtonRelease, w->mapFromGlobal(global), Qt::LeftButton, Qt::LeftButton, event->modifiers()); QMouseEvent mouse(QEvent::MouseButtonRelease, event->position(), w->mapFromGlobal(global), Qt::LeftButton, Qt::LeftButton, event->modifiers());
QApplication::sendEvent(w, &mouse); QApplication::sendEvent(w, &mouse);
} }
auto *drag = new QDrag(this); auto *drag = new QDrag(this);
@ -573,18 +573,18 @@ void TabBar::mouseReleaseEvent(QMouseEvent* event)
return; return;
} }
if (!rect().contains(event->pos())) { if (!rect().contains(event->position().toPoint())) {
ComboTabBar::mouseReleaseEvent(event); ComboTabBar::mouseReleaseEvent(event);
return; return;
} }
if (event->button() == Qt::MiddleButton) { if (event->button() == Qt::MiddleButton) {
if (emptyArea(event->pos())) { if (emptyArea(event->position().toPoint())) {
m_tabWidget->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd, true); m_tabWidget->addView(QUrl(), Qz::NT_SelectedTabAtTheEnd, true);
return; return;
} }
int id = tabAt(event->pos()); int id = tabAt(event->position().toPoint());
if (id != -1) { if (id != -1) {
m_tabWidget->requestCloseTab(id); m_tabWidget->requestCloseTab(id);
return; return;

View File

@ -251,7 +251,7 @@ void TabIcon::paintEvent(QPaintEvent* event)
void TabIcon::mousePressEvent(QMouseEvent *event) void TabIcon::mousePressEvent(QMouseEvent *event)
{ {
// If audio icon is clicked - we don't propagate mouse press to the tab // If audio icon is clicked - we don't propagate mouse press to the tab
if (m_audioIconDisplayed && event->button() == Qt::LeftButton && m_audioIconRect.contains(event->pos())) { if (m_audioIconDisplayed && event->button() == Qt::LeftButton && m_audioIconRect.contains(event->position().toPoint())) {
m_tab->toggleMuted(); m_tab->toggleMuted();
return; return;
} }

View File

@ -58,7 +58,7 @@ void AddTabButton::wheelEvent(QWheelEvent* event)
void AddTabButton::mouseReleaseEvent(QMouseEvent* event) void AddTabButton::mouseReleaseEvent(QMouseEvent* event)
{ {
if (event->button() == Qt::MiddleButton && rect().contains(event->pos())) { if (event->button() == Qt::MiddleButton && rect().contains(event->position().toPoint())) {
m_tabWidget->addTabFromClipboard(); m_tabWidget->addTabFromClipboard();
} }
@ -68,7 +68,7 @@ void AddTabButton::mouseReleaseEvent(QMouseEvent* event)
void MenuTabs::mouseReleaseEvent(QMouseEvent* event) void MenuTabs::mouseReleaseEvent(QMouseEvent* event)
{ {
if (event->button() == Qt::MiddleButton) { if (event->button() == Qt::MiddleButton) {
QAction* action = actionAt(event->pos()); QAction* action = actionAt(event->position().toPoint());
if (action && action->isEnabled()) { if (action && action->isEnabled()) {
auto* tab = qobject_cast<WebTab*>(qvariant_cast<QWidget*>(action->data())); auto* tab = qobject_cast<WebTab*>(qvariant_cast<QWidget*>(action->data()));
if (tab) { if (tab) {

View File

@ -39,7 +39,7 @@ void HorizontalListWidget::mousePressEvent(QMouseEvent* event)
void HorizontalListWidget::mouseMoveEvent(QMouseEvent* event) void HorizontalListWidget::mouseMoveEvent(QMouseEvent* event)
{ {
if (!itemAt(event->pos())) { if (!itemAt(event->position().toPoint())) {
// Don't unselect item so it ends up with no item selected // Don't unselect item so it ends up with no item selected
return; return;
} }

View File

@ -65,11 +65,11 @@ void TreeWidget::insertTopLevelItems(int index, const QList<QTreeWidgetItem*> &i
void TreeWidget::mousePressEvent(QMouseEvent* event) void TreeWidget::mousePressEvent(QMouseEvent* event)
{ {
if (event->modifiers() == Qt::ControlModifier) { if (event->modifiers() == Qt::ControlModifier) {
Q_EMIT itemControlClicked(itemAt(event->pos())); Q_EMIT itemControlClicked(itemAt(event->position().toPoint()));
} }
if (event->buttons() == Qt::MiddleButton) { if (event->buttons() == Qt::MiddleButton) {
Q_EMIT itemMiddleButtonClicked(itemAt(event->pos())); Q_EMIT itemMiddleButtonClicked(itemAt(event->position().toPoint()));
} }
QTreeWidget::mousePressEvent(event); QTreeWidget::mousePressEvent(event);

View File

@ -1090,13 +1090,13 @@ void WebView::_mousePressEvent(QMouseEvent *event)
break; break;
case Qt::MiddleButton: case Qt::MiddleButton:
m_clickedUrl = page()->hitTestContent(event->pos()).linkUrl(); m_clickedUrl = page()->hitTestContent(event->position().toPoint()).linkUrl();
if (!m_clickedUrl.isEmpty()) if (!m_clickedUrl.isEmpty())
event->accept(); event->accept();
break; break;
case Qt::LeftButton: case Qt::LeftButton:
m_clickedUrl = page()->hitTestContent(event->pos()).linkUrl(); m_clickedUrl = page()->hitTestContent(event->position().toPoint()).linkUrl();
break; break;
default: default:
@ -1114,7 +1114,7 @@ void WebView::_mouseReleaseEvent(QMouseEvent *event)
switch (event->button()) { switch (event->button()) {
case Qt::MiddleButton: case Qt::MiddleButton:
if (!m_clickedUrl.isEmpty()) { if (!m_clickedUrl.isEmpty()) {
const QUrl link = page()->hitTestContent(event->pos()).linkUrl(); const QUrl link = page()->hitTestContent(event->position().toPoint()).linkUrl();
if (m_clickedUrl == link && isUrlValid(link)) { if (m_clickedUrl == link && isUrlValid(link)) {
userDefinedOpenUrlInNewTab(link, event->modifiers() & Qt::ShiftModifier); userDefinedOpenUrlInNewTab(link, event->modifiers() & Qt::ShiftModifier);
event->accept(); event->accept();
@ -1124,7 +1124,7 @@ void WebView::_mouseReleaseEvent(QMouseEvent *event)
case Qt::LeftButton: case Qt::LeftButton:
if (!m_clickedUrl.isEmpty()) { if (!m_clickedUrl.isEmpty()) {
const QUrl link = page()->hitTestContent(event->pos()).linkUrl(); const QUrl link = page()->hitTestContent(event->position().toPoint()).linkUrl();
if (m_clickedUrl == link && isUrlValid(link)) { if (m_clickedUrl == link && isUrlValid(link)) {
if (event->modifiers() & Qt::ControlModifier) { if (event->modifiers() & Qt::ControlModifier) {
userDefinedOpenUrlInNewTab(link, event->modifiers() & Qt::ShiftModifier); userDefinedOpenUrlInNewTab(link, event->modifiers() & Qt::ShiftModifier);
@ -1136,7 +1136,7 @@ void WebView::_mouseReleaseEvent(QMouseEvent *event)
case Qt::RightButton: case Qt::RightButton:
if (s_forceContextMenuOnMouseRelease) { if (s_forceContextMenuOnMouseRelease) {
QContextMenuEvent ev(QContextMenuEvent::Mouse, event->pos(), event->globalPosition().toPoint(), event->modifiers()); QContextMenuEvent ev(QContextMenuEvent::Mouse, event->position().toPoint(), event->globalPosition().toPoint(), event->modifiers());
_contextMenuEvent(&ev); _contextMenuEvent(&ev);
event->accept(); event->accept();
} }

View File

@ -137,10 +137,10 @@ bool AutoScroller::mousePress(QObject* obj, QMouseEvent* event)
// Start? // Start?
if (m_view != view && middleButton) { if (m_view != view && middleButton) {
return showIndicator(view, event->pos()); return showIndicator(view, event->position().toPoint());
} }
else if (!m_indicator->isVisible() && middleButton) { else if (!m_indicator->isVisible() && middleButton) {
return showIndicator(view, event->pos()); return showIndicator(view, event->position().toPoint());
} }
// Stop // Stop

View File

@ -32,13 +32,13 @@ GM_SettingsListWidget::GM_SettingsListWidget(QWidget* parent)
void GM_SettingsListWidget::mousePressEvent(QMouseEvent* event) void GM_SettingsListWidget::mousePressEvent(QMouseEvent* event)
{ {
if (containsRemoveIcon(event->pos())) { if (containsRemoveIcon(event->position().toPoint())) {
Q_EMIT removeItemRequested(itemAt(event->pos())); Q_EMIT removeItemRequested(itemAt(event->position().toPoint()));
return; return;
} }
if (containsUpdateIcon(event->pos())) { if (containsUpdateIcon(event->position().toPoint())) {
Q_EMIT updateItemRequested(itemAt(event->pos())); Q_EMIT updateItemRequested(itemAt(event->position().toPoint()));
return; return;
} }
@ -47,7 +47,7 @@ void GM_SettingsListWidget::mousePressEvent(QMouseEvent* event)
void GM_SettingsListWidget::mouseDoubleClickEvent(QMouseEvent* event) void GM_SettingsListWidget::mouseDoubleClickEvent(QMouseEvent* event)
{ {
if (containsRemoveIcon(event->pos()) || containsUpdateIcon(event->pos())) if (containsRemoveIcon(event->position().toPoint()) || containsUpdateIcon(event->position().toPoint()))
return; return;
QListWidget::mouseDoubleClickEvent(event); QListWidget::mouseDoubleClickEvent(event);

View File

@ -171,7 +171,7 @@ bool QjtMouseGestureFilter::mouseButtonPressEvent(QMouseEvent* event, QObject* o
if (event->button() == d->gestureButton) { if (event->button() == d->gestureButton) {
// d->px = QPixmap::grabWidget(static_cast<QWidget*>(obj)); // d->px = QPixmap::grabWidget(static_cast<QWidget*>(obj));
d->mgr->startGesture(event->pos().x(), event->pos().y()); d->mgr->startGesture(event->position().toPoint().x(), event->position().toPoint().y());
d->tracing = true; d->tracing = true;
} }
@ -184,7 +184,7 @@ bool QjtMouseGestureFilter::mouseButtonReleaseEvent(QMouseEvent* event, QObject*
if (d->tracing && event->button() == d->gestureButton) { if (d->tracing && event->button() == d->gestureButton) {
d->tracing = false; d->tracing = false;
return d->mgr->endGesture(event->pos().x(), event->pos().y()); return d->mgr->endGesture(event->position().toPoint().x(), event->position().toPoint().y());
// d->px = QPixmap(); // d->px = QPixmap();
// static_cast<QWidget*>(obj)->update(); // static_cast<QWidget*>(obj)->update();
} }
@ -197,7 +197,7 @@ bool QjtMouseGestureFilter::mouseMoveEvent(QMouseEvent* event, QObject* obj)
Q_UNUSED(obj) Q_UNUSED(obj)
if (d->tracing) { if (d->tracing) {
d->mgr->addPoint(event->pos().x(), event->pos().y()); d->mgr->addPoint(event->position().toPoint().x(), event->position().toPoint().y());
// static_cast<QWidget*>(obj)->update(); // static_cast<QWidget*>(obj)->update();
} }