summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QMetaType: remove compatibility code for MSVC 2013Thiago Macieira2018-06-251-20/+6
| | | | | | | We use the constexpr code for MSVC 2015. Change-Id: I91f63171877743978cb3fffd153ad52a3ee293d0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* tests: un-blacklist tst_QSizeGrip::hideAndShowOnWindowStateChange on xcbGatis Paeglis2018-06-251-2/+0
| | | | | | | | According to local testing and Grafana statistics for the period of the last 1 year, this test has not been failing on XCB. Change-Id: I86640b22c9e7a258965805a661e1e8c3ead8d012 Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
* tests: un-blacklist tst_QGestureRecognizer::panGesture on xcbGatis Paeglis2018-06-251-2/+0
| | | | | | | | According to local testing and Grafana statistics for the period of the last 1 year, this test has not been failing on XCB. Change-Id: Ia7fda4c42d4aeaecd4485d18383cf46bf6af63d1 Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
* widgets: fix QWidget::save/restoreGeometry()Gatis Paeglis2018-06-254-28/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWidget::restoreGeometry() is calling QWidget::move() with restoredFrameGeometry, which internally calls setGeometry() and sets positionPolicy = QWindowPrivate::WindowFrameExclusive, which is invalid: restoredFrameGeometry is WindowFrameInclusive geometry. QPA plugins rely on correctly set policies when interpreting x,y. QWidget::move() was not designed for this AFAICT, so making it to accept frame geometry is no-op. It is widely used legacy code, changing it could cause regressions. Save/restore API was introduced in Qt 4.2, at that time we did not have APIs like QWindow::setFramePosition(), so its unclear why geometry() was not stored instead. The documentation also is somewhat unclear: "[..] save the geometry when the window closes [..]" Frame or client geometry? It does not specify. And from the code we see that frame geometry was passed as client geometry, not making the original intention clearer. Besides that, restoreGeometry() is full of other undocumented assumptions where to place windows and when to fail (fortunately its easy to write your own save/restore logic). Added a Qt 6 note in the source code. What this patch changes: Now we store geometry() in saveGeometry() and use that value in restoreGeometry() by setGeometry(). This does not cause any behavior difference in window positioning (tst_QWidget::saveRestoreGeometry still works). Geometry restored from data saved with earlier versions of saveGeometry() might be positioned at: x + leftMargin, y + topMargin. This patch makes tst_QWidget::saveRestoreGeometry to always fail instead of being flaky. Blacklisting for XCB instead of selected distros. Also enabled excluded code paths for XCB on tst_QDockWidget::restoreDockWidget(). It does not seem to be flaky, maybe it was in 2015, but lot of things have changed since then. Task-number: QTBUG-66708 Change-Id: Ic86a6fd091e2c71b7550b2f476386da704253cd4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix: crash when painting with high-dpr image brushEirik Aavitsland2018-06-251-3/+3
| | | | | | | | | | | The recently merged f5fe9fc5a4 (Add ObjectMode to QGradient) changed combineXForm() to check the brush's gradient's coordinatemode. However, combineXForm() is now also used when painting with high-dpr image brush. In the latter case, the gradient is 0 so this would crash. Testcase: tst_lancelot, image_dpr.qps. Change-Id: I5e2785ef708768c3fa3eac0999c9c24fd25108f4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix window(child)geometry manual testsTor Arne Vestbø2018-06-252-12/+12
| | | | | | Task-number: QTBUG-67632 Change-Id: I16482d3501cc7c7893d6eac4617c77dc70e1e215 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* widgetwindow: send DragMove for every DragEnterGatis Paeglis2018-06-253-47/+69
| | | | | | | | | | ... as specified in the documentation. This was a regression from Qt4 and can cause mouse cursor flickering durig dragging on e.g. custom widget where some areas of the widget do not accept drag-and-drop. Task-number: QTBUG-67155 Change-Id: Iaa6f9407181931ed8e3d6a8fec13fd59d3c8625d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* dnd: send DragEnter and DragMove on DnD startGatis Paeglis2018-06-258-65/+177
| | | | | | | | | | | | | | | | | | | | | | | This was a regression from Qt4 and also is the documented behavior. In addition this patch fixes various issues with cursor shape updating that were discovered along the way and that are necessary for testing the new changes. The code in QGuiApplicationPrivate::processDrag() also needed a fixup, particularly the resetting of QGuiApplicationPrivate::currentDragWindow. Without this fix we would get DragMove (the one that immediately follows the DragEnter) only for the first DragEnter event. For example when dnd starts on mouse press then for mouse click we would get: <click> DragEnter->DragMove->DragLeave <click> DragEnter->DragLeave but the expected is: <click> DragEnter->DragMove->DragLeave <click> DragEnter->DragMove->DragLeave Task-number: QTBUG-34331 Change-Id: I3cc96c87d1fd5d1342c7f6c9438802ab30076e9e Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix incorrect JSON in qt_attribution.jsonKai Koehne2018-06-251-1/+1
| | | | | | | Fix spurious comma added in commit c4a21708ed186640f4db381dc80. Change-Id: I6d62378dfdda7a0da611eed1064cff707b9c6bf6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Restore creation of '.pc' filesAlexander Afanasyev2018-06-251-1/+1
| | | | | | | | | This is a partial revert of commit:6c5d227da1709eb81968823f38a133747c0e95b0 All credits to Martin Afanasjew <martin@afanasjew.de> for the original patch. Change-Id: Ib66303505888c821fc43eca213b956ce76acbbfa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Fix framework include paths in .pc filesMorten Johan Sørvig2018-06-252-2/+11
| | | | | | | | | | | | | | | | | | The macOS framework build of Qt copies headers to each framework instead of a centralized include location. Update the .pc file generator to match this behavior. Add two include paths to the .pc files: -Ipath/to/lib/foo.framework/Headers This makes #include <FooHeader> work. -Fpath/to/lib This makes #include <Foo/FooHeader> work. Task-number: QTBUG-35256 Change-Id: I013ce161c904fe6b7bbb03e33c163d32fdda0647 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* qmake: remove system framework path check from writePkgConfigFile()Morten Johan Sørvig2018-06-251-3/+1
| | | | | | | | | | | /System/Library/Frameworks is now under system integrity protection and is not usable for 3rd-party framework installs. /Library/Frameworks continues to be a documented framework install locaton. Change-Id: I26f96ed57985218452ebbf9578e08f04b4e5cfd8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Update the ICC x86 sub-architecture compiler optionsThiago Macieira2018-06-231-8/+8
| | | | | | | | | | | | By using -march= instead of -x, we turn on some other processor features too. This was already the case for AVX2, which enabled all Haswell features (notably FMA, BMI and BMI2). Change-Id: If025d476890745368955fffd153126fc9eafc5d6 Reviewed-by: Alexander Shevchenko <sav_ix@ukr.net> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRegularExpression: minor code tidiesGiuseppe D'Angelo2018-06-231-6/+6
| | | | | | | Use nullptr, clarify comments. Change-Id: Ib5f5879d8281cc455635513f82ff8c4bdb951ea8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QByteArray: add compare() with case sensitivity optionsThiago Macieira2018-06-2218-56/+212
| | | | | | | | | | | | | Need to do the same for startsWith() and endsWith(). indexOf() is a lot harder. [ChangeLog][QtCore][QByteArray] Added compare(), which takes Qt::CaseSensitivity as one of the parameters. This function is more efficient than using toLower() or toUpper() and then comparing. Change-Id: Ib48364abee9f464c96c6fffd152e69bde4194df7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QListView: do not delete item on internal moveChristian Ehrlicher2018-06-222-0/+53
| | | | | | | | | | | | | | When an internal DnD occoures in IconMode, the item is moved to it's new place but the logic in filterStartDrag() has no clue about the fact that an internal move happend. Therefore the item gets deleted. Fix it by changing the event's drop action to Qt::CopyAction to avoid the deletion as it is done within QListWidget DnD code. [ChangeLog][QtWidgets][QListView] Do not delete item on internal move. Task-number: QTBUG-67440 Change-Id: I873d3c9fa76e107e108d9af0dcf8cecd1e18a18f Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* xcb: add static overload for setting window nameGatis Paeglis2018-06-224-63/+40
| | | | | Change-Id: Ib581a582059e196567514f40b1964696ceaf3a88 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QRegularExpression: refactor pattern optimizationGiuseppe D'Angelo2018-06-2211-368/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the move to PCRE2, optimizing patterns has been a thorn in the side due to the fact that PCRE2's JIT compiler modifies the pattern object itself (instead of returning a new set of data, like PCRE1 did). To make this fit with the existing behavior, a read/write lock was introduced, with the read part locking when matching and the write when compiling (or JIT-compiling) the pattern. This locking strategy however introduced a performance issue, as we needed: * to acquire a write lock to compile/optimize the pattern (incl. the common case where the pattern was already compiled, so bailing out immediately); * to acquire a read lock during the actual match, to prevent some other thread from optimizing the pattern under our nose. This was due to the "lazy" optimization policy of QRegularExpression -- optimize a pattern after a certain number of usages. The excessive amount of locking effectively limited scalability. Simplify the code, and drop that policy altogether: since JIT compiling in PCRE2 is faster and pretty much "always recommended", just always do it for any pattern (unless it gets disabled via env variables) when compiling it. This allows to go back to a plain QMutex, and now the actual matching doesn't require acquiring any locks any longer. Of course, there is still a mutex acquired just before matching for checking whether the pattern needs recompiling in the first place; this can probably be further optimized via double-checked locking (using atomics), but not doing it right now. This shift makes a couple of pattern options controlling optimization useless, and allows to centralize the 3 QRegularExpression tests (which were actually the very same test, just setting slightly different optimizations strategies). While at it, install a stress-test for threading, with the idea of running it under TSAN or helgrind to catch bugs in QRegularExpression's locking. [ChangeLog][Important Behavior Changes][QRegularExpression] Regular expressions are now automatically optimized (including JIT compiling) on their first usage. The pattern options OptimizeOnFirstUsageOption and DontAutomaticallyOptimizeOption no longer have any effect, and will get removed in a future version of Qt. QRegularExpression::optimize() can be still used to compile and optimize the regular expression in advance (before any match), if needed. Task-number: QTBUG-66781 Change-Id: Ia0e97208ae78255fe811b78029ed01c204e47bd2 Reviewed-by: David Faure <david.faure@kdab.com>
* centralize ICC flags for *nix-systems toolchainsAlexander Shevchenko2018-06-223-176/+130
| | | | | | | | | | | linux-icc and macx-icc toolchains contain a significant amount of code which can be merged to a common configuration file. as a side effect, such merge resulted in reduction a parts of linux-icc and macx-icc toolchains to the common view. Change-Id: I37d110734eeeb9bd61ca0aa942de380ac8e75f1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Build the Windows platform plugin with QT_NO_FOREACHJoerg Bornemann2018-06-227-15/+21
| | | | | | | ...for consistency with the other platform plugins. Change-Id: I85946d610a62c19140618c83f80c4aa63fce4bc3 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Add a secure UDP client exampleTimur Pocheptsov2018-06-2211-1/+1173
| | | | | | | | | | | | A simple application that establishes DTLS connection(s) and sends/receives datagrams. Class DtlsAssociation is essentially a QUdpSocket|QDtls pair: it initiates a handshake, handles timeouts and errors. After establishing an encrypted connection it sends messages to the server and processes responses. Task-number: QTBUG-67596 Change-Id: I92d481b7dfd2459e6a93c754b338a2e897a7feaf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add ObjectMode coordinate mode to QGradientEirik Aavitsland2018-06-228-26/+57
| | | | | | | | | | | | | | | | | | | | | | The ObjectBoundingMode coordinate mode of QGradient allows specifying the gradient coordinates relative to the object being painted. But if the gradient brush also has a transformation, that transformation is applied in the logical, not object, coordinate space. That behavior is counterintuitive. However, changing it now would break existing code. Instead, we introduce a new coordinate mode enum with the expected behavior, and document the old one as deprecated. This prepares to fix the bugs below in qtsvg, by making it possible to specify the same behavior in Qt as SVG has. [ChangeLog][QtGui][QGradient] Add ObjectMode coordinate mode [ChangeLog][Important Behavior Changes] QDataStream version bumped up to 18 to account for changes in the serialization of QGradient. Task-number: QTBUG-59978 Task-number: QTBUG-67995 Change-Id: I8820a2555359812f3e1a46e37d6ac2cc29a2091d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Make the stub implementation of QThread compile againUlf Hermann2018-06-223-10/+40
| | | | | | | | | | | | | | | | We cannot inline methods of QThreadPrivate because QThreadData has to be declared before. The global QThreadData needs to be accessible to QThreadData::clearCurrentThreadData(), and QAdoptedThread::run() has to be moved inside the #ifndef QT_NO_THREAD block as run() doesn't exist in the stub and Q_DECL_OVERRIDE would be wrong. We also fix the QThreadData::current() method to take and use the same parameters as in the non-stub case. Change-Id: Id29ca44b11fa95ed2df7cc39243a07ce7d3c455e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Make the sleep methods available in QThread even if QT_NO_THREADUlf Hermann2018-06-223-2/+16
| | | | | | | | | sleep, msleep, and usleep are not actually related to threading and serve a purpose also in a single threaded application. Change-Id: Iba2e343d48a9c09e60125bc1b589047e0241608a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* xcb: account for misbehaving Unity DnD ManagerGatis Paeglis2018-06-223-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... which may cause dnd data to be lost. As soon as Unity sees that dnd operation has started (it monitors for changes on XdndSelection) it creates an invisible window named XdndCollectionWindowImp that fill entire screen and starts to act as DnD target. Once it has fetched the mime data it moves XdndCollectionWindowImp away without sending any DnD termination events. XdndCollectionWindowImp does not respect the XDnD protocol. Only when its gone we can start a normal dnd operation - looking for real DnD target. We ask windows if they are XdndAware on the initial mouse press and subsequent mouse move events. This patch sets a cursor to Qt::ForbiddenCursor while DnD is interfered by XdndCollectionWindowImp. A user will see the real DnD action (reflected by cursor) only after the next mouse move when XdndCollectionWindowImp has stopped interfering. We also setCanDrop(false) while DnD target is XdndCollectionWindowImp. Temporary seeing ForbiddenCursor is better than losing DnD data. Dropping in this state means that drop will simply be ignored. It is unclear what Unity developers expected DnD source window to do when user releases mouse while XdndCollectionWindowImp is stealing the data. Looking at Unity code, it appears that they were hoping to be quick enough that it would never happen. Task-number: QTBUG-49464 Change-Id: I10880073f6d843572be44fe9a3c4f78194466299 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* xcb: qxcbdrag.cpp cleanupsGatis Paeglis2018-06-224-154/+118
| | | | | | | | | | | | | | | | | | | | | | | | | - moved finding of XdndAware target logic in its own function to reduce size of QXcbDrag::move(). - switched to use categorized logging with more consistent logging messages - added more comments to avoid constatly looking at the specification for the meanings of Xdnd* actions and who sends/receives the action. - removed dead code (findXdndAwareParent), which should have been removed in 269fdbdd2bedda5f5eacb751224d3a3fc3eed5bc when reimplementing this logic in XCB. - removed needless reseting of state variables in various places as this is handled in QXcbDrag::init() on DnD start. - renamed variable in QXcbDrag::dndEnable(): xdnd_widget -> window - and other minor cleanups Change-Id: Ib667f80ceb4c07b7409a90c041044c98665877f3 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix tst_qtextbrowser for configurations with builtin testdataOliver Wolff2018-06-222-13/+25
| | | | | Change-Id: I1dc17642934e8fd2d5e3b7f245e1fb0c26b8e75a Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: Make widgets/widgets auto tests passOliver Wolff2018-06-2224-2/+185
| | | | | | Task-number: QTBUG-68297 Change-Id: I64d6e89e515a6284fbd8625cded22511de783481 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* winrt: make widgets/kernel auto tests passOliver Wolff2018-06-226-6/+125
| | | | | | Task-number: QTBUG-68297 Change-Id: I96839927fd98e2c6e533a2a3587ae66e599ec8fc Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: Make itemview auto tests passOliver Wolff2018-06-229-2/+75
| | | | | | Task-number: QTBUG-68297 Change-Id: I285dca678c34fd4170686635c7541e598442aa29 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: make dialog auto tests passOliver Wolff2018-06-224-2/+21
| | | | | Change-Id: I2d31c2e9513944ba722b59ac69e91973a7aabba5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* winrt: Fix/blacklist failing text related auto testsOliver Wolff2018-06-223-2/+20
| | | | | | | | | winrt still has some issues with some character sets. These tests are skipped/blacklisted for now and will be investigated. Task-number: QTBUG-68297 Change-Id: I898e3383a4673b6dc87815a75e705f3302a4cbba Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* winrt: Skip QGuiApplication auto tests that do no applyOliver Wolff2018-06-221-0/+6
| | | | | Change-Id: I618eb0d6aa0bb09ab635f56e64c8d0df33c2dab3 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* tst_qresourceengine: Fix position of testqrc for builtin testdataOliver Wolff2018-06-221-1/+1
| | | | | | | | A change between 5.11 and dev has modified the position of testqrc inside the resource list. Adapt accordingly. Change-Id: I697103f4b8c9e93bb613e814c47a4e68e9a997ab Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* winrt: Skip network auto tests for nowOliver Wolff2018-06-222-2/+2
| | | | | | | | | | In order to get winrt CI checked, the network tests are being skipped for now. As soon as winrt has landed in CI, these will be fixed and re-enabled. Task-number: QTBUG-68297 Change-Id: I692d72f9e0c97840bd7396551b4e707eec845ebb Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* winrt: Make tst_qwindow passOliver Wolff2018-06-222-2/+35
| | | | | | Task-number: QTBUG-68297 Change-Id: I9b5e90faa60a4fa2063b217db3b59ea3e89e4444 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Compiler detection: add support for C++17's [[deprecated]] on enumeratorsGiuseppe D'Angelo2018-06-211-0/+11
| | | | | Change-Id: I5cff94d036bd311aee2b6418dd793fde89de0938 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add tst_QDtls auto-testTimur Pocheptsov2018-06-2115-1/+1583
| | | | | | | | | | | | | | | | | | | | | | | The test is somewhat similar to tst_QSslSocket but is smaller (in scope, will grow in future), it has no QTcpSocket/QAbstractSocket-specific things and has more DTLS-specific code. At the moment it does not use our network test server, all work is done in the same process with two QUdpSockets and two QDtls objects. We test (both on client/server ends): - parameters validation (for all functions that do this) and the correctness of error codes/handshake states - handshake procedure (with/out certificates and with pre-shared keys) - timeouts and re-transmissions during (D)TLS handshake - peer verification (and related verification errors) - aborted/resumed handshake - encrypted I/O - DTLS shutdown For now, this test is OpenSSL-only. Task-number: QTBUG-67597 Change-Id: I27006bfe3d6c02b89596889e8482a782c630402a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add a secure UDP server exampleTimur Pocheptsov2018-06-2111-1/+1212
| | | | | | | | | | | | | | | | | | It's a simple DTLS server, implemented with QUdpSocket, QDtlsClientVerifier and QDtls. The server is configured to use PSK only (it has no certificate/key). The server uses a single QUdpSocket socket and de-multiplexes UDP datagrams internally (thus it can work with several clients simultaneously). Future update will probably add more options (like configuring with certificate/key, etc). For now - it's as minimalistic and simple as possible. Task-number: QTBUG-67596 Change-Id: Ic7d18dbab6dbcc9ed44c82e69a2b364df24aa256 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* SSL: Add a feature for DTLSUlf Hermann2018-06-215-8/+27
| | | | | | | | | | | For now the new feature depends on openssl as that is the only supported implementation. Once we get an implementation for SecureTransport, we can change the condition. The feature needs to be public because qdtls.h is a public header. Change-Id: Ie3e4acbeb2888f2fb13453b3ecdc19bacc83f6e6 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QDtlsClientVerifier - add auto-testTimur Pocheptsov2018-06-193-2/+502
| | | | | | | | | | | | | | | | This part of DTLS is relatively easy to test: we never do a complete handshake. Certificates, verification, ciphers, etc. - do not matter at this stage (to be tested in tst_QDtls). Errors are mostly insignificant and can be ignored or handled trivially. The test is OpenSSL-only: SecureTransport failed to correctly implement/ support server-side DTLS, the problem reported quite some time ago and no fixes from Apple so far. Task-number: QTBUG-67597 Change-Id: I21ad4907de444ef95d5d83b50083ffe211a184f8 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Let's encrypt datagramsTimur Pocheptsov2018-06-1814-24/+2682
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds DTLS support to QtNetwork module (and its OpenSSL back-end). DTLS over UDP is defined by RFC 6347. The new API consists of 1) QDtlsClientVerifier which checks if a client that sent us ClientHello is a real DTLS client by generating a cookie, sending a HelloVerifyRequest with this cookie attached, and then verifiying a cookie received back. To be deployed in combination with a server-side QUdpSocket. 2) QDtls - initiates and proceeds with a TLS handshake (client or server side), with certificates and/or pre-shared key (PSK), and encrypts/decrypts datagrams after the handshake has finished. This patch does not implement yet another UDP socket, instead it allows use of existing QUdpSocket(s), by adding DTLS support on top. OpenSSL back-end uses a custom BIO to make it work with QUdpSocket and give a finer control over IO operations. On the server side, demultiplexing is left to client code (could be done either by connecting QUdpSocket or by extracting address/port for an incoming datagram and then forwarding/dispatching them to the corresponding QDtls object). Task-number: QTPM-779 Change-Id: Ifcdf8586c70c3018b0c5549efc722e795f2c1c52 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QCborValue: store US-ASCII strings as 8-bitThiago Macieira2018-06-182-3/+27
| | | | | | | | | | | | They're easy to convert back to UTF-16, their length is the same, they occupy half the memory and they're easy to encode into CBOR (no transformation necessary). The code was copied from QJsonPrivate::Latin1String::operator=(). Change-Id: I56b444f9d6274221a3b7fffd150c52bcb6c97f37 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QToolbar: Un-hide the QLayout::indexOf non-virtualThiago Macieira2018-06-181-1/+1
| | | | | | | | | Breaks the build with QT6_VIRTUAL qtoolbarlayout_p.h:99:9: error: 'QToolBarLayout::indexOf' hides overloaded virtual function [-Werror,-Woverloaded-virtual] Change-Id: I6efb28c3145047559ec0fffd15386c39739b42f9 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix warning that QRegion::rects() is deprecatedThiago Macieira2018-06-181-1/+2
| | | | | | | Since we do need a container so we can sort, use std::back_inserter. Change-Id: I6efb28c3145047559ec0fffd153880918eb47184 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* GCC: Disable the -Wmissing-field-initializers in GCC 4Thiago Macieira2018-06-181-0/+2
| | | | | | | | | | | | | | | Perfectly valid C++11 code trying to default-initialize an object with {} is being warned. GCC 5 and up only warn if you initialize some fields and not others. qcborvalue.h:68:25: error: missing initializer for member 'QCborError::c' [-Werror=missing-field-initializers] QCborError error = {}; ^ Task-number: QTBUG-68889 Change-Id: I6efb28c3145047559ec0fffd1538577de250e283 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
* QCborValue: fix warning about shadowing membersThiago Macieira2018-06-183-15/+18
| | | | | | | | | | | qcborvalue.h:145:9: error: declaration of 'taggedValue' shadows a member of 'this' [-Werror=shadow] Newer versions of GCC don't warn for variable shadowing a member function. Task-number: QTBUG-68889 Change-Id: I6efb28c3145047559ec0fffd153857b856267d6d Reviewed-by: Liang Qi <liang.qi@qt.io>
* QCborStreamReader: Fix uninitialized warningLiang Qi2018-06-181-1/+1
| | | | | | | | | | | serialization/qcborstream.cpp: In member function 'QCborStreamReader::StringResult<int> QCborStreamReader::readStringChunk(char*, qsizetype)': serialization/qcborstream.cpp:2845:62: error: 'content' may be used uninitialized in this function [-Werror=maybe-uninitialized] memcpy(ptr, d->buffer.constData() + d->bufferStart + offset, toRead); ^ Task-number: QTBUG-68889 Change-Id: Ieea05672f2fdd7685c2af0e0aa7fa8b281d25618 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build with SSE 4.1 but not AVX2Thiago Macieira2018-06-161-1/+1
| | | | | | | | | Failed on my Sandybridge Mac with -march=native: qstring.cpp:363:19: error: redefinition of 'mask' with a different type: 'const __m128i' Change-Id: I6efb28c3145047559ec0fffd15386aeb8d36d681 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove unused QString::toLatin1_helper overloadThiago Macieira2018-06-162-6/+0
| | | | | | | | | Commit 5dc1e08c8c602738f6a827cea0de44683c7bbd0b changed QString::toLocal8Bit_helper to use qt_convert_to_latin1 so it became unused. It was never used in inline functions in the headers. Change-Id: I6efb28c3145047559ec0fffd15382f9d08efdfeb Reviewed-by: Lars Knoll <lars.knoll@qt.io>