Commit Graph

4969 Commits

Author SHA1 Message Date
Thiago Macieira
c250a0ec3a Unify and optimize QByteArray::to{Upper,Lower}
Do a check first if we need to transform before doing the transform.
This means we won't detach when transforming data that is already
correct.

And instead of using QChar, use our own hand-rolled table. In a proper
LTO build, the QChar calls would be resolved to a lookup of the Unicode
data, but not many people do LTO builds, Therefore, this means a great
speed-up is achieved by simply avoiding the function call. The extra
gain in performance comes from the simpler translation table instead of
the more complex full-Unicode data.

Also as a consequence, this changes the handling of two characters in
Latin 1: 'ß' should be uppercased to "SS" but we won't do it, and 'ÿ'
can't be uppercased in Latin 1 ('Ÿ' is outside the range).

Benchmarking is included. Comparing the Qt 5.4 algorithm to the new code
is almost 20x faster. Other alternatives are included in the benchmark
and are all faster than the current code, though slower than the new
one. While all of them could compress the tables to be smaller or shared
between uppercasing and lowercasing, they would also expand to more code
(though probably less than the extra bytes required in the full
translation table). In the trade-off, I decided to go with simplicity
and most efficient code.

Change-Id: I002d98318d236de0d27ffbea39d662cbed359985
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-19 03:39:05 +02:00
Frederik Gladhorn
d5bf787fc0 Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: Ia03a010d1fbfc89c04144c1c106336f0e1c45ec1
2014-08-18 15:25:11 +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
Frederik Gladhorn
b2a7d865b2 Update IAccessible2 to 1.3.0
In addition change to the one in all file instead of individual
interfaces. Future updates only have to copy the new version of
ia2_api_all.idl and run nmake.

Change-Id: Ie7a1e65c8dd0c73809ac97aae2d586f425337f18
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-08-13 16:51:27 +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
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
Thiago Macieira
db851ed5d1 Trim the QString benchmark test
The comparison, Latin 1 and UTF-8 benchmarks contained in this file are
stale. The implementation changed in Qt 5.3 and this benchmark couldn't
be updated (test data too large for Qt).

Please contact Thiago Macieira to obtain the benchmarks and test data.

Change-Id: I48c19b1f1711eb73c953a30ed4da510e97a62472
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-09 15:36:36 +02:00
Thiago Macieira
e319196f76 Ensure that qCleanupFuncinfo works with some C++11 new constructs
This commit adds tests for ref-qualified member functions, the new
syntax for functions and decltype.

__PRETTY_FUNCTION__ for lambdas varies wildly between compilers and will
produce really bizarre results after cleanup. It's not tested and is
known to be broken.

Change-Id: I70c8dbcba54790357cecba35aa45c5cc672f29d1
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-09 15:35:59 +02:00
Marc Mutz
e41b45f1ae QPair: add constexpr liberally
On templates, adding constexpr makes a given instantiation constexpr
if it can be.

This turns qMakePair(0,0), say, into a compile-time constant.

The effects on existing code are small, but exist:

  $ size lib/*{-baseline,-paircexp} | sort -nr
  6516727  211192    2608 6730527  66b31f lib/libQt5Widgets.so.5.4.0-baseline
  6516711  211192    2608 6730511  66b30f lib/libQt5Widgets.so.5.4.0-paircexp
  5373720   44492   15976 5434188  52eb4c lib/libQt5Core.so.5.4.0-baseline
  5373504   44492   15976 5433972  52ea74 lib/libQt5Core.so.5.4.0-paircexp
  5107206  125072    6080 5238358  4fee56 lib/libQt5Gui.so.5.4.0-baseline
  5107030  125072    6080 5238182  4feda6 lib/libQt5Gui.so.5.4.0-paircexp
  1341290   30180    2600 1374070  14f776 lib/libQt5Network.so.5.4.0-baseline
  1341210   30180    2600 1373990  14f726 lib/libQt5Network.so.5.4.0-paircexp
  # no other libraries benefit

[ChangeLog][QtCore][QPair] Can now be used in C++11 constexpr contexts.

Change-Id: I3872e6aa33a7d02a168516f4dfa7119efcac8c40
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-09 09:06:16 +02:00
Thiago Macieira
dcf9883dff Move the special QByteArrayList methods into QList
and make QByteArrayList be a simple typedef.

As a side-effect, the constructor taking a QByteArray is no longer
available since I couldn't find a way to add it to QList<T> when T is
QByteArray. My template-foo failed me. I tried:

 - QEnableIf<is_same<T, QByteArray>::value, QByteArray>::type
   => makes QList fail to compile for any T that isn't QByteArray
 - make the constructor a template member
   => it compiles if the parameter is a QByteArray, but not a const
      char[4] like the test was
 - inheriting constructors
   => runs into ICC and Clang bugs that I could not work around

Besides, the constructor with std::initializer_list is a superior
solution anyway.

Change-Id: Ic86fbadc1104142bfd907a5c4147199bf839fb89
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-09 09:05:43 +02:00
Marc Mutz
2431bf1b20 QPixelFormat: don't inherit it
Instead of abusing inheritance to provide convenience constructors,
use simple inline constructor functions. The name got a lower-case
q to indicate a free function. The usual fromXYZ() static methods
were deemed not fitting in this case in the initial round of review,
since they implied some kind of conversion while these functions are
simply constructors of formsts, which contain no data.

This also solves the problem that some of these ctors could have been
called with just one argument and were therefore candidates for hidden
QPixelFormat temporary injection.

QPixelFormatRgb was renamed to qPixelFormatRgba to explain the third
argument at the call site better.

There seem to be no users of this class in qt5.git at this time.

Change-Id: Ib4fe8ceb2d30744127b116a748724a3406400eb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-09 09:05:24 +02:00
Glen Mabey
35105f173e Long live QByteArrayList!
Initial submission of a new class QByteArrayList with the
purpose of aggregating and then joining QByteArray instances.

[ChangeLog][QtCore] Added new QByteArrayList class.

Done-with: Marc Mutz <marc.mutz@kdab.com>
Change-Id: I503af58f125d7f44fef10360177490c933e5840f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-09 09:01:41 +02:00
Keith Gardner
a332322de9 Long live QVersionNumber!
The class provides compare operators, stream operators, and hashing
functions. This class aims to be compatible with (but not restricted to)
the Semantic Versioning 2.0 standard (semver.org).

[ChangeLog][QtCore] Added QVersionNumber class

Done-with: Marc Mutz <marc.mutz@kdab.com>
Change-Id: I244c8ccc002909af03987a2df052734d1a8621a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-09 09:00:24 +02:00
Frederik Gladhorn
1e2af80785 Fix int conversion to string
clang warning: adding 'int' to a string does not append to the string

Change-Id: I6dc393269a52e9482fde106c17132336cf5ce226
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-08 10:45:53 +02:00
Takumi Asaki
8e3aacf61b OS X: Remove mnemonics in parentheses
In some language, mnemonics put after label text within parentheses.
e.g. "&Open" is translated to "開く(&O)" in Japanese.

OS X doesn't use mnemonics and '&' in label text is removed.
Mnemonics in parentheses (and spaces before them) also should be removed.

Change-Id: I88c0a1f60af7e148b3cf24a4e215ce807d62bce3
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2014-08-08 10:44:29 +02:00
Laszlo Agocs
bb760d9514 Add support for glMapBufferRange in the wrappers and resolvers
QOpenGLBuffer::map() and related helpers are becoming useless in
OpenGL ES 3.0 and up: instead of the old GL_OES_map_buffer,
glMapBufferRange, but not glMapBuffer, is now part of the standard.
On desktop GL_ARB_map_buffer_range is present by default in OpenGL 3.0
and newer.

[ChangeLog][QtGui] Added QOpenGLBuffer::mapBufferRange().

Task-number: QTBUG-38168
Change-Id: I4e9bbe8ced9ee4d535ac32849a8c08c26d79cb49
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-08 07:29:53 +02:00
Laszlo Agocs
22e4391413 Add default format to QSurfaceFormat
Add defaultFormat() and setDefaultFormat() statics to QSurfaceFormat.
These define the default values for the requestedFormat members of
QOpenGLContext, QWindow and QOpenGLWidget (and implicitly QOpenGLWindow,
QQuickWindow, etc.)

This replaces QQuickWindow::setDefaultFormat() which can now be removed.

The main inspiration here is not the convenience (avoiding setFormat() calls
for all windows/widgets), but robustness: by setting the format once at the start
of the application, all windows and contexts, including the internal share context
used by QOpenGLWidget and QQuickWidget, will use the same format, eliminating
the possibility of failing due to trying to share between incompatible contexts.

Furthermore, since such a functionality is anyway mandatory for QQuickWindow
(due to the possibility of creating windows from QML code), extending it to
QSurfaceFormat and QOpenGLContext/QWindow is the next logical step.

Change-Id: Ie94486adc489d17fecfcebb7050fecedffd2688b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-08 07:29:29 +02:00
Marc Mutz
7f78d547ca QCommandLineParser: support extremely concise option configuration in C++11
The goal of this commit to make the code in the test work:

    QCommandLineParser parser;
    parser.addOptions({
        { "a",                "The A option." },
        { { "v", "verbose" }, "The verbose option." },
        { { "i", "infile" },  "The input file.", "value" },
    });

For this, QCommandLineParser needs a version of addOption that can
take a list of options. That's what addOptions() is for.

More importantly, the QCommandLineOption ctors mustn't be explicit.
OTOH, any implicit conversion from QString or QStringList to
QCommandLineOption is also undesirable.

To solve this dilemma, add new QCommandLineOption ctors that just
take one argument and are explicit, and make the existing ctors
implicit. In order to avoid ambiguities, remove the default values
of their resp. 2nd arguments. The new ctors are by intention not
\since 5.4, as they are completely transparent to the user.

Et voila, even better than getopt_long(3).

[ChangeLog][QtCore][QCommandLineParser] Added addOptions() method.

Change-Id: I5e779f3406cd0f6c8ec6ecbf6c8074af226de300
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-06 22:17:22 +02:00
Marc Mutz
18bb58a5a6 QProgressDialog: fix setBar() not properly adopting the new QProgressBar
The "adoption" code is taken from setLabel().

Task-number: QTBUG-40503
Change-Id: Id512b28eb756b4a80e5701e599e2cbdf5346ff62
Reviewed-by: David Faure <david.faure@kdab.com>
2014-08-06 14:55:36 +02:00
Jędrzej Nowacki
1fceabe8c7 Implement QStringRef::split
[ChangeLog][QtCore] Added the QStringRef::split() function

Change-Id: I28709c9761785dea7be4e7d621ecf4e1ae007a72
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-06 14:04:40 +02:00
Marc Mutz
8b75ae4b82 Add a test for some copy semantics to QPalette
It isn't a thorough check of all the mutable methods for detaching, but a start.

Change-Id: I523fd30d3459186654e12fd25c384ed990ab7a00
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-08-06 13:52:30 +02:00
Marc Mutz
de8a9dee5a QPalette: add move constructor
As with many other implicitly shared classes, efficient move semantics
requires setting the d-pointer to nullptr, which then needs to be checked
for in the dtor and the copy assignment operator.

Change-Id: I654d181a1dfdd9a16e2f9fb96b57475cdd0b4561
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-06 13:52:24 +02:00
Friedemann Kleint
088e9bbb4b QHeaderView::restoreState(): Add sanity check.
Read data into local variables and apply only after a check.

Task-number: QTBUG-40462
Change-Id: Id06060d0d5b0eafc2d303526a86d552ff5747a72
Reviewed-by: David Faure <david.faure@kdab.com>
2014-08-06 06:28:39 +02:00
Marc Mutz
559a72e4b6 QtConcurrent::run: allow to select the thread pool on which to run the task
This is the second and last part of the forward-port of
https://qt.gitorious.org/qt/qt/merge_requests/1281

[ChangeLog][QtConcurrent] run() now optionally takes as its first argument
the QThreadPool to run the task on.

Task-number: QTBUG-17220
Change-Id: I4b46eca6ef7de9cd34dac07e6d4b8ad830426b97
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-05 18:05:04 +02:00
Marc Mutz
c55aec2ed7 QFutureInterface: allow to work with a QThreadPool != globalInstance()
Background:
It is often necessary/advisable to schedule tasks on thread pools !=
globalInstance(). As Herb Sutter writes in
http://www.drdobbs.com/parallel/use-thread-pools-correctly-keep-tasks-sh/216500409
and the Qt Training Material stresses, tasks you schedule on a (global)
thread pool should be non-blocking, which currently rules out using any of
the QtConcurrent functions for, say, file I/O.

Nonetheless it's often convenient to have thread pools also for file I/O, as
the thumbnail viewer exercise in the Qt Training Material shows. In this
case, you'd use a dedicated thead pool, leaving the global thread pool for
CPU-bound tasks.

Yet, none of the QtConcurrent functions allow to pick the QThreadPool
instance on which to schedule the work created with them.

This patch prepares for them to do so.

This is the first part of the forward-port of
https://qt.gitorious.org/qt/qt/merge_requests/1281.

Implement by using a new QThreadPool* member that defaults to nullptr,
and adding setThreadPool to set this member, then using it in lieu of
QThreadPool::globalInstance() everywhere.

I chose to leave m_pool == nullptr to mean globalInstance() to avoid
creating the global instance whenever a QFuture is created, even if the
future represents the result of a calculation not run on the global thread
pool.

[ChangeLog][QtCore][QFuture] Can now be used with any QThreadPool, not
just globalInstance().

Task-number: QTBUG-17220
Change-Id: I4e1dc18d55cf60141b2fa3d14e2d44a3e9e74858
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-05 18:04:56 +02:00
Olivier Goffart
27b67c5399 Logging: use the known function when the first frame of the backtrace is unknown
Change-Id: Ia591805c82e7bf77dc7af04f1054c7daca58eb6a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-05 16:52:34 +02:00
Laszlo Agocs
34fbc61f22 Introduce QRasterWindow
A simple convenience class providing a QWindow that has a
paintEvent and supports opening a painter on itself. It
behaves exactly like QOpenGLWindow in this respect, which is not
surprising since they share the same base class (QPaintDeviceWindow).

QRasterWindow does not however have any OpenGL dependencies and will
be present in -no-opengl builds too.

[ChangeLog] Added QRasterWindow, a thin convenience wrapper for a
QWindow on which a QPainter can be opened.

Done-with: Jorgen Lind <jorgen.lind@digia.com>
Change-Id: I37e82720492945d7b85d5f713eea8d5f7556e511
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
2014-08-05 16:47:42 +02:00
Laszlo Agocs
e48737ae77 Introduce QOpenGLWindow
[ChangeLog] Added QOpenGLWindow. This serves as a convenience class for
creating windows showing OpenGL content via an API similar to QGLWidget
and without any widget dependencies.

Done-with: Jorgen Lind <jorgen.lind@digia.com>
Task-number: QTBUG-36899
Change-Id: I52e9bc61acb129dbfd3841b3adeffab2dbcf7f05
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-08-05 16:47:37 +02:00
Frederik Gladhorn
b53e08e335 Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/dev 2014-08-05 16:47:13 +02:00
Andrew Knight
a93bfc1ebe Remove d3dcompiler_qt
This library was created as a work around for limitations on Windows
Phone 8.0, which will not be supported going forward (Qt 5.4). Therefore,
we no longer need (or want to maintain) this experimental feature and
should remove it from the repository.

Change-Id: Ia417833f9de43e2d3e0940df93625e7d87a555ea
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2014-08-05 16:44:13 +02:00
Friedemann Kleint
61269c26f6 Fix cmake-test for Dynamic OpenGL.
Change-Id: I604501d07b4728c5158e88a6760b9f1e31311991
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-05 06:34:33 +02:00
Frederik Gladhorn
0936bc54f9 Merge remote-tracking branch 'origin/5.3' into dev
Conflicts:
	config.tests/arch/arch.cpp
	src/opengl/qgl_qpa.cpp
	src/widgets/kernel/qapplication.cpp

Change-Id: I80b442a4c2c9632743a5b5c7319ff201ec5bc4fd
2014-08-04 09:51:36 +02:00
Laszlo Agocs
e453484bca Make QOpenGLWidget public
QOpenGLWidget is now public.

In addition Qt::WA_AlwaysStackOnTop is introduced to support the
special case of semi-transparent QOpenGLWidget or QQuickWidget on
top of regular widgets.

hellogl_es2 becomes the qopenglwidget example. This example performs
painting both via QPainter and native GL commands and has the OpenGL
widget combined with other, normal widgets.

The widget stack receives some changes when it comes to renderToTexture
widgets like QQuickWidget and QOpenGLWidget. Calling update() will now
result in a paint event, which is essential for QOpenGLWidget since we
want it to behave like a regular widget. The dirty region handling is
extended specially for such widgets due to performance reasons.
(an OpenGL content update must not result in any backingstore painting,
and is thus handled as a different kind of dirtiness)

[ChangeLog] Added QOpenGLWidget. This widget serves as a replacement for QGLWidget.

Task-number: QTBUG-36899
Task-number: QTBUG-40086
Change-Id: Ibf7f82fea99b39edfffd2fc088e7e0eadbca25cf
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
2014-08-01 17:13:59 +02:00
Marc Mutz
ce6a949c79 tst_QTimeZone: test QTimeZonePrivate::isValidId()
This is in preparation of rewriting the function for efficiency.

Change-Id: Id5c16b984b95d76e1f26d862e3813f75980f44fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-07-31 21:05:07 +02:00
Marc Mutz
b88d4b0384 Add a test for move assignment to tst_QPalette
It was simply missing.

Change-Id: I6645bb9fe9c81aec9c46ac5efc7d2295a3784ff6
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-31 21:04:43 +02:00
Allan Sandfeld Jensen
d8dc664b94 Ensure valid data after QImage::invertPixels
QImage::invertPixels may produce invalid data after inversions of
images with premultiplied alpha, because the inverted colors will be
larger than the alpha.

This patch converts any image with a premultiplied alpha channel to
ARGB32 before inverting the pixels, and then back to the original
format after the inversion.

Support is added for correct inversion of RGBA8888 and RGB30 formats.

Task-number: QTBUG-39901
Change-Id: Ief24c55f495e67ef2ad6429b5b418d02963a64dd
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-07-31 20:16:09 +02:00
Friedemann Kleint
8c336845ca tst_qwidget: Fix geometries.
Use sizes relative to the test widget size; move windows relative
to the top left point of the available screen geometry. Set a window
title on widgets to be able to identify them. The test now
passes on Windows using a 4K monitor.

Task-number: QTBUG-38858
Change-Id: I5df9198e390befeb3ca18796e24180135a084aad
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
2014-07-31 18:36:17 +02:00
Friedemann Kleint
dd99c10c56 tst_qwindow: Fix geometries.
Use sizes relative to the test window size; move windows relative
to the top left point of the available screen geometry.
The test now passes on Windows using a 4K monitor.

Task-number: QTBUG-38858
Change-Id: Ia8d992f2a9bfa1cb1deacaf918ed0cfff7616959
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2014-07-31 18:36:05 +02:00
Shawn Rutledge
da9e02eb83 QTabletEvent manual test: show buttons, pressure, eraser
- Show which button was pressed or released
- Render an ellipse proportional to pressure for each point drawn
- Different color for the eraser
- More complete output for each event
- Don't show mouse events by default, just as most tablet applications
  can now ignore mouse events on the drawing canvas.  But for the
  purpose of testing interleaving of tablet and mouse events,
  one can give the argument --mouse when starting this program
  to show them too, as before.

Task-number: QTBUG-39458
Change-Id: I5e03f1aa748be39d524bd6984ff5d66579787cf9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
2014-07-31 12:20:34 +02:00
Jędrzej Nowacki
f5c3126201 Add QString::splitRef functions.
The functions can be used to optimize code that do not need to use
the split results as QString directly.

[ChangeLog][QtCore] QString can now split a string to a list of
QStringRef.

Change-Id: Ic2dc929e1fba82f9a060e37c51068a301cb5b866
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-07-31 08:50:22 +02:00
Marc Mutz
c7386938b4 QProgressDialog: make the cancel button retranslate on LanguageChange
It is documented to be, and the LanguageChange event is caught and processed.
However, retranslateStrings() uses QProgressDialog::setCancelButtonText(),
which unconditionally sets useDefaultCancelText=true, blocking any further
changes to the button text by subsequent LanguageChange events.

The fix is to use extracted QProgressDialogPrivate::setCancelButtonText()
which - quite intentionally - doesn't set useDefaultCancelText.

Task-number: QTBUG-40504
Change-Id: I6e701deda10c454cb088c0b0778ac2d6adff574a
Reviewed-by: David Faure <david.faure@kdab.com>
2014-07-30 23:41:01 +02:00
Marc Mutz
e2331c6f76 QProgressDialog: don't crash when setting the same {bar,button,label} again
The associated test has unearthed that setBar() fails to make the new bar a child
of the progress dialog. This will be fixed in a separate commit.

Task-number: QTBUG-40502
Change-Id: I2d09ebb07ae6395449a4efe38a638df831eebdd7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-07-30 23:39:24 +02:00
Marc Mutz
41dae1e33a tst_QProgressDialog: enable topLevelWindows() check in cleanup()
Detects widget leaks.

Change-Id: Ia2287debc96a5b87b224b887661679eba8622dc0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-07-30 23:38:35 +02:00
Marc Mutz
f5b9c38a9f Clean up tst_QProgressDialog
Remove empty ctor and dtor.

Change-Id: Ib89f463eb2623bbb66cc3faa2ab2d5992810f153
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2014-07-30 23:38:12 +02:00
Frederik Gladhorn
4010cfbf2d Merge "Merge remote-tracking branch 'origin/5.3' into dev" into refs/staging/dev 2014-07-30 22:52:15 +02:00
Frederik Gladhorn
d71f9d8c05 Accessibility: Top level widgets should only be in the hierarchy once
On Linux for example Orca gets confused when showing a dialog that is a
child of another widget since it would show up twice in the hierarchy.

Task-number: QTBUG-39444
Change-Id: I84773ecc3d6774a652dbeb29ad201779f5b3191c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-07-30 20:52:41 +02:00
Allan Sandfeld Jensen
d702ba20e5 Support RGB30 formats in OpenGL framebuffers and paint engine
This patch adds support for binding RGB30 images as textures, and as
internal format of framebuffer objects. Together with the
QOpenGLPaintDevice
this provides support for rendering to and from RGB30 in full precision.

[ChangeLog][QtGui][QOpenGLFramebufferObject] Support 10-bit per color
channels formats as the internal framebuffer format, making it possible
to render in that precision.

Change-Id: I06de2d12dfe1c1adc466d574fdffbc77f88f4f16
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-07-30 20:03:09 +02:00
Thiago Macieira
5d11688d02 Fix QByteArray::to{Upper,Lower} when the array contains embedded nulls
[ChangeLog][QtCore][QByteArray] Fixed a bug that would cause QByteArray
to stop converting toUpper or toLower at the first embedded null
character.

Change-Id: Ia369037206617813d86a8f1489589243c82aa51b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-07-30 19:48:41 +02:00