diff options
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/qdockarea.cpp | 6 | ||||
-rw-r--r-- | src/widgets/qprogressbar.cpp | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/src/widgets/qdockarea.cpp b/src/widgets/qdockarea.cpp index 663c3d9..68d9e1c 100644 --- a/src/widgets/qdockarea.cpp +++ b/src/widgets/qdockarea.cpp @@ -204,13 +204,15 @@ static int dock_strut( QDockWindow *w, Qt::Orientation o ) { if ( o != Qt::Horizontal ) { int wid; - if ( ( wid = w->fixedExtent().width() ) != -1 ) + if ( ( wid = w->fixedExtent().width() ) != -1 ) { return QMAX( wid, QMAX( w->minimumSize().width(), w->minimumSizeHint().width() ) ); + } return QMAX( w->sizeHint().width(), QMAX( w->minimumSize().width(), w->minimumSizeHint().width() ) ); } else { int hei; - if ( ( hei = w->fixedExtent().height() ) != -1 ) + if ( ( hei = w->fixedExtent().height() ) != -1 ) { return QMAX( hei, QMAX( w->minimumSizeHint().height(), w->minimumSize().height() ) ); + } return QMAX( w->sizeHint().height(), QMAX( w->minimumSizeHint().height(), w->minimumSize().height() ) ); } } diff --git a/src/widgets/qprogressbar.cpp b/src/widgets/qprogressbar.cpp index d5011da..99dedb0 100644 --- a/src/widgets/qprogressbar.cpp +++ b/src/widgets/qprogressbar.cpp @@ -429,8 +429,10 @@ void QProgressBar::drawContents( QPainter *p ) QWMatrix oldMatrix = buffer.painter()->worldMatrix(); - QStyleControlElementData ceData = populateControlElementDataFromWidget(this, QStyleOption()); - QStyle::ControlElementFlags elementFlags = getControlElementFlagsForObject(this, ceData.widgetObjectTypes, QStyleOption()); + const QStyleControlElementData &ceData = populateControlElementDataFromWidget(this, QStyleOption()); + QStyle::ControlElementFlags elementFlags = getControlElementFlagsForObject(this, QStyleOption()); + + QRect ceDataRectOrig = ceData.rect; // Draw contents if (m_orientation == Qt::Vertical) { @@ -447,7 +449,7 @@ void QProgressBar::drawContents( QPainter *p ) buffer.painter()->setWorldMatrix(m, TRUE); - ceData.rect = QRect(ceData.rect.y(), ceData.rect.x(), ceData.rect.height(), ceData.rect.width()); + const_cast<QStyleControlElementData&>(ceData).rect = QRect(ceData.rect.y(), ceData.rect.x(), ceData.rect.height(), ceData.rect.width()); } style().drawControl(QStyle::CE_ProgressBarContents, buffer.painter(), ceData, elementFlags, @@ -461,6 +463,8 @@ void QProgressBar::drawContents( QPainter *p ) QStyle::visualRect(style().subRect(QStyle::SR_ProgressBarLabel, this), this ), colorGroup(), flags); } + + const_cast<QStyleControlElementData&>(ceData).rect = ceDataRectOrig; } #endif |