Results 1 to 4 of 4

Thread: Plasmoid opacity

  1. #1
    Join Date
    Jun 2008
    Location
    Germany/Belarus/Sweden
    Posts
    53
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Plasmoid opacity

    Hi all!
    Do anybody know how to set opacity for plasmoid?
    Background transparency like Desktop Folder plasmoid has...
    I have tried with QPointer::setOpacity() but that doesn't work.

    Qt Code:
    1. void TestPlasmoid::paintInterface(QPainter *p, const QStyleOptionGraphicsItem *option, const QRect &contentsRect)
    2. {
    3. p->setOpacity(0.2);
    4. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Plasmoid opacity

    Isn't the background drawn by your current plasma theme? And please show us, what your base class is and have do you set/draw the background.

  3. #3
    Join Date
    Sep 2006
    Location
    Belgrade
    Posts
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Plasmoid opacity

    The FolderView plasmoid uses a different background image - the "widgets/translucentbackground" instead of the normal "widgets/background".

    So, the appearance is not hard-coded, and (depending on the theme) the FV could have even more opaque background than the normal plasmoids.
    While you were hanging yourself on someone else's words
    Dying to believe in what you heard
    I was staring straight into the shining sun

  4. #4
    Join Date
    Jun 2008
    Location
    Germany/Belarus/Sweden
    Posts
    53
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Plasmoid opacity

    Thanks for help! I figured it out, setBackgroundHints(Plasma::Applet::TranslucentBack ground); makes the trick.

Similar Threads

  1. Change Opacity of QPushButton
    By DiamonDogX in forum Qt Programming
    Replies: 3
    Last Post: 5th November 2010, 13:09
  2. Replies: 1
    Last Post: 31st August 2007, 14:46
  3. Opacity in Linux OS
    By shyam prasad in forum Qt Programming
    Replies: 2
    Last Post: 22nd May 2007, 06:59
  4. problem of opacity for textLabel
    By Stephano in forum Qt Programming
    Replies: 21
    Last Post: 19th May 2006, 11:52
  5. opacity of QLabel(background opaque)
    By Stephano in forum Qt Tools
    Replies: 1
    Last Post: 9th May 2006, 13:57

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.