Results 1 to 5 of 5

Thread: widget with rounded corners

  1. #1
    Join Date
    Feb 2006
    Posts
    60
    Thanks
    21
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default widget with rounded corners

    hi,
    I want to have a widget with rounded corners, i.e no sharp corners. i.e arcs in place of corners at the four ends.

    Please provide me a code snippet if possible

    Thankig you,

    regards,
    sreedhar

  2. #2
    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: widget with rounded corners

    What do you mean by widget? A standalone window or a widget that you can put on other widgets?

  3. #3
    Join Date
    Feb 2006
    Posts
    60
    Thanks
    21
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: widget with rounded corners

    I want to place a small widget on top of another widget. i.e the top widget is the child of the below widget

    regards

  4. #4
    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: widget with rounded corners

    Play with setMask
    a life without programming is like an empty bottle

  5. #5
    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: widget with rounded corners

    IMO you just need to leave the corners not drawn in the paint event of your widget. There is even no reason to use setMask. In Qt4.1+ there is no background drawn by default. In Qt4.0 I think you need to pass some flag to your widget to enable the same behaviour.

Similar Threads

  1. minimize child widget
    By sreedhar in forum Qt Programming
    Replies: 5
    Last Post: 15th May 2006, 13:02
  2. Replies: 4
    Last Post: 24th March 2006, 23:50
  3. Forwarding mouse events to another widget.
    By yogeshm02 in forum Qt Programming
    Replies: 8
    Last Post: 28th February 2006, 14:25
  4. [Qt 4.1.0] Split a widget on demand
    By Townk in forum Qt Programming
    Replies: 3
    Last Post: 17th February 2006, 15:16
  5. advanced split widget
    By vitaly in forum Qt Programming
    Replies: 10
    Last Post: 24th January 2006, 21:00

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.