Commit Graph

5017 Commits

Author SHA1 Message Date
Robin Burchell
3006bd2d44 Make QElapsedTimer default to invalid (and now non-POD).
The practical uses of a POD QElapsedTimer are not really that clear, and the
number of misuses of this API are quite high. Default the state to invalid to
prevent against mistakes.

[ChangeLog][QtCore][QElapsedTimer] Is no longer a POD.

Change-Id: I267292acf2bfca7404e3e449dd04410441d7ce26
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-09-03 13:19:35 +02:00
Jeremy Lainé
cd3dece750 ssl: common key parser support for encrypted keys
This adds the infrastructure for reading and writing encrypted private keys
when using non-OpenSSL backends. Each platform must provide its cryptographic
encrypt / decrypt functions.

As WinRT already uses the common parser, this commit includes an
implementation for that platform.

Done-with: Andrew Knight <andrew.knight@digia.com>
Task-number: QTBUG-40688
Change-Id: I0d153425ce63601ff03b784a111e13962061025f
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-09-02 23:16:25 +02:00
Andrew Knight
efdabc4b0e Remove vestiges of d3dcompiler_qt
Change-Id: I2a233cb0bfec27a7535a31818568955f8bf85c15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-09-02 21:55:41 +02:00
Jeremy Lainé
31938846ae qasn1element: add QAsn1Element::toInteger
This change adds the ability to decode ASN.1 INTEGER fields,
provided they represent a positive number of less than 64-bit.

This is needed for PKCS#12 decoding.

Change-Id: Iafb76f22383278d6773b9e879a8f3ef43c8d2c8f
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-09-02 09:52:08 +02:00
Jeremy Lainé
5c3a499c9f ssl: disable (broken) i/o on DER encoded keys
QSslKey currently has methods which supposedly allow decoding and
encoding private keys as DER protected by a passphrase. This is
broken by design as explained in QTBUG-41038, as storing the encrypted
DER data alone makes no sense: such a file lacks the necessary
information about the encryption algorithm and initialization vector.

This change:

- explicitly stops using the passphrase when decoding DER in the
  constructor. The behavior is unchanged, it is not possible to
  read the encrypted DER alone.

- refuses to honor the passphrase to DER encode a private key. The toDer
  method now outputs an empty QByteArray instead of garbage.

Task-number: QTBUG-41038
Change-Id: I4281050cf1104f12d154db201a173633bfe22bd9
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-30 17:36:23 +02:00
Jeremy Lainé
2fd0afc1f8 ssl: add a test for 3DES encrypted keys
This adds a test for 3DES encrypted keys in addition to the
current DES encrypted keys.

Change-Id: I229e3ef710e9ee23efa2a3275b89d958491de4a2
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-30 17:24:05 +02:00
Oliver Wolff
5328ec7e10 winrt: complete QSslCertificate implementation
The native handle and import functions are now available for use in other
parts of the winrt backend.

Change-Id: I07e6f95b3411c3dc7c1a7a164544b18e5e435d01
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-08-30 08:20:51 +02:00
Jeremy Lainé
6a4cb8d62b ssl: Add common key parser for backends
This internal implementation of QSslKey can be used when OpenSSL is not
available. Encrypted keys are not supported, as the cryptography must
be supplied by a separate library.

With this commit, WinRT is migrated to the new implementation,
but qsslkey_winrt.cpp is left in place so that the missing crypto
implementation can be added later. This also means most of the expected
failures for that platform can be removed from the autotest.

Change-Id: I24a3ad1053bb72311613b28b3ae845aa1645a321
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-29 23:18:22 +02:00
Christoph Schleifenbaum
fc4993be1f QListView: Catch stack overflow on mutual scrollbar calculation.
Task-number: QTBUG-39902
Change-Id: Ie850371098070e8ce485d5cb122aa89c18d97359
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-29 07:26:29 +02:00
Friedemann Kleint
0aa84a619e QLineEdit: Disable standard key 'cut' when there is no selection.
Task-number: QTBUG-40477
Change-Id: I0741a1a769c9e7e0d19e8aec231acc29461d44ea
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-28 16:19:36 +02:00
Robin Burchell
9b599c6cea tst_qstatusbar: Allow a little more leeway in timer checking.
Timer granularity means that sometimes this won't wait the full timeout before
vanishing the message. Add some extra tolerance so we don't unnecessarily fail
integrations.

Change-Id: I203ac16cda7bd1f0437dd3febc0509c17e86c25a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-28 13:59:37 +02:00
Jeremy Lainé
d4dc3159c7 Check certificate nullity instead of handle
This changes tests which use QSslCertificate::handle() to determine
if a certificate is null to use QSslCertificate::isNull() instead.

This is required for non-OpenSSL backends which do not actually
expose a private handle.

Change-Id: I9523ba0dd00d47ba337b543ad34840125db99bfb
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-08-28 13:33:46 +02:00
Friedemann Kleint
4354fef3d4 Windows: Prevent hidden transient children from being re-shown by Windows.
Bring back code from Qt 4 to handle WM_SHOWWINDOW / SW_PARENTOPENING
correctly.

Task-number: QTBUG-40696
Change-Id: If018bf90573f495dbe32d0c46f522ccde0691ebb
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-28 13:26:06 +02:00
Jędrzej Nowacki
918038ad57 Mark QByteArrayList as metatype built-in type.
As a side effects it also adds core templates types to the tests

Change-Id: I0e3338e0bffdf21982aa83d404c83288e54411f4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-28 10:13:04 +02:00
Andrew Knight
ecbf6dfbf5 ssl: Share the host name matching utilities
This moves the socket backend's host name matching functions up to
QSslSocketPrivate so that they can be shared between backends. This
works, as there is no OpenSSL-specific code here.

Change-Id: I73c2081fdc2e60a44c90e90800d1e1877391a626
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-27 15:03:58 +02:00
Friedemann Kleint
92c7cb8155 Close popup widgets when wheel events are received
Task-number: QTBUG-40656
Change-Id: I134b07705744c23af9718dee486ab5e9ad4352cf
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-08-26 19:58:56 +02:00
Robin Burchell
6aa1b6e015 tst_qtreewidget: Skip test that crashes on Wayland.
Change-Id: I6cc2eb90df57eb5c33d3a93920ea719b5e2cfc0d
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-25 23:23:26 +02:00
Robin Burchell
f10eda7cb5 tst_qtreeview: Skip test that crashes on Wayland.
Change-Id: Iff2499dff1906a7c65fc5c007b96675f4bac2b42
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-25 23:23:20 +02:00
Shawn Rutledge
0ce707d1d5 QColorDialog manual test improvements
Show debug output for rejected and currentColorChanged signals,
because accepting is not the only scenario to be tested.

Task-number: QTBUG-40855
Change-Id: If741ab19392e7d4314e0eff82a939d202ae86b48
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
2014-08-25 17:04:47 +02:00
Morten Johan Sørvig
30bb830fc1 OS X: Fix pan gestures.
The QPanGesture recognizer requires single-point touch events. The touch
implementation in Qt 4 would test Qt::WA_TouchPadAcceptSingleTouchEvents
and forward single touch events if set.

Making this work in Qt 5 is a little bit more involved since the platform
plugins don't know about widgets.

Change the Cocoa touch implementation to send single-point touch events
to QWidgetWindow windows only. Make QApplication forward single-point
touch events only if the target widget has the
Qt::WA_TouchPadAcceptSingleTouchEvents attribute set.

Task-number: QTBUG-35893
Change-Id: I68712a5e3efb4ece7a81ca42f49c412e525eeb3a
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
2014-08-25 16:07:36 +02:00
Allan Sandfeld Jensen
7dce962200 Add operator-> to QJson iterators
The iterators for QJsonArray and QJsonObject are currently lacking an
operator-> definition. Unfortunately it is not possible to do in clean
way without redefining either the iterators or QJsonValueRef class.

This patch instead adds two fake pointer classes that are only used
to handle the operator-> return value.

Task-number: QTBUG-29573
Change-Id: Ief785a6afbbedc9e89cf3b6f3958c2c755997a66
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2014-08-25 16:03:42 +02:00
Jeremy Lainé
4040bc21ab Added QAsn1Element
This element can be used for backends that do not offer all the
information that is needed when implementing a ssl certificate backend.
WinRT and the SecureTransport lack functionality in this area for
example.

The sources and tests are added for ssl and openssl configurations in order
to be tested. The condition for adding these can be changed as soon
as they are used by an actual implementation

Change-Id: I2b836133105afdc178bf3b1ee7d732bea069effa
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-08-24 06:01:05 +02:00
Robin Burchell
3ef985ecb7 tst_dialog: Skip test that doesn't pass on Wayland.
Wayland does not support QCursor::setPos.

Change-Id: Ic50bc31944db70605af01529cc2b7483dfc334a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-23 13:50:47 +02:00
Robin Burchell
722fd511a2 tst_qtouchevent: Skip tests that fail with qwindow-compositor.
Change-Id: I6b37e04b8a25942f36ae09a8b0c6a3e3610eec19
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-23 13:50:39 +02:00
Robin Burchell
26edb0d315 tst_qwindow: Skip tests that fail with qwindow-compositor.
Change-Id: I95d180cfa30b7398344f5a851e0bf849e7834a7a
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-23 13:50:36 +02:00
Robin Burchell
bcea65851c tst_qinputmethod: Skip tests that fail with qwindow-compositor.
Change-Id: I0163bffe49e3fcbb8132c4926ec975e3a6979285
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-23 13:50:33 +02:00
Robin Burchell
b38eb2985a tst_qguiapplication: Skip tests that fail with qwindow-compositor.
Change-Id: Iac3e9e8d4d857af944de66a95cebc9955bd8beda
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-23 13:50:30 +02:00
Robin Burchell
7232b022c8 tst_qsqlthread: Add debug about when threads finished.
Useful if someone is ever forced to try diagnose what goes wrong with this test.

Change-Id: I4b5e607e6329b6ebad2b40b3f65d6cacbb6b7fcf
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2014-08-23 13:50:27 +02:00
Robin Burchell
0da4ddfcc5 tst_QWidget: Skip tests that don't pass with qwindow-compositor.
Everything else passes, after some pending fixes in QtWayland.

Change-Id: Ibd8efcaab8c5210111854f1a7362434046a62898
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-20 21:45:15 +02:00
Robin Burchell
69b256285b tst_qsqlthread: Move manual qWait calls into QTRY_VERIFY
Reduces the average runtime of this test for me by ~600ms, but due to the
threading variance the exact reduction is hard to tell.

Change-Id: I96a9f949ae2381f69d9364e6637db0db4bd3b165
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-08-20 21:45:01 +02:00
Laszlo Agocs
28add98e24 Skip the expose region test on Windows
In some CI configurations this fails from time to time. Have to disable
it unless we can make it more robust somehow.

Change-Id: Iadd8904d7223a6aeff53dafa36b94df3f60e1ad8
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-20 18:03:44 +02:00
Konstantin Ritt
7304c9a4e8 Make HarfBuzz-NG the default shaper on all platforms
[ChangeLog][Important Behavior Changes] HarfBuzz-NG is now the default
shaper on all platforms. This results in a better shaping results
for various languages, better performance, and lower memory consumption.

Task-number: QTBUG-18980
Change-Id: I4d9454fc37e9050873df3857e52369dfc7f191b2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
2014-08-20 10:10:40 +02:00
Robin Burchell
2e2374a226 tst_qsqlthread: Replace sched_yield calls with QThread::yieldCurrentThread.
Makes the test behavior identical across all platforms.

Change-Id: I5e564598d8e61588af2b73f04b4ca7c9b899c02a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-19 18:51:44 +02:00
Frederik Gladhorn
41f496cb7f Accessibility: QSpinBox should not have any children
On both iOS and Android it is very confusing to be able to move the focus to both, the line edit and the outer frame that is the spin box.
For Linux this fixes an issue that orca would not read the value correctly after pressing the up/down buttons.

Task-number: QTBUG-39861
Task-number: QTBUG-39442
Change-Id: I73c50c91e9021324c52d168d537afd0ea719a48f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-19 14:23:13 +02:00
Maurice Kalinowski
2ffcf3a423 WinRT: Fix QSettings auto-tests
WinRT is a sanboxed environment, hence files can only be created in
some writable location.
For some tests we reset the current directory to minimize the required
changes. We cannot do this for the application lifetime as the test
also has cases where it reads files relative to the executable inside
the sandbox.

Change-Id: Ib9d37c8cffd191f0d1055f835c11d10887923378
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-08-19 08:58:01 +02:00
Robin Burchell
3be048826f tst_qdbusabstractadaptor: Reduce qWait() usage.
Convert qWait to QTRY_ where we can, and make the qWait durations explicit (not
buried in a function call, but inline in the actual test) where we can.

Total runtime for me goes from 91 seconds to 2 seconds.

Change-Id: I45b3562cb94721a521718365fd51a4172a2e4e18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-19 04:09:24 +02:00
Giuseppe D'Angelo
75b62f3a17 Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-08-19 00:42:00 +02:00
Robin Burchell
ef1ee956c1 tst_qmouseevent_modal: Replace some qWait with QTRY_VERIFY.
Takes the total time for this test from ~1.2 seconds to ~0.42 seconds for me.

Change-Id: I426e600a7afe01d7343108b432eda8b83d6f3d85
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-08-18 20:57:23 +02:00
Robin Burchell
e8012b0405 Remove some manual qWait and use QTRY_VERIFY instead.
This takes 300ms off the total time for this test.

Change-Id: I230b8a58315797a81579f6a07da282b0dc40637d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-08-18 20:57:20 +02:00
Robin Burchell
87bc094611 tst_qstatusbar: Use a timer and remove some unnecessary waits to reduce test time.
Time taken by this testcase reduced from 7 seconds to 5.1 seconds for me.

Change-Id: I93b1c5fbc7d9d6515c9ce51a64fdd5c2ffbd54c8
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-08-18 20:57:09 +02:00
Shawn Rutledge
2f9c00d9a0 Tablet manual test: show rotated ellipse if the stylus has rotation
Followup to da9e02eb83:
If the stylus is a Wacom Art Pen for example, the regular_widgets
test will show a rotated ellipse with size proportional to pressure
for each tablet point, instead of a circle.

Task-number: QTBUG-39458
Change-Id: I4bbb5f8ceabf7006928d95df3ecd62378394f085
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-08-18 16:51:42 +02:00
Robin Burchell
74805930d1 tst_qwindowcontainer: Convert some QVERIFYs to QCOMPAREs
So when they fail it's easier to figure out why.

Change-Id: I7e76a6e0b8076ede30a6bb9049a031063c569dfc
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-18 13:53:01 +02:00
Robin Burchell
037125ee4a tst_dialog: Convert some QVERIFY to QCOMPARE.
Change-Id: Ibca62cf9dd2e19e32388d19f0c7b34fb7fd81268
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-18 13:52:58 +02:00
Robin Burchell
ac1f1c42c7 tst_qlistview: Convert some qWaits into QTRY_* usage.
This takes the total runtime of tst_qlistview for me from ~47 seconds to ~10
seconds.

Change-Id: Ie6fe95fe0852c2de37e99c2ad02230de78e0995e
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-18 13:52:54 +02:00
Andrew Knight
8c864ac498 winrt: Add partial SSL key support
This allows for opening of public key files. It does not, however,
support opening private keys (or decrypting/encrypting them). This is
due to limitations in the native API.

Nearly all public key tests pass (the native API doesn't support the
40-bit key in the test set). The private key tests are expected to fail.

Task-number: QTBUG-40688
Change-Id: Id8f2f1ae6526540736ceb2e5371f6a5d80c4ba7b
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-08-13 21:09:51 +02:00
Ivan Komissarov
6c3c1a4cb8 Add the QStorageInfo class
Allows to retrieve information about mounted volumes such as label,
total/available size, filesystem type and so on.
Possible use cases are:
- allows to do checks about filesystem before performing actual
  operation (such as available/maximum volume size)
- allows to retrive information about volume that can be shown in file
  dialogs
- allows to retrieve volume for specific path and check if two or more
  paths belong to the same volume or not

[ChangeLog][QtCore] Added QStorageInfo class to retrive information
about mounted volumes and drives

Change-Id: Ibf9c2e6b53ef39c5605894a4422acdbbca4030c4
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-08-13 16:09:58 +02:00
Maurice Kalinowski
091653e9e7 Implement native settings format for WinRT
WinRT stores settings inside the app bundle, not in the registry.
Some tests are not fully functional due to errors in the file
implementation (See QTBUG-40588).

QSettings::SystemScope translates to a roaming container on WinRT,
meaning that settings stored inside there should be uploaded and
shared among devices. However, this is untested so far.

The tests have been updated for those platforms which do not store
the order of keys. This has been done on some locations only so
far, but needed to be done on more places for WinRT.

Task-number: QTBUG-33498
Change-Id: Ifd0194387b09c220d31812b4b6fd0ce9a7d84d24
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-08-13 09:40:56 +02:00
Frederik Gladhorn
fc931e5595 Accessibility: Fix boundaries for text functions in QLineEdit
Make the functions work consistently. For example asking for the line at
the cursor position when the cursor was at the end returned an empty
line before.

Task-number: QTBUG-38500
Change-Id: I60fc78c7be129a59c83efcfce6d8fdd16f2c3f65
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-13 09:07:04 +02:00
Frederik Gladhorn
ca524e5b70 Merge remote-tracking branch 'origin/5.3' into 5.4
Manually included changes from
3a347a4e70
in src/opengl/qgl.cpp.

Conflicts:
	src/opengl/qgl_qpa.cpp
	src/plugins/platforms/android/androidjnimain.cpp

Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
2014-08-12 13:05:02 +02:00
Laszlo Agocs
b08cc0ec6f Make the expose region local on all platforms
QExposeEvent::region() reports a region in a random coordinate system.
The behavior is undocumented and the platform plugins do different things.

xcb, offscreen and ios are correct. These set the region in local coordinates,
which is the most logical interpretation of the expose region.

windows is almost correct, except for one occurrence.

cocoa and others need changes: passing in geometry() as the exposed region is
always wrong.

The patch documents the expected behavior both for QExposeEvent and
internally in QWindowSystemInterface. The problematic plugins are fixed to
use local coordinates.

Task-number: QTBUG-40470
Change-Id: I6ded3154d14254fa71d4292d8e1b5e6cf696c81a
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-12 07:47:32 +02:00