From 7ecf525f2007e046f54e83e4a460b7f8ff79c03d Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 8 Aug 2013 15:30:14 -0500 Subject: Fix a minor valgrind warning --- src/kernel/qstyle.cpp | 24 ++++++++++++++++++++++++ src/kernel/qstyle.h | 22 +++------------------- 2 files changed, 27 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/kernel/qstyle.cpp b/src/kernel/qstyle.cpp index ebc7e5b..75757c9 100644 --- a/src/kernel/qstyle.cpp +++ b/src/kernel/qstyle.cpp @@ -2795,6 +2795,30 @@ QPixmap QStyle::stylePixmap(StylePixmap sp, const QWidget *w, const QStyleOption \obsolete */ +#ifndef QT_NO_COMPAT +int QStyle::defaultFrameWidth() const +{ + QStyleControlElementData ceData; + return pixelMetric( PM_DefaultFrameWidth, ceData, CEF_None ); +} + +void QStyle::tabbarMetrics( const QWidget* t, int& hf, int& vf, int& ov ) const +{ + QStyleControlElementData ceData; + hf = pixelMetric( PM_TabBarTabHSpace, ceData, CEF_None, t ); + vf = pixelMetric( PM_TabBarTabVSpace, ceData, CEF_None, t ); + ov = pixelMetric( PM_TabBarBaseOverlap, ceData, CEF_None, t ); +} + +QSize QStyle::scrollBarExtent() const +{ + QStyleControlElementData ceData; + ceData.orientation = Qt::Horizontal; + return QSize(pixelMetric(PM_ScrollBarExtent, ceData, CEF_None), + pixelMetric(PM_ScrollBarExtent, ceData, CEF_None)); +} +#endif + QStyleControlElementData::QStyleControlElementData() { isNull = true; activePainter = 0; diff --git a/src/kernel/qstyle.h b/src/kernel/qstyle.h index c38f403..be23340 100644 --- a/src/kernel/qstyle.h +++ b/src/kernel/qstyle.h @@ -1189,25 +1189,9 @@ public: // Old 2.x QStyle API #ifndef QT_NO_COMPAT - int defaultFrameWidth() const - { - QStyleControlElementData ceData; - return pixelMetric( PM_DefaultFrameWidth, ceData, CEF_None ); - } - void tabbarMetrics( const QWidget* t, - int& hf, int& vf, int& ov ) const - { - QStyleControlElementData ceData; - hf = pixelMetric( PM_TabBarTabHSpace, ceData, CEF_None, t ); - vf = pixelMetric( PM_TabBarTabVSpace, ceData, CEF_None, t ); - ov = pixelMetric( PM_TabBarBaseOverlap, ceData, CEF_None, t ); - } - QSize scrollBarExtent() const - { - QStyleControlElementData ceData; - return QSize(pixelMetric(PM_ScrollBarExtent, ceData, CEF_None), - pixelMetric(PM_ScrollBarExtent, ceData, CEF_None)); - } + int defaultFrameWidth() const; + void tabbarMetrics( const QWidget* t, int& hf, int& vf, int& ov ) const; + QSize scrollBarExtent() const; #endif public: -- cgit v1.2.1