Results 1 to 2 of 2

Thread: PrimitiveElemet's Paint Area

  1. #1
    Join Date
    Jan 2006
    Location
    France
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default PrimitiveElemet's Paint Area

    Hi,

    How do I get the default style's paint area for painting a primitive in Qt3?

    Qt Code:
    1. const QStyle &aStyle = QApplication::style();
    2. QStyle::SFlags flags = QStyle::Style_Default;
    3. if( YeboGogo)
    4. flags |= QStyle::Style_On | QStyle::Style_Enabled;
    5. else
    6. flags |= QStyle::Style_Off | QStyle::Style_Enabled;
    7.  
    8. aStyle.drawPrimitive( QStyle::PE_Indicator, p, QRect(2,2,cr.height()-2,cr.height()-2), cg, flags);
    9. ...
    10. ...
    To copy to clipboard, switch view to plain text mode 


    Ie, I would like to calculate the correct size for the QRect parameter.
    Regards,
    Last edited by derick; 26th January 2006 at 22:10. Reason: typo
    Derick Schoonbee

  2. #2
    Join Date
    Jan 2006
    Location
    France
    Posts
    36
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: PrimitiveElemet's Paint Area (Solved)

    Found it

    QSize QStyle::sizeFromContents ( ContentsType contents, const QWidget * widget, const QSize & contentsSize, const QStyleOption & opt = QStyleOption:efault ) const [pure virtual]
    Derick Schoonbee

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.