Hi,

I have an Image loaded in a ScrollView and I have attempted to override the ScrollView onWheel behaviour as follows:


Qt Code:
  1. import QtQuick 2.1
  2. import QtQuick.Controls 1.0
  3.  
  4. Rectangle {
  5. id: root
  6. color: "grey"
  7.  
  8. ScrollView {
  9. id: scrollview
  10. frameVisible: false
  11. anchors.fill: parent
  12.  
  13. Image {
  14. source: "qrc:/images/sample.jpg"
  15.  
  16. MouseArea {
  17. anchors.fill: parent
  18. onClicked: {
  19. console.log("onClicked")
  20. }
  21.  
  22. onWheel: {
  23. console.log("onWheel")
  24. }
  25. }
  26. }
  27. }
  28. }
To copy to clipboard, switch view to plain text mode 

When run if I click on the image the onClicked() is called ok, but if I move the mouse wheel the onWheel is never called.

What am I doing wrong?

Eventually (if I can get it to work) I would like to override it in such a way that moving the mouse wheel while holding the control key down calls some application specific code. Moving the wheel without holding the control key should allow the ScrollView to move the scrollbar. Something like:

Qt Code:
  1. onWheel: {
  2. console.log("onWheel")
  3. if (wheel.modifiers & Qt.ControlModifier)
  4. doSomething(wheel)
  5. else
  6. how_do_I_call_the_normal_behaviour?
  7. }
To copy to clipboard, switch view to plain text mode 

2. Any ideas on how to call the default behaviour? Is there a way to not consume the event so that the parent can do so?

Thanks for any help