The handling of the null QPolygonF case was not correct as it would
always be seen as valid. This ensures it is treated in the same way as
QPolygon when it is in fact null.
[ChangeLog][QtGui][QPolygonF] When a QVariant holds a QPolygonF()
then it will be correctly seen as a null QVariant.
Change-Id: Icae34f513c3a8e1dd3f50cb64a3d13ae7c636cc4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
The RFC 2822 date format should always use en_US locale for month and
day names instead of whatever the system locale is. Also remove some
duplicate code.
Change-Id: Ia2f7ee405b4e0e2f04980301783b9488628da73f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Added clarifying explanations to the QEXPECT_FAIL statements.
Now it should be easier to understand what is expected from the parser.
Change-Id: I1dacd60564f292d9ce43de7254525c34fa7cdc55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Changed the processing of non-character code handling in the UTF8 codec.
Non-character codes are now accepted in QStrings, QUrls and QJson strings.
Unit tests were adapted accordingly.
For more info about non-character codes,
see: http://www.unicode.org/versions/corrigendum9.html
[ChangeLog][QtCore][QUtf8]
UTF-8 now accepts non-character unicode points; these are not replaced
by the replacement character anymore
[ChangeLog][QtCore][QUrl]
QUrl now fully accepts non-character unicode points; they are encoded as
percent characters; they can also be pretty decoded
[ChangeLog][QtCore][QJson]
The Writer and the Parser now fully accept non-character unicode points.
Change-Id: I77cf4f0e6210741eac8082912a0b6118eced4f77
Task-number: QTBUG-33229
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add qjson* implementation files from corelib/json
to the qmake build. Add a read-only compile mode,
enabled by defining QT_JSON_READONLY.
Add qmake built-in function parseJson(file, into)
which parses a json file into the given variable.
qmake uses a flat key -> value-list implementation
for storing variables, which means that some hackery
is need to represent arbitrarily nested JSON. Use a
special "_KEYS_" variable for arrays and objects:
Arrays:
["item1", "item2"]
$${array._KEYS_} -> 0 1 2
$${array.0} -> "item1"
$${array.1} -> "item2"
Objects:
{ "key1" : "value1", "key2" : "value2" }
$${object._KEYS_} -> key1 key2
$${object.key1} -> value1
$${object.key2} -> value2
Change-Id: I0aa2e4e4ae14fa25be8242bc16d3cffce32504d2
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Check if the datetime is valid before converting it to a different time
spec. If it is invalid then just change the spec to keep behavior
consistent with 5.1.
Task-number: QTBUG-34020
Change-Id: I6630ec1d50f810a2178ab3222bd32af018085f81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change the default output of the logging framework to prefix messages
with a 'category: ' in case the category is not "default", so that e.g.
QLoggingCategory cat("qt.core.codes.windows");
qCWarning(cat) << "MultiByteToWideChar: Cannot convert multibyte text";
will print
qt.core.codes.windows: MultiByteToWideChar: Cannot convert multibyte text
while output from qWarning etc will show unaltered output. This should
help users to discover categories, and to group output together.
Change-Id: Iac2e1514f7dc5671966c36a440a119c857564cfc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
the function is a trivial wrapper for the QTextCodec one, so there is
little point in explicitly testing it.
Change-Id: I0c4950e5a54b7ffff9ba73a001cedb517497a596
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There are a few problems with the Quadruplor setup in Qt 5.
First of all, it doesn't work with modules, since it has
a hard coded library dependency list. Second of all, it
duplicates the application template, so changes need to also
be duplicated. This often gets out of sync. Third of all,
it duplicates a lot of deployment rules which are now contained
in androiddeployqt.
Task-number: QTBUG-33996
Change-Id: I0630a38aeba7d0075df8fae671abc311fc36de61
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
No need to default to yet another SDK here. This is a left-over
from Necessitas, which supports versions down to android-4.
Change-Id: I2e79be641288c14f92c205b30f2db6db793d783f
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
This fixes QStatusBar so it is back to the original behavior of only
emitting the signal when the message has changed. The intention of the
code that caused this to break in the first place is kept intact.
Change-Id: I2f57c2abec01246ed924626ad954ac9ff9889855
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
QAccessibleImageInterface already has an API to return the
size of the image.
This function ensures that their API's are not overlapping.
Alternatively, we could merge both functions into
QAccessibleImageInterface::imageRect(), but the assumption is that
images change position more often than their size.
Change-Id: I55c25cdff187b9f497828f04cfd5f969cfbc451f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
This is a performance and memory optimization which also fixes bugs
that are related to creating widgets, file system models etc.
despite using platform native dialogs. Similar to
785bc64f8e for QColorDialog.
Task-number: QTBUG-33039
Change-Id: Ia1aa7ec1f43b47006b9ebd377aed15c958538a17
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
When the QPolygonF type was added to QMetaType it did not bump up the
values in load() and save() for QVariant.
Task-number: QTBUG-33981
Change-Id: I7ad99cda70620c5449c15527c3daf920972d047f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
The test is randomly failing on CI when ran on 10.7.
Task-number: QTBUG-31454
Change-Id: I79fce9a37616c6abaee960e338f8eea8fe6f31cf
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Position cursor outside and move once more.
Task-number: QTBUG-33972
Change-Id: If060f1359361981cf1243d8d2a4ebef181689d74
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This patch merges the two classes that were used to make
dock widgets accessible into one.
The title bar does not need to be represented by its own
accessible object.
In addition the buttons on the toolbar are now labelled.
Task-number: QTBUG-33946
Change-Id: Id90d8c09f15ed683e64dbe3f6ac55bca7a0b300f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
The pointer can be null. Going trough the reference invokes undefined
behavior here.
Change-Id: Ia84e4e732cdcbbaee0f5f0679765d18069ea8b2d
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
The cursor needs to be within the view from start on Mac.
Task-number: QTBUG-33973
Change-Id: I313c9fd1c3a917e135a92497f1818d1b0d8b7698
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
When CSS was set in the head tag then it was not being inherited by the
child tags. This ensures that the inhertiance happens and that the deeper
the CSS is set then it will ensure that it has precedence over the ones
set on the parent.
A test is added that shows the standard inheritance from the head tag and
the precedence from child tags in effect too.
Task-number: QTBUG-28770
Change-Id: I30be3ec141b2cd8d6e0db8a92669aed34da93b33
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This yields the same results as previously and is more in line
with existing interfaces.
Change-Id: I0bf0372bf18f3bfde579385cddbe594bf71e3c52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
qtbase/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp:652:36: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
f.write(QByteArray("i am " + i));
~~~~~~~~^~~
qtbase/tests/auto/corelib/io/qfilesystemwatcher/tst_qfilesystemwatcher.cpp:652:36: note: use array indexing to silence this warning
f.write(QByteArray("i am " + i));
^
& [ ]
Change-Id: Icc966559be3c2cde3416193b8a1ddab7e0323ade
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I5a1e601e3aa6e84300efa09bfbd9232fecab903e
Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
On one suse box I have both /usr/bin/sh and /bin/sh which means that the
test should prefer the one first in the path instead of random order.
Change-Id: Ie94bf8404479fa42a36a8ee45e09986114693871
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The QCoreApplication test has quite a few test cases that we would like
to exercise using the GUI event-dispatcher. Instead of duplicating the
tests for the GUI dispatcher, we inherit tst_QCoreApplication, which
also lets us add extra tests that are specific to tst_QGuiApplication.
Change-Id: Ib411457131b8d3fed871f682c1c0568577f6127d
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
If create() or makeCurrent() calls fail, the test should fail fast.
Change-Id: I025c541f94c8eee492cf0e1545bfbb8027eff2a7
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
At the Daylight Tme to Standard Time transition, the local time repeats
itself, i.e. 2am occurs twice. Qt's behavior when setting this using
the local time is ambiguous, as it depends on the system implementation
of mktime, which behaves differently on different platforms. Currently
this behavior remains undefined. When setting using an msecs or time_t
value however we can determine the correct instance to use and cache it
to ensure that any conversion back from local time to msecs is performed
consistantly on all platforms.
Note that caching this value will result in any calculations being wrong
should the system time zone change, or its rules change. This will be
fixed in Qt 5.3 when the system time zone change signal is implemented
and QDateTime switches to using QTimeZone instead of mktime to provide
consistnt behavior across platforms.
The QTimeZone spec does not require this fix as it already caches the
correct offset in setMSecsFromEpoch().
Change-Id: I799588db474e744a6d81e80f6a0442920569ebd3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Task-number: QTBUG-26722
Change-Id: I579111b5d34f8e3cdc6bb016d9c0e42ec3ffb8c9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Stephen Chu <stephen@ju-ju.com>
Mac uses the CLDR format codes which need to be translated into their
Qt equivalent. The existing code mistranslates the year code, is
outdated for a number of new codes introduced in recent versions of
CLDR, and by default accepted any codes it didn't recognize.
This change updates support to the latest version of CLDR, fixes the
treatment of years, and defaults to ignoring any new format codes
added in the future.
Note that this change cannot have auto tests written as the system
locale formats change between versions of OSX. Testing must be
done manually by changing system locale and formats.
Task-number: QTBUG-25057
Change-Id: I69dda25b4a0b38d3971995644546306876922d57
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
In case of implicit memory sharing, QString::reserve caused data
truncation if given size was smaller than size of data.
Task-number: QTBUG-29664
Change-Id: If2da5ad051385635ebb829c18b5ebaa349f08e8a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
Except where we're actually testing QCoreApplication::applicationName()
and friends.
Change-Id: I25514884c11f43a4f82b1f818f822dc3d79f69a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
If we end up QSKIP'ing the test 'wronlyFileName' is never created.
Change-Id: I2ccbfdb630b58d7904e73b476a65a82a45ab90d7
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Commit 310031188c (Fix moc stumbling over gcc __attribute__
extensions, 2012-10-01) applied similar logic for GNU style
attributes.
Change-Id: I550eaefd703b4e974e6ffae7716f02074c8a8823
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This simplifies the code a bit and ensures that it is respecting what
the relevant function expects the size to be as.
Change-Id: Iec88fab84c27a33d6f1a9e9413ea6beb0a39c68d
Reviewed-by: John Layt <jlayt@kde.org>
Unfortunately we returned the column description when the AT client
asked for the row description....
Change-Id: I46bc0edb4fd0f7cc6d98d7d6e0d8ca6f77553a26
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Fixes the obvious race between the test of 'release' in the thread
and the setting of 'release' in the test function.
Change-Id: I92df52d7b18e8154f17229a3dbd4a0e58f4a3b5b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
The code uses a QSignalSpy to check whether the thread started,
but the signal emission (and subsequent appending to the spy) and
the check for spy.count() before the final thr.wait() are not
synchronized:
The signal emission happens-after the thr.start() and -before the
final thr.wait(). Likewise, the spy.count() happens-after thr.start()
and -before thr.wait(), but neither one happens-before the other.
Thus, there is a data race.
The wait(200) between thr.start() and mutex.unlock() doesn't help,
either, because we check only that it doesn't return true, iow, we
check that it timed out. But it will happily do that if the thread
has not yet started executing, so there's no happens-before relation
to be had via that avenue, either.
I first fixed by moving the spy.count() check to after thr.wait().
In that case:
signal emission happens-before thread finishing
happens-before thr.wait() returning
happens-before spy.count()
so no race.
Arguably, that makes the check rather useless, so I decided to remove
it completely.
Change-Id: I6bb47c4114961ee6e9251cfebeb4b7794ba674a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Remove benchmark tests that are no longer required as they are simple
overloads of other methods.
Change-Id: I610211543d17c077f482fa2145ac3da7d0767282
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add support to QDateTime for time zones using the new QTimeZone class.
[ChangeLog][QtCore][QDateTime] Add support for a new Qt::TimeZone
spec to be used with QTimeZone to define times in a specific
time zone.
Change-Id: I21bfa52a8ba8989b55bb74e025d1f2b2b623b2a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>