Results 1 to 1 of 1

Thread: Mouse propogation event

  1. #1
    Join Date
    Mar 2021
    Posts
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Exclamation Mouse propogation event

    Qt Forum,
    This is to state an issue regarding a problem of overlapping qml components.
    The requirement of our application is to get some value on touch points with a marker
    and one touching the same point again, the marker is removed.
    We are using repeaters to create components at respecting x,y cordinates.

    1. The window consists of a grid of small cells which cover the whole window.
    2. As the user clicks the screen, the coordinates and grid cell index is send to cpp
    and respective temperature is returned to the qml.
    3. We are using MVC architecture to
    store the temperate , grid index and coordinates of one marker component and
    use repeater to display on the screen.
    4. We created a marker component in qml and used the component to show the point touched
    by user with the corresponding temperature
    5. When the user clicks back on same grod index, the marker present tere is removed.

    Now, the problem occurs that when more than one markers are close to each other, they overlapp
    and its difficult to make out the readings.
    We used mouse propogation technique to stop qml to send grid cells to cpp very near to any other point.

    Qt Code:
    1. //
    2. Repeater {
    3. id: repeater
    4. anchors.fill: parent
    5. model: temperatureModel
    6. delegate: Item {
    7. id: markerItem
    8. x: screenCoordinate.x-width/2
    9. y: screenCoordinate.y-height/2
    10. width: 200
    11. height: 200
    12. TemperatureMarkerView {
    13. width: 50
    14. height: 50
    15. anchors.centerIn: parent
    16. temp: temperature
    17. displayRight: (videoItemRect.width - screenCoordinate.x) > width ? true : false
    18. }
    19. MouseArea {
    20. anchors.fill: parent
    21. onClicked: {
    22. mouse.accepted = true // this line does not allow the qml to send grid index to
    23. // cpp for when user click inside the container which contains
    24. // current marker
    25. }
    26. }
    27. }
    28. }
    To copy to clipboard, switch view to plain text mode 

    But the problem here is that, since qml doesnt send the grid index back, the cpp cannot delete the already present marker as well
    Last edited by d_stranz; 2nd March 2021 at 16:51. Reason: missing [code] tags

Similar Threads

  1. Event Filter Mouse Press/Release Event not called
    By Alundra in forum Qt Programming
    Replies: 3
    Last Post: 22nd September 2016, 01:59
  2. Ogre+qt mouse event (add object with mouse problem)
    By rimie23 in forum Qt Programming
    Replies: 7
    Last Post: 24th April 2012, 11:49
  3. Replies: 14
    Last Post: 17th January 2012, 10:01
  4. Replies: 3
    Last Post: 7th January 2012, 09:38
  5. Replies: 1
    Last Post: 30th October 2009, 09:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.