From 618fe66d5bc9a3165bdb4f30ce85cbf2305b6540 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Wed, 16 Jan 2013 12:07:40 +0100 Subject: Doc: Update changes-5.0.1 file with documentation-related changes Change-Id: I51b0de95e9da8409647fba811b9c2d2ef1f478b6 Reviewed-by: Jerome Pasion --- dist/changes-5.0.1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dist/changes-5.0.1 b/dist/changes-5.0.1 index e73776185d..bf5df25b53 100644 --- a/dist/changes-5.0.1 +++ b/dist/changes-5.0.1 @@ -22,6 +22,13 @@ information about a particular change. General Improvements -------------------- + - Documentation: + - Moved documentation under the correct module, fixed module identifiers + - Cleanup of examples and their documentation + - [QTBUG-28579] Fixed broken links to C++ class reference and examples + for a number of modules in Qt Creator Help contents + - Fixed incorrect or missing links, typos + Third party components ---------------------- -- cgit v1.2.3 From 5607259cccfa89111165c852238c808e371d5f33 Mon Sep 17 00:00:00 2001 From: Jing Bai Date: Fri, 18 Jan 2013 14:23:52 +0100 Subject: fix a typo in cube example Change-Id: I1ad01aa519007d203669ccc63ef7d769b7e740b5 Reviewed-by: Sergio Ahumada --- examples/opengl/cube/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/opengl/cube/main.cpp b/examples/opengl/cube/main.cpp index fdae1caa16..4f70f4a92e 100644 --- a/examples/opengl/cube/main.cpp +++ b/examples/opengl/cube/main.cpp @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); app.setApplicationName("cube"); app.setApplicationVersion("0.1"); -#ifdef QT_NO_OPENGL +#ifndef QT_NO_OPENGL MainWidget widget; widget.show(); #else -- cgit v1.2.3 From e3bd06426afce9773fa64afe1a9946647cdec181 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Tue, 8 Jan 2013 18:47:37 +0000 Subject: Fix socket binding on mingw builds The mingw headers lack the IPV6_V6ONLY define, depending where you get them from. Currently the headers provided by mingw-builds are more complete than those from mingw.org itself. I have removed the compile time check, defined the macro if it is undefined, and it should be just a runtime check for if you are running on windows XP you get no dual stack binding. Task-number: QTBUG-28787 Task-number: QTBUG-28971 Task-number: QTBUG-28972 Change-Id: Iafadbb55d367c44ba9f812a24115e65591701b54 Reviewed-by: Ilya Sidorov Reviewed-by: Peter Hartmann (cherry picked from commit d3c4296198947162b8d4d27758a6947c7a1a693e) --- src/network/socket/qnativesocketengine_win.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/network/socket/qnativesocketengine_win.cpp b/src/network/socket/qnativesocketengine_win.cpp index be71ccb08d..beb7fe6b6a 100644 --- a/src/network/socket/qnativesocketengine_win.cpp +++ b/src/network/socket/qnativesocketengine_win.cpp @@ -61,6 +61,12 @@ QT_BEGIN_NAMESPACE +//Some distributions of mingw (including 4.7.2 from mingw.org) are missing this from headers. +//Also microsoft headers don't include it when building on XP and earlier. +#ifndef IPV6_V6ONLY +#define IPV6_V6ONLY 27 +#endif + #if defined(QNATIVESOCKETENGINE_DEBUG) void verboseWSErrorDebug(int r) @@ -204,7 +210,6 @@ static inline void qt_socket_getPortAndAddress(SOCKET socketDescriptor, const qt void QNativeSocketEnginePrivate::setPortAndAddress(sockaddr_in * sockAddrIPv4, qt_sockaddr_in6 * sockAddrIPv6, quint16 port, const QHostAddress & address, sockaddr ** sockAddrPtr, QT_SOCKLEN_T *sockAddrSize) { - if (address.protocol() == QAbstractSocket::IPv6Protocol || address.protocol() == QAbstractSocket::AnyIPProtocol || socketProtocol == QAbstractSocket::IPv6Protocol @@ -599,7 +604,6 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters() } } -#if defined (IPV6_V6ONLY) // determine if local address is dual mode DWORD ipv6only = 0; QT_SOCKOPTLEN_T optlen = sizeof(ipv6only); @@ -611,7 +615,6 @@ bool QNativeSocketEnginePrivate::fetchConnectionParameters() localAddress = QHostAddress::Any; } } -#endif memset(&sa, 0, sizeof(sa)); if (::getpeername(socketDescriptor, &sa.a, &sockAddrSize) == 0) { @@ -652,7 +655,6 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin setPortAndAddress(&sockAddrIPv4, &sockAddrIPv6, port, address, &sockAddrPtr, &sockAddrSize); -#if defined (IPV6_V6ONLY) if (socketProtocol == QAbstractSocket::IPv6Protocol && address.toIPv4Address()) { //IPV6_V6ONLY option must be cleared to connect to a V4 mapped address if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) { @@ -660,7 +662,6 @@ bool QNativeSocketEnginePrivate::nativeConnect(const QHostAddress &address, quin ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) ); } } -#endif forever { int connectResult = ::WSAConnect(socketDescriptor, sockAddrPtr, sockAddrSize, 0,0,0,0); @@ -793,15 +794,11 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &a, quint16 port) // binding to a multicast address address = QHostAddress(QHostAddress::AnyIPv6); } -#if defined (IPV6_V6ONLY) //This is default in current windows versions, it may change in future so set it explicitly if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) { ipv6only = 1; ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) ); } -#else - Q_UNUSED(ipv6only) -#endif break; case QAbstractSocket::IPv4Protocol: if ((address.toIPv4Address() & 0xffff0000) == 0xefff0000) { @@ -810,12 +807,9 @@ bool QNativeSocketEnginePrivate::nativeBind(const QHostAddress &a, quint16 port) } break; case QAbstractSocket::AnyIPProtocol: -#if defined (IPV6_V6ONLY) - if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) + if (QSysInfo::windowsVersion() >= QSysInfo::WV_6_0) { ipv6only = ::setsockopt(socketDescriptor, IPPROTO_IPV6, IPV6_V6ONLY, (char*)&ipv6only, sizeof(ipv6only) ); - else -#endif - { + } else { address = QHostAddress(QHostAddress::AnyIPv4); //xp/WS2003 and earlier don't support dual stack, so bind to IPv4 socketProtocol = QAbstractSocket::IPv4Protocol; } -- cgit v1.2.3 From 498dfa3de70a606edf52d10e5c597a60afc1d2c2 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 21 Jan 2013 13:48:09 +0100 Subject: Doc: added path to qtcore.qdocconf Added examples/widgets Required for resource-system.qdoc referring to application.qrc Task-number: QTBUG-29101 Change-Id: Ia51020a02801e04e3ff8d13f09277d7cd3fe1109 Reviewed-by: Jerome Pasion --- src/corelib/doc/qtcore.qdocconf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf index 61c9d2bc00..cb87530f54 100644 --- a/src/corelib/doc/qtcore.qdocconf +++ b/src/corelib/doc/qtcore.qdocconf @@ -37,6 +37,6 @@ exampledirs += \ snippets \ ../../../examples/threads/ \ ../../../examples/tools/ \ - ../../../examples/widgets/widgets/analogclock + ../../../examples/widgets/ imagedirs += images -- cgit v1.2.3 From 90197276a8108ec5b34899e0dab4f05bf8c79c2b Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Mon, 21 Jan 2013 16:50:59 +0100 Subject: Doc: solved snippet issue in coordsys.qdoc Reference to analogclock/main.cpp : removed folder 'gui' from path Task-number: QTBUG-29101 Change-Id: Ib51189e693ba59aed5c969c96f1b684d6c180b0c Reviewed-by: Jerome Pasion --- src/gui/doc/src/coordsys.qdoc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/doc/src/coordsys.qdoc b/src/gui/doc/src/coordsys.qdoc index 17e0506ae3..b76a9361a4 100644 --- a/src/gui/doc/src/coordsys.qdoc +++ b/src/gui/doc/src/coordsys.qdoc @@ -230,7 +230,7 @@ \row \li {2,1} - \snippet gui/analogclock/main.cpp 1 + \snippet analogclock/main.cpp 1 We translate the coordinate system so that point (0, 0) is in the widget's center, instead of being at the top-left corner. We also @@ -244,7 +244,7 @@ See also the \l {Window-Viewport Conversion} section. - \snippet gui/analogclock/main.cpp 2 + \snippet analogclock/main.cpp 2 We draw the clock's hour hand by rotating the coordinate system and calling QPainter::drawConvexPolygon(). Thank's to the @@ -259,14 +259,14 @@ the code guarantees that the code that follows won't be disturbed by the transformations we've used. - \snippet gui/analogclock/main.cpp 3 + \snippet analogclock/main.cpp 3 We do the same for the clock's minute hand, which is defined by the four points (1, 0), (0, 1), (-1, 0), and (0, -40). These coordinates specify a hand that is thinner and longer than the minute hand. - \snippet gui/analogclock/main.cpp 4 + \snippet analogclock/main.cpp 4 Finally, we draw the clock face, which consists of twelve short lines at 30-degree intervals. At the end of that, the painter is -- cgit v1.2.3 From 5e5bc779c3e3099159503f989de6baf589ea90d7 Mon Sep 17 00:00:00 2001 From: Jerome Pasion Date: Tue, 22 Jan 2013 14:32:36 +0100 Subject: Doc: Updated HTML copyright year to 2013. Change-Id: I9e750fa78ea552f6f906afb4dc52373f3eac2d39 Reviewed-by: Sergio Ahumada --- doc/global/qt-html-templates-offline.qdocconf | 2 +- doc/global/qt-html-templates-online.qdocconf | 2 +- doc/global/qt-module-defaults-online.qdocconf | 2 +- doc/global/qt-module-defaults.qdocconf | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/global/qt-html-templates-offline.qdocconf b/doc/global/qt-html-templates-offline.qdocconf index 5f989d2fa8..e9b2c6a7a8 100644 --- a/doc/global/qt-html-templates-offline.qdocconf +++ b/doc/global/qt-html-templates-offline.qdocconf @@ -39,7 +39,7 @@ HTML.footer = \ "\n" \ "
\n" \ "

\n" \ - " © 2012 Digia Plc and/or its\n" \ + " © 2013 Digia Plc and/or its\n" \ " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ " their respective owners.

\n" \ "
\n" \ diff --git a/doc/global/qt-html-templates-online.qdocconf b/doc/global/qt-html-templates-online.qdocconf index 040a5483c2..c794c47679 100644 --- a/doc/global/qt-html-templates-online.qdocconf +++ b/doc/global/qt-html-templates-online.qdocconf @@ -54,7 +54,7 @@ HTML.footer = \ "
\n" \ "
\n" \ "

\n" \ - " © 2012 Digia Plc and/or its\n" \ + " © 2013 Digia Plc and/or its\n" \ " subsidiaries. Documentation contributions included herein are the copyrights of\n" \ " their respective owners.

\n" \ "
\n" \ diff --git a/doc/global/qt-module-defaults-online.qdocconf b/doc/global/qt-module-defaults-online.qdocconf index b42b4c4f13..93ecae16fa 100644 --- a/doc/global/qt-module-defaults-online.qdocconf +++ b/doc/global/qt-module-defaults-online.qdocconf @@ -7,7 +7,7 @@ include(compat.qdocconf) dita.metadata.default.author = Qt Project dita.metadata.default.permissions = all dita.metadata.default.publisher = Qt Project -dita.metadata.default.copyryear = 2012 +dita.metadata.default.copyryear = 2013 dita.metadata.default.copyrholder = Digia Plc dita.metadata.default.audience = programmer diff --git a/doc/global/qt-module-defaults.qdocconf b/doc/global/qt-module-defaults.qdocconf index 8c8df29437..15b3724355 100644 --- a/doc/global/qt-module-defaults.qdocconf +++ b/doc/global/qt-module-defaults.qdocconf @@ -7,7 +7,7 @@ include(compat.qdocconf) dita.metadata.default.author = Qt Project dita.metadata.default.permissions = all dita.metadata.default.publisher = Qt Project -dita.metadata.default.copyryear = 2012 +dita.metadata.default.copyryear = 2013 dita.metadata.default.copyrholder = Digia Plc dita.metadata.default.audience = programmer -- cgit v1.2.3 From b077e67fd2538bc972eb5f050c7e0d28681a30ca Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 21 Jan 2013 15:23:26 +0100 Subject: Cocoa: Backport Qt 4's QCocoaView tracking areas into QNSView Task-number: QTBUG-29153 Change-Id: Ib190c074defaa459a8acc738f09af4a65e5d91d1 Reviewed-by: Richard Moe Gustavsen --- src/plugins/platforms/cocoa/qnsview.mm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 678f88baa0..5060d7dc25 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -472,6 +472,39 @@ static QTouchDevice *touchDevice = 0; [self handleMouseEvent:theEvent]; } +- (void)updateTrackingAreas +{ + [super updateTrackingAreas]; + + // [NSView addTrackingArea] is slow, so bail out early if we can: + if (NSIsEmptyRect([self visibleRect])) + return; + + QCocoaAutoReleasePool pool; + if (NSArray *trackingArray = [self trackingAreas]) { + NSUInteger size = [trackingArray count]; + for (NSUInteger i = 0; i < size; ++i) { + NSTrackingArea *t = [trackingArray objectAtIndex:i]; + [self removeTrackingArea:t]; + } + } + + // Ideally, we shouldn't have NSTrackingMouseMoved events included below, it should + // only be turned on if mouseTracking, hover is on or a tool tip is set. + // Unfortunately, Qt will send "tooltip" events on mouse moves, so we need to + // turn it on in ALL case. That means EVERY QCocoaView gets to pay the cost of + // mouse moves delivered to it (Apple recommends keeping it OFF because there + // is a performance hit). So it goes. + NSUInteger trackingOptions = NSTrackingMouseEnteredAndExited | NSTrackingActiveInActiveApp + | NSTrackingInVisibleRect | NSTrackingMouseMoved; + NSTrackingArea *ta = [[[NSTrackingArea alloc] initWithRect:[self frame] + options:trackingOptions + owner:self + userInfo:nil] + autorelease]; + [self addTrackingArea:ta]; +} + - (void)mouseMoved:(NSEvent *)theEvent { [self handleMouseEvent:theEvent]; -- cgit v1.2.3 From d5dec5d00deae7914613b12109b2be11add8c4ee Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Fri, 14 Dec 2012 10:43:04 +0100 Subject: Document QtMacUnifiedToolBar. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I108c12a351fd867a2d44b7fe8957d17100ef2c91 Reviewed-by: Morten Johan Sørvig --- src/widgets/widgets/qmainwindow.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 4f81decfbc..5bb331a99a 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1480,6 +1480,9 @@ bool QMainWindow::event(QEvent *event) \obsolete This property is not implemented in Qt 5. Setting it has no effect. + + A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras at + http://qt.gitorious.org/qtplayground/qtmacextras */ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) { -- cgit v1.2.3 From 586fabb3b5681e06378a0b31737a0e306e36717b Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 18 Jan 2013 16:36:42 +0100 Subject: Disable only accessibility bridge without dbus on linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Keeping accessibility and only disabling the bridge will enable more builds to work. Warning about disabling accessibility disabled is needed because in QStyle it is used to discover semantics about widgets (if a toolbutton is in a toolbar). Change-Id: Iae4e6ab63479743bdd70cba4b1954ec7cf3f88e9 Reviewed-by: Jan Arve Sæther --- configure | 30 ++++++++++++---------- .../linuxaccessibility/linuxaccessibility.pri | 2 +- src/plugins/platforms/xcb/qxcbintegration.cpp | 4 ++- tests/auto/other/other.pro | 2 +- tools/configure/configureapp.cpp | 8 ++++-- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/configure b/configure index 699d98e883..38daeed3c3 100755 --- a/configure +++ b/configure @@ -831,6 +831,7 @@ CFG_AVX=auto CFG_AVX2=auto CFG_REDUCE_RELOCATIONS=auto CFG_ACCESSIBILITY=auto +CFG_ACCESSIBILITY_ATSPI_BRIDGE=no # will be enabled depending on dbus and accessibility being enabled CFG_IWMMXT=no CFG_NEON=auto CFG_MIPS_DSP=auto @@ -3093,6 +3094,10 @@ Configure options: + -largefile ......... Enables Qt to access files larger than 4 GB. -no-accessibility .. Do not compile Accessibility support. + Disabling accessibility is not recommended, as it will break QStyle + and may break other internal parts of Qt. + With this switch you create a source incompatible version of Qt, + which is unsupported. + -accessibility ..... Compile Accessibility support. -no-sql- ... Disable SQL entirely. @@ -4949,20 +4954,19 @@ if [ "$CFG_KMS" = "yes" ]; then fi # Detect accessibility support -if [ "$CFG_ACCESSIBILITY" != "no" ]; then - if [ "$CFG_XCB" = "no" ]; then - CFG_ACCESSIBILITY=yes - else - # linux/xcb accessibility needs dbus - if [ "$CFG_DBUS" != "no" ] && [ -n "$PKG_CONFIG" ]; then - CFG_ACCESSIBILITY=yes +if [ "$CFG_ACCESSIBILITY" = "no" ]; then + echo >&2 "Warning: Disabling Accessibility. This version of Qt is unsupported." +else + CFG_ACCESSIBILITY=yes + + # linux/xcb accessibility bridge needs dbus + if [ "$CFG_XCB" != "no" ]; then + if [ "$CFG_DBUS" != "no" ]; then + CFG_ACCESSIBILITY_ATSPI_BRIDGE=yes + QT_CONFIG="$QT_CONFIG accessibility-atspi-bridge" else - if [ "$CFG_ACCESSIBILITY" = "auto" ]; then - CFG_ACCESSIBILITY=no - else - echo "Accessibility support needs DBus." - exit 101 - fi + echo >&2 "Warning: Disabling Linux Accessibility Bridge: DBus is missing." + QCONFIG_FLAGS="$QCONFIG_FLAGS QT_NO_ACCESSIBILITY_ATSPI_BRIDGE" fi fi fi diff --git a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri index 09d437678f..2721002ea5 100644 --- a/src/platformsupport/linuxaccessibility/linuxaccessibility.pri +++ b/src/platformsupport/linuxaccessibility/linuxaccessibility.pri @@ -1,4 +1,4 @@ -qtHaveModule(dbus):contains(QT_CONFIG, xcb):contains(QT_CONFIG, accessibility) { +contains(QT_CONFIG, accessibility-atspi-bridge) { QT += dbus include(../../3rdparty/atspi2/atspi2.pri) diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 9af1f0404f..9fe6e4253b 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -84,8 +84,10 @@ #include #ifndef QT_NO_ACCESSIBILITY #include +#ifndef QT_NO_ACCESSIBILITY_ATSPI_BRIDGE #include "../../../platformsupport/linuxaccessibility/bridge_p.h" #endif +#endif QT_BEGIN_NAMESPACE @@ -112,7 +114,7 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters) m_fontDatabase.reset(new QGenericUnixFontDatabase()); m_inputContext.reset(QPlatformInputContextFactory::create()); -#ifndef QT_NO_ACCESSIBILITY +#ifndef QT_NO_ACCESSIBILITY_ATSPI_BRIDGE m_accessibility.reset(new QSpiAccessibleBridge()); #endif } diff --git a/tests/auto/other/other.pro b/tests/auto/other/other.pro index ea6290db42..35aaf4d48f 100644 --- a/tests/auto/other/other.pro +++ b/tests/auto/other/other.pro @@ -50,7 +50,7 @@ cross_compile: SUBDIRS -= \ wince*|!contains(QT_CONFIG, accessibility): SUBDIRS -= qaccessibility -!contains(QT_CONFIG, accessibility)|!contains(QT_CONFIG, xcb): SUBDIRS -= qaccessibilitylinux +!contains(QT_CONFIG, accessibility-atspi-bridge): SUBDIRS -= qaccessibilitylinux !mac: SUBDIRS -= \ macgui \ diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 81f575335f..5b8039c109 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1650,8 +1650,12 @@ bool Configure::displayHelp() desc("WIDGETS", "no", "-no-widgets", "Disable QtWidgets module.\n"); - desc("ACCESSIBILITY", "no", "-no-accessibility", "Do not compile Windows Active Accessibility support."); - desc("ACCESSIBILITY", "yes", "-accessibility", "Compile Windows Active Accessibility support.\n"); + desc("ACCESSIBILITY", "no", "-no-accessibility", "Disable accessibility support.\n"); + desc( "", "Disabling accessibility is not recommended, as it will break QStyle\n" + "and may break other internal parts of Qt.\n" + "With this switch you create a source incompatible version of Qt,\n" + "which is unsupported.\n"); + desc("ACCESSIBILITY", "yes", "-accessibility", "Enable accessibility support.\n"); desc( "-no-sql-", "Disable SQL entirely, by default none are turned on."); desc( "-qt-sql-", "Enable a SQL in the Qt Library."); -- cgit v1.2.3 From d4f4ee4e033a62858aaf4f29970bc404d9b4c009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 23 Jan 2013 08:37:12 +0100 Subject: Fixed copy text bug as well as potential other latent xcb plugin bugs. As Gatis found out the copy text bug is caused by the xcb plugin's handleEnterNotifyEvent() receiving an event with a seemingly random "time" member. That is however not due to a bug in the X server but rather due to a missing break statement in the event dispatching in qxcbconnection.cpp, causing an xcb_client_message_event_t to be treated as an xcb_enter_notify_event_t, and thus an xcb_window_t to be treated as an xcb_timestamp_t. The other xcb_enter_notify_event_t values would of course also be complete garbage. Task-number: QTCREATORBUG-8476 Task-number: QTBUG-28398 Change-Id: Id8c09a6682f78b646a0d1d27b0650248bbfa1046 Reviewed-by: Gunnar Sletta Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbconnection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 1192894693..d261655cbd 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -770,6 +770,7 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event) HANDLE_PLATFORM_WINDOW_EVENT(xcb_unmap_notify_event_t, event, handleUnmapNotifyEvent); case XCB_CLIENT_MESSAGE: handleClientMessageEvent((xcb_client_message_event_t *)event); + break; case XCB_ENTER_NOTIFY: HANDLE_PLATFORM_WINDOW_EVENT(xcb_enter_notify_event_t, event, handleEnterNotifyEvent); case XCB_LEAVE_NOTIFY: -- cgit v1.2.3 From 786a6466e88faf25c55c626a17f5296bce564daa Mon Sep 17 00:00:00 2001 From: Mehdi Fekari Date: Wed, 16 Jan 2013 11:38:19 -0500 Subject: Add autotests for Indonisian and Catalan locales Change-Id: Idbf14ee6f0cd83acfdc407408794aac7ad91c054 Reviewed-by: Lars Knoll --- tests/auto/corelib/tools/qlocale/tst_qlocale.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp index 883d6a0c1d..8cdad67966 100644 --- a/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/tools/qlocale/tst_qlocale.cpp @@ -1653,6 +1653,10 @@ void tst_QLocale::ampm() QLocale tr("tr_TR"); QCOMPARE(tr.amText(), QString::fromUtf8("\303\226\303\226")); QCOMPARE(tr.pmText(), QString::fromUtf8("\303\226\123")); + + QLocale id("id_ID"); + QCOMPARE(id.amText(), QLatin1String("AM")); + QCOMPARE(id.pmText(), QLatin1String("PM")); } void tst_QLocale::dateFormat() @@ -1681,6 +1685,14 @@ void tst_QLocale::timeFormat() QCOMPARE(no.timeFormat(QLocale::NarrowFormat), QLatin1String("HH:mm")); QCOMPARE(no.timeFormat(QLocale::ShortFormat), QLatin1String("HH:mm")); QCOMPARE(no.timeFormat(QLocale::LongFormat), QLatin1String("'kl'. HH:mm:ss t")); + + const QLocale id("id_ID"); + QCOMPARE(id.timeFormat(QLocale::ShortFormat), QLatin1String("HH.mm")); + QCOMPARE(id.timeFormat(QLocale::LongFormat), QLatin1String("HH.mm.ss t")); + + const QLocale cat("ca_ES"); + QCOMPARE(cat.timeFormat(QLocale::ShortFormat), QLatin1String("H.mm")); + QCOMPARE(cat.timeFormat(QLocale::LongFormat), QLatin1String("H.mm.ss t")); } void tst_QLocale::dateTimeFormat() -- cgit v1.2.3 From ce35c0db0d9dd849c736eabaeb57d597186aaa13 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Mon, 14 Jan 2013 14:43:52 +0100 Subject: QSslConfiguration: toggle on demand loading of root certs properly make sure we keep track of when we can load root certs and when we cannot (we cannot when the developer set the certs explicitly). This is implemented the same way for QSslSocket already, and needs to be duplicated because we have 2 methods for setting CA certificates: one in QSslSocket and one in QSslConfiguration. In addition, adapt the auto test which checks whether setting a default QSslConfiguration works: There is no way to set on demand loading through the API, so it should be enabled by default. Task-number: QTBUG-29103 Change-Id: I5146128aaa385dfcc0ad1e0ef81a92d9350ec5f2 Reviewed-by: Richard J. Moore --- src/network/ssl/qsslconfiguration.cpp | 3 ++ src/network/ssl/qsslconfiguration_p.h | 2 + src/network/ssl/qsslsocket.cpp | 15 +++++++- src/network/ssl/qsslsocket_p.h | 2 + .../tst_qsslsocket_onDemandCertificates_member.cpp | 28 ++++++++++++-- tests/manual/qnetworkreply/main.cpp | 43 ++++++++++++++++++++++ tests/manual/qnetworkreply/qnetworkreply.pro | 2 +- 7 files changed, 90 insertions(+), 5 deletions(-) diff --git a/src/network/ssl/qsslconfiguration.cpp b/src/network/ssl/qsslconfiguration.cpp index 46aa1a1eb5..0ae67b3c1f 100644 --- a/src/network/ssl/qsslconfiguration.cpp +++ b/src/network/ssl/qsslconfiguration.cpp @@ -181,6 +181,7 @@ bool QSslConfiguration::operator==(const QSslConfiguration &other) const d->protocol == other.d->protocol && d->peerVerifyMode == other.d->peerVerifyMode && d->peerVerifyDepth == other.d->peerVerifyDepth && + d->allowRootCertOnDemandLoading == other.d->allowRootCertOnDemandLoading && d->sslOptions == other.d->sslOptions; } @@ -208,6 +209,7 @@ bool QSslConfiguration::isNull() const return (d->protocol == QSsl::SecureProtocols && d->peerVerifyMode == QSslSocket::AutoVerifyPeer && d->peerVerifyDepth == 0 && + d->allowRootCertOnDemandLoading == true && d->caCertificates.count() == 0 && d->ciphers.count() == 0 && d->localCertificate.isNull() && @@ -519,6 +521,7 @@ QList QSslConfiguration::caCertificates() const void QSslConfiguration::setCaCertificates(const QList &certificates) { d->caCertificates = certificates; + d->allowRootCertOnDemandLoading = false; } /*! diff --git a/src/network/ssl/qsslconfiguration_p.h b/src/network/ssl/qsslconfiguration_p.h index 841641d6aa..3e6e43361d 100644 --- a/src/network/ssl/qsslconfiguration_p.h +++ b/src/network/ssl/qsslconfiguration_p.h @@ -83,6 +83,7 @@ public: : protocol(QSsl::SecureProtocols), peerVerifyMode(QSslSocket::AutoVerifyPeer), peerVerifyDepth(0), + allowRootCertOnDemandLoading(true), sslOptions(QSslConfigurationPrivate::defaultSslOptions) { } @@ -98,6 +99,7 @@ public: QSsl::SslProtocol protocol; QSslSocket::PeerVerifyMode peerVerifyMode; int peerVerifyDepth; + bool allowRootCertOnDemandLoading; QSsl::SslOptions sslOptions; diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 87ea975bec..cfc3c19bba 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -903,7 +903,12 @@ void QSslSocket::setSslConfiguration(const QSslConfiguration &configuration) d->configuration.peerVerifyMode = configuration.peerVerifyMode(); d->configuration.protocol = configuration.protocol(); d->configuration.sslOptions = configuration.d->sslOptions; - d->allowRootCertOnDemandLoading = false; + + // if the CA certificates were set explicitly (either via + // QSslConfiguration::setCaCertificates() or QSslSocket::setCaCertificates(), + // we cannot load the certificates on demand + if (!configuration.d->allowRootCertOnDemandLoading) + d->allowRootCertOnDemandLoading = false; } /*! @@ -2378,6 +2383,14 @@ QByteArray QSslSocketPrivate::peek(qint64 maxSize) } } +/*! + \internal +*/ +bool QSslSocketPrivate::rootCertOnDemandLoadingSupported() +{ + return s_loadRootCertsOnDemand; +} + /*! \internal */ diff --git a/src/network/ssl/qsslsocket_p.h b/src/network/ssl/qsslsocket_p.h index 3dc80ea22a..851dec5840 100644 --- a/src/network/ssl/qsslsocket_p.h +++ b/src/network/ssl/qsslsocket_p.h @@ -182,6 +182,8 @@ public: virtual QSslCipher sessionCipher() const = 0; virtual void continueHandshake() = 0; + Q_AUTOTEST_EXPORT static bool rootCertOnDemandLoadingSupported(); + private: static bool ensureLibraryLoaded(); static void ensureCiphersAndCertsLoaded(); diff --git a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp index bf6fde896b..eb04be10c8 100644 --- a/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp +++ b/tests/auto/network/ssl/qsslsocket_onDemandCertificates_member/tst_qsslsocket_onDemandCertificates_member.cpp @@ -46,7 +46,10 @@ #include #include +#ifdef QT_BUILD_INTERNAL #include "private/qhostinfo_p.h" +#include "private/qsslsocket_p.h" +#endif #include "../../../network-settings.h" @@ -211,12 +214,31 @@ void tst_QSslSocket_onDemandCertificates_member::onDemandRootCertLoadingMemberMe socket3->connectToHostEncrypted(host, 443); QVERIFY(!socket3->waitForEncrypted()); - // setting empty SSL configuration explicitly -> should not work + // setting empty SSL configuration explicitly -> depends on on-demand loading QSslSocketPtr socket4 = newSocket(); this->socket = socket4.data(); - socket4->setSslConfiguration(QSslConfiguration()); + QSslConfiguration conf; + socket4->setSslConfiguration(conf); socket4->connectToHostEncrypted(host, 443); - QVERIFY(!socket4->waitForEncrypted()); +#ifdef QT_BUILD_INTERNAL + bool rootCertLoadingAllowed = QSslSocketPrivate::rootCertOnDemandLoadingSupported(); +#if defined(Q_OS_LINUX) || defined (Q_OS_BLACKBERRY) + QCOMPARE(rootCertLoadingAllowed, true); +#elif defined(Q_OS_MAC) + QCOMPARE(rootCertLoadingAllowed, false); +#endif // other platforms: undecided (Windows: depends on the version) + // when we allow on demand loading, it is enabled by default, + // so on Unix it will work without setting any certificates. Otherwise, + // the configuration contains an empty set of certificates + // and will fail. + bool works; +#if defined (Q_OS_WIN) + works = false; // on Windows, this won't work even though we use on demand loading +#else + works = rootCertLoadingAllowed; +#endif + QCOMPARE(socket4->waitForEncrypted(), works); +#endif // QT_BUILD_INTERNAL } #endif // QT_NO_OPENSSL diff --git a/tests/manual/qnetworkreply/main.cpp b/tests/manual/qnetworkreply/main.cpp index b8b20ec4da..feb07b4c7d 100644 --- a/tests/manual/qnetworkreply/main.cpp +++ b/tests/manual/qnetworkreply/main.cpp @@ -46,8 +46,13 @@ #include #include #include +#include #include "../../auto/network-settings.h" +#ifdef QT_BUILD_INTERNAL +#include "private/qsslsocket_p.h" +#endif + #define BANDWIDTH_LIMIT_BYTES (1024*100) #define TIME_ESTIMATION_SECONDS (97) @@ -58,6 +63,8 @@ private slots: void initTestCase(); void limiting_data(); void limiting(); + void setSslConfiguration_data(); + void setSslConfiguration(); }; QNetworkReply *reply; @@ -129,6 +136,42 @@ void tst_qnetworkreply::limiting() QVERIFY(!QTestEventLoop::instance().timeout()); } +void tst_qnetworkreply::setSslConfiguration_data() +{ + QTest::addColumn("url"); + QTest::addColumn("works"); + + QTest::newRow("codereview.qt-project.org") << QUrl("https://codereview.qt-project.org") << true; + QTest::newRow("test-server") << QUrl("https://" + QtNetworkSettings::serverName() + "/") << false; +} + +void tst_qnetworkreply::setSslConfiguration() +{ + QFETCH(QUrl, url); + QNetworkRequest request(url); + QSslConfiguration conf = request.sslConfiguration(); + conf.setProtocol(QSsl::TlsV1_0); // TLS 1.0 will be used anyway, just make sure we change the configuration + request.setSslConfiguration(conf); + QNetworkAccessManager manager; + reply = manager.get(request); + QObject::connect(reply, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); + QTestEventLoop::instance().enterLoop(15); + QVERIFY(!QTestEventLoop::instance().timeout()); +#ifdef QT_BUILD_INTERNAL + QFETCH(bool, works); + bool rootCertLoadingAllowed = QSslSocketPrivate::rootCertOnDemandLoadingSupported(); +#if defined(Q_OS_LINUX) || defined (Q_OS_BLACKBERRY) + QCOMPARE(rootCertLoadingAllowed, true); +#elif defined(Q_OS_MAC) + QCOMPARE(rootCertLoadingAllowed, false); +#endif // other platforms: undecided (Windows: depends on the version) + if (works) { + QCOMPARE(reply->error(), QNetworkReply::NoError); + } else { + QCOMPARE(reply->error(), QNetworkReply::SslHandshakeFailedError); + } +#endif +} QTEST_MAIN(tst_qnetworkreply) diff --git a/tests/manual/qnetworkreply/qnetworkreply.pro b/tests/manual/qnetworkreply/qnetworkreply.pro index 3d98ee429f..64666103a0 100644 --- a/tests/manual/qnetworkreply/qnetworkreply.pro +++ b/tests/manual/qnetworkreply/qnetworkreply.pro @@ -2,7 +2,7 @@ TEMPLATE = app TARGET = tst_qnetworkreply QT -= gui -QT += network testlib +QT += core-private network network-private testlib SOURCES += main.cpp DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -- cgit v1.2.3 From 6476d6728eb3cde8e4a5fd0eb607b92977932296 Mon Sep 17 00:00:00 2001 From: Andreas Aardal Hanssen Date: Tue, 22 Jan 2013 17:33:24 +0100 Subject: Make sure QGraphicsItem notifies changes to focusScopeItem. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A glitch in QGraphicsItem's logic made it update the focusScopeItem pointer, but fail to notify the change to QDeclarativeItem through the d_ptr->focusScopeItemChange() virtual function, hindering QDeclarativeItem from emitting focusChanged() correctly for focus scopes that do not have focus. Two lines were moved, and a comment updated to reflect the reason why the "return" is needed at this point. It's clear that the calls to focusScopeItemChange() are unrelated to the return. Task-number: QTBUG-29260 Change-Id: I12ba9161b16d34c3689401a92c86d2047989f7bd Reviewed-by: Andreas Aardal Hanssen Reviewed-by: Jan Arve Sæther Reviewed-by: Alan Alpert --- src/widgets/graphicsview/qgraphicsitem.cpp | 12 +++-- .../qgraphicsitem/tst_qgraphicsitem.cpp | 57 ++++++++++++++++++++++ 2 files changed, 64 insertions(+), 5 deletions(-) diff --git a/src/widgets/graphicsview/qgraphicsitem.cpp b/src/widgets/graphicsview/qgraphicsitem.cpp index 318c379974..87f5f17531 100644 --- a/src/widgets/graphicsview/qgraphicsitem.cpp +++ b/src/widgets/graphicsview/qgraphicsitem.cpp @@ -3237,12 +3237,14 @@ void QGraphicsItemPrivate::setFocusHelper(Qt::FocusReason focusReason, bool clim if (p->flags() & QGraphicsItem::ItemIsFocusScope) { QGraphicsItem *oldFocusScopeItem = p->d_ptr->focusScopeItem; p->d_ptr->focusScopeItem = q_ptr; + if (oldFocusScopeItem) + oldFocusScopeItem->d_ptr->focusScopeItemChange(false); + focusScopeItemChange(true); if (!p->focusItem() && !focusFromHide) { - if (oldFocusScopeItem) - oldFocusScopeItem->d_ptr->focusScopeItemChange(false); - focusScopeItemChange(true); - // If you call setFocus on a child of a focus scope that - // doesn't currently have a focus item, then stop. + // Calling setFocus() on a child of a focus scope that does + // not have focus changes only the focus scope pointer, + // so that focus is restored the next time the scope gains + // focus. return; } break; diff --git a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index 72014e29b5..b14e68951b 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -428,6 +428,7 @@ private slots: void ensureDirtySceneTransform(); void focusScope(); void focusScope2(); + void focusScopeItemChangedWhileScopeDoesntHaveFocus(); void stackBefore(); void sceneModality(); void panelModality(); @@ -9371,6 +9372,62 @@ void tst_QGraphicsItem::focusScope2() QCOMPARE(siblingFocusScope->focusItem(), (QGraphicsItem *)siblingChild2); } +class FocusScopeItemPrivate; +class FocusScopeItem : public QGraphicsItem +{ + Q_DECLARE_PRIVATE(FocusScopeItem) +public: + FocusScopeItem(QGraphicsItem *parent = 0); + QRectF boundingRect() const { return QRectF(); } + void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *) { } + + int focusScopeChanged; + FocusScopeItemPrivate *d_ptr; +}; + +class FocusScopeItemPrivate : QGraphicsItemPrivate +{ + Q_DECLARE_PUBLIC(FocusScopeItem) +public: + void focusScopeItemChange(bool) + { ++q_func()->focusScopeChanged; } +}; + +FocusScopeItem::FocusScopeItem(QGraphicsItem *parent) + : QGraphicsItem(*new FocusScopeItemPrivate, parent), focusScopeChanged(0) +{ + setFlag(ItemIsFocusable); +} + +void tst_QGraphicsItem::focusScopeItemChangedWhileScopeDoesntHaveFocus() +{ + QGraphicsRectItem rect; + rect.setFlags(QGraphicsItem::ItemIsFocusScope | QGraphicsItem::ItemIsFocusable); + + FocusScopeItem *child1 = new FocusScopeItem(&rect); + FocusScopeItem *child2 = new FocusScopeItem(&rect); + + QCOMPARE(rect.focusScopeItem(), (QGraphicsItem *)0); + QCOMPARE(child1->focusScopeChanged, 0); + QCOMPARE(child2->focusScopeChanged, 0); + child1->setFocus(); + QCOMPARE(rect.focusScopeItem(), (QGraphicsItem *)child1); + QCOMPARE(child1->focusScopeChanged, 1); + QCOMPARE(child2->focusScopeChanged, 0); + child2->setFocus(); + QCOMPARE(rect.focusScopeItem(), (QGraphicsItem *)child2); + QCOMPARE(child1->focusScopeChanged, 2); + QCOMPARE(child2->focusScopeChanged, 1); + child1->setFocus(); + QCOMPARE(rect.focusScopeItem(), (QGraphicsItem *)child1); + QCOMPARE(child1->focusScopeChanged, 3); + QCOMPARE(child2->focusScopeChanged, 2); + child1->clearFocus(); + QCOMPARE(rect.focusScopeItem(), (QGraphicsItem *)0); + QCOMPARE(child1->focusScopeChanged, 4); + QCOMPARE(child2->focusScopeChanged, 2); +} + void tst_QGraphicsItem::stackBefore() { QGraphicsRectItem parent; -- cgit v1.2.3 From bfd73eaba3000861037d03787f87d1f4dafefea8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 23 Jan 2013 12:48:21 +0100 Subject: Respect the filename specified when showing the native filedialog When a filename was specified as part of the start up directory then it should ensure this is put in the filename lineedit in the native filedialog. Change-Id: I2b190933d46553908b5bcf17506cb2a95fb1f982 Reviewed-by: Friedemann Kleint --- .../platforms/windows/qwindowsdialoghelpers.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp index 15520c98b0..74193c47a3 100644 --- a/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp +++ b/src/plugins/platforms/windows/qwindowsdialoghelpers.cpp @@ -668,6 +668,7 @@ public: inline void setNameFilters(const QStringList &f); inline void selectNameFilter(const QString &filter); inline QString selectedNameFilter() const; + void selectFile(const QString &fileName) const; bool hideFiltersDetails() const { return m_hideFiltersDetails; } void setHideFiltersDetails(bool h) { m_hideFiltersDetails = h; } void setDefaultSuffix(const QString &s); @@ -961,6 +962,11 @@ void QWindowsNativeFileDialogBase::setLabelText(QFileDialogOptions::DialogLabel } } +void QWindowsNativeFileDialogBase::selectFile(const QString &fileName) const +{ + m_fileDialog->SetFileName((wchar_t*)fileName.utf16()); +} + // Return the index of the selected filter, accounting for QFileDialog // sometimes stripping the filter specification depending on the // hideFilterDetails setting. @@ -1230,6 +1236,12 @@ QWindowsNativeDialogBase *QWindowsFileDialogHelper::createNativeDialog() const QString initialDirectory = opts->initialDirectory(); if (!initialDirectory.isEmpty()) result->setDirectory(initialDirectory); + const QStringList initialSelection = opts->initiallySelectedFiles(); + if (initialSelection.size() > 0) { + QFileInfo info(initialSelection.front()); + if (!info.isDir()) + result->selectFile(info.fileName()); + } const QString initialNameFilter = opts->initiallySelectedNameFilter(); if (!initialNameFilter.isEmpty()) result->selectNameFilter(initialNameFilter); @@ -1255,9 +1267,13 @@ QString QWindowsFileDialogHelper::directory() const return QString(); } -void QWindowsFileDialogHelper::selectFile(const QString & /* filename */) +void QWindowsFileDialogHelper::selectFile(const QString &fileName) { - // Not implemented. + if (QWindowsContext::verboseDialogs) + qDebug("%s %s" , __FUNCTION__, qPrintable(fileName)); + + if (QWindowsNativeFileDialogBase *nfd = nativeFileDialog()) + nfd->selectFile(fileName); } QStringList QWindowsFileDialogHelper::selectedFiles() const -- cgit v1.2.3