Results 1 to 7 of 7

Thread: How to set the BORDER COLOR of QDialog?

  1. #1
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Question How to set the BORDER COLOR of QDialog?

    Hi All!
    How to set the BORDER COLOR of QDialog.
    When I use palette property of this it changes only the background; but I want to change the BORDER COLOR also .
    What I do for this!
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  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: How to set the BORDER COLOR of QDialog?

    If by border colour you mean the window decoration frame, they you can't do that in a simple way - it is not part of the application, but a part of the window manager (like KDE or GNOME).

  3. #3
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to set the BORDER COLOR of QDialog?

    Quote Originally Posted by wysota View Post
    If by border colour you mean the window decoration frame, they you can't do that in a simple way - it is not part of the application, but a part of the window manager (like KDE or GNOME).
    Dear Sir!
    How a way It can be implement in Qt4?
    Please give any suggestion.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  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: How to set the BORDER COLOR of QDialog?

    You can get rid of the frame by using QWidget::setMask() or by removing all the decorations by setting the FramelessWindowHint before showing the window. Either way this will remove the frame, not change its colour.

  5. #5
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Thanks
    8
    Thanked 14 Times in 14 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to set the BORDER COLOR of QDialog?

    Quote Originally Posted by wysota View Post
    You can get rid of the frame by using QWidget::setMask() or by removing all the decorations by setting the FramelessWindowHint before showing the window. Either way this will remove the frame, not change its colour.
    Dear Sir!
    That means frames colour cann't be changed in Qt4.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  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: How to set the BORDER COLOR of QDialog?

    That's what I said in the beginning

  7. #7
    Join Date
    Aug 2006
    Posts
    250
    Thanks
    19
    Thanked 49 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to set the BORDER COLOR of QDialog?

    You can't influence the frame colour using any toolkit. This is not Qt specific. The only way to fake it is to make your window frameless, then draw the titlebar and frame manually. Some windows apps tend to do this. That's usually a bad idea though, since users won't like your non-standard app, and you have to reimplement things like window movement and minimize/maximize/close buttons yourself. Lots of work for a minor cosmetic issue.

Similar Threads

  1. Resizing a QDialog to the content size
    By Nyphel in forum Qt Programming
    Replies: 8
    Last Post: 15th March 2007, 08:16

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.