From 8b833b8261b80ab8bf0dc9f812f7ab0ce8e52095 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 30 Apr 2015 11:21:28 +0200 Subject: [PATCH] Remove some workarounds for Qt bugs that have been fixed. Change-Id: I0e7112ee3f3790fba42fc882cb98e06ec6a2186d Reviewed-by: Eike Ziller --- .../qmleditorwidgets/contextpanewidget.cpp | 25 ++++++------------- .../contextpanewidgetimage.cpp | 15 +++-------- .../qmleditorwidgets/customcolordialog.cpp | 12 +++------ .../actionmanager/actioncontainer.cpp | 16 ------------ 4 files changed, 16 insertions(+), 52 deletions(-) diff --git a/src/libs/qmleditorwidgets/contextpanewidget.cpp b/src/libs/qmleditorwidgets/contextpanewidget.cpp index 680bced6439..6c568aa88b6 100644 --- a/src/libs/qmleditorwidgets/contextpanewidget.cpp +++ b/src/libs/qmleditorwidgets/contextpanewidget.cpp @@ -81,15 +81,10 @@ DragWidget::DragWidget(QWidget *parent) : QFrame(parent) setFrameShadow(QFrame::Sunken); m_startPos = QPoint(-1, -1); m_pos = QPoint(-1, -1); - - // TODO: The following code should be enabled for OSX - // when QTBUG-23205 is fixed - if (!HostOsInfo::isMacHost()) { - m_dropShadowEffect = new QGraphicsDropShadowEffect; - m_dropShadowEffect->setBlurRadius(6); - m_dropShadowEffect->setOffset(2, 2); - setGraphicsEffect(m_dropShadowEffect); - } + m_dropShadowEffect = new QGraphicsDropShadowEffect; + m_dropShadowEffect->setBlurRadius(6); + m_dropShadowEffect->setOffset(2, 2); + setGraphicsEffect(m_dropShadowEffect); } void DragWidget::mousePressEvent(QMouseEvent * event) @@ -107,14 +102,10 @@ void DragWidget::mouseReleaseEvent(QMouseEvent *event) { if (event->button() == Qt::LeftButton) { m_startPos = QPoint(-1, -1); - // TODO: The following code should be enabled for OSX - // when QTBUG-23205 is fixed - if (!HostOsInfo::isMacHost()) { - m_dropShadowEffect = new QGraphicsDropShadowEffect; - m_dropShadowEffect->setBlurRadius(6); - m_dropShadowEffect->setOffset(2, 2); - setGraphicsEffect(m_dropShadowEffect); - } + m_dropShadowEffect = new QGraphicsDropShadowEffect; + m_dropShadowEffect->setBlurRadius(6); + m_dropShadowEffect->setOffset(2, 2); + setGraphicsEffect(m_dropShadowEffect); } QFrame::mouseReleaseEvent(event); } diff --git a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp index 3e458c5ae28..26dc2f89b17 100644 --- a/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp +++ b/src/libs/qmleditorwidgets/contextpanewidgetimage.cpp @@ -30,8 +30,6 @@ #include "contextpanewidgetimage.h" -#include - #include "ui_contextpanewidgetimage.h" #include "ui_contextpanewidgetborderimage.h" #include @@ -633,15 +631,10 @@ PreviewLabel::PreviewLabel(QWidget *parent) m_hooverInfo->setFrameShape(QFrame::StyledPanel); m_hooverInfo->setFrameShadow(QFrame::Sunken); - - // TODO: The following code should be enabled for OSX - // when QTBUG-23205 is fixed - if (!Utils::HostOsInfo::isMacHost()) { - QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect; - dropShadowEffect->setBlurRadius(4); - dropShadowEffect->setOffset(2, 2); - m_hooverInfo->setGraphicsEffect(dropShadowEffect); - } + QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect; + dropShadowEffect->setBlurRadius(4); + dropShadowEffect->setOffset(2, 2); + m_hooverInfo->setGraphicsEffect(dropShadowEffect); m_hooverInfo->setAutoFillBackground(true); m_hooverInfo->raise(); } diff --git a/src/libs/qmleditorwidgets/customcolordialog.cpp b/src/libs/qmleditorwidgets/customcolordialog.cpp index 1e2343fee88..828978c772a 100644 --- a/src/libs/qmleditorwidgets/customcolordialog.cpp +++ b/src/libs/qmleditorwidgets/customcolordialog.cpp @@ -54,14 +54,10 @@ CustomColorDialog::CustomColorDialog(QWidget *parent) : QFrame(parent ) setFrameShape(QFrame::StyledPanel); setFrameShadow(QFrame::Sunken); - // TODO: The following code should be enabled for OSX - // when QTBUG-23205 is fixed - if (!HostOsInfo::isMacHost()) { - QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect; - dropShadowEffect->setBlurRadius(6); - dropShadowEffect->setOffset(2, 2); - setGraphicsEffect(dropShadowEffect); - } + QGraphicsDropShadowEffect *dropShadowEffect = new QGraphicsDropShadowEffect; + dropShadowEffect->setBlurRadius(6); + dropShadowEffect->setOffset(2, 2); + setGraphicsEffect(dropShadowEffect); setAutoFillBackground(true); m_hueControl = new HueControl(this); diff --git a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp index a1aef0885fa..29182dc781e 100644 --- a/src/plugins/coreplugin/actionmanager/actioncontainer.cpp +++ b/src/plugins/coreplugin/actionmanager/actioncontainer.cpp @@ -419,27 +419,11 @@ void MenuActionContainer::removeMenu(QMenu *menu) m_menu->removeAction(menu->menuAction()); } -static bool menuInMenuBar(const QMenu *menu) -{ - foreach (const QWidget *widget, menu->menuAction()->associatedWidgets()) { - if (qobject_cast(widget)) - return true; - } - return false; -} - bool MenuActionContainer::updateInternal() { if (onAllDisabledBehavior() == Show) return true; - if (Utils::HostOsInfo::isMacHost()) { - // work around QTBUG-25544 which makes menus in the menu bar stay at their enabled state at startup - // (so menus that are disabled at startup would stay disabled) - if (menuInMenuBar(m_menu)) - return true; - } - bool hasitems = false; QList actions = m_menu->actions();