Results 1 to 20 of 21

Thread: Why isn't it working? About external JS

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2012
    Posts
    26
    Thanks
    3
    Platforms
    Windows

    Default Re: Why isn't it working? About external JS

    because if it works, it is very easy to applicate anywhere

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Why isn't it working? About external JS

    The thing is it doesn't work And you are really not helping me solve your problem. The code you posted last time makes completely no sense and your explanation doesn't really explain what you are trying to do. Your "because if it works, it is very easy to applicate anywhere" also doesn't add anything to the subject. Please state what you are trying to achieve instead of trying to fix this nonsense code.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jul 2012
    Posts
    26
    Thanks
    3
    Platforms
    Windows

    Default Re: Why isn't it working? About external JS

    Quote Originally Posted by wysota View Post
    The thing is it doesn't work And you are really not helping me solve your problem. The code you posted last time makes completely no sense and your explanation doesn't really explain what you are trying to do. Your "because if it works, it is very easy to applicate anywhere" also doesn't add anything to the subject. Please state what you are trying to achieve instead of trying to fix this nonsense code.
    ok, I have a animation qml file, Anime.qml, and I added it to Main.qml as Anime { ...some code... }. In this Anime.qml, if mouse exit from mouse area (I did it with onExited{..some code...}), some opacity and visibilty change and they works well. However, I want to add a code for SCORE in onExited{...}, because I want to increase score +1, when onExited works.

    This SCORE is in Main.qml like Text{... text = bla bla ...} , and normally it shows 0. I want that, if onExited condition ok in Anime.qml, this SCORE text in Main.qml should increase +1, and we see 1 instead of 0 on the screen.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Why isn't it working? About external JS

    That's quite easy. You don't need any extra javascript files for this...

    javascript Code:
    1. import QtQuick 1.1
    2.  
    3. Rectangle {
    4. id: root
    5. width: 600
    6. height: 400
    7.  
    8. property int score: 0
    9.  
    10. Text {
    11. id: txt
    12. anchors.top: parent.top
    13. anchors.left: parent.left
    14. anchors.margins: 16
    15. text: score
    16. }
    17.  
    18. Rectangle {
    19. anchors.left: parent.left
    20. anchors.right: parent.right
    21. anchors.top: txt.bottom
    22. anchors.bottom: parent.bottom
    23. color: "lightyellow"
    24.  
    25. Rectangle {
    26. width: 100
    27. height: 100
    28. radius: width/2
    29. anchors.centerIn: parent
    30. color: "blue"
    31.  
    32. MouseArea {
    33. anchors.fill: parent
    34. hoverEnabled: true
    35. onExited: root.score = root.score+1
    36. }
    37. }
    38. }
    39.  
    40. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to use an external variable ?
    By Computer Hater in forum General Programming
    Replies: 10
    Last Post: 25th June 2011, 04:45
  2. QProcess & Working with External Programs
    By jstippey in forum Qt Programming
    Replies: 2
    Last Post: 20th December 2010, 20:04
  3. Using external libraries
    By Handi in forum Newbie
    Replies: 5
    Last Post: 9th December 2010, 22:51
  4. Use external DLL ?
    By pl01 in forum Newbie
    Replies: 5
    Last Post: 10th November 2010, 14:48
  5. add external api
    By adamatic in forum Qt Programming
    Replies: 6
    Last Post: 16th April 2009, 10:25

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.