Results 1 to 7 of 7

Thread: I want QLabel which has text boundary(shadow)

  1. #1
    Join Date
    Apr 2007
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default I want QLabel which has text boundary(shadow)

    I want to make letters on label have boundary like drop-shadow for distance 0.

    Is there any way to implement this?

    Thanks for reading.

  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: I want QLabel which has text boundary(shadow)

    Reimplement paintEvent and draw the shadow using a gray semitransparent pen and then the letters.

  3. #3
    Join Date
    Jan 2008
    Location
    Silicon valley
    Posts
    15
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: I want QLabel which has text boundary(shadow)

    If the label content is static, it will be easier to create it as a pixmap, and put it there in a designer.

  4. #4
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: I want QLabel which has text boundary(shadow)

    Some help can you get using with QPushButton checkable & checked property.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  5. #5
    Join Date
    Apr 2007
    Posts
    17
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: I want QLabel which has text boundary(shadow)

    I could implement by drawing text with double layer.
    Thanks for replying.

  6. #6
    Join Date
    Sep 2010
    Posts
    28
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: I want QLabel which has text boundary(shadow)

    I see the thread is quite old, but I'm trying to solve this problem as well. Could you explain what you meant by "drawing text with double layer"?

  7. #7
    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: I want QLabel which has text boundary(shadow)

    It means you first draw the shadow with an offset and then the regular text without the offset. Now you can also use QGraphicsDropShadowEffect effect on the label.
    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.


Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. Editable text in QGraphicsView
    By wysota in forum Qt Programming
    Replies: 8
    Last Post: 24th February 2007, 15:30
  3. QLabel, large, rich text, font size
    By TheKedge in forum Qt Programming
    Replies: 3
    Last Post: 5th February 2007, 11:56
  4. Qlabel with (icon and text) HowTo ?
    By QiT in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2006, 08:14
  5. Setting text color on QLabel
    By Yorma in forum Newbie
    Replies: 11
    Last Post: 15th June 2006, 07:25

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.