Results 1 to 3 of 3

Thread: Impossible Qt quick application from Ray Rischpater's book

  1. #1
    Join Date
    Nov 2016
    Posts
    48
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Impossible Qt quick application from Ray Rischpater's book

    Hi all. At first no quick application possible. You told me to install qtdeclarative5-dev and qml-module-qtqick2. I did that. I have now Qtquick but I have a problem with my first code. Look please at line 9. Here is the code:
    Qt Code:
    1. import QtQuick 2.5
    2. import QtQuick.Window 2.2
    3.  
    4. Window {
    5. visible: true
    6. width: 360
    7. height: 360
    8.  
    9. MouseArea {
    10. anchors.fill: parent
    11. onCliqued: {//Cannot assign to non-existent property "onCliqued"
    12. Qt.quit();
    13. }
    14. }
    15.  
    16. Text {
    17. id: text
    18. text: qsTr("Hello World")
    19. anchors.centerIn: parent
    20. }
    21.  
    22. Rectangle {
    23. id: rectangle1
    24. x: 135
    25. y: 50
    26. width: 100
    27. height: 100
    28. color: "#ffff22"
    29.  
    30. MouseArea {
    31. id: mouseArea1
    32. anchors.fill: parent
    33. onClicked: text.text = qsTr("Hi there ! ")
    34. }
    35. }
    36. }
    To copy to clipboard, switch view to plain text mode 
    I dont find how to tag the above code. Sorry. Look please at the commented line. Thanks
    Last edited by anda_skoa; 29th November 2016 at 12:25. Reason: missing [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: Impossible Qt quick application from Ray Rischpater's book

    MouseArea has no signal named "cliqued" so there is no signal handler "onCliqued"

    I would have assumed that you wanted to handle the "clicked" signal, but you do that later on so I am not sure which signal you are looking for here.

    Cheers,
    _

  3. #3
    Join Date
    Nov 2016
    Posts
    48
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: Impossible Qt quick application from Ray Rischpater's book

    I deleted all about first MouseArea, and now everything is OK. Thank you very much. But how is it possible there is such a big error in the book ?? The error is on page 19 of the book "Application Development with Qt Creator. Second Edition".

Similar Threads

  1. Impossible to create a quick project
    By sylas in forum Newbie
    Replies: 4
    Last Post: 25th November 2016, 11:47
  2. Qt Quick Book in Italian Language
    By paolosereno in forum Qt Quick
    Replies: 0
    Last Post: 17th August 2015, 17:10
  3. Replies: 0
    Last Post: 29th March 2015, 17:46
  4. Quick application (Qa)
    By tilsitt in forum Qt-based Software
    Replies: 1
    Last Post: 7th April 2011, 13:45
  5. i need to know insert and delete methods in qsql for phone book application
    By gaurav purohit in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 15th September 2009, 14:04

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.