Commit Graph

36111 Commits

Author SHA1 Message Date
Gabriel de Dietrich
25d5c8fe5d Cocoa Menus: Clean up code
In this edition:

  * Use Objective-C properties where appropriate.
  * Use recently introduced qt_objc_cast().
  * Remove uses of foreach.
  * Update copyright headers.

Change-Id: I2a07a7b6cab27b833e4deaeedf9563463ff55914
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-26 17:51:53 +00:00
Christian Ehrlicher
b2a282d7c7 QToolButton: Elide text when constraints prevent from showing whole text
When a QToolButton has a fixed width and the text is too long, the text
was cropped which made the button look ugly.
Fix it by eliding the text in the middle in this case.

Task-number: QTBUG-64132
Change-Id: I7bc46d1edcf4e67b5e1a5b651d4793f9ffa15310
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-04-26 16:37:21 +00:00
Thiago Macieira
26e3dfd4ab Improve padding hole issues in QAbstractPrintDialogPrivate
Placing a boolean between two pointers means we'll have a 7-byte padding
hole (64-bit). So move it to the bottom of the class, consuming the tail
padding that needs to be there anyway on 64-bit systems.

On 32-bit Unix systems, the better place would be at the top, as the
parent class (QDialogPrivate) has a 3-byte tail padding. But that's
fragile, as QDialogPrivate can change, doesn't apply to MSVC's ABI and
doesn't gain us anything on 64-bit.

Change-Id: I3840d727dee443318644fffd1528e4f05f4142bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-26 16:15:30 +00:00
Giuseppe D'Angelo
fcc94b1442 QColorDialog: deprecate rgba()
It was already deprecated in the documentation, just use
the QT_DEPRECATED macros.

Change-Id: Ie9ba7dd36af8e4eb5bddb7429182db98c7c638f5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-26 16:01:52 +00:00
Liang Qi
b3ebe8713b Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-04-26 15:53:08 +00:00
Tor Arne Vestbø
7c3053b301 qmake: Don't map Xcode SYMROOT to output directory
The output directory may be the same as the source directory in
the case of an in-source build, but Xcode treats the SYMROOT as
a build directory, and automatically excludes it from Time Machine
backups, which may result in not backing up sources.

Instead we map SYMROOT to an .xcode subdirectory of the output
directory, and then use CONFIGURATION_BUILD_DIR to make sure
the final build targets end up where they used to.

Task-number: QTBUG-52474
Change-Id: I3852ca9088e75ca62fca4c1217b5485175d9436f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2018-04-26 14:19:21 +00:00
Morten Johan Sørvig
7160df3a15 High-dpi drawTiledPixmap (raster paint engine)
Implement more consistent behavior for drawTiledPixmap(),
which should produce the same visual tiling pattern
independent of display devicePixelRatio

Consider the following pixmaps and draw calls:

  QPixmap px32; // 32x32
  QPixmap px64; // 64x64
  drawTiledPixmap(QRect(0, 0, 128, 128), px32);
  drawTiledPixmap(QRect(0, 0, 128, 128), px64);

On 1x displays this will produce 4x4 and 2x2 tiles,
respectively.

On 2x displays this would previously produce a different
tiling pattern, where the paint engine would tile in
the device pixel coordinate system. Change this to
tile in the device independent coordinate system,
producing the same visual tiling pattern as the 1x case.

It is possible to produce a 4x4 tiling pattern with
high-resolution output from the 64x64 pixmap by setting
the devicePixelRatio:

  QPixmap px64;
  px64.setDevicePixelRatio(2);
  drawTiledPixmap(QRect(0, 0, 128, 128), px64);

This change adds an inverse scale to the image filler
transform that accounts for the pixmap devicePixelRatio.

[ChangeLog][QtGui] QPainter::drawTiledPixmap() now
tiles in the device independent coordinate system.

Change-Id: I4918d274192967f222f181b374571c7c597dcd76
Reviewed-by: Jonathan Courtois <jonathan.courtois@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: 石博文 <sbw@sbw.so>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-26 10:39:25 +00:00
Frederik Christiani
c127fc83ad Show high DPI custom cursor on macOS
Set the devicePixelRatio to 1 on the scaled down pixmap.
A scaled down version of the high DPI pixmap is added to the NSCursor in
addition to the high DPI one, but the devicePixelRatio must be set
correctly on the smaller of the two for macOS to pick the right image
to use on a high resolution display (retina).

This change also fixes the problem that only a high DPI custom cursor
with a hotspot in the upper left quadrant is applied by macOS. I suspect
that the NSCursor was discarded by macOS, because the hotspot was
outside the device independent bounds of the smaller scaled image.

Task-number: QTBUG-52211
Change-Id: I7e552e8f62f5255dd3786da44b2f619f6790c37a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-26 08:56:32 +00:00
Liang Qi
866b47916d Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: Ideea96d1b43d47b1d9b34e11c9986a88e240aa71
2018-04-26 09:55:10 +02:00
Oswald Buddenhagen
4bab1b0d7c configure: don't emit empty GCC_MACHINE_DUMP to qdevice.pri
there is no point in doing that.

Change-Id: Ie09edeed340ea87eddb38980b0df7ed777ec6280
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-04-25 18:53:33 +00:00
Oswald Buddenhagen
75587c8030 qmake: fix look-up of relative files from .depend_command in shadow builds
the dependency paths are fixified against the output directory, so we
must resolve them accordingly.

Change-Id: Id92750aad358153bd2db5daca3194c54eda58dbb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-04-25 18:52:49 +00:00
Lars Knoll
a9fc91466c Protect all accesses to the global engine cache by a mutex
Otherwise, we'll end up with corrupted memory when using
QRegExp from multiple threads.

Amends bbdc1b5ccb.

Change-Id: I9d35897629d0bc26503aa0c537c5f99013921fdd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-25 18:50:06 +00:00
Oswald Buddenhagen
395a19f032 improve documentation, mostly of the QT_TR*_NOOP macros
Change-Id: I65ccddec84a01945a6aee2a859d4f92ea830785b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Mateusz Starzycki <mstarzycki@gmail.com>
Reviewed-by: Martin Smith <martin.smith@qt.io>
2018-04-25 17:17:04 +00:00
Oswald Buddenhagen
b55176df08 syncqt: prune references to @ignore_for_master_contents
this variable hasn't been used in any syncqt.profile for many years, and
if it would, it would cause quite some side effects.

Change-Id: Ia936eff8f6a2a801fc644eee991821165d51dc1f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-25 17:16:55 +00:00
Gabriel de Dietrich
960424f86b Cocoa QPA: Remove uses of NULL
Change-Id: Ia0d1f019622d20ad70b5fd8c4122b719c0286738
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-04-25 17:08:01 +00:00
Gabriel de Dietrich
446916c927 QCocoaNSMenuItem: Add default initializer
Just tidying code a bit.

Change-Id: I492535094533ee307d757bfbbcb41376291f8878
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-25 17:07:46 +00:00
Paul Olav Tvete
3d863ae798 Fix build with -no-feature-graphicsview
Change-Id: Idddd353695d2a24ed90c29f557abfedf11d82fbc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-25 14:04:09 +00:00
Simon Hausmann
388c4ef9f7 Fix build of static plugins with resources with debug-and-release
Writing out the $TARGET_plugin_resources.cpp file in !build_pass breaks
when TARGET is adjusted by $qtPlatformTargetSuffix values. We end up
writing out $TARGET_plugin_resources.cpp but the debug Makefile looks
for $TARGET_debug_plugin_resources.cpp.

Try using the pro file name as name source instead, as suggested by
Ossi.

Task-number: QTBUG-67931
Change-Id: I221cf9b2ec1db699568d0c73513aa66ecf0ada97
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-25 13:39:32 +00:00
Eirik Aavitsland
bd1fd197ca Fix drawTiledPixmap() and texture-brush painting with high-DPR images
Although QPainter::drawImage()/drawPixmap() would render images scaled
according to their devicePixelRatio(), that would not happen for
drawTiledPixmap() and when using a textured brush. Implemented here,
in combination with the pending "High-dpi drawTiledPixmap (raster
paint engine)" commit.

[ChangeLog][QtGui] Fix drawTiledPixmap() and texture-brush painting with high-DPR images

Task-number: QTBUG-67248
Change-Id: I037e3f897fa708038a0222d3b0c61c7842d87961
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-04-25 13:39:28 +00:00
Friedemann Kleint
29b012eb0f Fix crash in QMainWindow::tabifyDockWidgets()
The list of tab bars in QMainWindowLayout::animationFinished()
is apparently modified by animations. Take a copy before
iterating over it and showing the tab bars.

Amends ba2221bd73.

Task-number: QTBUG-67916
Change-Id: Ib3a70eeac1f3b3f0dd7bd5d37aa6c34b92a55086
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-04-25 13:39:24 +00:00
Gatis Paeglis
d50d35d9db tests: cleanup tst_QComboBox::keyBoardNavigationWithMouse()
- Don't use QCursor when we can position a mouse relative to the
window coordinates via QTest::mouse*() functions. Even the way
QCursor was user here seemed to be hackish. This hack apparently
was there to make the test pass on macOS, I have verified that
the updated test continue working on this platform.

- Remove Q_OS_QNX ifdef, as this test does not depend on QCursor anymore.

- Remove QTest::qWait()-s. Unconditinal waiting should not be used.

- Add better comments.

- Other minor things.

And move tst_QComboBox to use QTEST_QPA_MOUSE_HANDLING code path.
Eventually we want to deprecate the legacy code path.

Change-Id: Ib72f324b5197d0fd66fc32b8c1c7509e58838e04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-25 13:07:23 +00:00
Kari Oikarinen
0cb940b1d3 tests/auto/widgets/widgets: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I7b0c259800082284ddae4e25d139ad3adc858467
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-25 11:55:34 +00:00
Kai Koehne
7917305aa5 Doc: Show more examples on how to have multiple logging rules
Task-number: QTBUG-66050
Change-Id: I6872cd64f9b27b9849e4166af7aa6414c372cd5e
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-25 11:02:53 +00:00
Jüri Valdmann
98ef4239a6 Support std::unique_ptr and others in Q_DECLARE_PRIVATE
Use ptr.operator->() instead of ptr.data() for getting the raw pointer.

[ChangeLog][QtCore][QtGlobal] Q_DECLARE_PRIVATE can now be used with
std::unique_ptr and other smart pointer types.

Change-Id: I7f3f698d7bac477f2185837681e366057d292588
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-25 09:49:08 +00:00
Joerg Bornemann
c2ccb48560 Fix include style in qreadwritelock_p.h
...to make that file bootstrap-compatible.

Change-Id: Ic7c3b64cb27f3fd81f0140b6ee899310fa04f4c7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-25 09:46:15 +00:00
Nico Vertriest
b1bbce2609 Doc: Update doc for Dir View Example
Task-number: QTBUG-60635
Change-Id: I4a23f4866c76b9f5c29653ca30e44c3b844a9aa8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2018-04-25 09:02:02 +00:00
Nico Vertriest
5155942a0d Doc: Update Gradients Example
modify to latest syntax for connect statements

Task-number: QTBUG-60635
Change-Id: Ie0f8f6bdbd5aec7379f7572e978adf65b9a96bdc
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2018-04-25 09:01:47 +00:00
Friedemann Kleint
1b1fd81a81 Windows QPA: Add missing calls to keyboard initialization
Add calls to changeKeyboard() to the QWindowsKeyMapper constructor
and the handling of WM_INPUTLANGCHANGE so that the locale is
correctly initialized and changes are processed.

Change-Id: Ia30d8c6434ca85165e4882240ae16f9a75dcf4ff
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-04-25 07:42:55 +00:00
Friedemann Kleint
f7980f4eda Windows QPA: Fix handling of VK_DECIMAL/VK_SEPARATOR
Remove the hardcoded mapping from the key table for fallback keys
since the keys are locale-dependent.

Task-number: QTBUG-57992
Change-Id: I016ab5f7f7e8abfd30f6416d2e7597db7deecb9b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2018-04-25 07:42:43 +00:00
Allan Sandfeld Jensen
18db0b49c6 Don't crash on <br> following a <table>
A <br> has a new-line but no text, so be able to handle no lines.

Task-number: QTBUG-60853
Change-Id: I3d4dbd529114bbe8afe760c3622b52446202ec7c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2018-04-25 07:08:50 +00:00
Kari Oikarinen
73031ebb99 tests/auto/widgets/{effects,styles}: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I1af537bae705d4627880c5ae50669b1ef72562f2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-25 05:47:01 +00:00
Johan Klokkhammer Helsing
8ac0e6592b Skip flaky tst_QWindow::childWindowPositioning on Wayland
Sometimes causes protocol errors (i.e. termination) on Wayland with xdg-shell
v6.

Task-number: QTBUG-67648
Change-Id: I6c855affb145590f47a425d233c5fd6b7e1e8914
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
2018-04-25 04:51:34 +00:00
Morten Johan Sørvig
0f6a6b2bff Cocoa: Don’t starve the event loop on requestUpdate()
Some of our examples, and perhaps also some applications,
call requestUpdate() immediately after producing a
frame. This can cause Cocoa to immediately start
(trying to) draw a new frame without processing e.g.
input events.

This should (and will) be handled by rate limiting
updates with CVDisplayLink. In the mean time fall back
to using the base class QPlatformWindow implementation,
which is implemented using a timer, which will allow
for input event processing.

Change-Id: Ic2541f344b2f4018d785404a06274959a7bad2df
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2018-04-24 19:48:50 +00:00
Gabriel de Dietrich
c7eb2c173e QCocoaFontDialogHelper: Fix NSFontManager delegate warning
According to Apple's documentation, there's no delegate
in NSFontManager. We set its target instead. The action
is changeFont: by default.

Change-Id: I8c01bfa97c78dd8097f38c27353748d13f51489f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-04-24 19:46:14 +00:00
Gabriel de Dietrich
a4e6117c53 Style sheets: detect and use font set on QHeaderViews
We also ask the parent style to draw the header label
instead of the base style which is more likely to respect
other text related parameters.

Change-Id: I6dd658fa4d016a76d7c450478dc42f07e4b807c4
Task-number: QTBUG-33855
Task-number: QTBUG-37153
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-04-24 18:27:34 +00:00
Allan Sandfeld Jensen
e413874467 Fix division by zero in radial gradiants with NEON
The NEON implementation uses rsqrt and thus can not be taken on 0, so
replace the minimum with something close to zero instead of zero.

Task-number: QTBUG-59961
Change-Id: Ia39e45be675b056c1e22900495ce9ba4e8b70e5f
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-04-24 18:16:54 +00:00
Gabriel de Dietrich
143cf9e467 QCocoaWindow: Fix handleMouseEvent() compilation warning
qtbase/src/plugins/platforms/cocoa/qcocoawindow.mm:408:53: warning:
      'handleMouseEvent<QWindowSystemInterface::DefaultDelivery>' is deprecated [-Wdeprecated-declarations]
                            QWindowSystemInterface::handleMouseEvent(window(), window()->mapFromGlobal(localPoint.toPoint()), localPoint,

Change-Id: Ifbf8c46e31a1de2089ce0e16cec087fdd9adb64e
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2018-04-24 17:42:53 +00:00
Thiago Macieira
309dacedac Atomics: remove requirement for alignment equality with plain types
This was originally added so that you could replace a T with
QAtomicInteger<T> in the same class and still keep ABI. However, for
legacy reasons, on 32-bit x86, types larger than 4 bytes keep an old
1990s alignment of only 4 bytes, but modern std::atomic<T> for those 8-
byte types enforces an alignment of 8 bytes. Therefore, the requirement
to keep alignment is not possible to guarantee.

In other words: you may not replace T with QAtomicInteger<T> or
std::atomic<T> and assume no ABI breakages in all platforms.

This is a requirement to implement atomicity. An 8-byte type aligned to
only a 4-byte boundary could cross a 16-byte boundary or, worse, cross a
cacheline boundary. Crossing the 16-byte boundary could be bad on some
processors, but crossing the cacheline boundary (addresses ending in
0x3C, 0x7C, 0xCC and 0xFC, or 4 out of 64 possible addresses or 6.25%)
is always bad: the CPUs cannot guarantee an atomic load or store
operation.

See also <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71660>.

Task-number: QTBUG-67858
Change-Id: If90a92b041d3442fa0a4fffd15283e4615474582
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2018-04-24 17:36:42 +00:00
Kari Oikarinen
15ada2b917 tests/auto/widgets/kernel: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: Icb32b516002c3bb2841c8e7a29624e54cfcbbcac
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-24 05:01:57 +00:00
Qt Forward Merge Bot
02268b8496 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: If950406391f79d99f0101f0b6755395accb26f34
2018-04-24 01:00:19 +02:00
Simon Hausmann
be9a56e5e3 Make it easier to use resources in plugins when using static linking
RCC generates code that registers resources automatically on program
startup via global constructors. When linking statically and nothing
references the symbols in the .o file compiled from the RCC generated
code, then the linker will discard the embedded resources and they will
not get initialized. That is why for static linking it is necessary to
explicitly initialize resources using the Q_INIT_RESOURCE macro.

We can avoid the need for the explicit initialization in the context of
plugins that are statically linked into the application. resources.prf
can generate a .cpp file with a helper function that contains all the
Q_INIT_RESOURCE calls for all resources in the plugin. That helper
function in turn is injected into the plugin entry point, which in turn
is guaranteed to be included in the final binary.

Change-Id: If1abf9c85ef92935020af073b989c58c1ae6ca63
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-04-23 13:56:07 +00:00
Lars Knoll
c579f49e2a Fix QML integration of widgets
We need to mark the object as deleted before destroying
it's declarative data, otherwise all sorts of bad things
can happen.

This fixes the qwidgetsinqml autotest in qtdeclarative.

Change-Id: I05a645ebe1ca7a50c8927e3dbd9ebb5aaf369a71
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 3e91625b58)
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-23 13:46:55 +00:00
Martin Smith
b458cb312c doc: Make both qEnvironmentVariable() functions visible in the docs
There had been a fake declaration for qEnvironmentVariable() in qglobal.h
thaqt was only visible to QDoc. It was removed in favor of documenting
both the actual declarations of qEnvironmentVariable(), one with a 2nd
parameter for passing a defualt value and one without that parameter.
But the one without the default value parameter was marked internal, so
it didn't appear in the docs.

When both functions were documented with a shared comment, a bug in
QDoc was revealed, because these functions are global, while the shared
comment functionality had only been implemented for class member functions.
Now the shared comment functionality has been implemented for global
functions, so these two functions are now documented with a shared
comment. We can, of course, reintroduce the #ifdef QCLANG_QDOC trick, if
that is pre3ferred.

Change-Id: I41d85def5daa3215a995d7697d064dfae37e8b2a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-23 13:28:51 +00:00
Friedemann Kleint
994e0e4c36 Windows QPA: Fix Korean IME removing words when using CTRL shortcuts
Ignore the WM_IME_ENDCOMPOSITION message in that case.

Done-with: Tobias Koenig <tobias.koenig@kdab.com>
Task-number: QTBUG-58300
Change-Id: I9506754a149905222a324b85634964fce398d3ac
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-04-23 12:57:43 +00:00
Mårten Nordheim
72bb1d95fd Introduce QPasswordDigestor functions
Added a few functions to derive keys from passwords. Currently it
supports PBKDF1 and PBKDF2 as defined in
RFC 8018 ( https://tools.ietf.org/html/rfc8018 ).

[ChangeLog][QtNetwork][QPasswordDigestor] Added QPasswordDigestor

Task-number: QTBUG-30550
Change-Id: I2166b518bd8b54e3486514166e76fd9ba2f219c8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-23 12:55:45 +00:00
Mårten Nordheim
c45802e33a QSslKey: Implement PKCS#8 support for the generic backend
This patch adds the ability to decode keys which are encoded with PKCS#8
using the generic back-end (used in winrt and secure transport).

It works on both WinRT and macOS; however QSslKey seems unused in the
WinRT backend and it seems only RSA keys can be used for certificates
on macOS. Meaning that DSA and Ec, which in theory* should represent
their unencrypted versions, can't currently be tested properly.

* Can also be confirmed by loading the key using the ST or WinRT
backend, calling toPem(), writing the output to a file and then loading
the unencrypted key using openssl.

[ChangeLog][QtNetwork][QSslKey] Added support for PKCS#8-encoded keys
in the generic SSL back-end (used for SecureTransport on macOS and for
WinRT). Note that it does not support keys encrypted with a PKCS#12
algorithm.

Task-number: QTBUG-59068
Change-Id: Ib27338edc7dbcb5c5e4b02addfdb4b62ac93a4c3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-23 12:55:38 +00:00
Tor Arne Vestbø
79d900bee4 iOS: Document why we're using a runloop mode tracker in our event dispatcher
Change-Id: I71093ca05988c3e1ad6d51be7363952dd3f0518e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-23 12:55:32 +00:00
Kari Oikarinen
12559058b0 tst_QFile: Don't expect Windows HANDLE equality in nativeHandleLeaks()
That check is flaky on Windows. It doesn't seem to be testing Qt functionality.
I also don't see CreateFile2() documentation mentioning any guarantees that
opening the same file twice would give the same HANDLE each time.

Change-Id: Ica2e60571ae9fc39bf822803a2a9dd6add8323d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-23 12:45:32 +00:00
David Faure
46ec170d2b Speed up QTimeZone::isTimeZoneIdAvailable by a factor 43
Creating and sorting a list of bytearrays just to check if one entry is
present, is really overkill. By adding a new virtual method
isTimeZoneIdAvailable() in the backend classes, we can do this much more
efficiently.

Implemented for Utc and Tz backends, the others fall back to the
slow way.

The new benchmark shows, in release mode:
Before: 43 msecs per iteration (total: 86, iterations: 2)
After: 1.1 msecs per iteration (total: 73, iterations: 64)

Change-Id: Ic0d79a41d74e2ce6aa088fa7986c41d33902c36b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-23 06:48:12 +00:00
Kai Koehne
7b87bdff1a Doc: Mark local functions in qlogging.cpp as internal
This fixes qdoc warnings introduced by 67d5f79fe6.

Change-Id: I4b199e6243d9a7706befe4bc9549c78c11026d9e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-23 06:27:57 +00:00