Results 1 to 2 of 2

Thread: change the opacity

  1. #1
    Join Date
    Sep 2013
    Posts
    9
    Thanks
    5
    Qt products
    Qt5
    Platforms
    Windows

    Default change the opacity

    Hi!!

    I like to change opacity when the mouse is over rectangle. How can I do?

    MouseArea {

    onOpacityChanged:
    rec1.opacity(0.4)
    }

    thanks!!

  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: change the opacity

    javascript Code:
    1. Rectangle {
    2. opacity: ma.containsMouse ? 0.4 : 1.0
    3.  
    4. MouseArea {
    5. id: ma
    6. anchors.fill: parent
    7. hoverEnabled: true
    8. }
    9. }
    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.


  3. The following user says thank you to wysota for this useful post:

    askatuak (18th September 2013)

Similar Threads

  1. Change Opacity of QPushButton
    By DiamonDogX in forum Qt Programming
    Replies: 3
    Last Post: 5th November 2010, 12:09
  2. Layered Opacity
    By JeffC in forum Newbie
    Replies: 0
    Last Post: 9th June 2010, 15:42
  3. Plasmoid opacity
    By AcerExtensa in forum KDE Forum
    Replies: 3
    Last Post: 25th July 2009, 14:22
  4. Window Opacity
    By chethana in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2007, 10:45
  5. Opacity in Linux OS
    By shyam prasad in forum Qt Programming
    Replies: 2
    Last Post: 22nd May 2007, 05:59

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.