| Summary: | MouseArea doesn't have the property cursorShape. | ||
|---|---|---|---|
| Product: | [Unmaintained] QmlWeb | Reporter: | Igor A. <igor.andruszkiewicz> |
| Component: | QtQuick | Assignee: | Anton Kreuzkamp <akreuzkamp> |
| Status: | RESOLVED UNMAINTAINED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Igor A.
2015-11-29 22:45:12 UTC
I propose following changes
1. New enums in Qt
Key_Play: 250,
Key_Sleep: 95,
Key_Zoom: 251,
Key_Cancel: 3,
// CursorShape
ArrowCursor: 0,
UpArrowCursor: 1,
CrossCursor: 2,
WaitCursor: 3,
IBeamCursor: 4,
SizeVerCursor: 5,
SizeHorCursor: 6,
SizeBDiagCursor: 7,
SizeFDiagCursor: 8,
SizeAllCursor: 9,
BlankCursor: 10,
SplitVCursor: 11,
SplitHCursor: 12,
PointingHandCursor: 13,
ForbiddenCursor: 14,
WhatsThisCursor: 15,
BusyCursor: 16,
OpenHandCursor: 17,
ClosedHandCursor: 18,
DragCopyCursor: 19,
DragMoveCursor: 20,
DragLinkCursor: 21,
LastCursor: 21, //DragLinkCursor,
BitmapCursor: 24,
CustomCursor: 25
}
2. the property
createSimpleProperty("enum", this, "cursorShape");
3. CSS cursor change
this.dom.onmouseover = function(e) {
self.containsMouse = true;
self.dom.style.cursor = cursorShapeToCSS();
self.entered();
}
this.dom.onmouseout = function(e) {
self.containsMouse = false;
self.dom.style.cursor = "auto";
self.exited();
}
this.dom.onmousemove = function(e) {
if (self.enabled && (self.hoverEnabled || self.pressed)) {
var mouse = eventToMouse(e);
self.positionChanged(mouse);
self.mouseX = mouse.x;
self.mouseY = mouse.y;
}
}
function cursorShapeToCSS(){
var cursor = "auto";
switch (self.cursorShape) {
case Qt.ArrowCursor: cursor = "default"; break;
case Qt.UpArrowCursor: cursor = "auto";break;
case Qt.CrossCursor: cursor = "crosshair";break;
case Qt.WaitCursor: cursor = "wait";break;
case Qt.IBeamCursor: cursor = "auto";break;
case Qt.SizeVerCursor: cursor = "auto";break;
case Qt.SizeHorCursor: cursor = "auto";break;
case Qt.SizeBDiagCursor: cursor = "auto";break;
case Qt.SizeFDiagCursor: cursor = "auto";break;
case Qt.SizeAllCursor: cursor = "auto";break;
case Qt.BlankCursor: cursor = "auto";break;
case Qt.SplitVCursor: cursor = "auto";break;
case Qt.SplitHCursor: cursor = "auto";break;
case Qt.PointingHandCursor: cursor = "pointer";break;
case Qt.ForbiddenCursor: cursor = "not-allowed";break;
case Qt.WhatsThisCursor: cursor = "auto";break;
case Qt.BusyCursor: cursor = "progress";break;
case Qt.OpenHandCursor: cursor = "auto";break;
case Qt.ClosedHandCursor: cursor = "move";break;
case Qt.DragCopyCursor: cursor = "auto";break;
case Qt.DragMoveCursor: cursor = "auto";break;
case Qt.DragLinkCursor: cursor = "auto";break;
case Qt.LastCursor: cursor = "auto";break;
case Qt.BitmapCursor: cursor = "auto";break;
case Qt.CustomCursor: cursor = "auto"; break;
}
return cursor;
}
Thank you for the bug report. As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists. If this bug is no longer persisting or relevant please change the status to resolved. This project is unfortunately no longer maintained. If a new maintainer wants to step up and take care, the project is archived here: https://invent.kde.org/unmaintained/qmlweb You can just clone it in your private namespace on invent.kde.org and if you have started to work on it and fixed/implemented something get it reviewed and the project unarchived. Sorry for the inconveniences. |