Results 1 to 4 of 4

Thread: Adjust gui brightness

  1. #1
    Join Date
    May 2009
    Posts
    21
    Thanks
    4
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Adjust gui brightness

    Hi,

    I would like to add functionality for adjusting the brightness of the gui to my app. So that the color of text, buttons, ... could be changed to a lighter or darker color by the user.

    I've seen that there is the possibility to define style sheets but as I would like to have about 100 brightness steps 100 hand edit qss files isn't that nice.


    Thank you for all ideas. I really need this.


    Lodorot

    PS: I'm using Qt 4.5.1

  2. #2
    Join Date
    Jun 2008
    Location
    Rome, Italy
    Posts
    95
    Thanks
    19
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Adjust gui brightness

    Take a look here (Issue 29, Translucent Widgets in Qt), maybe it's what you're looking for.

  3. #3
    Join Date
    May 2009
    Posts
    21
    Thanks
    4
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adjust gui brightness

    @cydside Could you specify how translucet widgets can help me changing the color of all the gui widgets in my window to a darker or lighter color?

    Thanks

    Lodorot

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Adjust gui brightness

    Cant say about the translucent widgets... but you can try the following with style sheets -
    Define your style sheet with some variable multiplied by brightness... something like -
    Qt Code:
    1. {
    2. background-color: rgb(234* _BRIGHTNESS_ , 134* _BRIGHTNESS_ , 34* _BRIGHTNESS_ );
    3. }
    To copy to clipboard, switch view to plain text mode 

    Then read the style sheet in your code, replace the _BRIGHTNESS_ with your desired value ( 0-1) and apply the style sheet.

    Hope this will give you the desired effect

Similar Threads

  1. Query:How to change brightness of a screen(framebuffer) using Qtopia ?
    By sureshgani1984 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 18th May 2009, 00:23
  2. contrast, transparency, brightness...
    By Noxxik in forum Qt Programming
    Replies: 6
    Last Post: 28th February 2009, 22:29
  3. adjust Font size to a given rect when drawText
    By yartov in forum Qt Programming
    Replies: 5
    Last Post: 14th May 2008, 19:03
  4. Replies: 1
    Last Post: 23rd August 2006, 18:02
  5. adjust Letter Spacing
    By niko in forum Newbie
    Replies: 3
    Last Post: 16th August 2006, 10:05

Tags for this Thread

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.