Disable QGraphicsDropShadowEffect for Mac

The QGraphicsDropShadowEffect::draw() results in a crash on
Mac https://bugreports.qt-project.org/browse/QTBUG-23205 .

Task-number: QTCREATORBUG-7605
Change-Id: Icee71e6452997b2daede7ef4735e508caf68aa1a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
(cherry picked from commit d0152332a4)
Reviewed-by: Aurindam Jana <aurindam.jana@nokia.com>
This commit is contained in:
Aurindam Jana
2012-07-05 14:00:45 +02:00
committed by Eike Ziller
parent 96b7d4a182
commit f2399eb775
3 changed files with 16 additions and 0 deletions

View File

@@ -102,10 +102,14 @@ DragWidget::DragWidget(QWidget *parent) : QFrame(parent)
m_startPos = QPoint(-1, -1); m_startPos = QPoint(-1, -1);
m_pos = QPoint(-1, -1); m_pos = QPoint(-1, -1);
// TODO: The following code should be enabled for OSX
// when QTBUG-23205 is fixed
#ifndef Q_OS_MAC
m_dropShadowEffect = new QGraphicsDropShadowEffect; m_dropShadowEffect = new QGraphicsDropShadowEffect;
m_dropShadowEffect->setBlurRadius(6); m_dropShadowEffect->setBlurRadius(6);
m_dropShadowEffect->setOffset(2, 2); m_dropShadowEffect->setOffset(2, 2);
setGraphicsEffect(m_dropShadowEffect); setGraphicsEffect(m_dropShadowEffect);
#endif
} }
void DragWidget::mousePressEvent(QMouseEvent * event) void DragWidget::mousePressEvent(QMouseEvent * event)
@@ -123,10 +127,14 @@ void DragWidget::mouseReleaseEvent(QMouseEvent *event)
{ {
if (event->button() == Qt::LeftButton) { if (event->button() == Qt::LeftButton) {
m_startPos = QPoint(-1, -1); m_startPos = QPoint(-1, -1);
// TODO: The following code should be enabled for OSX
// when QTBUG-23205 is fixed
#ifndef Q_OS_MAC
m_dropShadowEffect = new QGraphicsDropShadowEffect; m_dropShadowEffect = new QGraphicsDropShadowEffect;
m_dropShadowEffect->setBlurRadius(6); m_dropShadowEffect->setBlurRadius(6);
m_dropShadowEffect->setOffset(2, 2); m_dropShadowEffect->setOffset(2, 2);
setGraphicsEffect(m_dropShadowEffect); setGraphicsEffect(m_dropShadowEffect);
#endif
} }
QFrame::mouseReleaseEvent(event); QFrame::mouseReleaseEvent(event);
} }

View File

@@ -611,10 +611,14 @@ PreviewLabel::PreviewLabel(QWidget *parent)
m_hooverInfo->setFrameShape(QFrame::StyledPanel); m_hooverInfo->setFrameShape(QFrame::StyledPanel);
m_hooverInfo->setFrameShadow(QFrame::Sunken); m_hooverInfo->setFrameShadow(QFrame::Sunken);
// TODO: The following code should be enabled for OSX
// when QTBUG-23205 is fixed
#ifndef Q_OS_MAC
QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect; QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect;
dropShadowEffect->setBlurRadius(4); dropShadowEffect->setBlurRadius(4);
dropShadowEffect->setOffset(2, 2); dropShadowEffect->setOffset(2, 2);
m_hooverInfo->setGraphicsEffect(dropShadowEffect); m_hooverInfo->setGraphicsEffect(dropShadowEffect);
#endif
m_hooverInfo->setAutoFillBackground(true); m_hooverInfo->setAutoFillBackground(true);
m_hooverInfo->raise(); m_hooverInfo->raise();
} }

View File

@@ -52,10 +52,14 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent )
setFrameShape(QFrame::StyledPanel); setFrameShape(QFrame::StyledPanel);
setFrameShadow(QFrame::Sunken); setFrameShadow(QFrame::Sunken);
// TODO: The following code should be enabled for OSX
// when QTBUG-23205 is fixed
#ifndef Q_OS_MAC
QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect; QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect;
dropShadowEffect->setBlurRadius(6); dropShadowEffect->setBlurRadius(6);
dropShadowEffect->setOffset(2, 2); dropShadowEffect->setOffset(2, 2);
setGraphicsEffect(dropShadowEffect); setGraphicsEffect(dropShadowEffect);
#endif
setAutoFillBackground(true); setAutoFillBackground(true);
m_hueControl = new HueControl(this); m_hueControl = new HueControl(this);