Results 1 to 3 of 3

Thread: Round-corner dialogs?

  1. #1
    Join Date
    Jun 2007
    Posts
    62
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Round-corner dialogs?

    Windows Qt v 4.3.2

    The art department at my work has told me that the dialogs on the latest program have to have rounded corners. And no title bar.

    Is this even possible with Qt?

    The closest I've managed to get has rounded corners, but the cut away portion is gray instead of transparent. I subclassed QDialog (so I could apply a style sheet) and had the constructor pass the Qt::SplashScreen flag to the QDialog constructor.

    That got rid of the title bar.

    Then I loaded in a style sheet that contained:
    Qt Code:
    1. {
    2. border-radius: 16px;
    3. }
    To copy to clipboard, switch view to plain text mode 

    That made the rounded corners.

    The only problem is that the cut-away part of the corners is gray instead of transparent. Does anybody have suggestions?

  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: Round-corner dialogs?

    You'll have to use QWidget::setMask(). See for example this thread: Toplevel widget with rounded corners.
    J-P Nurmi

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

    WinchellChung (14th March 2008)

  4. #3
    Join Date
    Jun 2007
    Posts
    62
    Thanks
    28
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Talking Re: Round-corner dialogs?

    Thank you very much! I dropped your code into my dialog, and it worked like magic.

Similar Threads

  1. Replies: 7
    Last Post: 15th November 2007, 17:19

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.