Results 1 to 2 of 2

Thread: A Shadow of my groupBox

  1. #1
    Join Date
    Aug 2007
    Posts
    275
    Thanks
    28
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default A Shadow of my groupBox

    I used QGroupbox to encapsulate some data for the user and i want to get fancy! I want to make a shadow to make it float on the containing widget. I am thinking of overiding the paint on this QGroupbox, but i am not too sure how can i draw the widget inside my groupbox now. since i will mess up the paint on it.

    If you guys can show/help/ give some sample code in playing with the paint on QGroupBox that will be highly appreciated.

    baray98

  2. #2
    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: A Shadow of my groupBox

    Use style sheets or QWidget::setContentsMargins() to reserve some margins for the shadow and override QWidget::paintEvent() to draw it. Don't forget to call the base class implementation to get group box title and frame.
    J-P Nurmi

Similar Threads

  1. How to draw soft shadow with QPainter?
    By troorl_ua in forum Qt Programming
    Replies: 9
    Last Post: 13th October 2008, 13:01
  2. Qt layout memory issue
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 25th August 2007, 17:11
  3. Desktop application shadow?
    By gfunk in forum Qt Programming
    Replies: 2
    Last Post: 18th November 2006, 02:42
  4. drawing shadow effect
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 25th May 2006, 15:41
  5. Problems putting layouts inside groupbox
    By conexion2000 in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 10:01

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.