From aadce7770a4a3738474172dd96d34d5b030c9d50 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 31 Jan 2012 22:26:40 +0000 Subject: [PATCH] 2012-01-31 14:19 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) * contrib/hbqt/qtgui/qth/QWidget.qth + Restored: PaintEvent = YES * contrib/hbqt/hbmk2_qt.hbs + Implemented: Style-sheets working when current class is actually a sub-class. Tip and code snippet forwarded by Francesco Perillo, many thanks. --- harbour/ChangeLog | 9 +++++++++ harbour/contrib/hbqt/hbmk2_qt.hbs | 5 +++++ harbour/contrib/hbqt/qtgui/qth/QWidget.qth | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index b86ebc94ee..ecb5dfec2e 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2012-01-31 14:19 UTC-0800 Pritpal Bedi (bedipritpal@hotmail.com) + * contrib/hbqt/qtgui/qth/QWidget.qth + + Restored: PaintEvent = YES + + * contrib/hbqt/hbmk2_qt.hbs + + Implemented: Style-sheets working when current class + is actually a sub-class. Tip and code snippet + forwarded by Francesco Perillo, many thanks. + 2012-01-31 20:04 UTC+0100 Viktor Szakats (harbour syenar.net) * src/rdd/usrrdd/rdds/arrayrdd.prg * contrib/gtwvg/wvgax.prg diff --git a/harbour/contrib/hbqt/hbmk2_qt.hbs b/harbour/contrib/hbqt/hbmk2_qt.hbs index 3c5b6cda8e..17af64f61f 100644 --- a/harbour/contrib/hbqt/hbmk2_qt.hbs +++ b/harbour/contrib/hbqt/hbmk2_qt.hbs @@ -1751,6 +1751,7 @@ METHOD HbQtSource:buildExtendedHeader() aadd( txt_, '' ) aadd( txt_, '#include ' ) IF ::lPaintEvent + aadd( txt_, '#include ' ) aadd( txt_, '#include ' ) aadd( txt_, '#include ' ) ENDIF @@ -1866,6 +1867,10 @@ METHOD HbQtSource:buildExtendedSource( t_ ) AAdd( txt_, ' }' ) AAdd( txt_, ' if( ! bEventHandelled )' ) AAdd( txt_, ' {' ) + AAdd( txt_, ' QStyleOption opt;' ) + AAdd( txt_, ' opt.init( this );' ) + AAdd( txt_, ' QPainter p( this );' ) + AAdd( txt_, ' style()->drawPrimitive( QStyle::PE_Widget, &opt, &p, this );' ) AAdd( txt_, ' ' + cObj + '::paintEvent( event );' ) AAdd( txt_, ' }' ) AAdd( txt_, '}' ) diff --git a/harbour/contrib/hbqt/qtgui/qth/QWidget.qth b/harbour/contrib/hbqt/qtgui/qth/QWidget.qth index e4de8ff6b1..e14e6bc2f6 100644 --- a/harbour/contrib/hbqt/qtgui/qth/QWidget.qth +++ b/harbour/contrib/hbqt/qtgui/qth/QWidget.qth @@ -15,7 +15,7 @@ Inherit = QObject, QPaintDevice New = pParent, nFlags -PaintEvent = +PaintEvent = YES