Item <-- MouseArea | ||
属性 | | |
acceptedButtons : Qt::MouseButtons | | |
containsMouse : bool | 【书】只读属性。表明当前鼠标光标是否在MouseArea上,默认只有鼠标的一个按钮处于按下状态时才可以被检测到。 | |
containsPress : bool | | |
cursorShape : Qt::CursorShape | | |
drag | 下面这些解释都来自书P117 | |
drag.active : bool | 【书】指定目标项目当前是否可以被拖动。值:true 或 false ?似乎是个只读属性不能设置。等于说设置了target就等于说是true了? | |
drag.axis : enumeration | 【书】指定可以拖动的方向。值:Drag.XAxis 程度方向 Drag.YAxis 垂直方向 Drag.XAndYAxis 程度和垂直方向 | |
drag.filterChildren : bool | 【书】使子 MouseArea 也启用拖动。值:true 或 false | |
drag.maximumX : real | 【书】最小和最大拖动隔断。值是像素,real类型的值。 | |
drag.maximumY : real | ||
drag.minimumX : real | ||
drag.minimumY : real | ||
drag.smoothed : bool | 【书】是否平滑拖动。值:true或false | |
drag.target : Item | 【书】指定要拖动的项目ID。值:对象 | |
drag.threshold : real | 【书】启用拖动的阈值,超过该值才被认为是一次拖动;合理设置阈值可以有效避免用户因抖动等原因造成的拖动误判。 real类型的值,以像素为单位。 | |
enabled : bool | 【书】是否启用鼠标处理,默认为true。如果设置为false则不处理任何鼠标事故。 | |
hoverEnabled : bool | 【书】默认环境下MouseArea项目只陈诉鼠标单击而不陈诉鼠标光标的位置改变,这可以通过设置hoverEnabled属性为true来举行更改。如许设置后,onPositionChanged(),onEntered()和onExited()等处理函数才可以使用。而且这时containsMouse属性也可以在没有鼠标按钮按下的环境下检查光标。 | |
mouseX : real | onMouseXChanged: { if (mouseX - recZoom.x >= 0) { xScaleZoom = 1; recZoom.width = mouseX - recZoom.x; } else { xScaleZoom = -1; recZoom.width = recZoom.x - mouseX; } } | |
mouseY : real | onMouseYChanged: { if (mouseY - recZoom.y >= 0) { yScaleZoom = 1; recZoom.height = mouseY - recZoom.y; } else { yScaleZoom = -1; recZoom.height = recZoom.y - mouseY; } } | |
pressAndHoldInterval : int | | |
pressed : bool | 【书】只读属性,表明是否在MouseArea上按住了鼠标按钮,这个属性经常用于属性绑定,可以实现在鼠标按下时执行一些操作。 【补例子】 | |
pressedButtons : MouseButtons | | |
preventStealing : bool | | |
propagateComposedEvents : bool | 【书】属性设置为true来传播clicked,doubleClicked和pressAndHold等事故。但是只有在MouseArea没有接受这些事故的时候,它们才可以继承向下传播。 | |
scrollGestureEnabled : bool | | |
信号 | | |
canceled() | | |
clicked(MouseEvent mouse) | | |
doubleClicked(MouseEvent mouse) | | |
entered() | | |
exited() | | |
positionChanged(MouseEvent mouse) | onPositionChanged() | |
pressAndHold(MouseEvent mouse) | | |
pressed(MouseEvent mouse) | onPressed() | |
released(MouseEvent mouse) | onReleased() | |
wheel(WheelEvent wheel) | | |
Method | | |
| |
欢迎光临 IT评测·应用市场-qidao123.com (https://dis.qidao123.com/) | Powered by Discuz! X3.4 |