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>
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>
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>
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>
With SHA1 47b3ecf3f4 some tests got
commented out by accident. This re-enables those tests.
Change-Id: If9c7d8a672b66086895a0383fe87d3101fb146fb
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
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>
The "adoption" code is taken from setLabel().
Task-number: QTBUG-40503
Change-Id: Id512b28eb756b4a80e5701e599e2cbdf5346ff62
Reviewed-by: David Faure <david.faure@kdab.com>
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>
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>
This commit reverts c4cef6fae9.
The above fix for QTBUG-25958 (cloned in QTBUG-40219) is not
complete and introduces the regression QTBUG-30049.
Task-number: QTBUG-30049, QTBUG-25958, QTBUG-40219
Change-Id: I3c4b774dce06c13cb4e089f8413a7747cedfd212
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
Add a test that checks that QHash keeps the first of the keys
that compare equal. This may or may not be documented, but is
inconsistent with the values in a QHash, where the last element
with equal key is kept.
Document this as a test. That way, we'll be informed when the
behavior changes (e.g. by a port to std::unordered_map).
Do the equivalent checks in tst_QMap, too. There, of course,
instead of equal keys, check equivalent ones.
Change-Id: I2c5f04f8e8a6bbc7dbaadadd878a4c876e4df042
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
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>
[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>
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>
Add a test that checks that QSet keeps the first of the elements
that have equal value. This is documented, but inconsistent with
values in a QHash, which keeps the last element with equal key.
Document this as a test. That way, we'll be informed when the
behavior changes (e.g. by a port to std::unordered_set).
Change-Id: I4ca1718bb86599b925b3ccd13b0856917cd4ce67
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
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>
This is in preparation of rewriting the function for efficiency.
Change-Id: Id5c16b984b95d76e1f26d862e3813f75980f44fb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
[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>
Use the built-in hex, showbase manipulator to format the number in
hex. Also, apply nospace() only once.
Change-Id: Id4b3d5f082ad13f52c8711408d7ec609bec3a621
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Export the former qMessageFormatString() as qFormatLogMessage(). This
allows custom message handlers to format their messages just like the
default message handler, taking qSetMessagePattern() /
QT_MESSAGE_PATTERN into account.
The method should arguably not add the '\n' at the end, which a follow
up commit will fix.
Change-Id: Ib2a9cfda91473df079daf03bf3197e6ac63e013e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
all else being equal, items with a higher numerical priority will appear
first in the result.
Change-Id: I4ee37ff404a53c4152a1e4fc2fc3c23ef525234d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
It allows to create a QJsonObject instance in C++ by using
initializer list of pairs QString QJsonValue, for example:
QJsonObject o = {{"property1", 1}, {"property2", 2}};
[ChangeLog][QtCore][QtJson] QJsonObject now supports
C++11 initializer lists.
Task-number: QTBUG-26606
Change-Id: I67af881e175f427e563e685336c48a5f8466b476
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Introduce function QMdiSubWindowPrivate::storeFocusWidget()
to store focus widget and call this when de-activating a
sub window. Change restoreFocus() to return a bool and call
it from QMdiSubWindowPrivate::setActive().
Task-number: QTBUG-38378
Change-Id: I18dbe66ce85213ca5b4907b5a09126544415351a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This function has been inlined in commit 4f50be8d,
but wasn't removed.
Change-Id: I1a4eb7399ab2dd87a9fb15c4c886004d777487a8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
On supported platform, allow to show a backtrace by using
%{backtrace} or %{backtrace depth=N separator="|"}
[ChangeLog][QtCore][Logging] QT_MESSAGE_PATTERN can include a
backtrace using %{backtrace}
Change-Id: Ib00418c070d3bd6fe846dc04bf69fa91ba64f9cd
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
If the test fails here, output the values actually used in comparison.
Change-Id: Ie4ed5ebdf1951c02b89a9648aee50a99d0bb0628
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is much more useful than the URL "file:", it allows to use
"empty path" and "empty URL" for the same meaning (e.g. not set).
QFileDialog actually uses "file:" though, as the URL for the
"My Computer" item in the sidebar. This patch preserves that.
[ChangeLog][QtCore][QUrl] QUrl::fromLocalFile now returns an empty URL
if the input string is empty.
Change-Id: Ib5ce1a3cdf5f229368e5bcd83c62c1d1ac9f8a17
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QJsonValue, while comparing two QJsonArrays, should consult also length
of the arrays, because a different than null base pointer doesn't mean
that an array is not empty.
Change-Id: If76739355a4e74b842e836289565f98d95c006d5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
QJsonValue, while comparing two QJsonObjects, should consult also length
of the objects, because a different than null base pointer doesn't mean
that an object is not empty.
Change-Id: Ibee1849ef9fed15d32f2c8f2aad9b053846e46b7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Before this change such code:
QJsonObject o;
o["blah"];
would create property "blah" and assign null value to it, while
this code:
const QJsonObject o;
o["blah"];
would not. The change unifies the confusing behavior. Now reading
a non-existing property, is not causing a property to be added
in any visible way.
Internally QJsonObject stores a special hash of undefined, but
referenced values. Such reference is supposed to not live long,
only to the first compacting or assignment.
Change-Id: Ib022acf74ff49bad88d45d65d7093c4281d468f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The operator should always return an undefined values for an empty
object
Change-Id: Ic38f7660d77c64b2d001967bc5109df4185db74a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Fix tests widgets leaking widgets and ensure it stays
that way by adding a check to cleanup().
Task-number: QTBUG-38858
Change-Id: I77a81d823c68cf0b4e51c2da55b1c473d6e4170b
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
No actual reason for this test, except my curiority. Then again, it's
good to have this check, too.
Change-Id: I815fce7e4dbe76e21cac29beb1dbfc1083191d24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
No actual reason for this test, except my curiority. Then again, it's
good to have this check, too.
Also checks that the last entry in the init_list "wins", which is
not how std:: containers work.
Change-Id: I4f7d1228f2b90a904b6c3f99e54afcd9970b723e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
No actual reason for this test, except my curiority. Then again, it's
good to have this check, too.
Also checks that the last entry in the init_list "wins", which is
not how std:: containers work.
Change-Id: Ia284d093cd0029432372630e81657fb687b9516f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This fixes high CPU load for upload devices that don't generate
a constant stream of data. Their readData() function was called all the
time without returning actual data.
This was noticed when implementing an upload device that emits data in
a limited way for bandwidth limiting.
[ChangeLog][QtNetwork][QNetworkAccessManager] Fixed high CPU load when handling
POST/upload QIODevice that generates data on readyRead().
Change-Id: Iefbcb1a21d8aedef1eb11761232dd16a049018dc
Reviewed-by: Richard J. Moore <rich@kde.org>
[ChangeLog][QtWidgets][QLineEdit] The signal textEdited() is now
emitted when the user clicks the clear button created by
setClearButtonEnabled() as well.
Task-number: QTBUG-40287
Change-Id: Iacd303ffd1533f27cfa68a6120cdd370e3d31ddc
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The old unix locking code is no longer working on unix since it locks on
a file descriptor, but QSaveFile creates a new file, and as a result we
get the lock on the wrong file. Also there is no need to keep the lock
held only for reading as QSaveFile is atomic. It just needs to be held
when doing a read before writing.
As a result, since we don't hold the same lock, there could be a race
with an application running an older version of Qt if they are writing
on the same configuration file.
[ChangeLog][QtCore][QSettings] Fixed data loss while writing the config
to the disk fails.
[ChangeLog][Important behavior changes] The locking mechanism inside
QSettings has changed and is no longer compatible with the one of
previous versions of Qt. There might be corruption if two applications
running different versions of Qt are writing to the same config file
at the same time. You must also now have write permissions in the
directory containing the settings file in order to write settings
Task-number: QTBUG-21739
Change-Id: I0844a5e96c8bc1e1222a3dac6cc48170ca77fe1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QRingBuffer is a fully inlined class used in many I/O classes.
So, it must be as fast and small as possible. To this end, a lot of
unnecessary special cases were replaced by generic structures.
Change-Id: Ic189ced3b200924da158ce511d69d324337d01b6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
The default in QTextStream is to use the C locale, so default
QTextStream are not affected. When you set a QLocale on it, the default
was to use group separators (which is the QLocale default too). This
commit makes QTextStream respect a QLocale in which the
OmitGroupSeparators option had been set.
Task-number: QTBUG-39956
Change-Id: I00fbe12fca7f0287c7217deb487ded6582a03b52
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Otherwise, when interrupting the test half-way (e.g. in gdb),
the user's ~/.config/QtProject.conf would be modified.
Change-Id: Id582c4a3fbf0acbed460126fccf0d39b3a09758a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
They shouldn't exist in the first place. They exist in two cases only:
1) mistake by the user in the QLibrary or QPluginLoader constructors or
setFileName
2) as a kludge for setLoadHints before a file name is set (we need to
store the user's requested hints somewhere)
This is important for the second case, as otherwise all QLibrary and
QPluginLoader objects without a file name would share the setting.
Task-number: QTBUG-39642
Change-Id: Iebff0252fd4d95a1d54caf338d4e2fff4de3b189
Reviewed-by: David Faure <david.faure@kdab.com>
This commit makes replaces the loadHints member with a setter, a getter
and an atomic variable. The setter will not set anything if the library
has already been loaded.
Task-number: QTBUG-39642
Change-Id: Ibb7692f16d80211b52aaf4dc88db1a989738a24d
Reviewed-by: David Faure <david.faure@kdab.com>
Allow to alter the default configuration for categories by passing a
message type: All message types with lower severity are disabled in this
category.
This is useful for libraries, which shouldn't mess with the category
registry itself: Setting rules, a category filter ... might cause
conflicts and ordering problems, so this API should be reserved to the
specific application.
For the Qt categories, we have code in the default category filter that
disables the 'debug' category. However, this is hardcoded, and there's no
way so far for other libraries to get the same behavior. With this patch
one can get the same behavior:
Q_LOGGING_CATEGORY(DRIVER_USB_EVENTS, "driver.usb.events", QtWarningMsg);
[ChangeLog][QtCore][Logging] Added QtMsgType argument to QLoggingCategory
constructor and Q_LOGGING_CATEGORY macro that controls the default
category configuration.
Change-Id: Ib2902f755f9f7285d79888ec30e8f3cef95ae628
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
~QDebug() removes any trailing space if autoInsertSpaces() is true.
However, if one uses QDebugStateSaver the global autoInsertSpaces might
be false, but a space was added by a custom operator<<.
Explicitly check for this in QDebugStateSaverPrivate::restoreState. Remove
any trailing space if the local state asks for adding trailing spaces, but
the original one doesn't. Add a trailing space if the local state doesn't
ask for one, but the global state does.
Change-Id: I243b5c76d5ed2c1ec4820da35ab6e254da1551d9
Reviewed-by: David Faure <david.faure@kdab.com>
Passing this flag to QFileDevice::map() will allow writes to the mapped memory
without modifying the file that was mapped. These writes will be lost when the
memory is unmapped.
Change-Id: I7d46b044fc370585de8c06fdb4059f1f1be12d7d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This was prompted by https://git.reviewboard.kde.org/r/119221
Change-Id: Ia148f07f6d711df533693918bbedfa5e7dc02cd5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Uninstall option will uninstall the test afer has been executed.
It is useful when you are using your own phone to execute the tests.
Change-Id: I2a3f6c3a93099d70c98f9ce059da22c409b55843
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Several tests require test data to be deployed with the
application. The easiest way to achieve this on Android
is to add them to a qrc file and use the QFINDTESTDATA macro
to look up the files. This fixes several test failures
in the gui/text subdirectory for Android.
Change-Id: If944bb1fc93434a1b2d6487da829d21bd6b84e87
Reviewed-by: BogDan Vatra <bogdan@kde.org>
When a dialog was parented on a native child widget,
its window handle was used as a transient parent.
This confused QPlatformWindow::initialGeometry() among
other things. Use top level window as is in Qt 4.
Task-number: QTBUG-40195
Change-Id: Ic82adc276175f92adde825fb2551274351e41f30
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
At the moment, there is no stream information in the cache file. This
can lead to a problem when current stream version differs from version
cache file written with.
As an example, if file written with Qt 5.1.1, QTimeDate in the metadata
stored as 13-bytes value, but Qt 5.2 and later can read additional 4
bytes which breaks following data, leading to network request just hangs
forever.
Adding stream version fixes this problem.
As cache format changed, cache version bumped.
Task-number: QTBUG-36219
Change-Id: I467d8c9fda82bcf9302192f51e7a00d2f6a9ff66
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
This prevents conflicts in case of link time optimizations or
precompiled headers are used since we don't include qglobal.h
in the generated code.
Change-Id: I4266c8ae38e6eafefd28b3bde5cb725a24d67ea0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Similar to QTextStream::reset(), this resets the stream format to the
defaults. Its primary use is inside custom operator<< implementations,
where you'd want to have a fixed format regardless of the current
stream state.
Change-Id: I421d76c61f164579bb90cf4195cc5376e2dcf0f3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Prevent the QGroupBox from changing the enabled state of
dialogs parented on it.
Task-number: QTBUG-40132
Change-Id: I91cc6ccf5ade0b3a491020ed947d4aceca62d7b6
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Prevent the splitter from adding them to the layout or showing
them.
Task-number: QTBUG-40132
Change-Id: Ife2be0bbd7e489570ef41f6f72a034b356c65f18
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
It can happen when the sidebar only has only one item, due to
"My Computer" being missing.
Change-Id: I2b38fef45139f1dfa20d88059e56185c3163a833
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
So that this method is at least called once in the test :)
Change-Id: I3b5fc6b7c464d9e56264c709cfa313d475004207
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Instantiate the timer on the stack to prevent it from
interfering with other tests.
Change-Id: I91ffe23b502fcddaeb6d6d3f89ea3d27b083cdb0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
We really do not need to do string parsing there.
Change-Id: Ie2277d9ff0d0445285b7108023941af111d9baca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This revert commit de1d5815c1 which
wrongly fixed a typo. There is no typo because we use startsWith
with that constant.
Also added a test because the %{time} support was added in commit
93563952d0 but the test was missing
Change-Id: Ic96e6f21f989ca3a2905ec6c89b93d2627b77b40
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Broke tst_QMenu::statusTip by closing the menu while it should not. (and therefore, a QTimer::singleShot that fires while following test are running is making the test fail)
This reverts commit 50c04d6318.
Change-Id: Ib4ef8190f945b915fe268745cc64d471994c5e2d
Reviewed-by: Richard J. Moore <rich@kde.org>
This patch aims to implement the session management available on OS X.
Currently applicationShouldTerminate is just a go through that closes
everything and ends the application. The new implementation calls
first appCommitData and cancels the termination properly if required.
This means that if a user wishes to logout, Qt applications can now
cancel that like e.g. answering to Safari asking whether it is ok to
close because of a number of opened tab/window.
Task-number: QTBUG-33034
Change-Id: Icedc8590a1c0934d9bc87d3a43d6702a9903bfb8
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
I've also updated the qfont test so it passes on Android now. Note that
there are no suitable cursive/fantasy fonts on Android, so the regular
default "Roboto" (or "Droid Sans" on older devices) will be picked here
instead.
[ChangeLog][Android] Fixed font selection to prefer "Droid Serif" when
Serif style hint is set on QFont.
Change-Id: I294eebcc4d79410e435bdddce552acc6044753b2
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
At the moment, it's possible to have 2 properties with the same name,
which doesn't make much sense. Notify the user about that so she can
react on it.
Change-Id: I4865b71730921b79ce9dd8abb0cc760b3f1dbfd8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
The function gives a warning if an argument doesn't exist.
Change-Id: I6a4bbbaf2fd241ced06dc71edfe4ef69732606d1
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Remove old message handler hack as we have a new and better api to
ignore warning messages.
Change-Id: Id967b2672fe3e3638db9977500118a19c2afb730
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When the platform plugin gives us specific fallbacks for a
specific script, we need to respect this, and load the correct
font family regardless of which writing systems it supports.
This is especially important since the common script is adapted
to match surrounding, proper scripts, so characters such as
digits next to e.g. Hebrew text will be marked as Hebrew. On
stock Android, there is a single Hebrew font, and this would
previously be put in all fallback slots for Hebrew regardless of
what fallback fonts were dictated by the platform plugin. Since
this font does not support the digits, they would show up as boxes.
[ChangeLog][Android] Fixed common characters like digits and
punctuation showing as boxes when positioned next to non-latin
scripts.
Task-number: QTBUG-39377
Change-Id: I1555e208a8ddc587c0bbdbfff1600cafdd9442e9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Allow the user to disable the quoting of QString, QByteArray,
QStringLiteral by passing a "noquote()" stream modifier.
This requires another flag to be added to QDebug::Stream. To
keep BC we're using the QMessageLogContext::version field
to differentiate between QDebug streams created by earlier
versions.
Task-number: QTBUG-37146
Change-Id: I9b215eabfcfd754af16ea87f3ef928d698e37d77
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This property is used to automatically hide tab bar if it has only one
tab.
Originally-by: Denis Kovalskiy <denimnumber1@gmail.com>
Change-Id: I6967f760010fa55bad6a5986c29abe7ccf625cf8
Reviewed-by: David Faure <david.faure@kdab.com>
Check result in initTestData().
Previously, QFINDTESTDATA() was repeatedly invoked in init(). The
data-driven cd() test then failed when invoked stand-alone since
cd_data(), which relies on the data path, is executed before init().
Task-number: QTBUG-40067
Change-Id: I91039247e8dcaedd92fa990f1b5f82bc54b17c60
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
At some point since Qt 4.8, the nbsp character has acquired
the whitespace attribute, causing it to be treated exactly
like an ordinary space. To account for this, we add an extra
check in the layout code to avoid breaking on non-breaking
spaces even if they have the whiteSpace flag set.
This is a temporary fix for the regression. The line breaking
algorithm needs to be refactored and support Unicode tr14
properly, which it currently doesn't.
[ChangeLog][Text] Fixed lines breaking on non-breaking spaces.
Task-number: QTBUG-39832
Change-Id: Ibd7e1a11ce4b82c611ecda1542c8638a67bf3cae
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This is trickier than the GLX and EGL implementations due to the
way pixel formats, windows and contexts work. Apart from some
restrictions, it should be fully functional nonetheless.
Add also some proper documentation.
Change-Id: Ia6e3eb1ab2701e439b8621b9092c2b0934ff2151
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
QMetaType::create can call user code and we should not keep mutex held as
this may cause dead lock.
Make sure the tst_qobjectrace actually emit some signal so the test check
there is no race if the receiver object is destroyed while
the mutex is unlocked.
Task-number: QTBUG-39990
Change-Id: I56ca1ae7a11cd7b33c1a68727370972862e11c2f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Like for integers, this is activated only on QLocales other than C.
[ChangeLog][QtCore][QTextStream] QTextStream now uses group separators
when writing floating-point numbers when the locale is not the C locale.
The old behavior can be restored by setting QLocale::OmitGroupSeparator
on the locale.
Change-Id: Ie451b91017746c3a9b11b6211b2ddd09cd295cd2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Currently QOpenGLTextureCache::bindTexture always convert any uploaded
image to RGBA8888 before uploading. This is quite inefficient when
OpenGL natively supports uploading formats in the original format.
This patch adds support for uploading a few native QImage formats. This
also get the performance of QOpenGLTextureCache::bindTexture on par with
QGLContext::bindTexture.
The texture brush used by QOpenGLPaintEngine is also converted to QImage,
since bindTexture will convert it to QImage anyway, and going over QPixmap
may cause an unnecessary conversion.
[ChangeLog][QtGui][QOpenGLTextureCache] Support uploading common QImage
formats directly to OpenGL when supported.
Change-Id: I828a763126441a98e4547c32ef52dddf7c129a32
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Adds basic support for 10-bit per color channel formats to QImage
and the XCB plugin. This will make it possible to paint to and from
these formats, but only at 8-bit per color channel accuracy.
This also fixes Qt5 applications on X11 with native 30bit depth.
[ChangeLog][QtGui][QImage] Added support for 10-bit per color channel image formats.
Task-number: QTBUG-25998
Change-Id: I93ccd3c74bfbb0bd94b352476e5fe58a94119e1f
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
This is used by Orca for geometric navigation (aka flat review) to move
the focus around. It is also generally sensible to be able to
programatically move the focus around. This way of moving the focus
is redundant with the action interface's focus action.
Task-number: QTBUG-40048
Change-Id: I1b61ea843f6bfc3dc00007772e0e5102555ca752
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
It allows to create a QJsonArray instance in C++ by using
a similar expression to JSON. For example:
QJsonArray a = {1, 2, 4};
[ChangeLog][QtCore][QtJson] QJsonArray now supports
C++11 initializer lists.
Task-number: QTBUG-26606
Change-Id: Icc352e518d9649d24176c89e7113d200d5c50b0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Support CF_DIBV5 for these images so that transparency is preserved.
Task-number: QTBUG-11463
Change-Id: I51881ae8bfbd05b92abd309766f4da9a7ea26c2d
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Factor out code to clear all mappings into
QFSFileEnginePrivate::unmapAll() and call that
from QTemporaryFile.
Task-number: QTBUG-39976
Change-Id: Ic1ceeba0ba4451866f1081fee430e5c458c0819d
Reviewed-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is no guarantee that the OES extension is present and the standard
functions are not required to be dynamically resolvable on ES.
By performing the ARB-style lookup for the suffixless function names we
can also support ES3 compatible contexts on desktop GL.
This also fixes the problem of picking up the APPLE extension functions
instead of ARB when both are available. vaoFuncsType was set to ARB correctly
but the helper has to take the preference of ARB into account too.
Task-number: QTBUG-38168
Change-Id: If7402320e8f96891017674f3c43bc57c4b5d29f3
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
The assumption that we can test "en_US" and expect
it to behave a certain way is flawed in that most
of the formatting settings are independently
configurable by the end user.
Make the test more robust while attempting to preserve
as much testing as possible:
Make the decimalPoint/groupSeparator tests check for
a range of possible values. Check that they are not
the same.
Remove the date formatting tests and the firstDayOfWeek()
== Sunday test.
Make the time zone test accept a non zero extended
time zone. ("GMT+2" in addition to "GMT+02".)
Change-Id: Ie1f89793eb785f526c5f6fafbb6726ef8c6cb016
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Fixed qwidget test cases for platforms that show windows full screen by
default and that don't support WindowMasks. Incorporated QNX/BlackBerry
peculiarities.
Change-Id: I349ecab5cef35c7d9751aa547465f685d620164a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
The combination of these unstable tests makes it very
hard to get changes through the CI system due to the
unrelated test failures.
Skip the following test functions:
tst_QIODevice::unget QTBUG-39983 (Mac)
tst_QThreadPool:expiryTimeoutRace QTBUG-3786 (Windows)
tst_QLocalSocket::processConnection QTBUG-39986 (Mac)
tst_QTcpServer::adressReusable QTBUG-39985 (Linux)
Change-Id: I96559bea0d437fd25966b6ccac1ece1490e06241
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This allows QQuickSystemPalette to listen to palette changes without
installing an expensive event filter on the application object.
Change-Id: I8b693e047d993c444e393d7a714a5709692c3560
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
The setting of (static) messageHandler to qDefaultMessageHandler if null
was happening in multiple threads simultaneously, so it needs synchronization.
Used an atomic pointer in case qInstallMessageHandler is called from a thread,
but more importantly, initialized the static vars right away.
Improve auto test to ensure that qInstallMessageHandler(0) still sets the
default message handler.
Change-Id: I70335af38c1d28a1cdba1df8a79c6006f227422e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Conflicts:
mkspecs/qnx-x86-qcc/qplatformdefs.h
src/corelib/global/qglobal.h
src/network/socket/qnativesocketengine_winrt.cpp
src/plugins/platforms/android/androidjniaccessibility.cpp
src/plugins/platforms/windows/qwindowswindow.cpp
Manually adjusted:
mkspecs/qnx-armle-v7-qcc/qplatformdefs.h
to include 9ce697f2d5
Thanks goes to Sergio for the qnx mkspecs adjustments.
Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
The sockaddr_in struct is defined in netinet/in.h header.
Change-Id: I67a3421094c96a5e948968a26723ec8c21f85c93
Reviewed-by: BogDan Vatra <bogdan@kde.org>
The almostplugin has an unresolved symbol, and on Android
we compile with -no-undefined.
Change-Id: Ia631193890dfe8e7ac8e58087475164222d876fc
Reviewed-by: BogDan Vatra <bogdan@kde.org>
It enables you to get a valid QSharedPointer instance to 'this',
when all you have is 'this'.
Task-number: QTBUG-7287
Change-Id: I3ed1c9c4d6b110fe02302312cc3c4a75e9d95a0c
Reviewed-by: Richard J. Moore <rich@kde.org>
Use SetWindowPlacement() to set the normal position when applicable
as is done in Qt 4.
Task-number: QTBUG-39544
Change-Id: Ia158b968ea15361d9937619f07b56eb8a0312a13
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
This macro is equivalent to arg.toUtf8().constData().
It is usable for "%s" arguments of qDebug(), qWarning(), qFatal(),
qCritical().
Change-Id: I2d9956e6651271e1e2183dce9c835511cf923bf3
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This allows us to quickly test if a compiler actually supports what it
claims to support.
Change-Id: Ia32212a11774aa7947ddffae30837c53665374f3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Improve consistency and use QTextDocument functions to find ranges
instead of coming up with our own scheme. This is important since
QCursor's char format depends on block positions.
Change-Id: I94eb137882dc6b5f7b01fa7693b4a536cc48d02a
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
It is needed to control a QStateMachine object from QML.
Change-Id: I19271d97718af2d688c477647d6341f70fdef3ea
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Qtbase contains four identical implementations of next power of two,
these should be shared and the implementation made available to other
qt modules, as it is also used many places outside of qtbase.
[ChangeLog][QtCore][QtMath] Introduced qNextPowerOfTwo methods.
Change-Id: Id23fbe5ad6bae647b30d5a4212c0330e48a50278
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add conversion methods similar to those in QString to QByteArray. This
is often more useful than the QString version since std::string like
QByteArray are byte arrays.
[ChangeLog][QtCore][QByteArray] Added convenience methods to convert
directly to and from std::string.
Change-Id: I92c29d4bb1d9e06a667dd9cdd936970e2d272006
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Instead of using std::thread, use the WinRT ThreadPool to manage
threads. This allows for setting the scheduling priority, and provides
a path to enable XAML integration (which requires Qt run on a background
thread).
QThread::terminate() is still unsupported, and only the winmain thread
can be adopted due to the behavior of the thread pool when creating
tasks from the GUI thread. The associated tests are now skipped, and
all other QThread tests pass.
Task-number: QTBUG-31397
Change-Id: Ib512a328412e1dffecdc836bc39de3ccd37afa13
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Forward canDropMimeData() and dropMimeData() to the source model.
[ChangeLog][QtCore][QAbstractProxyModel] QAbstractProxyModel now
forwards the drop-related API.
Task-number: QTBUG-39549
Change-Id: Ib81fcec862586e4ecfb99b9e0f4eb1a16eace762
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
In "setOpaqueResizeAndMove" this patch makes sure that the content of a subwindow
actually fits into the window, otherwise the resize does not work properly.
The content is dpi dependent and thus the pixel size of it increases with the display
dpi value.
Furthermore when moving the QMdiSubwindow this patch makes sure that we actually grab
the window's header and not one of it's tool buttons (minimize, maximize, close).
Change-Id: I88314994957c5883f57c09c9240a3b83f1ee42ed
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Bernd Weimer <bweimer@blackberry.com>
This allows QQuickApplication to listen to layout direction changes
without installing an expensive event filter on the application object.
Change-Id: I2d7d8906acecbc092657c4bd918bbdc9aad9744c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Fix condition to allow return a valid pointer when head != 0.
Change-Id: I5215f7dfc44924016c2d9b67ab2d9935b5164d7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
We were keeping a dangling pointer to a non-existent QIODevice around
which would lead to a crash.
Task-number: QTBUG-17400
Change-Id: Ie374cbb94bb45c9b0fbef46287b3317f60154123
Reviewed-by: Richard J. Moore <rich@kde.org>
The local files in availableSizes() were not resolved.
Introduce member variables for the file names, resolve them
in the constructor and add initTestCase() to verify.
Task-number: QTBUG-39287
Change-Id: If841e904700fe76b6c9265124ccba7764911fdc9
Reviewed-by: aavit <eirik.aavitsland@digia.com>
setEnabled() would race with isEnabled()/isDebugEnabled()/etc.
Change-Id: I2004cba81d5417a634b97f5c2f98d3a4ab71770d
Reviewed-by: David Faure <david.faure@kdab.com>
According to the spec rects get returned with iiii but we were directly
serializing QRect resulting in (iiii) as signature.
This would trip up Orca when trying to use flat review in text edits.
Task-number: QTBUG-39702
Change-Id: I8d6769688586e678d27cc4341de5176a91f057fc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
QImage::fill(uint) was incorrectly performing ARGB->RGBA conversion when
called on RGBA8888 formated images.
This patch moves the color conversion to QImage::fill(QColor) where it
belongs so that fill(uint) can behave consistent with documentation and
how it treats other formats.
The fill(uint) method had no automated tests, and this patch adds one.
[ChangeLog][QtGui][QImage] QImage::fill(uint) now fills the given pixel
value unconverted when used on RGBA8888 image, making it consistent with
the documentation and treatment of all other image formats.
Change-Id: I00a9d810c61d350dbdd7c4b9ad09e5ce11896b6d
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
If the widget exists in the style rules cache before it polishes for the
first time then it should be removed from styleSheetCache too so that the
latest set stylesheet is used for the polishing.
Task-number: QTBUG-39427
Change-Id: Ic1e7988afe530f16ea9996bae56543ed554d6be9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This reverts commit a1c5198387.
The idea of detecting non-spontaneous events by comparing
against the widget's crect has problems when sequences
of programmatic resizes occur. In addition, QWindowSystemInterface's
queueing of events is problematic for this.
Task-number: QTBUG-39611
Task-number: QTBUG-32590
Change-Id: I4674d8d5d5d432d938f7226b5790543335665c1f
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Currently QJsonValue and QJsonValueRef behave differently in
regard to the default values leading to confusion compile errors
depending on which of the two types one is actually using. Before
this change it was possible to write:
QJsonValue value = jsonObject["item"];
QString name = value.toString(QStringLiteral("default"));
but not:
QString name = jsonObject["item"].toString(QStringLiteral("default"));
Change-Id: Id1185acf339aa3a91e97848e85d068f84552df71
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
On Unix systems where the GUI event dispatcher uses a notification
system for socket notifiers that is out of band compared to select(),
it's possible for the QSocketNotifier to activate after the pipe has
been read from. When that happened, the ioctl(2) call with FIONREAD
might return 0 bytes available, which we interpreted to mean EOF.
Instead of doing that, always try to read at least one byte and examine
the returned byte count from read(2). If it returns 0, that's a real
EOF; if it returns -1 EWOULDBLOCK, we simply ignore the situation.
That's the case on OS X: the Cocoa event dispatcher uses CFSocket to get
notifications and those use kevent (and, apparently, an auxiliary
thread) instead of an in-thread select() or poll(). That means the event
loop would activate the QSocketNotifier even though there is nothing to
be read.
Task-number: QTBUG-39488
Change-Id: I1a58b5b1db7a47034fb36a78a005ebff96290efb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
In ICU the strength parameter decides whether a comparison is
case sensitive or not.
Fix mac comparison code. It can't have worked before.
Added some basic automated testing for QCollator.
Change-Id: I2646c464fd22ccd3a93c461fa3dba4bd1d4c7b4b
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
It is NOT always the same as isEnabled().
Added a unittest to prove it.
Change-Id: I7717126835923e8c091249bfcdf81767c44fb5f7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
The previous implementation used [NSApp orderedWindows]
which does not return NSPanel subclasses, which is
used by Qt dialogs and pops.
Use [NSWidow windowNumberAtPoint:belowWindowWithWindowNumber]
instead, which hit-tests on all window types. This
can potentially include windows from other processes
and non-Qt windows which needs to be filtered out.
Add EXPECT_FAIL to tst_MacGui::nonModalOrder. The
correct topLevelAt() implementation now exposes that
this test is failing.
Task-number: QTBUG-39322
Change-Id: I81afa3da964e08fe682802220d8fe81e9284205e
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
When navigating with the directional keys or tab/backtab, there are
certain situations where the cell that is edited is incorrect.
For example, consider the table below.
'^' represents the starting cell and the direction of navigation.
'c' represents the index that is arrived at as the currentIndex prior to this patch as
reported by view.selectionModel()->currentIndex().
'x' is the cell that should be edited:
+---+---+---+---+
| | | e | |
+---+---+---+---+
| | x | |
+---+ +---+
| | c | |
+---+---+---+---+
| | | ^ | |
+---+---+---+---+
Before this patch, the cell that will actually be edited is c, rather
than x, so after editing the cell and pressing enter, the previous
contents of the cell will still be shown.
With this patch, currentIndex() will be changed after every call to
cursorMove(). Navigation into and out of cells is not affected because
the visualCursor member in the QTableViewPrivate tracks the keyboard
navigation entry point. If after the up navigation into the span, the
user presses up, the cell entered is 'e', not the cell above 'x'.
Task-number: QTBUG-29239
[ChangeLog][QtWidgets][QTableView][QTableWidget] currentIndex() now
reflects the top left cell when in a span.
Change-Id: I3dc3db46ebba340102860fc4ad98fcaf91484983
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Traditionally, RCC in "C mode" was meant to bundle small resources into
a binary, like help texts or an occasional icon. RCC produces a .cpp
file containing the actual data in a char array which is then passed
to the compiler and linker as a normal source file. Larger resources
should be compiled in RCC's binary mode and loaded at run time.
Current Qt Quick use tries to deploy large hunks of data in "C mode",
causing heavy compiler/system load.
This patch works around the issue by splitting the process into
three parts:
1. Create a C++ skeleton, as usual, but use a placeholder array
with "easily compilable" (mostly NULs) data instead.
2. Compile the skeleton file.
3. Replace the placeholder data with the real binary data.
time (qmake5 ; make clean ; make) takes 1.3 s real time for a
100 MB resource here, and there is still room for improving patching
performance if really needed.
Change-Id: I10a1645fd86a95a7d5663c89e19b05cb3b43ed1b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
QWidget::resize() or QWidget::move() set the new size/position values
and send events. The spontaneous events generated by the platform
should be ignored in that case.
Task-number: QTBUG-30744
Task-number: QTBUG-38768
Task-number: QTBUG-32590
Change-Id: I9c0ae38842ed76a8a88ca64fdc9bbe106b2766b7
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This simple patch was an unfortunate victim of the Gitorious to
Gerrit transition. (https://qt.gitorious.org/qt/qt/merge_requests/1179)
As noted in the Gitorious review, a small bug in readHeader is also fixed: ||
instead of &&.
Done-with: Pali Rohár
Task-number: QTBUG-12684
Change-Id: I1fe16359b9b68c10e518904c6a5c58b00fb7379b
Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
Some codecs can't handle the range outside ascii properly and would then
fail to read the data back in correctly.
Task-number: QTBUG-15543
Change-Id: I4c02921e787a939eeec0c7a11603b5896d756aef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Store the value of QMessageBoxPrivate::autoAddOkButton
temporarily when automatically adding the "Show Details..."
button.
Task-number: QTBUG-39334
Change-Id: I173c83893548ee83b3d8ea2743f87686c32657e7
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
If QNX does not have inotify there is no native engine.
Change-Id: I042efd0b59f916f9e0b55bbe5c7f3fe7bb6914c8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
The selectable/selected states refer to items in a list and similar,
do not interpret them as text selection states.
Without this change NVDA for example announces text edits as selected
which makes no sense and which it doesn't do for native text items.
Change-Id: Ib1d109523bd4cc2b9b40ace8a8c3d7d3a7f9f25c
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
[ChangeLog][QtCore][QSaveFile] Now follows symbolic links while writing to
a link instead of replacing the link with the contents.
Change-Id: I5afd519cb9f96ae68fa4c23c33a18de75671a301
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Qt5 allows QAIM subclasses to reimplement the sibling() method. Unfortunately,
the default QAbstractProxyModel's reimplementation differs in behavior to what
the Qt4 version was doing. In particular, the Qt4 version used to use the row
and column as positions within the proxy model, while the Qt5 version mistakenly
does this at the level of source model. This is arguably broken; the caller asks
for a sibling of the proxy index, not for a sibling within the proxy model.
This change makes the QAPM::sibling work explicitly in the same way as the Qt4
code behaved.
The reimplementation of QAbstractProxyModel::sibling was introduced in
9dfba89c28. It was subsequently fixed with commit
999109866d not to return indexes from the source
model, but the logic was still different from the Qt4 version.
[ChangeLog][QtCore][QAbstractProxyModel] Fixed QAbstractProxyModel::sibling to
work in the same manner as the Qt4 code used to behave. Previously, Qt5's
implementation would treat the row and column as positions in the source model
instead of a position in the proxy itself.
Followup-to 9dfba89c28 and
999109866d
Change-Id: Ia25027b2ad9e4777ba28de2d2226d48f8cccf587
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
The sanity check added in d16508a285
didn't actually catch the case where the invalid data is large
enough to contain the offset table and table directory. Added sanity
checks to all the code that accesses the font data now, so this
should fix crashes with partial data as well as invalid data.
Task-number: QTBUG-37190
Change-Id: Ie43f10d8cf0b09007783b9b1c4d91bfed8c6b0f0
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
This brings QTimer::singleShot on par with QObject::connect in
terms of the new Qt5 syntax. With this patch, it is now possible
to connect singleShot to a member pointer, a static function
pointer and a functor (with or without a context object).
The short code path for 0 msec is not yet implemented - it will
require further modifications to QMetaObject before it will be.
An additional SFINAE on the new singleShot overloads had to be
implemented to prevent tricking the compiler into believing
const char * might be a function pointer.
[ChangeLog][QtCore][QTimer] Implemented new style connect syntax,
including functors, in QTimer::singleShot
Task-number: QTBUG-26406
Change-Id: I31b2fa2c8369648030ec80b12e3ae10b92eb28b4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
beginModalSessionForWindow will center the window and ignore
the set geometry. So to workaround this it checks the new value
against the old one and moves it back if need be.
Change-Id: I38bc74c04138992f2e0570fca666414025aeeba8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Use QTRY_COMPARE instead of hard-coded timeouts, ensure window is
shown.
Change-Id: I4f23144ee14150c4fba9c6fbd8c4ee2da472cc75
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This fixes an issue where, if characters were removed from several
blocks in a single edit, the document layout would end up being
corrupted since the document layout manager wouldn't re-layout the
proper number of text blocks.
Task-number: QTBUG-30051
Change-Id: Idf3a6f567120e6a5dbebf1f65f685d374219328a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
When syncing between QAction and native NSMenuItems, the ampersands
(mnemonics) were removed twice. This lead to double ampersands being
removed instead of replace with single ones.
Task-number: QTBUG-37933
Change-Id: If1d9cd247b467472647b22b38460b44b03f13d82
Reviewed-by: Liang Qi <liang.qi@digia.com>
... because it fails on the new network test server. The Socks5 tests
in QUdpSocket have already been disabled by commit
aa3eaf9d2e .
Task-number: QTBUG-35490
Change-Id: Ib062adb422ff6e5538f14d15a266d79c3bb53956
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
It's a common need to assign a variable to something when entering a
code block, and then revert it upon exit. qscopedvaluerollback can
be used for this. But as a convenience, this patch adds an
extra constructor so that you can "protect" and set a variable
in one go instead of using two lines.
Change-Id: If4b89d3a5ba32ef2304bda058b1b6050932612ed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The existing waitForNotified method has the design limitation that it
doesn't allow the tracking of multiple I/O operations on a single
file handle.
Therefore we introduce an additional method waitForAnyNotified that
returns a pointer to the triggered OVERLAPPED object.
Change-Id: I536ed7f6828daa2b0ce03f2d662eeb10aa89ca99
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
QLockFile "noPermissions" test is not applicable with root
privileges.
Change-Id: I5779da524f24d0f1b9ef519d654856a6200da6bf
Reviewed-by: David Faure <david.faure@kdab.com>
Some of the QSaveFile tests are not applicable with root privileges.
Change-Id: I1a22906c0b14acf144f1849719152dfe9d79f426
Reviewed-by: David Faure <david.faure@kdab.com>
Recreating QCoreApplication could cause a crash in QNetworkAccessManager
constructor. That was caused by an invalid shutdown detection introduced
in f273d6fbc0.
Task-number: QTBUG-36897
Change-Id: Ib5bba773a2a4fcde690a3a93680aef551aae3a5b
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
First and foremost, the STL-style iterators don't do this. Those don't
provide a guarantee that the container won't get shared again while the
iterator is active.
Second, there's no protection against a second mutable iterator being
created and resetting the sharable flag back to true.
[ChangeLog][Important behavior changes] The mutable Java-style iterators
like QListMutableIterator and QHashMutableIterator no longer set the
parent container to unsharable mode. If you create a copy of the
container being iterated on after the iterator, any changes done with
the iterator might affect the copy too.
Discussed-on: http://lists.qt-project.org/pipermail/development/2014-February/015724.html
Change-Id: Iccfe411d5558c85ae459cff944215614c392388e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
It had no effect because of an explicit check for NoBrush.
However the default in QBitmap is (unfortunately) QBrush(color0), rather
than NoBrush, so the brush must be updated when calling setBrush(NoBrush).
I suppose the real issue is that lastBrush is default-constructed in
QRasterPaintEngine, rather than starting with the brush from QPainter,
which is QBrush(color0) for the case of the bitmap. But no reason to
special case NoBrush here anyway.
Task-Number: QTBUG-38781
Change-Id: I9996ac12bf628920cfaf0de9c886f637a336028b
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
GRAPHICS_ROOT and TZ environment variables are needed in child
processes in order to successfully run the auto test selftests.
Change-Id: I7befabd535b4c47b1e75acbe3d6158d0d9b811b3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This allows to easily create a matrix that performs the transformation
used by OpenGL fixed function to go from normalized device coordinates
to window coordinates.
This comes in useful if you need to perform the NDC->window coordinate
conversion inside a shader.
Change-Id: I183b3545bfb3eb1e8b13fc3172911b46926fcbb7
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
The currently used clipboard chain API has various problems with non-
responsive applications and requires checks for hung/debugged applications when
sending on notifications.
The new clipboard format listener API available from Windows Vista onwards
requires less code and does not have these problems, however the change
notifications now arrive asynchronously.
Change the tst_qclipboard to be able to deal with asynchronous change
notifications.
Task-number: QTBUG-38670
Task-number: QTBUG-33492
Change-Id: I3c49e346a34310431c20f3051d12eaabf330a3ad
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Prevent crash on platforms that don't support accessibility by skipping
tests.
Change-Id: I42ba44df3200e0abd62797c76a5c538fb1d2757c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Discussed with Peter and agreed that it's a slightly better fit there.
Change-Id: If8db777336e2273670a23d75d8542b30c07e0d7b
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
When passing invalid data to QRawFont, we need to fail gracefully
and mark the font as invalid, instead of crashing. This crashed
because of different missing sanity checks in the Windows
and FontConfig font databases.
[ChangeLog][Text] Fixed crash when trying to load a font from
invalid data.
Task-number: QTBUG-37190
Change-Id: I62c81217ec7d873350b575c9d4ae8e6f0a939540
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
warning: typedef 'Foo' locally defined but not used [-Wunused-local-typedefs]
Change-Id: Ifb1213414feb3aa5a5e46dac163e51ccd4925498
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There is no reason to have the test separated from other tools tests.
Change-Id: Ie5b19961c383f5e4bc1ad4452cba7b92153fc303
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When a UTF-8 sequences is too short, QUtf8Functions::fromUtf8 returns
EndOfString. If the decoder is stateful, we must save the state and then
restart it when more data is supplied.
The new stateful decoder (8dd47e34b9)
mishandled the Error case by advancing the src pointer by a negative
number, thus causing a buffer overflow (the issue of the task).
And it also did not handle the len == 0 case properly, though neither
did the older decoder.
Task-number: QTBUG-38939
Change-Id: Ie03d7c55a04e51ee838ccdb3a01e5b989d8e67aa
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Add support for loading certificates and keys from PKCS#12 bundles
(also known as pfx files).
Task-number: QTBUG-1565
[ChangeLog][QtNetwork][QSslSocket] Support for loading PKCS#12
bundles was added. These are often used to transport keys and
certificates conveniently, particularly when making use of
client certificates.
Change-Id: Idaeb2cb4dac4b19881a5c99c7c0a7eea00c2b207
Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
It may return null during program exit, due to QCoreGlobalData global
static already having been destroyed. If that's the case, QTextStream
needs to fall back to Latin 1, like QString::toLocal8Bit and
fromLocal8Bit already do.
Task-number: QTBUG-38316
Change-Id: I5949c8dec15b60f4a13b5d9307ed6abfc799fe20
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
QEXPECT_FAIL followed by QTRY_COMPARE considerably slows down
tests due to the check timing out.
Task-number: QTBUG-38890
Change-Id: I7f90f2627fc6ce149d159a6d13355ca1a8181d54
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
That long call chain is screaming "here, I'm dereferencing dangling
pointers! Valgrind me!" but 2006 Thiago didn't see them...
Change-Id: I44de5aea113d05edec2227e9db6be8cec9303be9
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
The main test won't find them if they are.
Change-Id: Iae3ffe4c0289a0c88d46c1bd2e414c20def89ab4
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
The tests for toString/fromString previously didn't run tests
for timezones with hh:mm where mm != 00.
Change-Id: I74da99c5b6890f46ce06446084a8129b4cbc7a02
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: John Layt <jlayt@kde.org>
Increase the chunk size of the server and remove hard-coded
interval when waiting for the server to listen.
Unmodified, the test takes 170s on Windows.
Change-Id: I65bdc93ff78e1b4fb429fcafd0fdc5e80bb281f9
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Use the correct palette and enforce Fusion style to prevent
the Vista style from clobbering the tooltip palette in polish().
Task-number: QTBUG-38183
Change-Id: Id19d548f818d801c4914a343e08207195c343888
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
The intent is to provide compile time validation of signals and to help
detect signal overloading in the future.
Change-Id: I9d5d46ed4b70c5d0cd407deb5928b1e76d37e007
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Determine the visual index by looking up the column of the QModelIndex
in the logicalIndices array instead of looping.
Task-number: QTBUG-37813
Change-Id: I5c3c73c67537877b03cdc2c36a52041d99f7f49d
Reviewed-by: David Faure <david.faure@kdab.com>
Change-Id: I92fa083665509932b75ff1037904a6f78a950fd6
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Change-Id: Ife5b7206fd3d7af57cfca3c0f28f56bb53ede7a7
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Nothing else seems to report this state and on windows
for example it results in NVDA reading subMenu which makes
little sense.
Task-number: QTBUG-38500
Change-Id: I64820d9f2ea9174034f01da42cb2266a19c19465
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
This test doesn't fail on Mac any more.
This reverts commit 36493a7a41.
Task-number: QTBUG-23685
Change-Id: Ib7c56494b07de9839b3287758fe228f799bc343c
Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Useful for any application that can take URLs on the command-line, so that
full paths and relative paths can also be accepted.
Change-Id: I8a2c50f36d60bdc49c065b3065972fd5d45fa12a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The fact that we kick in a pattern study and possibly a JIT compilation
after an undocumented number of usages is suboptimal, for a number
or reasons: users may want to JIT compile a pattern immediately,
and at the same time they may not want a random delay in the program
(due to the pattern getting optimized at a random usage).
So: add an optimize() call to force an immediate pattern optimization,
and a pattern option to force an optimization on the first usage.
Change-Id: I95efdecfd31f11ca7cceb9c05037df613601a11c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
sched_yield is standardized and on linux pthread_yield is implemented as sched_yield.
Building Qt for Android on OS X doesn't compile with the pthread version.
Change-Id: I1913afa83769805291e987f55b8f452299a43dce
Reviewed-by: Mark Brand <mabrand@mabrand.nl>