Results 1 to 4 of 4

Thread: why not works my mouseArea

  1. #1
    Join Date
    Mar 2016
    Posts
    9
    Qt products
    Qt5
    Platforms
    MacOS X

    Default why not works my mouseArea

    AnalogGauge.qml

    Qt Code:
    1. import QtQuick 2.0
    2. import QtQuick.Extras 1.4
    3. import QtQuick.Controls.Styles 1.4
    4.  
    5. Item {
    6. id:itemParent
    7. property real valueIn: 888888//valeur brut du protocole
    8. property int valprecision:1
    9. property var objChamps
    10. property int valminValue
    11. property int valmaxValue
    12. property int valangleMin:-120
    13. property int valangleMax:120
    14. property real vallabelStepSize
    15. property real valtickmarkStepSize
    16. property real valminorTickmarkCount
    17. property real valstepToMoveNeedle
    18.  
    19.  
    20. Rectangle{
    21. anchors.fill:parent
    22. color:"red"
    23.  
    24. MouseArea{
    25. acceptedButtons: Qt.LeftButton | Qt.RightButton
    26. anchors.fill:parent
    27. onClicked: console.log("test")
    28. }
    29. }
    30. }
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. AnalogGauge{
    2. objectName: "AFR"
    3. width:180
    4. height:180
    5. valminValue: 12
    6. valmaxValue: 18
    7. valstepToMoveNeedle:0.1
    8. vallabelStepSize:1
    9. valtickmarkStepSize:0.5
    10. valminorTickmarkCount:4
    11. valangleMin: -90
    12. valangleMax: 90
    13. objChamps:appli.getChamps(1,3)
    14. }
    To copy to clipboard, switch view to plain text mode 


    hello! my mouseArea not works, i don't understand, but rectangle is really "red"
    please help me.

    thank's
    Last edited by anda_skoa; 11th March 2016 at 13:11. Reason: fix code tags

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: why not works my mouseArea

    If you run AnalogGauge.qml in qmlscene, does it work?
    Because I've just copied the code for it to a file and it did work.

    Cheers,
    _

  3. #3
    Join Date
    Mar 2016
    Posts
    9
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: why not works my mouseArea

    if the item is dragable but is create in grid/ row....
    in this case, Mouse Area not work's, clicked not work's....


    it's work's, i don't understand what is happening.

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: why not works my mouseArea

    Well, if you have code that does not work, wouldn't it be a good idea to post that instead of or additional to code that works?

    Cheers,
    _

Similar Threads

  1. mousearea outside flickable not working
    By joko in forum Qt Quick
    Replies: 3
    Last Post: 15th December 2014, 17:36
  2. mousearea containsmouse property
    By joko in forum Qt Quick
    Replies: 8
    Last Post: 4th December 2014, 16:07
  3. MouseArea
    By Viper666 in forum Qt Quick
    Replies: 6
    Last Post: 10th January 2013, 14:30
  4. Replies: 3
    Last Post: 6th July 2011, 07:59
  5. Problem with MouseArea element
    By chiru in forum Qt Quick
    Replies: 1
    Last Post: 27th November 2010, 01:23

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.