Questions tagged [mousearea]

28 questions
16
votes
4 answers

MouseArea stole QML element's mouse events

If I put a MouseArea on a QML element, then MouseArea will steal all mouse events. Thus, TextEdit will be uneditable and unselectable. TextEdit { // some properties MouseArea { // some properties onClicked: { /* do something…
比尔盖子
  • 2,693
  • 5
  • 37
  • 53
6
votes
2 answers

Keep cursor shape while pressed as it moves outside its MouseArea

I am implementing narrow resize handles which give me annoying behavior. The cursor shape is as expected while the mouse is directly over the handle, but once dragging the handle is initiated, the cursor shape becomes inconsistent. There are two…
dtech
  • 47,916
  • 17
  • 112
  • 190
3
votes
1 answer

QML MouseArea: onExited doesn't trigger after programmatically moving mouse into MouseArea

This issue happens on Windows, but not on Linux. I haven't tried any other platforms. I have a custom class (code below) that uses QCursor to set the mouse position. The issue is with the following code (repo): import QtQuick 2.15 import…
Joshua Wade
  • 4,755
  • 2
  • 24
  • 44
2
votes
1 answer

QtLocation QML: MouseArea stop Updating on hover

I have a qml map application and I added a marker as MapQuickItem. I have a lat lon display connected to map Mousearea, when I move the mouse on the map i read lat/lon in realtime, and all works well. marker.qml is a mapquickItem with its Mousearea,…
Gab74
  • 45
  • 5
2
votes
1 answer

Propagating MouseArea events from parent to child

I have a global MouseArea mouseAreaRoot taking the whole screen to prevents actions on specific buttons when a popup is opened. Within the QML objects below this global MouseArea, I have a nested MouseArea nestedMenuMouseArea handling the clicks on…
Grégoire Borel
  • 1,880
  • 3
  • 33
  • 55
2
votes
1 answer

qml button not firing, same with MouseArea

Ive created a new QML project based on Qt 5.9.3. I setup a simple ApplicationWindow with a Button as well as my own button (MyButton) and I never get the onClicked() event to fire (apparently) for either of them. My application window pops up with…
Tim
  • 647
  • 1
  • 10
  • 21
2
votes
0 answers

QML: ScrollView and MouseAreas: 'mouse hover' not detected on the scrollbar

I have a QML application and need to open a dialog when I press a button. The dialog must be closed when the mouse is out of the dialog (with no click, so I think 'Popup' control can not be used). For that, I use MouseAreas and control when the…
Diego
  • 336
  • 2
  • 21
2
votes
1 answer

Use two MouseAreas simultaneously in Android

I am in the need to emulate a control key press on a tablet device that doesn't have a physical keyboard. In order to do so, I have an on-screen floating button which the user can use to achieve that. The problem however is that there can be only…
dtech
  • 47,916
  • 17
  • 112
  • 190
2
votes
1 answer

Phantom double clicks from MouseArea on Android

While testing out an application on Android I noticed something funky going on. A double click event handler has been triggering without any double clicks occurring on that particular item. Trying to isolate the issue I discovered that pretty much…
dtech
  • 47,916
  • 17
  • 112
  • 190
1
vote
1 answer

Get mouse x & y in nested MouseArea with hoverEnabled

I made a simplified MapImage component which allows to zoom and pan an image with the mouse. This component uses Flickable and MouseArea components. The MapImage component just handles image display, zooming and panning. I want to use another…
matt
  • 384
  • 2
  • 11
1
vote
1 answer

How can I use a MouseArea on a ShapePath in QML?

I'm currently learning how to use the Shapes in QML to draw more advanced components. I'm trying to create a button which looks like this : When I try to apply a MouseArea over the Shape component, the MouseArea does not seem to be able to catch…
Scytes
  • 13
  • 5
1
vote
1 answer

QML MouseArea, trigger and propagate events

I have a QML component with buttons, ... in it. I put a MouseArea which covers this entire component because I need to execute an action wherever I click on the component. However, I also want to execute the action behind the MouseArea. For example,…
SteveTJS
  • 635
  • 17
  • 32
1
vote
1 answer

QML: Problems with mousearea overlapping

I have a QML application and problems with MouseAreas. In a small test app, there is a red rectangle and when mouse enters this rect, a grey menu appears below (created with a Loader). This grey menu must be open while mouse is over the red…
Diego
  • 336
  • 2
  • 21
1
vote
2 answers

QML how to set color in a mouseArea

I want to design the following button layout: It has a restart button image laid on top of a blue background. I want to replicate the same in Qt using QML. I am using a MouseArea Qt Quick object over which I am overlapping the image in Stretch fill…
0
votes
3 answers

QML Keep transition during the x seconds on mousearea Pressed once

I checked the different mouseArea events in the documentation and there is no chance to execute a function while a mouseArea is being pressed once. I want to keep the transition for 5 seconds and after 5 seconds it should out back. Here is what i'm…
christoph
  • 29
  • 4
1
2