Results 1 to 5 of 5

Thread: QLabel Painting

  1. #1
    Join Date
    Mar 2006
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QLabel Painting

    Hi All

    I am vijay using VS 2005 with Qt integration ( 4.1 ). Currently i am in Image processing. What i want is , The labels border color should be as a white color. I have attached that bmp file. Can you see that file and give correct solution to solve that problem

    looking forward your favourable reply

    Thanks and regards
    vijay

  2. #2
    Join Date
    Jan 2006
    Location
    Ukraine,Lviv
    Posts
    454
    Thanks
    9
    Thanked 27 Times in 27 Posts
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: QLabel Painting

    First of all i havent see atached image
    But i give you my own
    If it that what you want i tell you how i do that ...
    - change frame shape for label diferent an NoFrame ;
    - change paletteForeground on white

    p.s. i do it with Qt 3.3.5 so i cant surly say that it will be correct on Qt 4
    Attached Images Attached Images
    • File Type: png 2.png (25.0 KB, 9 views)
    a life without programming is like an empty bottle

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

    vijay anandh (15th May 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QLabel Painting

    Quote Originally Posted by vijay anandh
    I have attached that bmp file.
    Please, don't attach BMPs --- even M$ Paint can save images in PNG, JPEG or GIF format.

  5. #4
    Join Date
    Mar 2006
    Posts
    29
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QLabel Painting

    Hi

    thanks for your mail. Exactly i want that type of style. , But setPaletteForeground is not working. Can you tell me what will be exact function.

    thanks and regards
    vijay

  6. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QLabel Painting

    Qt Code:
    1. label->setFrameStyle(QFrame::Plain | QFrame::Box);
    2. label->setLineWidth(3);
    3. QPalette pal = label->palette();
    4. pal.setColor(label->foregroundRole(), Qt::white);
    5. label->setPalette(pal);
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. Trouble with QLabel
    By dany_MB in forum Newbie
    Replies: 3
    Last Post: 14th August 2009, 08:21
  2. Replies: 3
    Last Post: 17th July 2008, 07:43
  3. QLabel ScaledContents ignored by style sheet?
    By WinchellChung in forum Newbie
    Replies: 3
    Last Post: 27th February 2008, 14:50
  4. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57
  5. QScrollArea display custom QLabel
    By spawnwj in forum Qt Programming
    Replies: 6
    Last Post: 6th December 2006, 03:38

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.