Commit Graph

2459 Commits

Author SHA1 Message Date
Stephen Kelly
f9caf48bee Use a QVector<int> instead of a QSet<int> in itemviews/models.
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>
2012-06-12 04:30:07 +02:00
Jędrzej Nowacki
3df316e961 Avoid a type name normalization during auto-registration.
Containers are auto-registered and use normalized names.

Change-Id: Id65c3940401f69436929220e1f6a971135e147ed
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-06-12 04:30:05 +02:00
Thiago Macieira
9e1a9878aa Add a unit test to QSharedPointer being deleted by a C++11 lambda
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>
2012-06-12 04:29:29 +02:00
Debao Zhang
7616f31052 Make qmetaobject autotest independent of QtWidgets
Change-Id: I4340036a4e6024d9b8d0c7832ad7bfb28ec4bc99
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-06-11 00:37:01 +02:00
Konstantin Ritt
12e0319213 Line Breaking Algorithm: handle the Object Replacement Character
See http://www.unicode.org/reports/tr14/#CB
and http://www.unicode.org/reports/tr14/#LB20 for details

Change-Id: Ice0aa2b2ce81f6e39839a353240420436eddd754
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-10 15:58:13 +02:00
Konstantin Ritt
c8dd0de1a6 Line Breaking Algorithm: don't break inside numeric expressions
Change-Id: I8362663454e4c6604ecb6289ae8009d47c78aeb1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-10 15:58:09 +02:00
Konstantin Ritt
48d99e74fc Update the Unicode Text Breaking Algorithm implementation tests
* 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>
2012-06-10 15:58:06 +02:00
Konstantin Ritt
d64cb5f707 Update the Unicode Text Breaking Algorithm implementation
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>
2012-06-10 15:58:02 +02:00
Konstantin Ritt
f32a7f1e21 Update the Unicode related autotests
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>
2012-06-10 15:57:57 +02:00
Kent Hansen
5e79415218 Make qpointer autotest build without widgets
Change-Id: Ibd05a49174e7055faa89c48659130a11418b9616
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Debao Zhang <dbzhang800@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-10 13:43:18 +02:00
Thiago Macieira
fbabbe63c5 Use UTF-8 in the QtTest data and benchmark tags
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>
2012-06-09 10:45:01 +02:00
Konstantin Ritt
80ceba9a36 QZip: improve reading of zip files, fix some edge cases in writing
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>
2012-06-08 21:49:58 +02:00
Markku Heikkila
9e75354aab Fix crash in QTreeWidgetItem::sortChildren when adding new item.
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>
2012-06-08 18:09:07 +02:00
Kent Hansen
5fc8cc830e Make qfont autotest build without widgets
Change-Id: I2ab344d44cb2aa8c59c1c28f7368784849d4b74d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-08 08:31:14 +02:00
Kent Hansen
027cd4c1b9 Make qicon autotest build without widgets
Change-Id: Ic6176404076bac956d00d57c99e0bbf0ac78beca
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-08 08:23:24 +02:00
Friedemann Kleint
23994a364e Add Qt::WindowTransparentForInput to Window flags manual test.
Change-Id: If27567a93d5a2e910289c680643503d02831d742
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-08 08:02:46 +02:00
Mitch Curtis
168c583a78 Allow ISODate string without seconds in QTime::fromString().
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>
2012-06-08 00:55:27 +02:00
Konstantin Ritt
88e735c9c9 Shift positions for lineBreakType
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>
2012-06-07 21:18:36 +02:00
Konstantin Ritt
8aac04f705 QTextBoundaryFinder: Consider soft hyphen as line breaking opportunity
SoftHyphen enum value was added to specify such a boundary reason

Change-Id: I4248909eed6ab8cbca419de4dcf9fe917620a158
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 21:18:36 +02:00
Kent Hansen
7d7cd17d38 Make qtexttable autotest build without widgets
Change-Id: Id5f93dee0c4b5978c473838559f586ced35a2981
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 07:26:05 +02:00
Kent Hansen
51aff5ba67 Make sql autotests build without widgets
Change-Id: Icd4d2ef39961e2e0ec5c9e910c74b3e8a35503bf
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 07:25:27 +02:00
Kent Hansen
2a62122682 Make "other" autotests build without widgets
Change-Id: I49e73c31b98e43259771c0e265cf13fc167c45f2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 07:24:31 +02:00
Kent Hansen
0f241b6f5e Don't build printsupport autotests when widgets aren't available
Change-Id: Ida376a75f376fc0d3696d715648c7229aec301e2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 07:24:01 +02:00
Kent Hansen
58db6e8822 Make animation autotests build without widgets
Change-Id: Icb0560a26973921611f697240fbce121fff518e9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:39:05 +02:00
Kent Hansen
1b444d5748 Remove widgets dependency from qdatastream autotest
Change-Id: I30ce3ce2d5a0badc7a846256825b4deea8c0856a
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:39:05 +02:00
Kent Hansen
872b412bcc Make qprocess autotest build without widgets
Change-Id: I0a428852222accbea8446ba1c284f1c44b9d4bf3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:39:01 +02:00
Kent Hansen
6f297d9dd4 Remove widgets dependency from qstringlistmodel autotest
Change-Id: I9678f9ee3fd8b01648cf2524452145568cf6fb4f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:38:58 +02:00
Kent Hansen
bb10660bea Make itemmodels autotest build without widgets
Change-Id: I7ff1a575c111452397c3461842c15bb01105cf95
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:38:44 +02:00
Kent Hansen
6f1b118b4d Make qstatemachine autotest build without widgets
Change-Id: I3a58cb1cbe0c86aca6e533187e85c166bf0f8957
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:38:41 +02:00
Kent Hansen
fe6fe39415 Make qpixmap autotest build without widgets
Change-Id: Iabf1e6815a2af79d9da84c0e2bb9c2de52cb698f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:38:41 +02:00
Kent Hansen
c6d3942ea7 Make qpicture autotest build without widgets
Change-Id: Id2047dace7b3087f1c7b83545f5e122ab936d33c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:38:38 +02:00
Kent Hansen
17e233e7c3 Make qmovie autotest build without widgets
Change-Id: Ie53b183e99de08c3cc35f4932b7aabf4bf5b0940
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:38:36 +02:00
Kent Hansen
5e19363699 Make gui tests build when widgets aren't available
Change-Id: I5b75116d148f84ae2f96dd6b573d14952c4b601c
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-06-07 00:38:01 +02:00
Kent Hansen
3874022ec0 Make qpainter autotest build without widgets
Change-Id: I4e05871e44f7a69aaa9cd5d876c249c7dd9d86e8
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-06-07 00:37:58 +02:00
Kent Hansen
5951b61374 Make qtextdocumentlayout autotest build without widgets
Change-Id: Ib767f9cac5fc3274ed16e87f0c4da68102147645
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:37:55 +02:00
Kent Hansen
a9eb513019 Make qtextobject autotest build without widgets
Change-Id: I9ea79b62d22faeccc07d8c21a0d8f032b40abef0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-07 00:37:52 +02:00
Mike FABIAN
897e19f95e Check LANGUAGE as well in QSystemLocale::fallbackLocale
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>
2012-06-06 15:29:34 +02:00
Kent Hansen
302e6968f1 statemachine: Make delayed event posting work from secondary thread
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>
2012-06-06 13:27:32 +02:00
Bradley T. Hughes
637ecd571f Remove insignificant_test for tst_qwindow on Mac OS X
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>
2012-06-06 12:53:55 +02:00
Bradley T. Hughes
e8cd9a617d Cocoa: do not send multiple window activation events
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>
2012-06-06 12:07:48 +02:00
Samuel Rødal
80653bf4ce Added QScreen::setOrientationUpdateMask().
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>
2012-06-06 07:41:17 +02:00
Denis Dzyubenko
944221001c Fixed QJsonObject::find()
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>
2012-06-06 02:03:11 +02:00
Stephen Kelly
7d28f7772c Use QPointer instead of QWeakPointer.
The use of QWeakPointer for tracking QObject pointers is to be
deprecated.

Change-Id: If460ca7f515db77af24030152f4bd56e1a5fae7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-05 18:42:26 +02:00
Mitch Curtis
24aad8d663 Write test to confirm QStateMachine calls connectNotify().
Task-number: QTBUG-16628
Change-Id: I77535fcb9a6ae306df8ccd670ee1bfc32721d66a
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-05 16:01:29 +02:00
Lars Knoll
143daa6ac2 Correctly locate files with relative paths
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>
2012-06-05 13:40:00 +02:00
Mitch Curtis
05d980664f Make QIODevice::seek() return false for sequential files.
Task-number: QTBUG-18173
Change-Id: Ie3a96d3a6f60995b8ba7823153778869d0c2dc58
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-05 13:12:58 +02:00
Rohan McGovern
4eecbf3b84 tst_qtoolbutton: stabilize and improve failure message
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>
2012-06-05 09:21:36 +02:00
Mitch Curtis
f3f648f920 Fix QTemporaryFile::open() failing after remove().
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>
2012-06-05 06:15:06 +02:00
Mitch Curtis
872f0b94ac Make QString("inf").toFloat() return inf instead of zero.
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>
2012-06-05 06:14:57 +02:00
Konstantin Ritt
93ead35939 Improve the QTextBoundaryFinder autotests a lot
The existing tests has been retained, the new ones has been added.

Change-Id: I12ae1b4e63dde46f3b14a7c1423c13d5881d4507
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-05 06:14:41 +02:00
Bradley T. Hughes
9b07fd0d5c Add QDeferredDeleteEvent
Use this to store the loop-level counter needed by QCoreApplication
when determining when it is safe to delete an object.

This removes the hack to hijack the QEvent::d pointer (even though
the pointer is unused).

Change-Id: I91c0b1aa00235ec6e13feb30bf928e56d2f80026
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-05 06:14:16 +02:00
Mitch Curtis
d8e457323c Allow 24:00:00 for ISO dates in QDateTime::fromString().
ISO 8601 section 4.2.3 states that "The end of one calendar day [24:00]
coincides with [00:00] at the start of the next calendar day", so
fromString() was updated to account for this.

Task-number: QTBUG-25387
Change-Id: I391db0da755dbc822ba0820c302a2c10391e1f3b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-05 06:12:37 +02:00
Rohan McGovern
1668c47608 Replace QTEST_APPLESS_MAIN with QTEST_MAIN in tests using QProcess
QProcess requires an application object to be created in order to work
correctly on Windows.

Task-number: QTBUG-26023
Task-number: QTBUG-26024
Change-Id: Ifa90946262bc7e2a7df6b6aad54e10b54473fc97
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-06-05 06:12:20 +02:00
Kent Hansen
f7c2ba9bbe Enter initial state before QStateMachine::started() is emitted
The documentation says that started() "is emitted when the state
machine has entered its initial state", but the implementation
didn't adhere to that.

The consequence is that if you e.g. emitted a signal from a slot
connected to started(), and that signal was used by a transition
from the initial state, the signal would effectively get ignored and
the state machine would remain in the initial state.

Task-number: QTBUG-24307
Change-Id: Ibbeb627d517eaff821d88e256a949eacf6aae350
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-06-04 16:53:42 +02:00
Kent Hansen
2682165708 Fix typos in QState sorting functions
A QObject can't be a child of itself, so the comparison always
returned false. In practice, this was causing the entry/exit order
of parallel states to be random.

QObject::children() is documented to contain the children in the
order in which they were added, so this fix actually achieves
deterministic behavior.

Task-number: QTBUG-25959
Change-Id: Id3f12d6bfbc249f1d4fed0bafb7d0217093e458e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-06-04 16:50:24 +02:00
Rohan McGovern
2268be8040 tst_languagechange: increased timeout on Windows
This test's runtime significantly varies on separate runs on Windows;
runtimes from 10 to 830 seconds have been observed in CI.

Increase the timeout to restore CI stability.

Task-number: QTBUG-26006
Change-Id: Iba153e65264a177d146b2f3647ec6ba529af7135
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-06-04 03:07:48 +02:00
Oswald Buddenhagen
98c7afb8d6 avoid redundant tests
tryRun() already implies tryLink() and tryCompile(), so there is no
point in executing the stages separately ...

Change-Id: Id7321efaca474e8c5db2bc246ac26323d8a99e58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-01 20:34:31 +02:00
Rohan McGovern
79a025b88a Marked expected failures in tst_qtextlayout on Windows
Task-number: QTBUG-25924
Change-Id: I24a8ab6a695bf76f19e9082e1d8b11d8ec03fc4f
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-06-01 16:12:03 +02:00
Kent Hansen
37db43f1c2 Add private API for working with meta-methods in signal index range
Internally, QObject and QMetaObject already leave out non-signal
methods when working with signals. This is possible because the
signals always come before other types of meta-method in the
meta-object data. Ignoring irrelevant methods is faster and can
save memory.

QMetaObject provides internal indexed-based connect() and
disconnect() functions. However, these functions currently take an
absolute method index as the signal specifier, instead of an
absolute _signal_ index. Hence, QMetaObject and friends must convert
from the method index range to the signal index range.

By providing an API that only considers signal indices, clients of
the index-based QMetaObject::connect()/disconnect() can provide the
proper signal index directly. Similarly, for the qtdeclarative
integration (QDeclarativeData hooks) the signal index can be passed
directly. This will eliminate most of the conversions back and forth
between signal index and method index, and some other redundant work
done by qtdeclarative's custom connection implementation.

There are some places where the behavior can't be changed; for
example,  QObject::senderSignalIndex() will still need to return an
index in the method range, since that function is public API.

Changing QMetaObject::connect()/disconnect() to take an index in
the signal range will be done in a separate commit; this commit is
only an enabler for porting existing usage of those functions to
the new behavior.

Change-Id: Icb475b6bbdccc74b4e7ee5bf72b944b47159cebd
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-01 16:04:04 +02:00
Lars Knoll
79194978cd Fix a bug in the case conversion code
Chars that have a case conversion that converts
them into several characters can't be handled
by QChar::toUpper() etc and should get ignored. The code
didn't do that correctly.

Change-Id: I281d122e90bf49187b6449088d2fccef2ef75e86
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-01 13:11:50 +02:00
Thiago Macieira
5a447502b5 Fix the QVector build with C++11 initialiser lists
Initialiser lists were not tested before in the QVector rewrite, so
the older malloc call was left behind.

Also, std::initializer_list has const iterators returning const data
and broke the build in a few places where const qualifiers were
missing.

Change-Id: I3c04e58361989aa7438621cda63c7df457d7dad8
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-01 12:27:37 +02:00
Thiago Macieira
9c5a77f0ef Make QVector compile with QT_STRICT_ITERATORS again
Move the iterator classes into QArrayTypedData and add constBegin()
and constEnd() to that class.

I also had to add an operator T*() to the strict iterators, since
there are many places that expect the iterator to behave like a
pointer (including in QVector itself).

Change-Id: Icc5ed56ad47b013664a48eef9d31b5273aecb4e3
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-01 12:27:32 +02:00
Rohan McGovern
9469e9fdeb Make tst_qabstractnetworkcache parallel-safe
Use a unique QTemporaryDir instead of a fixed path for the test cache.

Change-Id: Ib664033a509a6cefd7c323708f80ef595b202178
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-06-01 03:16:11 +02:00
Rohan McGovern
8eed0ce930 Mark tst_qfreelist as parallel-safe
This autotest appears to be parallel-safe.

Change-Id: I12f9202633941e9339de0709353efb2b41df4fa1
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-06-01 03:16:04 +02:00
Chris Adams
fbee9834dc Fix crash in QStringBuilder when concatenating data-less QLatin1String
Previously, the append functions in QConcatenable in the QStringBuilder
dereferenced the data() pointer of the argument QLatin1String without
performing null check.

Change-Id: I629f19fbce3113f1f80f4272fa7ae34e1dbc6bee
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-06-01 01:22:06 +02:00
Miikka Heikkinen
32fa7a5410 Fix tst_qlistwidget::fastScroll test case
tst_qlistwidget::fastScroll fails if the mouse cursor happens to be
over the tested widget, because that causes an item to highlight,
resulting in unexpected region of widget to be painted. Fixed by
forcing the mouse cursor off the widget before the test.

Task-number: QTBUG-24299
Change-Id: I8f45541feda44681179d43eda67d970d5fea4e40
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-01 01:21:17 +02:00
Laszlo Agocs
b551d5e4f7 QPA tablet event support
Should be sufficient to allow implementing the actual functionality in
xcb/cocoa/windows to match the Qt 4 level of tablet event support.

Task-number: QTBUG-25864
Change-Id: Iebcca256dfba841d8976b58fda1b76026d3133a3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-05-31 09:13:01 +02:00
Rohan McGovern
b63e101a90 Make tst_qnetworkdiskcache parallel-safe
Use a QTemporaryDir for a unique test cache directory for each process,
rather than a fixed path.

Change-Id: I64df8422d01282bbc108e942947c1b55368bd941
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-31 05:37:28 +02:00
Rohan McGovern
c09b5f5ad8 Improved stability of tst_qstatemachine, mark as parallel-safe
tst_QStateMachine::postEventFromOtherThread() assumed that 10,000
iterations of the event loop in a separate thread could always be
completed successfully within the default QTRY_COMPARE timeout.
This may be false if the CPU load is already high - such as when running
other tests concurrently.

Decrease the iteration count.

Change-Id: I780523f73c0c16fa0b2ab3201b2b0affdebc198d
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-31 05:37:25 +02:00
Rohan McGovern
af8fa2794b Make tst_qtextstream parallel-safe.
Write to a QTemporaryDir instead of the test's build directory.

Change-Id: Ib65a0d58fbdf8caf8f2cb7002aeed1ce34742183
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-31 05:37:25 +02:00
Rohan McGovern
26631bec9f Marked tst_qtemporaryfile as parallel-safe
This test failed a parallel stress test, but seemingly only because it
writes to its own build directory.  This should not interfere with other
running autotests.

Change-Id: I27a2f31e32a5b8157ef1082cf0e939bcc0c61c70
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-31 05:37:22 +02:00
Rohan McGovern
489dd2804b Marked tst_qfile as parallel-safe
This test failed a parallel stress test, but seemingly only because it
writes to its own build directory.  This should not interfere with other
running autotests.

Change-Id: I80e548fdb0e915ebe86dcd2205537cb6fee09cff
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-31 05:37:19 +02:00
Jędrzej Nowacki
d17cf14185 Implement QVector with QArrayData interface.
Change-Id: I109f46892aed2f6024459812d24922b12358814d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-30 17:07:27 +02:00
Rohan McGovern
46ae50a5d0 Marked tst_qprocess as parallel-safe
This autotest appears to be parallel-safe.  It fails our parallel stress
test, but only because it writes to its own build directory.  This
should not interfere with other autotests.

Change-Id: Ie99dde24edc0fda0c8ec4352a6e44abb7cbc54f8
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-30 06:29:10 +02:00
Jan-Arve Saether
7cdcc26722 Fix Qt 5 todo issues for QSizePolicy.
* Merge the two public ctors.
* Use bitflags instead of shifting bits (more readable).
* Add autotest
* Use int datatype for the "stretch setters". (values out of bounds are clamped)

Streaming to QDataStream will still use the Qt 4 format.

Task-number: QTBUG-25100

Change-Id: Iecb1e78cb12717e4d84448484c3ad8ca469d571a
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-05-30 01:54:45 +02:00
John Layt
44f7df439f QtPrintSupport - Add QPrinterInfo api for more printer details
A previous commit changed the Mac behaviour for printerName()
from returning the CUPS Description to returning the CUPS Name.
In case anyone was relying on this for a human-readable name
add new api to return the CUPS Description.  Also add the
Location and Make and Model which will be used in the Unix
print dialog instead of directly calling CUPS.

Change-Id: I9901bf8d6368466adf111580f5db5a3f01ca9170
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-05-29 23:48:15 +02:00
Rohan McGovern
dd3e4f1dbe Set explicit testcase.timeout for slow tests
We'd like to decrease the default timeout for tests in the Qt Project CI
so that we waste less time waiting for hanging tests.

Tests which genuinely take a long time to run, such as these, should
have their timeout explicitly set in their .pro file.

Change-Id: I4fe6249e9efa764b230251d73a1115c24411e168
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
4e9e4d940f Make tst_qfiledialog2 closer to parallel-safe.
Use a QTemporaryDir instead of the system-wide temporary directory.

The test is still not entirely parallel-safe (at least on X11) due to
requiring the shown dialog to have keyboard focus.

Change-Id: I628dc6ab52dda49f6957a301eea8944bb9d81453
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
b1e59467fb Make tst_selftests parallel-safe.
Use a QTemporaryDir for temporary files, instead of the current working
directory.

Change-Id: Ifeb2944238f785a1f7beb0dc2a7c1e092d121db5
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
70ad49d661 Mark tst_qsharedpointer as parallel-safe.
This autotest seems to be parallel-safe.  It was not marked as such due
to an issue which rarely causes the test to hang on exit on Windows, but
that appears unrelated to whether or not the test is run in parallel.

Change-Id: I30bac75be3ddc14139594605481eb6af3f6795e7
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
f21832a465 Marked tst_qmake as parallel-safe
This autotest fails a parallel-stress test because it writes into its
own source/build directory.  However, by inspection, it appears not
likely to cause issues with any tests other than itself.

Change-Id: I13789ba14bab240d34c22c5b77d6407995423afc
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 09:39:18 +02:00
Rohan McGovern
61904b8cfc Make tst_qfilesystemmodel parallel-safe.
Changed one testfunction to use the test's own QTemporaryDir instead of
the system-wide temporary directory.

Change-Id: I6740a7f4ba7f53174cd0730239d8dc088e5111ba
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 03:04:29 +02:00
Rohan McGovern
c68f4367f6 Make tst_qnetworkreply parallel-safe.
Ensure we always use a unique filename when writing to test files.
The test already contained code for this, but it was not applied in a
couple of places.

Change-Id: I1e29ee162c390e014688ab46e3658e2a463d203e
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-29 03:04:29 +02:00
Jiewen Wang
3be6ca3ee8 Eliminate QTreeWidget drag crash
In QTreeViewPrivate::adjustViewOptionsForIndex() wrong index had been
used when referencing to array of viewItems. Variable row is set to the
index of the QModelIndex, however it is not as same as the index in
viewItems[] when there was hidden item in treeWidget. Index of viewItems[]
should be used here. Unit test is added as well.

Change-Id: Idc7eda979e7d09c5a07bd6dffd92b7abbac10e67
Task-Id: QTBUG-25333
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-05-28 16:49:56 +02:00
Rohan McGovern
177070cb7b Add CONFIG+=parallel_test to suspected parallel-safe tests.
These tests have passed a parallel stress test on all three of Linux,
Mac, Windows.  Mark them with CONFIG+=parallel_test to allow CI to run
them in parallel, saving time.

Change-Id: I19fd333c3c645a67374ca998f6c8530dd236b0f8
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-05-28 07:33:01 +02:00
Rohan McGovern
f5c5063623 Marked tst_qprocess insignificant on mac
tst_qprocess::lockupsInStartDetached sometimes locks up on mac.
Mark this as a known issue.

Task-number: QTBUG-25895
Change-Id: I08b1bcf39f2bf373e74509a06415d9ba514b8993
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-28 03:30:21 +02:00
Mitch Curtis
cebcfcc66b Fixed unused function warning in qtextdocumentfragment test.
Change-Id: I74bb961bf23c4ca1e8e5dc77e870d43fcecc5c09
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-05-28 01:12:34 +02:00
Jiewen Wang
7381328bcc QStatusBar::showMessage will always take new timeout
There is a message check in QStatusBar::showMessage causing the call exits
early if the new 'message' is the same
as the current message. The check has been removed, and new timeout will
always take effect. Unit test is added as well.

Change-Id: I3a03c6842835824caba4adc37c3ed834952c4bb2
Task-Id: QTBUG-25492
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-05-25 21:41:42 +02:00
Tarja Sundqvist
7266e11297 QTBUG-16850: QLineEdit::setSelection removes blank characters
Changed checking of the start position so that it does not call d->control->text() because this removes blank characters when an input mask is used. Thus the
selection fails. Instead d->control->end() is used for checking the start position.

Task-number: QTBUG-16850
Change-Id: I62992fb81bd47d432bade9f219782d48eb309956
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-05-25 17:23:20 +02:00
John Layt
3dffbe8c81 QtPrinterInfo: Improve QPrinterInfo Testing
Much of the current QPrinterInfo tests fail due to being dependent on
specific physical or network printers being attached.  This change
removes all printer specific tests and replaces them with generic
tests that will use whatever printers are installed.

Note if no printers are installed then the tests will still pass. A
later change will add virtual printers to test returned results are
correct.

Windows test code is also required and will come later.

This does not yet remove the "insignificant" status from the test,
further improvements and code fixes are still required.

Change-Id: I60802445924edb126aadf78337a8cb6f2f3b3d37
Reviewed-by: John Layt <jlayt@kde.org>
2012-05-25 13:23:14 +02:00
Mitch Curtis
794febd713 Write QList unit tests for movable, complex, etc. types.
Change-Id: I641ada39f7c84cd221ec1e235cdb0c86270d49fc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-05-24 20:20:52 +02:00
John Layt
36f469bdb1 QtPrintSupport - Modify Platform Plugin QPrinterInfo api
Change the way the printsupport plugin creates QPrinterInfo
objects, provide platform api to return a named printer, and
expose this as static public api in QPrinterInfo.

Only the Mac plugin used the old api, the other plugins will
have direct support added in separate commits, but will use
the default implementation for now.

Change-Id: I7d6b6556eb39919cfb15bc0e814afbaf13c5712c
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-05-24 09:48:27 +02:00
Rohan McGovern
0a298ab485 tst_qmetatype: avoid slow compilation with some MSVC2010
MSVC2010 32-bit (with and without service pack 1) takes about 1 hour to
compile this file in some builds, since
1c7421ad14.

Avoid the relevant portion of the code just for these compilers.

Change-Id: Icbb4fa12a6d563a7cdc882c30cdb5705675bedb0
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-05-24 07:14:40 +02:00
John Layt
f3ad57e90e QtPrintSupport - Fix Mac printerName() use
Mac in Qt4 and 5 has been using the PMPrinter Name for the QPrinter
and QPrinterInfo printerName() value, but this is incorrect. This
is in fact the CUPS Description field, is in human readable form
and is not guaranteed to be unique. The CUPS Name field is the
PMPrinter ID value and should be used as the unique identifier
when accessing printers. This has worked up to now due to an
undocumented feature in the OSX api that accepted the Name when
the ID should be used.

Changing all uses of PMPrinterGetName to PMPrinterGetID fixes this
and allows the QPrinterInfo test of names to pass without
munging the names.

Change-Id: I25322aa1a924bed9f67f4ad5e208274c8b700e17
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: John Layt <jlayt@kde.org>
2012-05-23 23:55:43 +02:00
Laszlo Agocs
cd8ff4fa8f Fix wrong local positions in mouse events when no tlw was given
Calling handleMouseEvent() with w == 0 implies that the local position
is bogus and instead it should be calculated from the global position
once the target window is known.

Change-Id: If173d0570f6dcc8b7bc5d6f21fa1f69d06d9d702
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
2012-05-23 19:22:34 +02:00
Shane Kearns
f604fd8ff4 QAuthenticator - test NTLM SSO and normal paths separately
Single signon code path gets the NTLM responses from the system,
so we can't predict the contents.

Task-number: QTBUG-25851
Change-Id: Ia8aa1741ae5af9e48643331bf9a3768550a30166
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-05-23 14:18:34 +02:00
David Faure
f06b629bfb Fix handling of invalid urls in QDataStream << QUrl
When given an invalid url, the output shouldn't be a valid url.

KDE's kurltest detected this regression compared to Qt4, where
all invalid urls were empty in toString() -- but we don't want that,
to give as much feedback as possible to the user.

Change-Id: Ie53e6e1c0a1d4bb9e12b820220dfb7e2f7753959
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-05-23 14:18:34 +02:00
Jędrzej Nowacki
06906ce40d Fix warning about unused variable in tst_qvariant.
Change-Id: I9e713aa6a2033c5c4cd4b97bbd4ebb461d46962a
Reviewed-by: Jonas Rabbe <jonas.rabbe@gmail.com>
2012-05-23 14:18:34 +02:00
Rohan McGovern
03536d3e3d Removed CONFIG+=parallel_test from suspected parallel-unsafe tests [2]
These tests have failed a parallel stress test and may contribute to
instability in test runs.

Change-Id: Ibbbe01f7d9550b953fc9fbd6ed52fc99fdb5f5d7
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-05-23 03:17:59 +02:00
Tasuku Suzuki
8b78b3a620 Fixed QLineEdit::inputMethodQuery() for Qt::ImHints
It should return QWidget::inputMethodHints() instead of QVariant()

Change-Id: I01f5de8f2087ac67d125f54f08abed523653eb92
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-05-23 01:11:27 +02:00