Results 1 to 3 of 3

Thread: Custom style - drawControl event not called for top level windows

  1. #1
    Join Date
    Aug 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Custom style - drawControl event not called for top level windows

    Hello,

    well, the title says it all. I am writing a custom style which inherits QCommonStyle, and I noticed that drawControl() is called for all widgets on the form, but not for the form itself.

    I realize I can use form's paintEvent, but then it wouldn't be part of the style. Any idea how can I draw something on a top level window from within the style class?

    Thanks,

    Nik

  2. #2
    Join Date
    Aug 2008
    Posts
    45
    Thanks
    1
    Thanked 6 Times in 6 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Custom style - drawControl event not called for top level windows

    What is this 'form', is it some Qt's class or your own? Of what is it inherited from?

  3. #3
    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: Custom style - drawControl event not called for top level windows

    Subclasses of QWidget should draw the QStyle::PE_Widget element using QStyle::drawPrimitive() so you can implement your additional stuff there.
    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.


Similar Threads

  1. createEditor() is not called in custom delegate
    By landstreicher in forum Qt Programming
    Replies: 3
    Last Post: 22nd July 2010, 03:41
  2. Application Level Style
    By peteg in forum Newbie
    Replies: 1
    Last Post: 5th June 2010, 14:42
  3. QObject's event method not being called
    By jkburges in forum Qt Programming
    Replies: 1
    Last Post: 4th September 2009, 09:02
  4. Custom event gets not propagated to the top level widget
    By nightghost in forum Qt Programming
    Replies: 0
    Last Post: 29th January 2009, 09:06
  5. Replies: 3
    Last Post: 20th February 2007, 13:02

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.