Results 1 to 6 of 6

Thread: Round ended edges

  1. #1
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Round ended edges

    Hi all

    Working on Qt4.2 on Intel MAC

    Can anybody tells me that is there a way to make the round edges for QMainWindow.,QTextEdit ,QFrame , QGroupBox .just Like there is for QPushButton..

    Thanx
    Last edited by merry; 8th August 2007 at 08:57. Reason: updated contents
    Always Believe in Urself
    Merry

  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: Round ended edges

    You'd have to reimplement the style and draw all the widgets yourself. And if you want to preserve the Aqua look of your MAC, I don't think it's possible on Qt side at all. You'd have to tweak your system settings, I guess... Or just change the widget style and use style-sheets to apply roundness to widget borders (but I don't think that's what you want).

  3. #3
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Round ended edges

    You'd have to reimplement the style and draw all the widgets yourself. And if you want to preserve the Aqua look of your MAC, I don't think it's possible on Qt side at all. You'd have to tweak your system settings, I guess... Or just change the widget style and use style-sheets to apply roundness to widget borders (but I don't think that's what you want).
    Thanx 4 d Reply,

    By Mistake i wrote Qt4.2 , Actully I am using QT 4.1 , on Intel MAC.

    And I think Qt 4.1 doesn't support style-sheets.

    Is there any other way to change the looks of QMainWindow and other widgets..

    You'd have to reimplement the style and draw all the widgets yourself.
    As u said , I mean How can I reimplement the styles.....Can you explain it to me with an example.

    Thanx
    Always Believe in Urself
    Merry

  4. #4
    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: Round ended edges

    Take a look at the docs for QStyle. There should be a link to an example that reimplements a style. And remember it won't work for top level windows. For those you can use QWidget::setMask().

  5. #5
    Join Date
    Jan 2007
    Posts
    326
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Round ended edges

    Thanx 4 d reply

    Orginally Posted by Wysota:

    Take a look at the docs for QStyle. There should be a link to an example that reimplements a style. And remember it won't work for top level windows. For those you can use QWidget::setMask().
    By using setMask ; we can set the Bitmap or any region for the widget, But I want to change the shape of the widget , i.e I want to make the edges of the widget "round".

    cheers
    Always Believe in Urself
    Merry

  6. #6
    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: Round ended edges

    The bitmap says whether a particular pixel of the widget should be visible or not. If you clear bits of the mask responsible for corners of the widget, you'll get rounded top-level widgets. Just make sure to adjust the mask when the window gets resized.

  7. The following user says thank you to wysota for this useful post:

    merry (10th August 2007)

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.