summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-22 20:13:50 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-07-22 20:21:19 +0200
commitabd3b8030cbcc50379578b88ce6019e338ff8597 (patch)
tree7a7acb89e594b57180e9823c4ab03dcce66d5b5f /src
parent5cb581b3b4c3305a0dfebead1ec7049ab6f2ebc4 (diff)
parent6f3bb0aafab877c34dea3d9141a9931b5a7914a5 (diff)
Merge remote-tracking branch 'origin/5.3' into dev
Conflicts: src/widgets/kernel/qwidget_qpa.cpp src/widgets/widgets.pro Change-Id: I697eec936c4e1a6c360edc8f0b472e23c0461ecb
Diffstat (limited to 'src')
-rw-r--r--src/gui/Qt5GuiConfigExtras.cmake.in22
-rw-r--r--src/gui/kernel/qwindow.cpp5
-rw-r--r--src/gui/text/qtextlayout.cpp5
-rw-r--r--src/network/access/qnetworkdiskcache.cpp10
-rw-r--r--src/plugins/platforms/windows/qwindowstabletsupport.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp5
-rw-r--r--src/printsupport/kernel/qpaintengine_alpha.cpp5
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/widgets.pro3
-rw-r--r--src/widgets/widgets/qsplitter.cpp6
10 files changed, 59 insertions, 30 deletions
diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
index d734e56d23..9a846d435e 100644
--- a/src/gui/Qt5GuiConfigExtras.cmake.in
+++ b/src/gui/Qt5GuiConfigExtras.cmake.in
@@ -66,7 +66,8 @@ if (NOT _qt5gui_OPENGL_INCLUDE_DIR)
endif()
unset(_GL_INCDIRS)
-_qt5_Gui_check_file_exists(${_qt5gui_OPENGL_INCLUDE_DIR})
+# Don\'t check for existence of the "_qt5gui_OPENGL_INCLUDE_DIR" because it is
+# optional.
list(APPEND Qt5Gui_INCLUDE_DIRS ${_qt5gui_OPENGL_INCLUDE_DIR})
set_property(TARGET Qt5::Gui APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${_qt5gui_OPENGL_INCLUDE_DIR})
@@ -105,13 +106,18 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
)
!!IF mac
set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}")
+ if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
+ set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
+ endif()
!!ENDIF
- if (WIN32 AND NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
+ if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
# The above find_library call doesn\'t work for finding
# libraries in Windows SDK paths outside of the proper
- # environment. Just add the library name to the result
- # variable instead.
- # We avoid doing this in the first case because Qt may be
+ # environment, even if the libraries are present. In other
+ # cases it is OK for the libraries to not be found
+ # because they are optional dependencies of Qt5Gui, needed
+ # only if the qopengl.h header is used.
+ # We try to find the libraries in the first place because Qt may be
# compiled with another set of GL libraries (such as coming
# from ANGLE). The point of these find calls is to try to
# find the same binaries as Qt is compiled with (as they are
@@ -119,7 +125,6 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
# above with paths known to qmake.
set(_Qt5Gui_${_cmake_lib_name}_LIBRARY_DONE TRUE)
unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE)
- list(APPEND Qt5Gui_${Name}_LIBRARIES ${_lib})
else()
add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED)
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${Qt5Gui_${Name}_INCLUDE_DIRS})
@@ -152,11 +157,6 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
endif()
endif()
endforeach()
- if (NOT CMAKE_CROSSCOMPILING)
- foreach(_dir ${Qt5Gui_${Name}_INCLUDE_DIRS})
- _qt5_Gui_check_file_exists(${_dir})
- endforeach()
- endif()
endmacro()
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 327544c59c..8159b7746e 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1119,6 +1119,11 @@ Qt::WindowState QWindow::windowState() const
void QWindow::setTransientParent(QWindow *parent)
{
Q_D(QWindow);
+ if (parent && !parent->isTopLevel()) {
+ qWarning() << Q_FUNC_INFO << parent << "must be a top level window.";
+ return;
+ }
+
d->transientParent = parent;
QGuiApplicationPrivate::updateBlockedStatus(this);
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 435ef2637d..9919ce6bb4 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -108,6 +108,10 @@ QT_BEGIN_NAMESPACE
This class is only used if the text layout is used to lay out
parts of a QTextDocument.
+ Normally, you do not need to create a QTextInlineObject. It is
+ used by QAbstractTextDocumentLayout to handle inline objects when
+ implementing a custom layout.
+
The inline object has various attributes that can be set, for
example using, setWidth(), setAscent(), and setDescent(). The
rectangle it occupies is given by rect(), and its direction by
@@ -117,6 +121,7 @@ QT_BEGIN_NAMESPACE
/*!
\fn QTextInlineObject::QTextInlineObject(int i, QTextEngine *e)
+ \internal
Creates a new inline object for the item at position \a i in the
text engine \a e.
diff --git a/src/network/access/qnetworkdiskcache.cpp b/src/network/access/qnetworkdiskcache.cpp
index a1cbd9364e..86a3b20a9c 100644
--- a/src/network/access/qnetworkdiskcache.cpp
+++ b/src/network/access/qnetworkdiskcache.cpp
@@ -56,7 +56,7 @@
#define CACHE_POSTFIX QLatin1String(".d")
#define PREPARED_SLASH QLatin1String("prepared/")
-#define CACHE_VERSION 7
+#define CACHE_VERSION 8
#define DATA_DIR QLatin1String("data")
#define MAX_COMPRESSION_SIZE (1024 * 1024 * 3)
@@ -686,6 +686,7 @@ void QCacheItem::writeHeader(QFile *device) const
out << qint32(CacheMagic);
out << qint32(CurrentCacheVersion);
+ out << static_cast<qint32>(out.version());
out << metaData;
bool compressed = canCompress();
out << compressed;
@@ -719,6 +720,13 @@ bool QCacheItem::read(QFile *device, bool readData)
if (v != CurrentCacheVersion)
return false;
+ qint32 streamVersion;
+ in >> streamVersion;
+ // Default stream version is also the highest we can handle
+ if (streamVersion > in.version())
+ return false;
+ in.setVersion(streamVersion);
+
bool compressed;
QByteArray dataBA;
in >> metaData;
diff --git a/src/plugins/platforms/windows/qwindowstabletsupport.cpp b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
index 2a1e5c58b9..8ceab02311 100644
--- a/src/plugins/platforms/windows/qwindowstabletsupport.cpp
+++ b/src/plugins/platforms/windows/qwindowstabletsupport.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the plugins of the Qt Toolkit.
@@ -347,7 +347,13 @@ QWindowsTabletDeviceData QWindowsTabletSupport::tabletInit(const quint64 uniqueI
bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, LPARAM lParam)
{
- const bool enteredProximity = LOWORD(lParam) != 0;
+ if (!LOWORD(lParam)) {
+ qCDebug(lcQpaTablet) << "leave proximity for device #" << m_currentDevice;
+ QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice,
+ m_devices.at(m_currentDevice).currentPointerType,
+ m_devices.at(m_currentDevice).uniqueId);
+ return true;
+ }
PACKET proximityBuffer[1]; // we are only interested in the first packet in this case
const int totalPacks = QWindowsTabletSupport::m_winTab32DLL.wTPacketsGet(m_context, 1, proximityBuffer);
if (!totalPacks)
@@ -367,17 +373,11 @@ bool QWindowsTabletSupport::translateTabletProximityEvent(WPARAM /* wParam */, L
m_devices.push_back(tabletInit(uniqueId, cursorType));
}
m_devices[m_currentDevice].currentPointerType = pointerType(currentCursor);
- qCDebug(lcQpaTablet) << __FUNCTION__ << (enteredProximity ? "enter" : "leave")
- << " proximity for device #" << m_currentDevice << m_devices.at(m_currentDevice);
- if (enteredProximity) {
- QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice,
- m_devices.at(m_currentDevice).currentPointerType,
- m_devices.at(m_currentDevice).uniqueId);
- } else {
- QWindowSystemInterface::handleTabletLeaveProximityEvent(m_devices.at(m_currentDevice).currentDevice,
- m_devices.at(m_currentDevice).currentPointerType,
- m_devices.at(m_currentDevice).uniqueId);
- }
+ qCDebug(lcQpaTablet) << "enter proximity for device #"
+ << m_currentDevice << m_devices.at(m_currentDevice);
+ QWindowSystemInterface::handleTabletEnterProximityEvent(m_devices.at(m_currentDevice).currentDevice,
+ m_devices.at(m_currentDevice).currentPointerType,
+ m_devices.at(m_currentDevice).uniqueId);
return true;
}
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 51497b3300..c5978c125c 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1709,8 +1709,11 @@ void QWindowsWindow::setWindowState_sys(Qt::WindowState newState)
if (!wasSync)
clearFlag(SynchronousGeometryChangeEvent);
// preserve maximized state
- if (visible)
+ if (visible) {
+ setFlag(WithinMaximize);
ShowWindow(m_data.hwnd, (newState == Qt::WindowMaximized) ? SW_MAXIMIZE : SW_SHOWNOACTIVATE);
+ clearFlag(WithinMaximize);
+ }
m_savedStyle = 0;
m_savedFrameGeometry = QRect();
}
diff --git a/src/printsupport/kernel/qpaintengine_alpha.cpp b/src/printsupport/kernel/qpaintengine_alpha.cpp
index ebb1b85e83..cdf5570979 100644
--- a/src/printsupport/kernel/qpaintengine_alpha.cpp
+++ b/src/printsupport/kernel/qpaintengine_alpha.cpp
@@ -359,7 +359,10 @@ void QAlphaPaintEngine::flushAndInit(bool init)
d->m_picpainter->setOpacity(painter()->opacity());
d->m_picpainter->setTransform(painter()->combinedTransform());
d->m_picengine->syncState();
- *d->m_picpainter->d_func()->state = *painter()->d_func()->state;
+ QPainterState &state = *d->m_picpainter->d_func()->state;
+ QPainter *oldPainter = state.painter;
+ state = *painter()->d_func()->state;
+ state.painter = oldPainter;
}
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index ef7bd8c3a5..e692a985eb 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1435,7 +1435,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (QWidget *nativeParent = q->nativeParentWidget()) {
if (nativeParent->windowHandle()) {
if (flags & Qt::Window) {
- win->setTransientParent(nativeParent->windowHandle());
+ win->setTransientParent(nativeParent->window()->windowHandle());
win->setParent(0);
} else {
win->setTransientParent(0);
diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro
index c2cf4b7dfe..d819436f66 100644
--- a/src/widgets/widgets.pro
+++ b/src/widgets/widgets.pro
@@ -8,6 +8,9 @@ DEFINES += QT_NO_USING_NAMESPACE
win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused
+MODULE_PLUGIN_TYPES += \
+ styles
+
QMAKE_DOCS = $$PWD/doc/qtwidgets.qdocconf
load(qt_module)
diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp
index f58881af0d..1f29af319a 100644
--- a/src/widgets/widgets/qsplitter.cpp
+++ b/src/widgets/widgets/qsplitter.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -1224,7 +1224,9 @@ void QSplitter::childEvent(QChildEvent *c)
return;
}
QWidget *w = static_cast<QWidget*>(c->child());
- if (c->added() && !d->blockChildAdd && !w->isWindow() && !d->findWidget(w)) {
+ if (w->isWindow())
+ return;
+ if (c->added() && !d->blockChildAdd && !d->findWidget(w)) {
d->insertWidget_helper(d->list.count(), w, false);
} else if (c->polished() && !d->blockChildAdd) {
if (isVisible() && !(w->isHidden() && w->testAttribute(Qt::WA_WState_ExplicitShowHide)))