Results 1 to 6 of 6

Thread: QStyle overpainting QDialogBox

  1. #1
    Join Date
    May 2011
    Posts
    27
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default QStyle overpainting QDialogBox

    Hello,
    I am on my way to create my own Style. I got it to overpaint Buttons, Checkboxes, etc..., but I don't know how to overpaint the QDialogBox. For the buttons i did it this way:
    In the drawPrimitiv function
    Qt Code:
    1. switch(element)
    2. {
    3. case PE_PanelButtonComand:
    4. {
    5. //Overpainting the button
    6. }
    7. }
    To copy to clipboard, switch view to plain text mode 

    But there is nothing for the windows itself, i tried PE_FrameWindow, but its never been called.
    How can i overpaint the QDialogBox in the Style class?

  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: QStyle overpainting QDialogBox

    What do you consider "overpainting"? There is PE_Widget available.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    May 2011
    Posts
    27
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QStyle overpainting QDialogBox

    I mean the frame of the dialogbox and the red close button, etc... This is what i want to overpaint and add my own widgets to it. I tried it out with the PE_Widget, but it does not work. I even made a custom DialogBox class and used the paintEvent to draw on it, but i cannot overdraw the frame and the close button. What do i have to do to achieve this?

  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: QStyle overpainting QDialogBox

    Quote Originally Posted by seux View Post
    I mean the frame of the dialogbox and the red close button, etc...
    So you mean the window decorations. This is not part of your application, you can't modify this area using QStyle. The window manager is responsible for this area.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2011
    Posts
    27
    Thanks
    10
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QStyle overpainting QDialogBox

    hm, okay, but is it possible to hide the frame? So that i have just the client area (or canvas or how it is called) without the window decorations?

  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: QStyle overpainting QDialogBox

    Yes. Set Qt::FramelessWindowHint on the window.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


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

    seux (1st September 2011)

Similar Threads

  1. QStyle vs Qt::BackgroundColorRole
    By wirasto in forum Qt Programming
    Replies: 4
    Last Post: 10th April 2015, 15:23
  2. Replies: 2
    Last Post: 14th July 2011, 12:28
  3. QStyle's question
    By aoo7wangyan in forum Qt Programming
    Replies: 1
    Last Post: 15th July 2009, 09:42
  4. how to rewrite QStyle
    By trytoremeber963 in forum Newbie
    Replies: 3
    Last Post: 28th April 2009, 08:18
  5. Using QStyle and StyleSheet
    By informatics in forum Qt Programming
    Replies: 1
    Last Post: 27th February 2007, 16:46

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.