summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2017-04-06 10:05:55 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-04-07 18:17:58 +0000
commit928cd15d3d3ab82734f49eb9d694faf59c3a0c6d (patch)
treeb4ccd30048fc23f59c8f156d6a0d1060b7121f16
parentbe770ca621f6463339b7d15be088e1b9acd851e5 (diff)
downloadqtwebkit-928cd15d3d3ab82734f49eb9d694faf59c3a0c6d.tar.gz
Import WebKit commit 342c7c7c069db3ca1d09ae6c5f7d600f9b241778
Change-Id: I8886595114569f61168aed76b23ad7288c5cb34c Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
-rw-r--r--Source/JavaScriptCore/API/JSCallbackObject.h12
-rw-r--r--Source/JavaScriptCore/b3/B3ValueInlines.h4
-rw-r--r--Source/JavaScriptCore/dfg/DFGClobberize.h4
-rw-r--r--Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h2
-rw-r--r--Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h12
-rw-r--r--Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.h14
-rw-r--r--Source/JavaScriptCore/runtime/TypedArrayAdaptors.h1
-rw-r--r--Source/PlatformQt.cmake12
-rw-r--r--Source/WTF/wtf/MetaAllocator.h2
-rw-r--r--Source/WebCore/bridge/qt/qt_pixmapruntime.cpp12
-rw-r--r--Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp5
-rw-r--r--Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h2
-rw-r--r--Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h2
-rw-r--r--Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h6
-rw-r--r--Source/WebCore/platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h2
-rw-r--r--Source/WebCore/platform/network/MIMESniffing.cpp4
-rw-r--r--Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp5
-rw-r--r--Source/WebCore/platform/qt/LocalizedStringsQt.cpp8
-rw-r--r--Source/WebCore/platform/qt/PasteboardQt.cpp2
-rw-r--r--Source/WebCore/platform/text/LineEnding.cpp2
-rw-r--r--Source/WebCore/rendering/TextDecorationPainter.cpp3
-rw-r--r--Source/WebKit/PlatformQt.cmake13
-rw-r--r--Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp3
-rw-r--r--Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp2
-rw-r--r--Source/WebKit2/UIProcess/CoordinatedGraphics/PageViewportController.cpp2
-rw-r--r--Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp2
-rw-r--r--Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp10
-rw-r--r--Source/cmake/OptionsQt.cmake15
-rw-r--r--Tools/qmake/projects/run_cmake.pro19
-rw-r--r--Tools/qt/jhbuild-qt-5.4.modules30
-rw-r--r--Tools/qt/patches/qtbase-5.4-add-macros-for-enabling-disabling-warnings.patch86
-rw-r--r--Tools/qt/patches/qtbase-5.4-fix-Clang-warning-about-inconsistent-use-of-C-11-ove.patch62
-rw-r--r--Tools/qt/patches/qtbase-5.4-fix-gcc-Wsuggest-override-warning-on-Q_OBJECT.patch30
33 files changed, 333 insertions, 57 deletions
diff --git a/Source/JavaScriptCore/API/JSCallbackObject.h b/Source/JavaScriptCore/API/JSCallbackObject.h
index addd21986..8356e704d 100644
--- a/Source/JavaScriptCore/API/JSCallbackObject.h
+++ b/Source/JavaScriptCore/API/JSCallbackObject.h
@@ -149,7 +149,19 @@ public:
void setPrivate(void* data);
void* getPrivate();
+ // FIXME: We should fix the warnings for extern-template in JSObject template classes: https://bugs.webkit.org/show_bug.cgi?id=161979
+#if COMPILER(CLANG)
+#if __has_warning("-Wundefined-var-template")
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wundefined-var-template"
+#endif
+#endif
DECLARE_INFO;
+#if COMPILER(CLANG)
+#if __has_warning("-Wundefined-var-template")
+#pragma clang diagnostic pop
+#endif
+#endif
JSClassRef classRef() const { return m_callbackObjectData->jsClass; }
bool inherits(JSClassRef) const;
diff --git a/Source/JavaScriptCore/b3/B3ValueInlines.h b/Source/JavaScriptCore/b3/B3ValueInlines.h
index 86cb8f6ad..d38cc44e2 100644
--- a/Source/JavaScriptCore/b3/B3ValueInlines.h
+++ b/Source/JavaScriptCore/b3/B3ValueInlines.h
@@ -42,7 +42,7 @@
namespace JSC { namespace B3 {
template<typename T>
-T* Value::as()
+inline T* Value::as()
{
if (T::accepts(opcode()))
return static_cast<T*>(this);
@@ -50,7 +50,7 @@ T* Value::as()
}
template<typename T>
-const T* Value::as() const
+inline const T* Value::as() const
{
return const_cast<Value*>(this)->as<T>();
}
diff --git a/Source/JavaScriptCore/dfg/DFGClobberize.h b/Source/JavaScriptCore/dfg/DFGClobberize.h
index 461217772..d7ce00df5 100644
--- a/Source/JavaScriptCore/dfg/DFGClobberize.h
+++ b/Source/JavaScriptCore/dfg/DFGClobberize.h
@@ -844,7 +844,9 @@ void clobberize(Graph& graph, Node* node, const ReadFunctor& read, const WriteFu
read(JSObject_butterfly);
AbstractHeap heap(NamedProperties, node->multiGetByOffsetData().identifierNumber);
read(heap);
- def(HeapLocation(NamedPropertyLoc, heap, node->child1()), LazyNode(node));
+ // FIXME: We cannot def() for MultiGetByOffset because CSE is not smart enough to decay it
+ // to a CheckStructure.
+ // https://bugs.webkit.org/show_bug.cgi?id=159859
return;
}
diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
index bd437e4ad..bc323021a 100644
--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayView.h
@@ -150,7 +150,7 @@ public:
void setIndexQuicklyToDouble(unsigned i, double value)
{
- setIndexQuicklyToNativeValue(i, toNativeFromValue<Adaptor>(value));
+ setIndexQuicklyToNativeValue(i, toNativeFromValue<Adaptor>(jsNumber(value)));
}
void setIndexQuickly(unsigned i, JSValue value)
diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h
index 5590df42e..d89fd034e 100644
--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h
+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewConstructor.h
@@ -43,7 +43,19 @@ public:
static JSGenericTypedArrayViewConstructor* create(
VM&, JSGlobalObject*, Structure*, JSObject* prototype, const String& name, FunctionExecutable* privateAllocator);
+ // FIXME: We should fix the warnings for extern-template in JSObject template classes: https://bugs.webkit.org/show_bug.cgi?id=161979
+#if COMPILER(CLANG)
+#if __has_warning("-Wundefined-var-template")
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wundefined-var-template"
+#endif
+#endif
DECLARE_INFO;
+#if COMPILER(CLANG)
+#if __has_warning("-Wundefined-var-template")
+#pragma clang diagnostic pop
+#endif
+#endif
static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype);
diff --git a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.h b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.h
index 7ef77490a..12d381246 100644
--- a/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.h
+++ b/Source/JavaScriptCore/runtime/JSGenericTypedArrayViewPrototype.h
@@ -42,8 +42,20 @@ protected:
public:
static JSGenericTypedArrayViewPrototype* create(
VM&, JSGlobalObject*, Structure*);
-
+
+ // FIXME: We should fix the warnings for extern-template in JSObject template classes: https://bugs.webkit.org/show_bug.cgi?id=161979
+#if COMPILER(CLANG)
+#if __has_warning("-Wundefined-var-template")
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wundefined-var-template"
+#endif
+#endif
DECLARE_INFO;
+#if COMPILER(CLANG)
+#if __has_warning("-Wundefined-var-template")
+#pragma clang diagnostic pop
+#endif
+#endif
static Structure* createStructure(VM&, JSGlobalObject*, JSValue prototype);
};
diff --git a/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h b/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h
index d4dc53557..270e36860 100644
--- a/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h
+++ b/Source/JavaScriptCore/runtime/TypedArrayAdaptors.h
@@ -27,6 +27,7 @@
#define TypedArrayAdaptors_h
#include "JSCJSValue.h"
+#include "MathCommon.h"
#include "TypedArrayType.h"
#include <wtf/MathExtras.h>
diff --git a/Source/PlatformQt.cmake b/Source/PlatformQt.cmake
index 397ab8dbc..8d5fd7e04 100644
--- a/Source/PlatformQt.cmake
+++ b/Source/PlatformQt.cmake
@@ -5,9 +5,9 @@
# by compiling any static library like WTF or JSC with optimization flags instead and keep
# debug symbols for the static libraries that implement API.
cmake_dependent_option(USE_MINIMAL_DEBUG_INFO "Add debug info only for the libraries that implement API" OFF
- "NOT MINGW" ON)
+ "NOT MINGW;NOT APPLE" ON)
-if (USE_MINIMAL_DEBUG_INFO)
+if (USE_MINIMAL_DEBUG_INFO AND CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(WTF PRIVATE -g0 -O1)
target_compile_options(JavaScriptCore PRIVATE -g0 -O1)
target_compile_options(WebCore PRIVATE -g0 -O1)
@@ -97,22 +97,26 @@ install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/Qt5WebKitConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/Qt5WebKitConfigVersion.cmake"
DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/Qt5WebKit"
+ COMPONENT Data
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/Qt5WebKitWidgetsConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/Qt5WebKitWidgetsConfigVersion.cmake"
DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/Qt5WebKitWidgets"
+ COMPONENT Data
)
install(EXPORT WebKitTargets
FILE WebKitTargets.cmake
NAMESPACE Qt5::
DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/Qt5WebKit"
+ COMPONENT Data
)
install(EXPORT Qt5WebKitWidgetsTargets
FILE Qt5WebKitWidgetsTargets.cmake
NAMESPACE Qt5::
DESTINATION "${KDE_INSTALL_CMAKEPACKAGEDIR}/Qt5WebKitWidgets"
+ COMPONENT Data
)
# Documentation
@@ -191,8 +195,8 @@ add_custom_target(docs)
add_dependencies(docs qch_docs)
if (GENERATE_DOCUMENTATION)
- install(DIRECTORY "${DOC_OUTPUT_DIR}/qtwebkit" DESTINATION ${DOC_INSTALL_DIR})
- install(FILES "${DOC_OUTPUT_DIR}/qtwebkit.qch" DESTINATION ${DOC_INSTALL_DIR})
+ install(DIRECTORY "${DOC_OUTPUT_DIR}/qtwebkit" DESTINATION ${DOC_INSTALL_DIR} COMPONENT Data)
+ install(FILES "${DOC_OUTPUT_DIR}/qtwebkit.qch" DESTINATION ${DOC_INSTALL_DIR} COMPONENT Data)
endif ()
# Uninstall target
diff --git a/Source/WTF/wtf/MetaAllocator.h b/Source/WTF/wtf/MetaAllocator.h
index 9dd375cad..c3bc3d15c 100644
--- a/Source/WTF/wtf/MetaAllocator.h
+++ b/Source/WTF/wtf/MetaAllocator.h
@@ -97,7 +97,7 @@ public:
// builds.
WTF_EXPORT_PRIVATE size_t debugFreeSpaceSize();
- WTF_EXPORT_PRIVATE Lock& getLock() { return m_lock; }
+ Lock& getLock() { return m_lock; }
WTF_EXPORT_PRIVATE bool isInAllocatedMemory(const LockHolder&, void* address);
#if ENABLE(META_ALLOCATOR_PROFILE)
diff --git a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
index d73837dc5..ede5c28ae 100644
--- a/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
+++ b/Source/WebCore/bridge/qt/qt_pixmapruntime.cpp
@@ -120,7 +120,7 @@ static JSValueRef getPixmapHeight(JSContextRef context, JSObjectRef object, JSSt
return JSValueMakeNumber(context, imageSizeForVariant(data).height());
}
-static JSValueRef assignToHTMLImageElement(JSContextRef context, JSObjectRef function, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef assignToHTMLImageElement(JSContextRef context, JSObjectRef /*function*/, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
{
if (!argumentCount)
return JSValueMakeUndefined(context);
@@ -143,7 +143,7 @@ static JSValueRef assignToHTMLImageElement(JSContextRef context, JSObjectRef fun
return JSValueMakeUndefined(context);
}
-static JSValueRef pixmapToImageData(JSContextRef context, JSObjectRef function, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef pixmapToImageData(JSContextRef context, JSObjectRef /*function*/, JSObjectRef object, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/)
{
QVariant& data = *static_cast<QVariant*>(JSObjectGetPrivate(object));
QImage image = toImage(data);
@@ -160,7 +160,7 @@ static JSValueRef pixmapToImageData(JSContextRef context, JSObjectRef function,
return ::toRef(exec, toJS(exec, globalObject, imageData.get()));
}
-static JSValueRef pixmapToDataUrl(JSContextRef context, JSObjectRef function, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef pixmapToDataUrl(JSContextRef context, JSObjectRef /*function*/, JSObjectRef object, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/)
{
QVariant& data = *static_cast<QVariant*>(JSObjectGetPrivate(object));
QByteArray byteArray;
@@ -173,7 +173,7 @@ static JSValueRef pixmapToDataUrl(JSContextRef context, JSObjectRef function, JS
return value;
}
-static JSValueRef pixmapToString(JSContextRef context, JSObjectRef function, JSObjectRef object, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+static JSValueRef pixmapToString(JSContextRef context, JSObjectRef /*function*/, JSObjectRef object, size_t /*argumentCount*/, const JSValueRef /*arguments*/[], JSValueRef* /*exception*/)
{
QVariant& data = *static_cast<QVariant*>(JSObjectGetPrivate(object));
QSize size = imageSizeForVariant(data);
@@ -189,7 +189,7 @@ static void finalizePixmap(JSObjectRef object)
delete static_cast<QVariant*>(JSObjectGetPrivate(object));
}
-JSObjectRef QtPixmapRuntime::toJS(JSContextRef context, const QVariant& value, JSValueRef* exception)
+JSObjectRef QtPixmapRuntime::toJS(JSContextRef context, const QVariant& value, JSValueRef* /*exception*/)
{
return JSObjectMake(context, getClassRef(), new QVariant(value));
}
@@ -203,7 +203,7 @@ static QVariant emptyVariantForHint(QMetaType::Type hint)
return QVariant();
}
-QVariant QtPixmapRuntime::toQt(JSContextRef context, JSObjectRef obj, QMetaType::Type hint, JSValueRef* exception)
+QVariant QtPixmapRuntime::toQt(JSContextRef context, JSObjectRef obj, QMetaType::Type hint, JSValueRef* /*exception*/)
{
if (!obj)
return emptyVariantForHint(hint);
diff --git a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 00bcb8532..c560492fb 100644
--- a/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -1259,7 +1259,7 @@ FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect, RoundingM
return FloatRect(roundedOrigin, roundedLowerRight - roundedOrigin);
}
-void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const Color& color)
+void GraphicsContext::setPlatformShadow(const FloatSize& size, float, const Color&)
{
// Qt doesn't support shadows natively, they are drawn manually in the draw*
// functions
@@ -1583,7 +1583,8 @@ void GraphicsContext::setURLForRect(const URL& url, const IntRect& rect)
if (p->paintEngine()->type() == QPaintEngine::Pdf)
static_cast<QPdfEngine *>(p->paintEngine())->drawHyperlink(p->worldTransform().mapRect(rect), url);
#else
- notImplemented();
+ UNUSED_PARAM(url);
+ UNUSED_PARAM(rect);
#endif
}
diff --git a/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h b/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h
index bf577344b..fc3121271 100644
--- a/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h
+++ b/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h
@@ -62,7 +62,7 @@ private:
void markIsInUse() { m_lastUsedTime = monotonicallyIncreasingTime(); }
RefPtr<BitmapTexture> m_texture;
- double m_lastUsedTime;
+ double m_lastUsedTime { 0.0 };
};
void scheduleReleaseUnusedTextures();
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
index 1664cffe7..133f3522b 100644
--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
@@ -251,7 +251,7 @@ private:
#endif
Timer m_animationStartedTimer;
TextureMapperAnimations m_animations;
- double m_lastAnimationStartTime;
+ double m_lastAnimationStartTime { 0.0 };
ScrollableArea* m_scrollableArea;
};
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h
index 84e7b274c..5859857f7 100644
--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h
+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h
@@ -131,9 +131,7 @@ struct CoordinatedGraphicsLayerState {
, replica(InvalidCoordinatedLayerID)
, mask(InvalidCoordinatedLayerID)
, imageID(InvalidCoordinatedImageBackingID)
-#if USE(GRAPHICS_SURFACE)
- , platformLayerFrontBuffer(0)
-#endif
+ , repaintCount(0)
#if USE(COORDINATED_GRAPHICS_THREADED)
, platformLayerProxy(0)
#endif
@@ -167,7 +165,7 @@ struct CoordinatedGraphicsLayerState {
#if USE(GRAPHICS_SURFACE)
IntSize platformLayerSize;
GraphicsSurfaceToken platformLayerToken;
- uint32_t platformLayerFrontBuffer;
+ uint32_t platformLayerFrontBuffer { 0 };
GraphicsSurface::Flags platformLayerSurfaceFlags;
#endif
diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h b/Source/WebCore/platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h
index 38c72e370..0e749be93 100644
--- a/Source/WebCore/platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h
+++ b/Source/WebCore/platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h
@@ -35,7 +35,7 @@ public:
IntRect updateRect;
// The id of the update atlas including the shareable bitmap containing the updates.
- uint32_t atlasID;
+ uint32_t atlasID { 0 };
// The offset in the bitmap where the rendered contents are.
IntPoint surfaceOffset;
diff --git a/Source/WebCore/platform/network/MIMESniffing.cpp b/Source/WebCore/platform/network/MIMESniffing.cpp
index 27aefcbcf..7f05a9a97 100644
--- a/Source/WebCore/platform/network/MIMESniffing.cpp
+++ b/Source/WebCore/platform/network/MIMESniffing.cpp
@@ -331,7 +331,8 @@ static inline const char* findSimpleMIMEType(const char* data, size_t dataSize,
return 0;
}
-bool isTypeInList(const char* type, const MagicNumbers* types, size_t typesCount)
+#if !ASSERT_DISABLED
+static bool isTypeInList(const char* type, const MagicNumbers* types, size_t typesCount)
{
for (size_t i = 0; i < typesCount; ++i) {
if (!strcmp(type, types[i].mimeType))
@@ -339,6 +340,7 @@ bool isTypeInList(const char* type, const MagicNumbers* types, size_t typesCount
}
return false;
}
+#endif
// http://tools.ietf.org/html/draft-abarth-mime-sniff-06#page-8
static const char* internalTextOrBinaryTypeSniffingProcedure(const char* data, size_t dataSize)
diff --git a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
index 211cf892a..951873190 100644
--- a/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
+++ b/Source/WebCore/platform/network/qt/QNetworkReplyHandler.cpp
@@ -92,10 +92,9 @@ void FormDataIODevice::prepareFormElements()
}
-qint64 FormDataIODevice::computeSize()
+qint64 FormDataIODevice::computeSize()
{
- for (int i = 0; i < m_formElements.size(); ++i) {
- const FormDataElement& element = m_formElements[i];
+ for (const auto& element : m_formElements) {
if (element.m_type == FormDataElement::Type::Data)
m_dataSize += element.m_data.size();
else {
diff --git a/Source/WebCore/platform/qt/LocalizedStringsQt.cpp b/Source/WebCore/platform/qt/LocalizedStringsQt.cpp
index 8c4e4ee15..24e1ca22b 100644
--- a/Source/WebCore/platform/qt/LocalizedStringsQt.cpp
+++ b/Source/WebCore/platform/qt/LocalizedStringsQt.cpp
@@ -760,25 +760,25 @@ String validationMessagePatternMismatchText()
return String();
}
-String validationMessageTooLongText(int valueLength, int maxLength)
+String validationMessageTooLongText(int, int)
{
notImplemented();
return String();
}
-String validationMessageRangeUnderflowText(const String& minimum)
+String validationMessageRangeUnderflowText(const String&)
{
notImplemented();
return String();
}
-String validationMessageRangeOverflowText(const String& maximum)
+String validationMessageRangeOverflowText(const String&)
{
notImplemented();
return String();
}
-String validationMessageStepMismatchText(const String& base, const String& step)
+String validationMessageStepMismatchText(const String&, const String&)
{
notImplemented();
return String();
diff --git a/Source/WebCore/platform/qt/PasteboardQt.cpp b/Source/WebCore/platform/qt/PasteboardQt.cpp
index fc7011094..2bc766782 100644
--- a/Source/WebCore/platform/qt/PasteboardQt.cpp
+++ b/Source/WebCore/platform/qt/PasteboardQt.cpp
@@ -380,7 +380,7 @@ Vector<String> Pasteboard::readFilenames()
}
#if ENABLE(DRAG_SUPPORT)
-void Pasteboard::setDragImage(DragImageRef, const IntPoint& hotSpot)
+void Pasteboard::setDragImage(DragImageRef, const IntPoint&)
{
notImplemented();
}
diff --git a/Source/WebCore/platform/text/LineEnding.cpp b/Source/WebCore/platform/text/LineEnding.cpp
index 28db166e4..c350dc1d0 100644
--- a/Source/WebCore/platform/text/LineEnding.cpp
+++ b/Source/WebCore/platform/text/LineEnding.cpp
@@ -59,7 +59,7 @@ public:
return reinterpret_cast<uint8_t*>(ptr);
}
- virtual void copy(const CString& source)
+ void copy(const CString& source) override
{
m_buffer = source;
}
diff --git a/Source/WebCore/rendering/TextDecorationPainter.cpp b/Source/WebCore/rendering/TextDecorationPainter.cpp
index f1e295ad1..91fa56a81 100644
--- a/Source/WebCore/rendering/TextDecorationPainter.cpp
+++ b/Source/WebCore/rendering/TextDecorationPainter.cpp
@@ -266,6 +266,9 @@ void TextDecorationPainter::paintTextDecoration(const TextRun& textRun, const Fl
auto paintDecoration = [&](TextDecoration decoration, TextDecorationStyle style, Color color, StrokeStyle strokeStyle,
const FloatPoint& start, const FloatPoint& end, int offset) {
+#if !ENABLE(CSS3_TEXT_DECORATION_SKIP_INK)
+ UNUSED_PARAM(offset);
+#endif
m_context.setStrokeColor(color);
m_context.setStrokeStyle(strokeStyle);
diff --git a/Source/WebKit/PlatformQt.cmake b/Source/WebKit/PlatformQt.cmake
index 82fc4595a..68909de95 100644
--- a/Source/WebKit/PlatformQt.cmake
+++ b/Source/WebKit/PlatformQt.cmake
@@ -378,6 +378,7 @@ install(
${WebKit_PUBLIC_HEADERS}
DESTINATION
${KDE_INSTALL_INCLUDEDIR}/QtWebKit
+ COMPONENT Data
)
file(GLOB WebKit_PRIVATE_HEADERS qt/Api/*_p.h)
@@ -386,6 +387,7 @@ install(
${WebKit_PRIVATE_HEADERS}
DESTINATION
${KDE_INSTALL_INCLUDEDIR}/QtWebKit/${PROJECT_VERSION}/QtWebKit/private
+ COMPONENT Data
)
set(WEBKIT_PKGCONGIG_DEPS "Qt5Core Qt5Gui Qt5Network")
@@ -435,8 +437,9 @@ ecm_generate_pkgconfig_file(
BASE_NAME Qt5WebKit
DEPS "${WEBKIT_PKGCONGIG_DEPS}"
FILENAME_VAR WebKit_PKGCONFIG_FILENAME
- INSTALL
)
+set(ECM_PKGCONFIG_INSTALL_DIR "${LIB_INSTALL_DIR}/pkgconfig" CACHE PATH "The directory where pkgconfig will be installed to.")
+install(FILES ${WebKit_PKGCONFIG_FILENAME} DESTINATION ${ECM_PKGCONFIG_INSTALL_DIR} COMPONENT Data)
if (KDE_INSTALL_USE_QT_SYS_PATHS)
set(WebKit_PRI_ARGUMENTS
@@ -463,7 +466,7 @@ ecm_generate_pri_file(
FILENAME_VAR WebKit_PRI_FILENAME
${WebKit_PRI_ARGUMENTS}
)
-install(FILES ${WebKit_PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
+install(FILES ${WebKit_PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR} COMPONENT Data)
if (QT_STATIC_BUILD)
set(WebKit_LIBRARY_TYPE STATIC)
@@ -586,6 +589,7 @@ install(
${WebKitWidgets_PUBLIC_HEADERS}
DESTINATION
${KDE_INSTALL_INCLUDEDIR}/QtWebKitWidgets
+ COMPONENT Data
)
file(GLOB WebKitWidgets_PRIVATE_HEADERS qt/WidgetApi/*_p.h)
@@ -594,14 +598,15 @@ install(
${WebKitWidgets_PRIVATE_HEADERS}
DESTINATION
${KDE_INSTALL_INCLUDEDIR}/QtWebKitWidgets/${PROJECT_VERSION}/QtWebKitWidgets/private
+ COMPONENT Data
)
ecm_generate_pkgconfig_file(
BASE_NAME Qt5WebKitWidgets
DEPS "${WEBKITWIDGETS_PKGCONFIG_DEPS}"
FILENAME_VAR WebKitWidgets_PKGCONFIG_FILENAME
- INSTALL
)
+install(FILES ${WebKitWidgets_PKGCONFIG_FILENAME} DESTINATION ${ECM_PKGCONFIG_INSTALL_DIR} COMPONENT Data)
if (KDE_INSTALL_USE_QT_SYS_PATHS)
set(WebKitWidgets_PRI_ARGUMENTS
@@ -627,7 +632,7 @@ ecm_generate_pri_file(
FILENAME_VAR WebKitWidgets_PRI_FILENAME
${WebKitWidgets_PRI_ARGUMENTS}
)
-install(FILES ${WebKitWidgets_PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})
+install(FILES ${WebKitWidgets_PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR} COMPONENT Data)
if (MSVC)
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
diff --git a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
index a6d0267af..569cc541e 100644
--- a/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/QWebPageAdapter.cpp
@@ -896,8 +896,7 @@ QList<MenuItem> descriptionForPlatformMenu(const Vector<ContextMenuItem>& items,
QList<MenuItem> itemDescriptions;
if (!items.size())
return itemDescriptions;
- for (int i = 0; i < items.size(); ++i) {
- const ContextMenuItem &item = items.at(i);
+ for (const auto& item : items) {
MenuItem description;
switch (item.type()) {
case WebCore::CheckableActionType: /* fall through */
diff --git a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
index 4c412e1dd..9b634184a 100644
--- a/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
+++ b/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp
@@ -806,7 +806,7 @@ void QQuickWebViewPrivate::chooseFiles(WKOpenPanelResultListenerRef listenerRef,
QStringList selectedPaths = dialogRunner.filePaths();
Vector<RefPtr<API::Object> > wkFiles(selectedPaths.size());
- for (unsigned i = 0; i < selectedPaths.size(); ++i)
+ for (int i = 0; i < selectedPaths.size(); ++i)
wkFiles[i] = API::URL::create(QUrl::fromLocalFile(selectedPaths.at(i)).toString());
WKOpenPanelResultListenerChooseFiles(listenerRef, toAPI(&API::Array::create(WTFMove(wkFiles)).leakRef()));
diff --git a/Source/WebKit2/UIProcess/CoordinatedGraphics/PageViewportController.cpp b/Source/WebKit2/UIProcess/CoordinatedGraphics/PageViewportController.cpp
index 1715657b8..63badacc3 100644
--- a/Source/WebKit2/UIProcess/CoordinatedGraphics/PageViewportController.cpp
+++ b/Source/WebKit2/UIProcess/CoordinatedGraphics/PageViewportController.cpp
@@ -78,10 +78,12 @@ float PageViewportController::deviceScaleFactor() const
return m_webPageProxy->deviceScaleFactor();
}
+#if PLATFORM(EFL)
static inline bool isIntegral(float value)
{
return static_cast<int>(value) == value;
}
+#endif
FloatPoint PageViewportController::pixelAlignedFloatPoint(const FloatPoint& framePosition)
{
diff --git a/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp b/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp
index 47b118a4b..c5337b3f9 100644
--- a/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp
+++ b/Source/WebKit2/UIProcess/Plugins/qt/PluginProcessProxyQt.cpp
@@ -49,7 +49,7 @@
namespace WebKit {
-class PluginProcessCreationParameters;
+struct PluginProcessCreationParameters;
void PluginProcessProxy::platformGetLaunchOptions(ProcessLauncher::LaunchOptions& launchOptions, const PluginProcessAttributes& pluginProcessAttributes)
{
diff --git a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
index 654829487..af3321926 100644
--- a/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/qt/WebPageQt.cpp
@@ -221,16 +221,6 @@ const char* WebPage::interpretKeyEvent(const KeyboardEvent* evt)
return mapKey ? keyPressCommandsMap->get(mapKey) : 0;
}
-static inline void scroll(Page* page, ScrollDirection direction, ScrollGranularity granularity)
-{
- page->focusController().focusedOrMainFrame().eventHandler().scrollRecursively(direction, granularity);
-}
-
-static inline void logicalScroll(Page* page, ScrollLogicalDirection direction, ScrollGranularity granularity)
-{
- page->focusController().focusedOrMainFrame().eventHandler().logicalScrollRecursively(direction, granularity);
-}
-
bool WebPage::performDefaultBehaviorForKeyEvent(const WebKeyboardEvent& keyboardEvent)
{
if (keyboardEvent.type() != WebEvent::KeyDown && keyboardEvent.type() != WebEvent::RawKeyDown)
diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
index a4b4fa4fe..ee59d7738 100644
--- a/Source/cmake/OptionsQt.cmake
+++ b/Source/cmake/OptionsQt.cmake
@@ -67,6 +67,12 @@ if (WIN32)
set(CMAKE_SHARED_MODULE_PREFIX "")
endif ()
+if (APPLE)
+ if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
+ set(CMAKE_DEBUG_POSTFIX _debug)
+ endif ()
+endif ()
+
WEBKIT_OPTION_BEGIN()
if (APPLE)
@@ -679,7 +685,9 @@ if (MSVC)
endforeach ()
endif ()
- set(ICU_LIBRARIES icuuc${CMAKE_DEBUG_POSTFIX} icuin${CMAKE_DEBUG_POSTFIX} icudt${CMAKE_DEBUG_POSTFIX})
+ if (NOT QT_CONAN_DIR)
+ set(ICU_LIBRARIES icuuc${CMAKE_DEBUG_POSTFIX} icuin${CMAKE_DEBUG_POSTFIX} icudt${CMAKE_DEBUG_POSTFIX})
+ endif ()
endif ()
if (NOT RUBY_FOUND AND RUBY_EXECUTABLE AND NOT RUBY_VERSION VERSION_LESS 1.9)
@@ -706,3 +714,8 @@ include(KDEInstallDirs)
if (NOT qt_install_prefix_dir STREQUAL "${CMAKE_INSTALL_PREFIX}")
set(KDE_INSTALL_USE_QT_SYS_PATHS OFF)
endif ()
+
+# We split all installed files into 2 components: Code and Data. This is different from
+# traditional approach with Runtime and Devel, but we need it to fix concurrent installation of
+# debug and release builds in qmake-based build
+set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Code")
diff --git a/Tools/qmake/projects/run_cmake.pro b/Tools/qmake/projects/run_cmake.pro
index e0c615b0a..ac8767154 100644
--- a/Tools/qmake/projects/run_cmake.pro
+++ b/Tools/qmake/projects/run_cmake.pro
@@ -4,6 +4,8 @@ ROOT_QT_BUILD_DIR = $$ROOT_BUILD_DIR/..
TEMPLATE = aux
+qtConfig(debug_and_release): CONFIG += debug_and_release build_all
+
msvc:!contains(QMAKE_HOST.arch, x86_64) {
debug_and_release {
warning("Skipping debug build of QtWebKit because it requires a 64-bit toolchain")
@@ -76,10 +78,13 @@ build_pass|!debug_and_release {
equals(QMAKE_HOST.os, Windows) {
if(equals(MAKEFILE_GENERATOR, MSVC.NET)|equals(MAKEFILE_GENERATOR, MSBUILD)) {
cmake_generator = "NMake Makefiles JOM"
+ make_command_name = jom
} else: if(equals(MAKEFILE_GENERATOR, MINGW)) {
cmake_generator = "MinGW Makefiles"
+ make_command_name = make
} else {
cmake_generator = "Unix Makefiles"
+ make_command_name = make
}
cmake_args += "-G \"$$cmake_generator\""
}
@@ -98,14 +103,22 @@ build_pass|!debug_and_release {
log("$${EOL}Running $$cmake_env cmake $$ROOT_WEBKIT_DIR $$cmake_args $${EOL}$${EOL}")
!system("$$cmake_cmd_base $$cmake_env cmake $$ROOT_WEBKIT_DIR $$cmake_args"): error("Running cmake failed")
- log("$${EOL}WebKit is now configured for building. Just run 'make'.$${EOL}$${EOL}")
+ log("$${EOL}WebKit is now configured for building. Just run '$$make_command_name'.$${EOL}$${EOL}")
- default_target.target = first
+ build_pass:build_all: default_target.target = all
+ else: default_target.target = first
default_target.commands = cd $$cmake_build_dir && $(MAKE) $$make_args
QMAKE_EXTRA_TARGETS += default_target
+ # When debug and release are built at the same time, don't install data files twice
+ debug_and_release:build_all:CONFIG(debug, debug|release): cmake_install_args = "-DCOMPONENT=Code"
+
+ install_impl_target.target = install_impl
+ install_impl_target.commands = cd $$cmake_build_dir && cmake $$cmake_install_args -P cmake_install.cmake
+ QMAKE_EXTRA_TARGETS += install_impl_target
+
install_target.target = install
- install_target.commands = cd $$cmake_build_dir && $(MAKE) install $$make_args DESTDIR=$(INSTALL_ROOT)
+ install_target.commands = $(MAKE) -f $(MAKEFILE) install_impl $$make_args DESTDIR=$(INSTALL_ROOT)
QMAKE_EXTRA_TARGETS += install_target
}
diff --git a/Tools/qt/jhbuild-qt-5.4.modules b/Tools/qt/jhbuild-qt-5.4.modules
index fc85f6ee0..194335129 100644
--- a/Tools/qt/jhbuild-qt-5.4.modules
+++ b/Tools/qt/jhbuild-qt-5.4.modules
@@ -6,8 +6,10 @@
<metamodule id="qt">
<dependencies>
<dep package="qtbase"/>
+ <dep package="qtdeclarative"/>
<dep package="qtlocation"/>
<dep package="qtsensors"/>
+ <dep package="qtwebchannel"/>
</dependencies>
</metamodule>
@@ -64,6 +66,9 @@
<patch file="qtbase-5.4-fontconfig-fix.patch" strip="1"/>
<patch file="qtbase-5.4-no-sslv3.patch" strip="1"/>
<patch file="qtbase-5.4-no-sslv2_3.patch" strip="1"/>
+ <patch file="qtbase-5.4-add-macros-for-enabling-disabling-warnings.patch" strip="1"/>
+ <patch file="qtbase-5.4-fix-Clang-warning-about-inconsistent-use-of-C-11-ove.patch" strip="1"/>
+ <patch file="qtbase-5.4-fix-gcc-Wsuggest-override-warning-on-Q_OBJECT.patch" strip="1"/>
</branch>
<dependencies>
<dep package="fontconfig"/>
@@ -74,6 +79,18 @@
</dependencies>
</autotools>
+ <autotools id="qtdeclarative"
+ autogen-template="%(prefix)s/bin/qmake %(srcdir)s"
+ makeinstallargs="install INSTALL_ROOT='$(DESTDIR)'"
+ supports-non-srcdir-builds="no">
+ <branch module="archive/qt/5.4/${version}/submodules/qtdeclarative-opensource-src-${version}.tar.xz" version="5.4.0"
+ repo="download.qt.io"
+ hash="sha256:e67c9275b0f6869a7c1e8023ad7c0a23fb19f8a8d2f350371e954ead0cfad7b6"/>
+ <dependencies>
+ <dep package="qtbase"/>
+ </dependencies>
+ </autotools>
+
<autotools id="qtlocation"
autogen-template="%(prefix)s/bin/qmake %(srcdir)s"
makeinstallargs="install INSTALL_ROOT='$(DESTDIR)'"
@@ -97,4 +114,17 @@
<dep package="qtbase"/>
</dependencies>
</autotools>
+
+ <autotools id="qtwebchannel"
+ autogen-template="%(prefix)s/bin/qmake %(srcdir)s"
+ makeinstallargs="install INSTALL_ROOT='$(DESTDIR)'"
+ supports-non-srcdir-builds="no">
+ <branch module="archive/qt/5.4/${version}/submodules/qtwebchannel-opensource-src-${version}.tar.xz" version="5.4.0"
+ repo="download.qt.io"
+ hash="sha256:24eb0125198270f8595babb6c0df74dd13e0ccc8c8a5e665151cf68c3306594c"/>
+ <dependencies>
+ <dep package="qtbase"/>
+ <dep package="qtdeclarative"/>
+ </dependencies>
+ </autotools>
</moduleset>
diff --git a/Tools/qt/patches/qtbase-5.4-add-macros-for-enabling-disabling-warnings.patch b/Tools/qt/patches/qtbase-5.4-add-macros-for-enabling-disabling-warnings.patch
new file mode 100644
index 000000000..053bfee02
--- /dev/null
+++ b/Tools/qt/patches/qtbase-5.4-add-macros-for-enabling-disabling-warnings.patch
@@ -0,0 +1,86 @@
+From 63a512023e861380f4489b103212769b741a93dc Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Thu, 30 Oct 2014 20:44:43 -0700
+Subject: [PATCH 1/1] Add macros for enabling/disabling warnings
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This allows us to avoid the ugly #if for compiler versions. We might
+still need for when a warning only occurs in one compiler version, but
+otherwise the code will be much cleaner.
+
+Change-Id: Ibc941d898b3dad2e3d87c11378f29139c31f0fff
+Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
+Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
+---
+ src/corelib/global/qcompilerdetection.h | 46 ++++++++++++++++++++++++++++++++-
+ 1 file changed, 45 insertions(+), 1 deletion(-)
+
+diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
+index ee396409d8..dcd185742a 100644
+--- a/src/corelib/global/qcompilerdetection.h
++++ b/src/corelib/global/qcompilerdetection.h
+@@ -1,7 +1,7 @@
+ /****************************************************************************
+ **
+ ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+-** Copyright (C) 2012 Intel Corporation
++** Copyright (C) 2014 Intel Corporation
+ ** Contact: http://www.qt-project.org/legal
+ **
+ ** This file is part of the QtCore module of the Qt Toolkit.
+@@ -1060,6 +1060,50 @@
+ # define Q_DECL_CONST_FUNCTION Q_DECL_PURE_FUNCTION
+ #endif
+
++/*
++ * Warning/diagnostic handling
++ */
++
++#define QT_DO_PRAGMA(text) _Pragma(#text)
++#if defined(Q_CC_INTEL)
++# define QT_WARNING_PUSH QT_DO_PRAGMA(warning(push))
++# define QT_WARNING_POP QT_DO_PRAGMA(warning(pop))
++# define QT_WARNING_DISABLE_INTEL(number) QT_DO_PRAGMA(warning(disable: number))
++# define QT_WARNING_DISABLE_MSVC(number)
++# define QT_WARNING_DISABLE_CLANG(text)
++# define QT_WARNING_DISABLE_GCC(text)
++#elif defined(Q_CC_MSVC) && _MSC_VER >= 1500
++# undef QT_DO_PRAGMA /* not needed */
++# define QT_WARNING_PUSH __pragma(warning(push))
++# define QT_WARNING_POP __pragma(warning(pop))
++# define QT_WARNING_DISABLE_MSVC(number) __pragma(warning(disable: number))
++# define QT_WARNING_DISABLE_INTEL(number)
++# define QT_WARNING_DISABLE_CLANG(text)
++# define QT_WARNING_DISABLE_GCC(text)
++#elif defined(Q_CC_CLANG)
++# define QT_WARNING_PUSH QT_DO_PRAGMA(clang diagnostic push)
++# define QT_WARNING_POP QT_DO_PRAGMA(clang diagnostic pop)
++# define QT_WARNING_DISABLE_CLANG(text) QT_DO_PRAGMA(clang diagnostic ignored text)
++# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text) // GCC directives work in Clang too
++# define QT_WARNING_DISABLE_INTEL(number)
++# define QT_WARNING_DISABLE_MSVC(number)
++#elif defined(Q_CC_GNU) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 405)
++# define QT_WARNING_PUSH QT_DO_PRAGMA(GCC diagnostic push)
++# define QT_WARNING_POP QT_DO_PRAGMA(GCC diagnostic pop)
++# define QT_WARNING_DISABLE_GCC(text) QT_DO_PRAGMA(GCC diagnostic ignored text)
++# define QT_WARNING_DISABLE_CLANG(text)
++# define QT_WARNING_DISABLE_INTEL(number)
++# define QT_WARNING_DISABLE_MSVC(number)
++#else // All other compilers, GCC < 4.6 and MSVC < 2008
++# define QT_WARNING_DISABLE_GCC(text)
++# define QT_WARNING_PUSH
++# define QT_WARNING_POP
++# define QT_WARNING_DISABLE_INTEL(number)
++# define QT_WARNING_DISABLE_MSVC(number)
++# define QT_WARNING_DISABLE_CLANG(text)
++# define QT_WARNING_DISABLE_GCC(text)
++#endif
++
+ /*
+ Proper for-scoping in MIPSpro CC
+ */
+--
+2.11.0
+
diff --git a/Tools/qt/patches/qtbase-5.4-fix-Clang-warning-about-inconsistent-use-of-C-11-ove.patch b/Tools/qt/patches/qtbase-5.4-fix-Clang-warning-about-inconsistent-use-of-C-11-ove.patch
new file mode 100644
index 000000000..63258bbcd
--- /dev/null
+++ b/Tools/qt/patches/qtbase-5.4-fix-Clang-warning-about-inconsistent-use-of-C-11-ove.patch
@@ -0,0 +1,62 @@
+From 3092bd56c394f22e027be59368789546afb5ca98 Mon Sep 17 00:00:00 2001
+From: Thiago Macieira <thiago.macieira@intel.com>
+Date: Wed, 17 Dec 2014 18:59:17 -0800
+Subject: [PATCH 1/1] Fix Clang warning about inconsistent use of C++11
+ override
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+We cannot use override in the Q_OBJECT macro, so tell Clang not to warn
+about our lack of use of the keyword in the three virtuals that Q_OBJECT
+overrides when the user uses Q_DECL_OVERRIDE in their own functions.
+
+We can't use Q_DECL_OVERRIDE for two reasons:
+ 1) because that would trigger the warning in any and all virtual
+ overrides the user may have in their own class (and most of Qt)
+ 2) because when Q_OBJECT is used in QObject, it's not overriding
+ anything -- it's the base declaration
+
+For #2, we could add a different macro exclusively for QObject that moc
+would expand, but it's unnecessary work.
+
+Change-Id: Ic9cb7896f93f06f4e86b6a42dc08f96d257f7550
+Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
+Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
+---
+ src/corelib/kernel/qobjectdefs.h | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
+index a495bce7ec..84e7a65a54 100644
+--- a/src/corelib/kernel/qobjectdefs.h
++++ b/src/corelib/kernel/qobjectdefs.h
+@@ -138,15 +138,24 @@ inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
+ # define Q_DECL_HIDDEN_STATIC_METACALL Q_DECL_HIDDEN
+ #endif
+
++#if defined(Q_CC_CLANG) && Q_CC_CLANG >= 306
++# define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_CLANG("-Winconsistent-missing-override")
++#else
++# define Q_OBJECT_NO_OVERRIDE_WARNING
++#endif
++
+ /* qmake ignore Q_OBJECT */
+ #define Q_OBJECT \
+ public: \
+ Q_OBJECT_CHECK \
++ QT_WARNING_PUSH \
++ Q_OBJECT_NO_OVERRIDE_WARNING \
+ static const QMetaObject staticMetaObject; \
+ virtual const QMetaObject *metaObject() const; \
+ virtual void *qt_metacast(const char *); \
+- QT_TR_FUNCTIONS \
+ virtual int qt_metacall(QMetaObject::Call, int, void **); \
++ QT_WARNING_POP \
++ QT_TR_FUNCTIONS \
+ private: \
+ Q_DECL_HIDDEN_STATIC_METACALL static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); \
+ struct QPrivateSignal {};
+--
+2.11.0
+
diff --git a/Tools/qt/patches/qtbase-5.4-fix-gcc-Wsuggest-override-warning-on-Q_OBJECT.patch b/Tools/qt/patches/qtbase-5.4-fix-gcc-Wsuggest-override-warning-on-Q_OBJECT.patch
new file mode 100644
index 000000000..f56cd3842
--- /dev/null
+++ b/Tools/qt/patches/qtbase-5.4-fix-gcc-Wsuggest-override-warning-on-Q_OBJECT.patch
@@ -0,0 +1,30 @@
+From 4790ccfa7a7dcdaf5b1c3c3f71bd333a6d754fba Mon Sep 17 00:00:00 2001
+From: David Faure <david.faure@kdab.com>
+Date: Wed, 27 Jul 2016 22:57:51 +0200
+Subject: [PATCH 1/1] Fix gcc -Wsuggest-override warning on Q_OBJECT
+
+Same reasoning as commit 3092bd5 (which was for Clang), but for gcc >= 5.1.
+
+Change-Id: I123b17670c1a64876b01fd39fb11648fa4e8b1fd
+Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
+Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
+---
+ src/corelib/kernel/qobjectdefs.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h
+index 8d32795af2..0a4492dcda 100644
+--- a/src/corelib/kernel/qobjectdefs.h
++++ b/src/corelib/kernel/qobjectdefs.h
+@@ -173,6 +173,8 @@ inline void qYouForgotTheQ_OBJECT_Macro(T1, T2) {}
+
+ #if defined(Q_CC_CLANG) && Q_CC_CLANG >= 306
+ # define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_CLANG("-Winconsistent-missing-override")
++#elif defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && Q_CC_GNU >= 510
++# define Q_OBJECT_NO_OVERRIDE_WARNING QT_WARNING_DISABLE_GCC("-Wsuggest-override")
+ #else
+ # define Q_OBJECT_NO_OVERRIDE_WARNING
+ #endif
+--
+2.11.0
+