Title: [135696] trunk/Source/WebKit/qt
- Revision
- 135696
- Author
- michael.brun...@digia.com
- Date
- 2012-11-26 02:35:28 -0800 (Mon, 26 Nov 2012)
Log Message
[Qt] QStyleFacadeImp build break with latest Qt 5
https://bugs.webkit.org/show_bug.cgi?id=103198
Reviewed by Simon Hausmann.
Original patch by J-P Nurmi <jpnu...@digia.com>.
Fixes QtWebKit build by replacing qobject_cast to
QMacStyle with calls to QObject::inherits. Also
replaces Q_WS_MAC preprocesser directives with Q_OS_MAC
for Qt 5 compatibility.
* WebCoreSupport/QStyleFacadeImp.cpp:
(WebKit::QStyleFacadeImp::getButtonMetrics):
(WebKit::QStyleFacadeImp::paintComboBox):
(WebKit::QStyleFacadeImp::paintInnerSpinButton):
(WebKit::QStyleFacadeImp::paintScrollBar):
Modified Paths
Diff
Modified: trunk/Source/WebKit/qt/ChangeLog (135695 => 135696)
--- trunk/Source/WebKit/qt/ChangeLog 2012-11-26 10:21:53 UTC (rev 135695)
+++ trunk/Source/WebKit/qt/ChangeLog 2012-11-26 10:35:28 UTC (rev 135696)
@@ -1,3 +1,23 @@
+2012-11-26 Michael BrĂ¼ning <michael.brun...@digia.com>
+
+ [Qt] QStyleFacadeImp build break with latest Qt 5
+ https://bugs.webkit.org/show_bug.cgi?id=103198
+
+ Reviewed by Simon Hausmann.
+
+ Original patch by J-P Nurmi <jpnu...@digia.com>.
+
+ Fixes QtWebKit build by replacing qobject_cast to
+ QMacStyle with calls to QObject::inherits. Also
+ replaces Q_WS_MAC preprocesser directives with Q_OS_MAC
+ for Qt 5 compatibility.
+
+ * WebCoreSupport/QStyleFacadeImp.cpp:
+ (WebKit::QStyleFacadeImp::getButtonMetrics):
+ (WebKit::QStyleFacadeImp::paintComboBox):
+ (WebKit::QStyleFacadeImp::paintInnerSpinButton):
+ (WebKit::QStyleFacadeImp::paintScrollBar):
+
2012-11-24 Sheriff Bot <webkit.review....@gmail.com>
Unreviewed, rolling out r135648 and r135649.
Modified: trunk/Source/WebKit/qt/WebCoreSupport/QStyleFacadeImp.cpp (135695 => 135696)
--- trunk/Source/WebKit/qt/WebCoreSupport/QStyleFacadeImp.cpp 2012-11-26 10:21:53 UTC (rev 135695)
+++ trunk/Source/WebKit/qt/WebCoreSupport/QStyleFacadeImp.cpp 2012-11-26 10:35:28 UTC (rev 135696)
@@ -27,7 +27,6 @@
#include <QApplication>
#include <QLineEdit>
-#include <QMacStyle>
#include <QPainter>
#include <QPushButton>
#include <QStyleFactory>
@@ -221,7 +220,7 @@
QFont defaultButtonFont = QApplication::font(&button);
*buttonFontFamily = defaultButtonFont.family();
*buttonFontPixelSize = 0;
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
button.setAttribute(Qt::WA_MacSmallSize);
QFontInfo fontInfo(defaultButtonFont);
*buttonFontPixelSize = fontInfo.pixelSize();
@@ -275,11 +274,11 @@
IntRect rect = opt.rect;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
// QMacStyle makes the combo boxes a little bit smaller to leave space for the focus rect.
// Because of it, the combo button is drawn at a point to the left of where it was expect to be and may end up
// overlapped with the text. This will force QMacStyle to draw the combo box with the expected width.
- if (qobject_cast<QMacStyle*>(m_style))
+ if (m_style->inherits("QMacStyle"))
rect.inflateX(3);
#endif
@@ -359,11 +358,11 @@
// Default to moving the buttons a little bit within the editor frame.
int inflateX = -2;
int inflateY = -2;
-#if defined(Q_WS_MAC) && !defined(QT_NO_STYLE_MAC)
+#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
// QMacStyle will position the aqua buttons flush to the right.
// This will move them more within the control for better style, a la
// Chromium look & feel.
- if (qobject_cast<QMacStyle*>(m_style)) {
+ if (m_style->inherits("QMacStyle")) {
inflateX = -4;
// Render mini aqua spin buttons for QMacStyle to fit nicely into
// the editor area, like Chromium.
@@ -451,10 +450,10 @@
MappedStyleOption<QStyleOptionSlider> opt(widget, proxyOption);
-#ifdef Q_WS_MAC
+#ifdef Q_OS_MAC
// FIXME: We also need to check the widget style but today ScrollbarTheme is not aware of the page so we
// can't get the widget.
- if (qobject_cast<QMacStyle*>(m_style))
+ if (m_style->inherits("QMacStyle"))
m_style->drawComplexControl(QStyle::CC_ScrollBar, &opt, painter, widget);
else
#endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes