We need to let the QGuiApplication determine whether quitting is appropriate
based on whether there are visible top level QWindows after the last top-level
QWidget was closed.
This solves the issue raised here: http://thread.gmane.org/gmane.comp.lib.qt.user/1880
The transientParent is the QWindow equivalent of parentWidget on QWidget, so the test
in QGuiApplication::shouldQuit is similar to the one in QApplication::shouldQuit.
Change-Id: I500eff8d5887f24415180134b3a4be3c630a896f
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
The QSet<int> is a more expensive container to use and create, so
it should be avoided.
This is source incompatible compared to earlier Qt 5 for
QAbstractItemView subclasses which reimplement dataChanged, but this
patch changes nothing compared to already-present SiC compared
to Qt 4.
Change-Id: Id95391dfd62a0a7f487a8765790b007badefb937
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Containers are auto-registered and use normalized names.
Change-Id: Id65c3940401f69436929220e1f6a971135e147ed
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
This already worked, but let's have a test so we can be sure it doesn't
regress.
Change-Id: I358b436d216e3ec4310f05ccf4f70f9e7aad3281
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* The Line Breaking Algorithm implementation conformance tests has been added;
* The Grapheme, Word, and Sentence Breaking Algorithm implementation
conformance tests has been updated.
Change-Id: Ia1a6eef6272d580964cb23788ddf30dfd5f4a5a3
Note: the Line Break test data contains some extended cases we don't currently support;
just skip them for now.
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
to make it conformant to the Unicode 6.1 specifications #14 and #29.
The most important changes are:
* The implementation has been reworked from scratch to fix all known bugs;
* Separate-out the grapheme and the line breaking implementation to eliminate
an overhead due to calculating unnecessary breaks;
* Stop using deprecated SG class in favor of resolving pairs of surrogates;
* A proper support for SMP code points;
* Support for extended grapheme clusters (a drop-in replacement for the legacy
grapheme clusters as of Unicode 5.1);
* The hardcoded tailoring of UBA has been eliminated which breaks the 7 years-old
lineBreaking test. Some later, we'll investigate if such a tailoring is still needed.
Change-Id: I9f5867b3cec753b4fc120bc5a7e20f9a73d89370
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Update NormalizationTest.txt data file with one from UCD 6.1;
Add few more QChar::unicodeVersion() testcases;
Add some line break class mapping testcases;
Add some exceptional case mapping testcases;
Add script class mapping test;
Change-Id: I164394984abb2b893c8db62fb77e7bd87aa0850b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Future-proofing. Since Qt source code is now mandated to be in UTF-8,
it is entirely possible that someone will use non-ASCII in data tags.
Though it would be interesting to see how to access them from the
Windows command-line.
Change-Id: I880fc312432b62143888ff1e1d9abbd54f704601
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This supercede https://codereview.qt-project.org/#change,25111 and fixes
some more cases;
The autotest crash is fixed as well (but the test itself omitted due to
.pro file misconfiguration)
Change-Id: I4a3adde18b4f9a8ac9822f700eee71d2a12b9c2c
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
This is a cherry-pick of 4f388c383e39b598d997e21bd9a4f16d89bd0625
from February
Recursive call is caused if user code calls QtreeWidgetItem()::sortChildren and
sorting is enbled in QTreeWidget.
First call is from user code and second is caused by timer.
When timer expires second call is made.
This recursion is prevented with QTreeModel::SkipSorting skipSorting()
in QTreeWidgetItem::sortChildren();
Task-number: QTBUG-20345
Change-Id: Ibf73e69274423f31397a9e391bfba7d5c4103a3c
Reviewed-by: Markku Tapio Heikkilä <markku.heikkila@digia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
According to ISO 8601 (section 4.2.2.3), seconds can be omitted
from a string representing time.
Task-number: QTBUG-2813
Change-Id: I2578f290845e46a8f49be489f1d7427984ae7f08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
to keep them consistent with positions for all other flags.
This changes the internal behavior so that attributes[0].lineBreakType now means
"break opportunity at start of the text (before the first character in the string)"
and is always assigned with HB_NoBreak to conform rule LB2
(see http://www.unicode.org/reports/tr14/#LB2).
The current implementation is based on the sample implementation from tr14
that aimed to be as simple as possible rather than to be optimal.
From now, we can use pieces of the attributes array "as is"
without having to adjust some positions. Or we can analize some long text
by chunks (e.g. paragraph by paragraph) and consume less memory.
This introduces a minor overhead that will be eliminated shortly.
Change-Id: Ic873a05a9d5203b1c3d5aff2e4445a3f034c4bd2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
SoftHyphen enum value was added to specify such a boundary reason
Change-Id: I4248909eed6ab8cbca419de4dcf9fe917620a158
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Because QSystemLocale::fallbackLocale() is about UI languages,
it makes sense to check LANGUAGE as well if appropriate.
Adapt tst_qlocale.cpp accordingly.
Suggested by Oswald Buddenhagen.
Change-Id: Ib2c9674081809e3251be4e34456b05210eebc010
Reviewed-by: Oswald Buddenhagen
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
postDelayedEvent() and cancelDelayedEvent() are marked as thread-safe
in the documentation. Unfortunately, they didn't actually work when
called from another thread; they just produced some warnings:
QObject::startTimer: timers cannot be started from another thread
QObject::killTimer: timers cannot be stopped from another thread
As the warnings indicate, the issue was that postDelayedEvent()
(cancelDelayedEvent()) unconditionally called QObject::startTimer()
(stopTimer()), i.e. without considering which thread the function
was called from.
If the function is called from a different thread, the actual
starting/stopping of the associated timer is now done from the
correct thread, by asynchronously calling a private slot on the
state machine.
This also means that the raw timer id can no longer be used as the
id of the delayed event, since a valid event id must be returned
before the timer has started. The state machine now manages those
ids itself (using a QFreeList, just like startTimer() and
killTimer() do), and also keeps a mapping from timer id to event
id once the timer has been started. This is inherently more complex
than before, but at least the API should work as advertised/intended
now.
Task-number: QTBUG-17975
Change-Id: I3a866d01dca23174c8841112af50b87141df0943
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
tst_QWindow::positioning() still fails on Mac OS X, and it does so in
several places. Skip this test for now as it causes isActive() to fail
as well. With positioning() QSKIP()ed, all the other test functions
pass:
Totals: 19 passed, 0 failed, 1 skipped
********* Finished testing of tst_QWindow *********
Task-number: QTBUG-23059
Change-Id: I58d036120c0121f515813cd20955ab3b82f81fe1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
When switching the active window within the same application, Cocoa
sends us an NSWindowDidResignKeyNotification for the old activated
window, then an NSWindowDidBecomeKeyNotificationfor the newly activated
window. Our handling of this would first set Qt's active window to zero,
then immediately reset it afterwards. Avoid this by checking the key
window when handling the deactivation event, and don't set the active
window to zero if a new window has become active.
Task-number: QTBUG-24322
Change-Id: I8719fc501049eeaaebb75e9ea03261b2209458b6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
It might be too expensive to always have an accelerometer sensor
running, so introduce API so that the application has to explictly ask
to get the orientation updates it's interested in.
Change-Id: Ib7dc5ad8807718409f744ebef53f4476aa05175d
Reviewed-by: Ian Monroe <ian.monroe@nokia.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Kevin Ottens <kevin.ottens.qnx@kdab.com>
The function returns mutable iterator on the object that can later be passed to
e.g. erase(), hence it should detach() to be consistent with
QJsonObject::begin() which also detaches.
Change-Id: Id79e8e012fd5469e06b68fbc9eecb7c6848ce9c1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
The use of QWeakPointer for tracking QObject pointers is to be
deprecated.
Change-Id: If460ca7f515db77af24030152f4bd56e1a5fae7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QUrl("relativefilename").toLocalFile() changed behavior
and now returns an empty string if the scheme is not set.
Setting the scheme to "file:" in setSource would however
break some other assumptions in the code about relative
url's.
Task-number: QTBUG-22416
Change-Id: I1b3fcbef81f6e356935ec426903989e783ce9a78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Allow for a little more leeway in timers.
Task-number: QTBUG-26004
Change-Id: I59936d0f675b7f734e04b3f5e63631c74ca4f163
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
If a QTemporaryFile is constructed using a template file path,
the path is generated in QTemporaryFileEngine::open() and then
filePathIsTemplate is set to false. If remove() and then open()
are called on the same QTemporaryFile, the path is not regenerated.
This change ensures that if the file path was generated, it will be
generated again in the scenario above.
Task-number: QTBUG-2557
Change-Id: I718ceb89daa9a9d46fdbe811fecc3d57d6dc08c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Currently, QString::toFloat() returns 0 (and sets ok to false) if you
try to convert "inf". This is because inf is greater than QT_MAX_FLOAT
and there is currently no check to handle inf.
Task-number: QTBUG-8629
Change-Id: I498daf4a7a6f880f928461fca628fcaf7d1d6d08
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>