Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
5d086f9c
Commit
5d086f9c
authored
Jun 05, 2019
by
Christoffer Ackelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QT: Fix for broken DragEnter/DragLeave.
parent
cf530345
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
22 deletions
+32
-22
xtt/lib/flow/qt/flow_draw_qt.cqt
xtt/lib/flow/qt/flow_draw_qt.cqt
+16
-11
xtt/lib/glow/qt/glow_draw_qt.cqt
xtt/lib/glow/qt/glow_draw_qt.cqt
+16
-11
No files found.
xtt/lib/flow/qt/flow_draw_qt.cqt
View file @
5d086f9c
...
@@ -647,22 +647,30 @@ void FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
...
@@ -647,22 +647,30 @@ void FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
button_pressed = 0;
button_pressed = 0;
button_clicked_and_pressed = 0;
button_clicked_and_pressed = 0;
}
}
if (pos.x() > 0 && pos.y() > 0 && pos.x() < target->width() && pos.y() < target->height()) {
if (button1_pressed || button2_pressed || button3_pressed) {
if (button1_pressed || button2_pressed || button3_pressed) {
if (!ctx->cursor_present) {
sts = ctx->event_handler(flow_eEvent_Enter, pos.x(), pos.y(), 0, 0);
} else {
sts = ctx->event_handler(
sts = ctx->event_handler(
flow_eEvent_ButtonMotion, pos.x(), pos.y(), 0, 0);
flow_eEvent_ButtonMotion, pos.x(), pos.y(), 0, 0);
}
} else {
} else {
sts = ctx->event_handler(
sts = ctx->event_handler(
flow_eEvent_CursorMotion, pos.x(), pos.y(), 0, 0);
flow_eEvent_CursorMotion, pos.x(), pos.y(), 0, 0);
}
}
} else if (ctx->cursor_present && (button1_pressed || button2_pressed || button3_pressed)) {
sts = ctx->event_handler(flow_eEvent_Leave, pos.x(), pos.y(), 0, 0);
}
break;
break;
}
}
case QEvent::Enter: {
case QEvent::Enter: {
QPoint pos =
QCursor::pos(
);
QPoint pos =
target->mapFromGlobal(QCursor::pos()
);
sts = ctx->event_handler(flow_eEvent_Enter, pos.x(), pos.y(), 0, 0);
sts = ctx->event_handler(flow_eEvent_Enter, pos.x(), pos.y(), 0, 0);
break;
break;
}
}
case QEvent::Leave: {
case QEvent::Leave: {
QPoint pos =
QCursor::pos(
);
QPoint pos =
target->mapFromGlobal(QCursor::pos()
);
sts = ctx->event_handler(flow_eEvent_Leave, pos.x(), pos.y(), 0, 0);
sts = ctx->event_handler(flow_eEvent_Leave, pos.x(), pos.y(), 0, 0);
break;
break;
}
}
...
@@ -674,9 +682,6 @@ void FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
...
@@ -674,9 +682,6 @@ void FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
sts = ctx->event_handler(flow_eEvent_Unmap, 0, 0, 0, 0);
sts = ctx->event_handler(flow_eEvent_Unmap, 0, 0, 0, 0);
break;
break;
}
}
case QEvent::FocusIn:
case QEvent::FocusOut:
break;
case QEvent::Wheel: {
case QEvent::Wheel: {
QWheelEvent* wheelEvent = ((QWheelEvent*)event);
QWheelEvent* wheelEvent = ((QWheelEvent*)event);
if (wheelEvent->delta() > 0) {
if (wheelEvent->delta() > 0) {
...
...
xtt/lib/glow/qt/glow_draw_qt.cqt
View file @
5d086f9c
...
@@ -705,22 +705,30 @@ void GlowDrawQt::event_handler(QEvent* event, QWidget* target)
...
@@ -705,22 +705,30 @@ void GlowDrawQt::event_handler(QEvent* event, QWidget* target)
button_pressed = 0;
button_pressed = 0;
button_clicked_and_pressed = 0;
button_clicked_and_pressed = 0;
}
}
if (pos.x() > 0 && pos.y() > 0 && pos.x() < target->width() && pos.y() < target->height()) {
if (button1_pressed || button2_pressed || button3_pressed) {
if (button1_pressed || button2_pressed || button3_pressed) {
if (!ctx->cursor_present) {
sts = ctx->event_handler(glow_eEvent_Enter, pos.x(), pos.y(), 0, 0);
} else {
sts = ctx->event_handler(
sts = ctx->event_handler(
glow_eEvent_ButtonMotion, pos.x(), pos.y(), 0, 0);
glow_eEvent_ButtonMotion, pos.x(), pos.y(), 0, 0);
}
} else {
} else {
sts = ctx->event_handler(
sts = ctx->event_handler(
glow_eEvent_CursorMotion, pos.x(), pos.y(), 0, 0);
glow_eEvent_CursorMotion, pos.x(), pos.y(), 0, 0);
}
}
} else if (ctx->cursor_present && (button1_pressed || button2_pressed || button3_pressed)) {
sts = ctx->event_handler(glow_eEvent_Leave, pos.x(), pos.y(), 0, 0);
}
break;
break;
}
}
case QEvent::Enter: {
case QEvent::Enter: {
QPoint pos =
QCursor::pos(
);
QPoint pos =
target->mapFromGlobal(QCursor::pos()
);
sts = ctx->event_handler(glow_eEvent_Enter, pos.x(), pos.y(), 0, 0);
sts = ctx->event_handler(glow_eEvent_Enter, pos.x(), pos.y(), 0, 0);
break;
break;
}
}
case QEvent::Leave: {
case QEvent::Leave: {
QPoint pos =
QCursor::pos(
);
QPoint pos =
target->mapFromGlobal(QCursor::pos()
);
sts = ctx->event_handler(glow_eEvent_Leave, pos.x(), pos.y(), 0, 0);
sts = ctx->event_handler(glow_eEvent_Leave, pos.x(), pos.y(), 0, 0);
break;
break;
}
}
...
@@ -732,9 +740,6 @@ void GlowDrawQt::event_handler(QEvent* event, QWidget* target)
...
@@ -732,9 +740,6 @@ void GlowDrawQt::event_handler(QEvent* event, QWidget* target)
sts = ctx->event_handler(glow_eEvent_Unmap, 0, 0, 0, 0);
sts = ctx->event_handler(glow_eEvent_Unmap, 0, 0, 0, 0);
break;
break;
}
}
case QEvent::FocusIn:
case QEvent::FocusOut:
break;
case QEvent::Wheel: {
case QEvent::Wheel: {
// TODO: the event handler should also take scroll delta as a parameter
// TODO: the event handler should also take scroll delta as a parameter
QWheelEvent* wheelEvent = ((QWheelEvent*)event);
QWheelEvent* wheelEvent = ((QWheelEvent*)event);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment