Results 1 to 6 of 6

Thread: how to change the color of the frame

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how to change the color of the frame

    hi friends,
    i need some suggestion to start designing my app ..

    i am having a .png image , a pixmap in my window
    and this window will receive signals every time ..
    according to the received signals i have to change the color on the surrounding frame layer of the pixmap .....
    i attached the picture how i wantt to change the color of the border of the image ... how can i change the border color around this image ....
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Thanks
    21
    Thanked 66 Times in 62 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to change the color of the frame

    if you have a frame surrounding your pixmap, something like this should work:

    frame->setStyleSheet("border: 2px solid myColor");

    u can change the value of myColor depending upon your requirements

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

    wagmare (12th May 2009)

  4. #3
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to change the color of the frame

    thanks ...
    i will try placing the pixmap in centre of the frame and then i will change the stylesheet background ... right aaa ..

  5. #4
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to change the color of the frame

    can any one help me how to set a pixmap centered inside the frame ..... i try stylesheet in designer .. set background image .. but it is showing in tiled fashion ....

  6. #5
    Join Date
    Jan 2008
    Location
    Poland
    Posts
    687
    Thanks
    4
    Thanked 140 Times in 132 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: how to change the color of the frame

    put QLabel in your frame, set your image as pixmap to that label, and alignment Center (HCenter | VCenter), with pixmap scaling to content turned off. You can do it all in Designer.
    I would like to be a "Guru"

    Useful hints (try them before asking):
    1. Use Qt Assistant
    2. Search the forum

    If you haven't found solution yet then create new topic with smart question.

  7. The following user says thank you to faldzip for this useful post:

    wagmare (12th May 2009)

  8. #6
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to change the color of the frame

    yes, its a good solution .... thank you very much ....

Similar Threads

  1. QSkinWindows Classes
    By kernel_panic in forum Qt-based Software
    Replies: 45
    Last Post: 20th April 2010, 12:35
  2. Change the shape of a frame.
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2007, 06:40
  3. Change frame rate
    By superutsav in forum General Programming
    Replies: 1
    Last Post: 3rd August 2006, 21:02
  4. how to change QGroupBox frame color? (Qt4)
    By high_flyer in forum Qt Programming
    Replies: 7
    Last Post: 9th May 2006, 13:48
  5. Multi frame management ... is it possible ?
    By yellowmat in forum Newbie
    Replies: 8
    Last Post: 25th January 2006, 10:41

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.