Results 1 to 2 of 2

Thread: Customised QWidget border

  1. #1
    Join Date
    Mar 2010
    Posts
    69
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Customised QWidget border

    Hi Guys,
    I have created a customised QWidget and now I want a border around it. So I have used stylesheet to do that using following bit of code.

    Qt Code:
    1. QString String = "border: 2px solid black;";
    2. setStylesheet(String );
    To copy to clipboard, switch view to plain text mode 

    The above code is drawing border around all the child widget of that customised widget. But I dont want that. I want just a single border around the customised widget. Is that possible without using the paint event?

    Thanks.
    Chandan

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Customised QWidget border

    You need to apply a selector, e.g. mytype { ... }

Similar Threads

  1. Replies: 2
    Last Post: 21st March 2012, 14:30
  2. Replies: 2
    Last Post: 15th February 2011, 14:10
  3. QWidget's border style
    By luochen601 in forum Qt Programming
    Replies: 2
    Last Post: 13th September 2010, 07:17
  4. costum QWidget with border-image in style sheet
    By qt fan in forum Qt Programming
    Replies: 1
    Last Post: 25th January 2009, 20:36
  5. Showing QWidget border around the window
    By maverick_pol in forum Qt Programming
    Replies: 2
    Last Post: 20th March 2008, 20:14

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.