Results 1 to 3 of 3

Thread: Problem with property bool

  1. #1
    Join Date
    Feb 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Problem with property bool

    Hi
    This is my code:
    Qt Code:
    1. import Qt 4.7
    2.  
    3. Item {
    4.  
    5. width: 180
    6. height: 60
    7. id: root
    8.  
    9. property bool collapsedButton: true
    10. (...)
    11. ParallelAnimation {
    12. running:root.collapsedButton
    13. NumberAnimation { target: backgroundCallapsed; property: "width"; to: 64 ;}
    14. NumberAnimation { target: background; property: "opacity"; to: 0 }
    15. NumberAnimation { target: text; property: "opacity"; to: 0 }
    16.  
    17. }
    18. (...)
    To copy to clipboard, switch view to plain text mode 
    Thie code does not work, but when I change "root.collapsedButton" form running to "true" this script work

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

    Default Re: Problem with property bool

    Define what "does not work" mean. Do you get any errors at the console?
    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
    Feb 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem with property bool

    Aniamtion don't run. Console is empty. Variable "collapsedButton" contains value "true", but animation don't start.
    I tried this:
    Qt Code:
    1. import Qt 4.7
    2.  
    3. Item {
    4.  
    5. width: 180
    6. height: 60
    7. id: root
    8.  
    9. property bool collapsedButton: true
    10. (...)
    11. ParallelAnimation {
    12. running:{
    13. if(root.collapsedButton == true){
    14. true
    15. }else{
    16. false
    17. }
    18. NumberAnimation { target: backgroundCallapsed; property: "width"; to: 64 ;}
    19. NumberAnimation { target: background; property: "opacity"; to: 0 }
    20. NumberAnimation { target: text; property: "opacity"; to: 0 }
    21.  
    22. }
    23. (...)
    To copy to clipboard, switch view to plain text mode 
    but aniamtion don't start too.

Similar Threads

  1. setVisible(bool) problem, only works one way
    By hojoff79 in forum Newbie
    Replies: 3
    Last Post: 29th December 2010, 18:01
  2. QListView::setSelectionRectVisible(bool)
    By ouekah in forum Newbie
    Replies: 3
    Last Post: 10th May 2010, 14:11
  3. porting of icon property problem
    By batileon in forum Qt Programming
    Replies: 1
    Last Post: 26th July 2008, 01:15
  4. Problem with "setModified(bool)"
    By _SamSoft_ in forum Qt Programming
    Replies: 3
    Last Post: 3rd June 2007, 14:51
  5. QMenu and setTearOffEnabled(bool)
    By dvmorris in forum Qt Programming
    Replies: 3
    Last Post: 9th April 2007, 02:18

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.