From e0dc27d791cd2106f661bd3d949281aaf1239990 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Tue, 8 Jul 2014 11:01:50 +0200 Subject: Doc: Hide QTextInlineObject constructor from the documentation The constructor takes an internal class instance as a parameter, and is not meant to be used externally. Add a note in the description and hide the constructor. Task-number: QTBUG-39785 Change-Id: Ice850f0968880f3933ebb7ae83efeaeed85441cb Reviewed-by: Konstantin Ritt Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextlayout.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index ede7426ffc..4879ae51d7 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. -- cgit v1.2.3 From cdba2439f91c1d3757e5d36f7759ac73a2e8ac2d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Jul 2014 10:32:07 +0200 Subject: QSplitter: Exclude top level widgets from child event handling. Prevent the splitter from adding them to the layout or showing them. Task-number: QTBUG-40132 Change-Id: Ife2be0bbd7e489570ef41f6f72a034b356c65f18 Reviewed-by: J-P Nurmi --- src/widgets/widgets/qsplitter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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(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))) -- cgit v1.2.3 From 8ee19816c87918136ea84f8451ab9e9c9764c8de Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Thu, 3 Jul 2014 14:52:21 +0200 Subject: CMake: Don't check the existence of GL files in the Qt5Gui package. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The GL libraries are optional, so they should not be added to the DEPENDENT libraries of Qt5::Gui if not found. Task-number: QTBUG-39859 Change-Id: Ib0e01da56a9fb5048a6ad8e0e9cede07fe0cf43b Reviewed-by: Lisandro Damián Nicanor Pérez Meyer Reviewed-by: Stephen Kelly --- src/gui/Qt5GuiConfigExtras.cmake.in | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src') 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() -- cgit v1.2.3 From 6186dd857176fd119e0c6e0732238e0aa20c4ce4 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 8 Jul 2014 13:35:06 +0200 Subject: make QtWidgets claim style plugins Change-Id: Ibb3fea65d59c2a43cd024fd34abfe558956bec69 Reviewed-by: J-P Nurmi --- src/widgets/widgets.pro | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/widgets/widgets.pro b/src/widgets/widgets.pro index 0b289c75ae..b12e2836d4 100644 --- a/src/widgets/widgets.pro +++ b/src/widgets/widgets.pro @@ -9,6 +9,7 @@ win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000 irix-cc*:QMAKE_CXXFLAGS += -no_prelink -ptused MODULE_PLUGIN_TYPES += \ + styles \ accessible/libqtaccessiblewidgets.so QMAKE_DOCS = $$PWD/doc/qtwidgets.qdocconf -- cgit v1.2.3 From feb1afc78290433b0c22b1b3f6d65542eeb5b957 Mon Sep 17 00:00:00 2001 From: Nikita Krupenko Date: Fri, 13 Jun 2014 20:04:16 +0300 Subject: Added stream version into network cache file format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At the moment, there is no stream information in the cache file. This can lead to a problem when current stream version differs from version cache file written with. As an example, if file written with Qt 5.1.1, QTimeDate in the metadata stored as 13-bytes value, but Qt 5.2 and later can read additional 4 bytes which breaks following data, leading to network request just hangs forever. Adding stream version fixes this problem. As cache format changed, cache version bumped. Task-number: QTBUG-36219 Change-Id: I467d8c9fda82bcf9302192f51e7a00d2f6a9ff66 Reviewed-by: Jędrzej Nowacki --- src/network/access/qnetworkdiskcache.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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(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; -- cgit v1.2.3 From e2203163d9cd03165142d98fa9ba8aaf5a9c3085 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 15 Jul 2014 16:57:27 +0200 Subject: Windows: Send QTabletLeaveProximity events. Proximity leave comes without packets, do not bail out. Task-number: QTBUG-40019 Change-Id: I4e6b4ca13ad875bdfdcd31f86b08de4a596e76cb Reviewed-by: Oliver Wolff Reviewed-by: Joerg Bornemann --- .../platforms/windows/qwindowstabletsupport.cpp | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3 From a71e285133087714034f3c84a758980c85b3801e Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 14 Jul 2014 13:53:23 +0200 Subject: Ensure transient parents are top level widgets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a dialog was parented on a native child widget, its window handle was used as a transient parent. This confused QPlatformWindow::initialGeometry() among other things. Use top level window as is in Qt 4. Task-number: QTBUG-40195 Change-Id: Ic82adc276175f92adde825fb2551274351e41f30 Reviewed-by: Jørgen Lind --- src/gui/kernel/qwindow.cpp | 5 +++++ src/widgets/kernel/qwidget_qpa.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 40e9b9723a..d6f9fad070 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -1083,6 +1083,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/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index 70d274796b..5a4bd33672 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -138,7 +138,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); -- cgit v1.2.3 From cf5e49681399c94b996a7b8b9299177361d926c1 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 7 Jul 2014 16:22:14 +0200 Subject: Windows printing: Preserve painter when syncing state. Fix a performance regression introduced by 58bb42dc2c338338b7b6079993ace3d55c2e1d7e . The picture painter was replaced by another painter. Task-number: QTBUG-40068 Task-number: QTBUG-38329 Change-Id: Ida51edd61c197f862adebdcdc685ebc105fe07a8 Reviewed-by: Michael Bruning Reviewed-by: Lars Knoll --- src/printsupport/kernel/qpaintengine_alpha.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/printsupport/kernel/qpaintengine_alpha.cpp b/src/printsupport/kernel/qpaintengine_alpha.cpp index ddfa918b90..6d292a6a71 100644 --- a/src/printsupport/kernel/qpaintengine_alpha.cpp +++ b/src/printsupport/kernel/qpaintengine_alpha.cpp @@ -346,7 +346,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; } } -- cgit v1.2.3 From ae99f83312e2785cae280d4d7474050e163b7328 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 21 Jul 2014 13:55:30 +0200 Subject: Windows: Fix window geometry when transiting from fullscreen to maximized. The workaround added for QTBUG-8361 also needs to trigger in the restore-from-fullscreen logic, set flag accordingly. Task-number: QTBUG-40254 Task-number: QTBUG-8361 Change-Id: I6d6c35bb7004c84c6b8feea05ad974c23ca205d2 Reviewed-by: Oliver Wolff --- src/plugins/platforms/windows/qwindowswindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index cdc0b24464..7d04c99d16 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1696,8 +1696,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(); } -- cgit v1.2.3