Commit Graph

8593 Commits

Author SHA1 Message Date
Gabriel de Dietrich
8b098e6544 tst_QMenuBar: Remove obsolete warning check
This warning was removed when we refactored QCocoaMenuItem::sync().

This change amends 8412009de6.

Task-number: QTBUG-68013
Change-Id: I0d65109dff5f82db530b6bdced96c05692af6b4b
Reviewed-by: Liang Qi <liang.qi@qt.io>
2018-05-01 17:11:16 +00:00
Morten Johan Sørvig
18d2619224 QGraphicsView: Improve high-DPI item caching
Scale cache size by target paint device devicePixelRatio.

Add manual test for the cache modes.

Change-Id: I9f3a2b4c4cf12571aefe54ebf534009a2448fb48
Done-with: MihailNaydenov <garfieldhq@yahoo.com>
Task-number: QTBUG-26795
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-26 23:39:46 +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
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
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
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
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
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
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
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
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
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
Qt Forward Merge Bot
100ebf1c97 Merge "Merge remote-tracking branch 'origin/5.11' into dev" into refs/staging/dev 2018-04-20 20:06:18 +00:00
Qt Forward Merge Bot
6f45fda50b Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I0bea38585382b5d9c8d7a013bf6bcb3a6008d159
2018-04-20 21:22:53 +02:00
Tor Arne Vestbø
2b40af7177 tst_qimagereader: Make sure to include all image resources in test
The manually maintained qrc file was missing corrupt_clut.bmp among
others.

Change-Id: I8916ba76a63950de03f25814d893306d046d273d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-04-20 15:05:01 +00:00
Andy Shaw
7c532891e0 Send ShortcutOverride event when receiving a non-spontaneous key press
When a key press is received which is not spontaneous then it needs to
be manually sent as a shortcut override event to ensure that any
matching shortcut is triggered first. This enables emulation/playback
of recorded events to still have the same effect.

[ChangeLog][QtWidgets] Sending a key press event with sendEvent() now
sends a ShortCutOverride event first to the widget to trigger any
shortcuts set first.

Task-number: QTBUG-48325
Change-Id: Iafcc2cdb1773bffe89edaeb0abc44cd5a51088e6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-20 10:18:49 +00:00
Jan Murawski
b0726e8641 Add HTTP caching headers to KnownHeaders
QNetworkRequest is already aware of the Last-Modified header but
has been lacking support for the If-Modified-Since, ETag, If-Match
and If-None-Match headers. These headers are used with HTTP to
signal conditional download requests.
See RFC 7232 for more information.

Change-Id: I248577b28e875fafd3e4c44fb31e8d712b6c14f1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-19 06:46:13 +00:00
Friedemann Kleint
370cd37cea Manual shortcut test: Arrange in QGridLayout
Change-Id: I93264bec8810f4dd1e2c010cc4dd35df93f31102
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-18 20:54:03 +00:00
Lars Schmertmann
c08197ccab QObject: Extend debug output of connect
Sometimes it is hard to find the line, when the warning
"QObject::connect: invalid null parameter" appears in the log.
This change adds the class names of the sender and receiver
to give a hint where to search for the wrong call to connect.

Change-Id: I00cead7d943f96d60f198cb3f0bed34ba10285c5
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2018-04-18 17:57:30 +00:00
Timur Pocheptsov
46ad794a96 Auto-tests: remove unneeded 'gui' from QT variable
none of these tests needs anything GUI-related.

Change-Id: I6b3c02bf13da60ab460f0cc4d804f1d03bc68f50
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-18 14:22:26 +00:00
Timur Pocheptsov
9865ecf9db h2 auto test - replace QEventLoop (and QTimer) with QTestEventLoop
QTestEventLoop (conveniently so) takes care of timeouts thus no
external QTimer/handling logic needed at all.

Change-Id: Id65ea928daec1e7d9380107e63916896f19d3d14
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-18 14:18:38 +00:00
Kari Oikarinen
c6ee1899ea Blacklist tst_QWindow::isActive on Ubuntu
Task-number: QTBUG-67768
Change-Id: Ie1e0b406c152c854ef3629fa4d469dd73452f128
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-18 13:23:18 +00:00
Andy Shaw
8e5f6e3bed Don't send a mouse move when we just need to do a synthetic enter/leave
[ChangeLog][QtWidgets] QApplication no longer sends a mouse move event
to the entered widget if it sends synthetic enter and leave events.

Task-number: QTBUG-67736
Change-Id: I75daaffd53f1ddc2bc4d7df67382cbc22d3eb6fc
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-18 08:19:41 +00:00
Qt Forward Merge Bot
c8625a3e67 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I86f04fc3b2e4291f161a4985adddd6fd6c789d33
2018-04-18 01:00:28 +02:00
Edward Welbourne
3ac029f674 Make generated selftest output match for in-source builds
When generate_expected_output.py is run for an in-source build, the
raw output contains no paths to the sources for the script to whittle
down, as it does for shadow builds, to just the path from qtbase down.
So kludge together some extra regexes that can fix that up and tweak
some relevant code to provide them with the data they need.

Change-Id: I656d7126087bd9ad20b2af6835fba314d90a171d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-17 16:22:49 +00:00
Andy Shaw
0b70f5ada9 QDoubleValidator: Allow intermediate values as close as possible to one considered invalid
The documentation states that if you have a range of
0.00-2.00 with the number of decimals set to 2 then
any number up to 9.99 would be considered intermediate.
This is because the number of digits still matches both before
and after the decimal point. If it is 10.0 or 9.999 then
it is still considered invalid.

In the case of 9.999 being invalid in this case, the documentation
is corrected as this was incorrectly indicated as Intermediate,
as the code indicates it as Invalid.

Change-Id: I07b433e856f355916a1240deafdf4ef58e680639
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-04-17 15:36:34 +00:00
Oliver Wolff
215e0f35d0 tst_qdir: Fix absoluteFilePath for winrt
The drive has to be defined for every Windows configuration (also
including winrt).

Change-Id: I94a3131b8aec20cda97dc78f55b1d87aa10240e4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2018-04-16 05:23:17 +00:00
Qt Forward Merge Bot
4aa6f54fec Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I8c353b4c53e90434453c76691eac39a894d23b49
2018-04-15 01:00:18 +02:00
Kari Oikarinen
0dd3e02aac tests/auto/widgets/util: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I795e564b051bbabd1fc2d2fca8171da6072f99eb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-13 12:32:52 +00:00
Kari Oikarinen
66cc08961f tst_QWidget: Avoid unconditional qWait()s
Task-number: QTBUG-63992
Change-Id: I1696ccbdf0523ece694f2dac52c015443c8b19fb
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-13 05:43:45 +00:00
Eirik Aavitsland
7f782e1fc4 Fix crash if QPixmap::defaultDepth() is called when no QGuiApplication
This static method can be called before QGuiApplication is created. At
that point there is yet no primary screen, so the implementation
needs to guard against dereferencing a nullptr.

Task-number: QTBUG-67309
Change-Id: I6b7b9e97b1c3c79bf2f9c6d6247c3b10f39f7a55
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2018-04-12 21:22:20 +00:00
Lars Knoll
4f158ccee5 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9f802cb9b4d9ccba77ca39428a5cb1afd2d01642
2018-04-12 22:00:35 +02:00
Alex Trotsenko
e8733ffc51 QWindowsPipeReader: fix waiting on inactive pipe
To read data from a named pipe, QWindowsPipeReader uses the ReadFileEx()
function which runs asynchronously. When reading is completed and the
thread is in an alertable wait state, the notified() callback is called
by the system, reporting a completion status of that operation. Then the
callback queues a readyRead signal and starts a new sequence. The latter
is skipped if the pipe is broken or the read buffer is full.

Thus, if an application does not run the event loop, the next call to
QWindowsPipeReader::waitForReadyRead() should emit the queued signal
and report true to the caller even if no new read operation was started.

Change-Id: I37102dbb1c00191d93365bfc2e94e743d9f3962a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2018-04-12 18:08:29 +00:00
Timur Pocheptsov
9917eb2ec6 HTTP/2 - reset uploadByteDevice if necessary
1. If a request was redirected or some error was encountered, we
   try to reset the uploading byte-device.
2. Disconnecting from the byte-device is not enough, since we have a
   queued connection, _q_uploadDataReadyRead() gets called even if
   byte-device was deleted and thus sender() can return null -
   we have to check this condition.
3. Update auto-test with a case where our server immediately
   replies with a redirect status code.

Task-number: QTBUG-67469
Task-number: QTBUG-66913
Change-Id: I9b364cf3dee1717940ddbe50cba37c3398cc9c95
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-12 14:02:20 +00:00
Allan Sandfeld Jensen
2cc9776652 Cut down on drawPixmap and drawImage combinations
There are too many combinations and the data is not very useful when
it is impossible to get an overview. This cuts a few rare formats out
and reduces the sizes tested to one small for overhead benchmarking
and one large for bandwidth benchmarking.

Change-Id: If0fe33e0e02b8cba771094a79072036f2cd4cf48
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-12 12:58:40 +00:00
Kari Oikarinen
a88063008d Blacklist tst_QItemDelegate::comboBox on openSUSE
This failed (occasionally) in finding the editor widget, so wait for the window
to be shown properly. Also enter the event loop with QTRY_VERIFY and not for a
fixed time of 1 s.

This however just moved the point of failure. Now the test fails since the
clearing and setting of focus does not dismiss the editor widget sometimes, so
still blacklist it.

Task-number: QTBUG-67282
Task-number: QTBUG-66216
Change-Id: Iec598609fce23a25d7b955082d0973685d612715
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-12 12:48:12 +00:00
Kari Oikarinen
b096982899 Don't mark tst_QFiledialog as insignificant_test
Change-Id: Id3fef4e66bd8f96c8f87dd94bbca216cc65f8489
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2018-04-12 12:21:55 +00:00
Edward Welbourne
5c63e6fd75 Clean up some trivia in tst_QTimeZone
Fix a mistaken #ifdef that should have been #if; and only call
QTimeZone::availableTimeZoneIds() once in transitionEachZone_data(),
while switching to use of a ranged-for.

Change-Id: Id27aae9ef450f21350283099c892ca7173884b94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-12 11:48:06 +00:00
Kari Oikarinen
350a64196f tests/auto/dbus: Avoid unconditional qWait()s
Use QTRY_COMPARE instead of a wait followed by QCOMPARE. Unless the condition
doesn't change and the wait provides the opportunity for things to go wrong.

Task-number: QTBUG-63992
Change-Id: I13474a45f1f4df9d77a418729a5748235ae0dd1a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2018-04-12 05:49:07 +00:00
Gabriel de Dietrich
91fa300cbe QMacStyle: CC_ComboBox is now HITheme-free
For the time being, no more stretched QComboBox. They
were already looking bad before and nobody complained,
so it's a non-issue. In the future, we might use square
combo boxes in the same way as we do for push buttons
but for non-editable QComboBox only.

Removes what is now dead code, including some leftovers.

tst_QMacStyle updated to reflect size changes to accom-
modate the focus ring.

Change-Id: I60fac86b9acb52cc96373bca0b3cad598ec4f1e7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2018-04-12 00:20:42 +00:00
Daniel Savi
6a4b6971f4 Add more formatting to QTextDocumentWriter when writing ODF files
QTextDocumentWriter only supports a small subset of table formatting
when exporting to ODF-format. This patch adds more formatting
capabilities to the ODF exporter:
- table border support
- table alignment
- table width
- respect column constraints (column widths)
- add a tab before soft line breaks. This will avoid causing the last
line to stretch all over the cell in justified paragraphs.

With this patch, line height settings are now exported, too.

[ChangeLog][QtGui][QDocumentWriter] QDocumentWriter now supports table
borders, table alignment, table width, column widths, line height and
image resolution when exporting QTextDocuments to ODF files.

Task-number: QTBUG-63581
Change-Id: I2d269ef0f842e73af64d48bfef531d5fa3078088
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2018-04-11 18:44:31 +00:00
Mårten Nordheim
f8e551cf08 Fix loading pkcs#8 encrypted DER-encoded keys in openssl
When we load DER-encoded keys in the openssl-backend we always turn it
into PEM-encoded keys (essentially we prepend and append a header and
footer and use 'toBase64' on the DER data).

The problem comes from the header and footer which is simply chosen
based on which key algorithm was chosen by the user. Which would be
wrong when the key is a PKCS#8 key. This caused OpenSSL to fail when
trying to read it. Surprisingly it still loads correctly for unencrypted
keys with the wrong header, but not for encrypted keys.

This patch adds a small function which checks if a key is an encrypted
PKCS#8 key and then uses this function to figure out if a PKCS#8 header
and footer should be used (note that I only do this for encrypted PKCS#8
keys since, as previously mentioned, unencrypted keys are read correctly
by openssl).

The passphrase is now also passed to the QSslKeyPrivate::decodeDer
function so DER-encoded files can actually be decrypted.

[ChangeLog][QtNetwork][QSslKey] The openssl backend can now load
encrypted PKCS#8 DER-encoded keys.

Task-number: QTBUG-17718
Change-Id: I52eedf19bde297c9aa7fb050e835b3fc0db724e2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-11 14:30:08 +00:00
Timur Pocheptsov
e3cea2a7b9 QSslSocket (OpenSSL 1.1) - respect requested protocol version
Properly handle single protocol TLS configurations. Previously,
due to the use of generic (non version-specific) client/server method
they worked as ranges of protocols instead. This also fixes a couple
of previously broken tests.

Task-number: QTBUG-67584
Change-Id: Ied23113a4fab6b407a34c953e3bd33eab153bb67
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2018-04-11 12:10:01 +00:00