Commit Graph

2651 Commits

Author SHA1 Message Date
Joerg Bornemann
0f3528a7f6 tst_QWidget::gdiPainting fixed
We cannot use QWidget::grab for widgets that have WA_PaintOnScreen set.
QScreen::grabWindow copies the real screen contents for us.

Change-Id: If1f6233ec48bcb2b941ea683c56ce71a39642e67
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-07-03 13:32:04 +02:00
Kurt Korbatits
28f30aa543 Fixed warnings in qnetworkreply unit test
On windows without ssl there was a disconnect on sslError signal
that was not wrapped in ifdef.

Change-Id: I9b1327adfa853d4dc8f1d8a0120f8f0ed7c13e9e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-07-03 04:03:12 +02:00
João Abecasis
deb8d178fe Add erase operation to QArrayDataOps
Change-Id: I37d3ac465f5beddb5038e22e9cda32acb16c78fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-07-03 01:55:39 +02:00
Martin Petersson
6c59cdecee QSslCertificate::fromPath fix wildcard handling
The reqExp used to handle wildcards in the path was broken. So we
always searched the working directory and not the specified path.
Autotest where passing because of a hack used for Windows paths
where we removed the first two chars in the path string.

This fix will not use nativeSeparators thus removing the Windows hack
and fix the regExp to match wildcard chars.

Task-number: QTBUG-23573
Change-Id: I56fadbb67f25b8ce9c0f17cb6232e0bdb9148b1c
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-07-03 01:09:33 +02:00
Yann Bodson
2ff6086e06 Fix capitalization with newline bug
We only want to change the capitalization if the QScriptAnalysis flag
was Lowercase, Uppercase or SmallCaps.

Task-number: QTBUG-17485
Change-Id: Icbecb09b06a9153866ae81d592b3f6779c2dafb5
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-07-03 01:08:37 +02:00
Stephen Kelly
91720b5bc2 Move the macros for invoking ctest to a shared location.
They are still internal, but all Qt5 modules will be able to use
them then.

Change-Id: I42ab656115b0976ca959293dfd664ec071f35dbf
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-07-03 01:08:25 +02:00
Stephen Kelly
13e1e30ec3 Add constexpr template specializations for built in metatypes.
This will make it possible (in Qt 6) to remove the enums listing
metatype ids. As it is constexpr, it can be used in switch statements
just like enums, as enum values, and as template specialization values.

Change-Id: I51293674c403714e34cb8a8b8953522fc97a740a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-07-03 01:08:05 +02:00
Kalle Juhani Lehtonen
2ec9d34df6 Mark qgl autotest as significant for Windows
After Mesa 3D OpenGL library deployment to Windows 7 machines the test
starts passing.

Task-number: QTBUG-25293
Change-Id: I228cd683359f3932670bfa6ec8c4f32e2b40144b
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-03 00:51:44 +02:00
Kalle Juhani Lehtonen
34396358d5 Change qglfunctions autotest to insignificant on Windows
Previously the test was skipped, because no OpenGL context was found.
After Mesa 3D OpenGL library distribution for Windows 7 machines,
OpenGL context is found, but the test crashes with exit code:
0xC0000409 (STATUS_STACK_BUFFER_OVERRUN)

Marking the test insignificant until the issue is resolved.

Task-number: QTBUG-26390
Change-Id: I996bbc3399704b541f5baa4832cf39b77b715c1c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-07-02 03:19:15 +02:00
Stephen Kelly
edfc0f89a9 Implement QVariant conversions for QObject derived pointer metatypes.
canConvert() and convert() use the metaobject to convert such types.

Change-Id: Ic05e74c5c2423b4b9682b88adc856a16dcba4cff
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-01 18:25:01 +02:00
Stephen Kelly
14c7bb72b9 Store the QMetaObject with the QMetaType.
This will allow conversion between pointers to compatible QObject
derived types.

Change-Id: I19e08934571fb3f1b91e594892214041fe5f6a11
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-07-01 15:07:10 +02:00
Toby Tomkins
179d9fe7b4 Flag consistently failing tests as expected fail tests.
Task-number: QTBUG-26372
Task-number: QTBUG-26371
Task-number: QTBUG-20984

Change-Id: I7ae558243c366769cd6c587e77f862558e8053a1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-06-30 04:30:15 +02:00
Giuseppe D'Angelo
985292b0a3 QAbstractProxyModel autotest doesn't need widgets
After the QStandardItemModel move to QtGui.

Change-Id: I2be82d89518ff97cf164026ee8b13a41f9c93d4a
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-06-29 22:42:23 +02:00
Giuseppe D'Angelo
dba22bc036 Move QStandardItem/QStandardItemModel to QtGui
The dependencies on QFont, QBrush, QIcon are all in QtGui, so there's
little sense to still have these classes in QtWidgets.

This also copies and pastes a version of QWidgetItemData as
QStandardItemData inside qstandarditemmodel_p.h.

Change-Id: Ibafc5a30748e7ce0b54753309ae6dc4a797fc20e
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-06-29 22:42:19 +02:00
Oswald Buddenhagen
1491065506 Merge branch 'buildsystem' (second round)
refactoring and cleanup. fixes x-builds between different os families.

Conflicts:
	mkspecs/features/qt.prf

Change-Id: I0205e6f07f77c9b015cf055dd87a471883949a91
2012-06-29 09:06:37 +02:00
Kurt Korbatits
551e1e63d9 Fixed several unit tests to work in shadow builds
- qlogging, qthreadstorage, qnetworkreply, qapplication, qfile, qprocess
  Added app_bundle and debug_and_release_target to CONFIG

Change-Id: I6212902c449520dc016da9590149a423069cc38c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-06-29 04:57:04 +02:00
Mitch Curtis
ab536c3c71 Make QCalendarWidget use its locale's firstDayOfWeek.
QCalendarWidget currently uses Qt::Sunday as the default first day
of the week. It has been suggested that a better user experience
would see the calendar's locale be used instead.

Task-number: QTBUG-19811
Change-Id: I4441bf9ffd52213ef622a4a7f498530b7cc9e110
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-06-28 17:15:17 +02:00
Kent Hansen
d359b0af2b Call QObject::disconnectNotify() when receiver is destroyed
Store the signal index in QObjectPrivate::Connection, thereby making
it available in "implicit" disconnect contexts (i.e., receiver
deletion).

This change does not cause the size of QObjectPrivate::Connection
to grow (still 40 bytes on 32-bit Linux, 72 bytes on 64-bit Mac).

Valgrinding the new benchmark indicates that the percentage of the
time spent in the QObject destructor increased from 7.8% to 8.4%
on ia32, for that particular stress test; the increase is the
combined cost of calling metaObject(), QMetaObjectPrivate::signal(),
and disconnectNotify() for one connection. In practice, the measured
wallclock time increased by about 3ms for a 500ms run (which
repeatedly constructs, connects, and destroys an object).

Task-number: QTBUG-4844

Change-Id: I1beb01c753f31542fc0acb62edb4c6d165fcc5b4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-28 14:44:20 +02:00
Rohan McGovern
f4dd033f41 Fixed qsslsocket_onDemandCertificates_{static,member}
This test had been XFAILing since August 2011, but recently started to
XPASS, possibly due to changes in the SSL setup on the tested host
(qt.nokia.com).

Removed QEXPECT_FAIL and replaced qt.nokia.com with
codereview.qt-project.org as a host expected to have working SSL.  (If
SSL on the latter were broken, it would immediately be detected by
any attempts at git over HTTPS.)

SSL setup can be verified as working by:

  openssl s_client -CApath /etc/ssl/certs \
    -connect codereview.qt-project.org:443 </dev/null

Task-number: QTBUG-20983
Change-Id: I9b4146da6545ab4115d6308044b1d242dd52b7f9
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-06-28 02:18:42 +02:00
Thiago Macieira
dc56fb18a7 Remove the extra warnings and -Werror from tst_qmimetype
Those belong in headersclean and nowhere else.

Change-Id: Ib7078ef3071266e4c03e3580068f978a9418cbf1
Reviewed-by: David Faure <faure@kde.org>
2012-06-27 12:39:53 +02:00
Oswald Buddenhagen
16785c4c14 do not unnecessarily mess with CONFIG
it could/would bite us later

Change-Id: I73f989e7603c6e5b7b85fc4ee4ad2557c1b02d80
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-06-27 09:39:01 +02:00
David Faure
2246e48a76 Add QGuiApplication::setApplicationDisplayName.
This is for use in window titles.

Change-Id: I0070a08abd379ae2edcfab4413c182bd9e840678
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-06-27 09:23:15 +02:00
Shane Kearns
c0a0b37103 Implement RFC6265 test suite
Tests against the test data from the IETF working group
https://github.com/abarth/http-state

The test data is in the parser.json file, imported from that repository
and with one patch applied to make the ordering0001 test case data match
the raw files which are used by their python test server.

Task-number: QTBUG-18920
Change-Id: I17c1a8d92aef2850907f009667c6574e4c8d0cdb
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-06-27 00:46:35 +02:00
Shane Kearns
058fddd1c0 Use RFC6265 rules for cookie path & path matching
Url encoding of paths is no longer used. This matches the
current release behaviour of Firefox, Chrome and MSIE browsers.
RFC6265 does not allow this type of encoding.

This fixes remaining path test cases in the IETF test suite.
Currently the path0027 test is passed by Firefox but failed by
Chrome and MSIE, so there is a potential compatibility issue.
However it is a corner case with a malformed cookie.

Task-number: QTBUG-15794
Change-Id: I9b02bb5adc32d614f512d314d06f2c60894aa2b0
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-06-27 00:46:35 +02:00
Shane Kearns
d76bd0d735 QNetworkCookie: Use RFC6265 rules for parsing Set-Cookie
The ';' separator takes priority even inside a quoted string.
Quotation marks have no special meaning, they are not parsed and
regenerated anymore. This means it is not possible to include
the ';' character inside a cookie value.
Other characters are returned transparently, including [",\]

Task-number: QTBUG-15794
Task-number: QTBUG-26002
Task-number: QTBUG-11641
Change-Id: I4eefef5c6ac7753d5a21c226169e264578521fe9
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-06-27 00:46:35 +02:00
Shane Kearns
a32d6834ad qget test - fix null pointer dereference
If the server sends a redirect with no body, the file is null

Change-Id: I49fd1d8a4cdd404497ebef4c7f3b478960776896
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-06-27 00:46:35 +02:00
Shane Kearns
74d3963c25 Change invalid test case (two cookies separated by ,)
Two cookies in a single Set-Cookie header are no longer allowed.
Check that this header is parsed according to RFC6265 rules instead

Change-Id: Ice48bbe78a9886208f7d1186cf1d8c37f46f1252
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-06-27 00:46:35 +02:00
Peter Hartmann
bd38ff3c54 QNetworkRequest autotest: adapt to new cookie parsing (re. commas)
Cookies cannot be separated by commas anymore, but are separated by
new lines.
See "Remove support for multiple cookies in one Set-Cookie header to
follow RFC6265."

Reviewed-by: Martin Petersson
Task-number: QTBUG-21456
(cherry-picked from 5d809703aa2d2a08ae7e9610fd42025b081d3d0c)

Change-Id: If7d1b4e58399a5d678495af6ff280409ba220e86
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-06-27 00:46:35 +02:00
Jocelyn Turcotte
297a25cc4b Remove support for multiple cookies in one Set-Cookie header to follow RFC6265.
This also allows cookie values to contain commas to increase compatibility like
most popular browsers do even though the RFC still reserves them for future uses.

Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Task-number: QTBUG-21456
(cherry-picked from 8ba781b01e900148fec2e9d26485369b3295487f)

Change-Id: Ib09ab2411dddf7f99de1c0c31680428b7412fc7e
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-06-27 00:46:35 +02:00
Debao Zhang
744a31fe2a tst_qtextscriptengine: make it compilable under MSVC2010
Source files which contain UTF-8 literals can not be compiled
by MSVC with Chinese/Japanese locale.

Change-Id: I5daa2e45c5e1ceb86da91e72288c24018c49c0f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2012-06-26 22:38:23 +02:00
Mitch Curtis
98803a76b3 Fix QIODevice warning when running rcc.
When opening a QFile on stdout, for example,
we must not call seek as it is a sequential device.
This has been flagged as a warning since commit Ie3a96d3a
and has resulted in spurious warnings being emitted.

In the case of opening a QFile in Append mode, QIODevice::open
already sets the position marker, so calling seek is redundant.
This is also true for the file engine's open function (called
through openExternalFile()), which also ensures the handle or
descriptor is repositioned appropriately.

Task-number: QTBUG-26104
Change-Id: I71040c399efe54e7538f54433368b432e959e08d
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-26 19:30:00 +02:00
David Faure
61162c6e87 Add missing subdirs (the new QUrl unit tests were not compiled and run)
Change-Id: I1b39d92b8a14d5aeca957180858e1980a534894b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2012-06-26 14:53:46 +02:00
Stephen Kelly
c42a0a7729 Factorize the cmake test infrastructure to be reusable.
This makes it easy to add cmake module tests for all modules.

Change-Id: I303bf7674ca6ae7a8544488f96e8e02afbaa6ff0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-06-26 11:49:52 +02:00
Tasuku Suzuki
197b145a23 Fixed inputMethodQuery() for Qt::ImHints
to return QWidget::inputMethodHints()

Change-Id: I46735c553e0cb4689cd0c53a69d07ed61ba56bf6
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-06-26 08:14:17 +02:00
Tarja Sundqvist
0a6dc44f24 QTBUG-26035: Remove positive sign from start of string
Updated removeGroupSeparators(QLocalePrivate::CharBuff *num) so that it
removes also positive sign ('+') at the start of the string. Auto test
included.

Task-number: QTBUG-26035

Change-Id: I8e0e071d6c682d9192a8c6bb2f282510e21b3c48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-06-26 08:14:17 +02:00
Oswald Buddenhagen
ed96d199f1 fix somewhat common edge case in $$shadowed()
if source and build dir are direct children of the common root and we
are shadowing the top-level source dir, there is of course no trailing
slash to match.

Change-Id: I8a34a6a72d16cb21d77d056e037235af9b32a008
Reviewed-by: Davide Pesavento <davidepesa@gmail.com>
Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-26 08:14:17 +02:00
Shane Kearns
afdce18f57 QSKIP test that is blocking unrelated changes in CI
The test looks vulnerable to misbehaviour if the working directory
contains unexpected files and folders. As it's already skipped on
Mac, skip on linux as well to unblock the CI.

Change-Id: Id2e48ea455eb77e36c4f9d899885e101f674c0a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-25 23:32:50 +02:00
Harald Fernengel
62d481757c Make test work on Mac OS X
Change-Id: I0c2d9bc7500972144d44060f38bc7a5da65ed30f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-23 16:25:47 +02:00
João Abecasis
796f85b611 Don't operate on bogus data, assert on preconditions instead
QVector::erase shouldn't try to make sense of iterators it doesn't own,
so the validation being done here is bogus and dangerous. Instead, it's
preferrable to assert, the user needs to ensure proper ownership.

The case of erasing an empty sequence is not checked for preconditions
to allow

    QVector v;
    v.erase(v.begin(), v.end());

, while being stricter on other uses.

Autotests were using ill-formed calls to the single argument erase()
function on an empty vector and were fixed. This function erases exactly
one element, the one pointed to by abegin and require the element exist
and be valid.

Change-Id: I5f1a6d0d8da072eae0c73a3012620c4ce1065cf0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-23 14:16:33 +02:00
David Faure
86ae3809a9 Skip 3 test methods if the test server isn't set up.
This makes things easier for developers touching QtCore and running
all QtCore unit tests.

Change-Id: I7aa832a6a1be07d90cacad2eecb2364285ff3818
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-06-23 14:16:29 +02:00
Stephen Kelly
3d2a8d09d1 Add a variable for the private includes for modules.
This is required to use QPA for example in 5.0.

Change-Id: I44bfc6987d778370e55c05c591f63ff84c482d0a
Reviewed-by: David Faure <faure@kde.org>
2012-06-23 14:16:24 +02:00
Stephen Kelly
2af438a6ce Give the CMake unit tests more meaningful names.
Change-Id: I0a54d32ec62ff6daf7672d0aabdeb038f4c7c78f
Reviewed-by: David Faure <faure@kde.org>
2012-06-23 11:37:49 +02:00
Stephen Kelly
ddf5226bd7 Forward-port change to QT4_ADD_RESOURCES macro for missing rcc files.
Forward-port of commit 9ce67d30011db4528d3d0bbee36412e13cfb80cc in
cmake.git.

Change-Id: I2d6c14f68f1630fc0835b3103e5058f52c2d0d13
Reviewed-by: David Faure <faure@kde.org>
2012-06-23 11:37:39 +02:00
Toby Tomkins
786341fda1 tst_qgraphicsview hoverLeave regressed
Task-number: QTBUG-26274

Change-Id: Ieafc6bf4a7fa5287985610a4dea57fbe6f3a9eba
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-06-22 05:21:54 +02:00
Janne Anttila
5281cba808 Fix qitemview and qdatetimeedit autotest builds for WinCE.
Defined missing SPI_GETPLATFORMTYPE macro as it was done in for example
in qwidget and qaccesiblity test cases.

Change-Id: I33a1e0119848911fbc4830299fcc1854f5259e86
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-06-21 00:58:29 +02:00
Janne Anttila
db7bdcd976 Fix qdiriterator autotest build for WEC7.
Change-Id: I18b1bdd79905761eff7a5ddbe1c6538c33624a1f
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
2012-06-21 00:58:26 +02:00
Samuel Rødal
ec2e99ead5 Fixed mouse grabbing preventing popups from being closed.
The pointer grabbing leads to fake Enter events being sent to the
Qt::Popup window, preventing it from closing since QWidget::underMouse()
returns true. We should only send Enter events if the mouse is actually
inside the widget.

Change-Id: I4ba3fb08943580f93ad4337ff0227becd647767e
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-21 00:58:22 +02:00
Shane Kearns
98fd2eeb62 Handle fragmented responses on SOCKS5 control channel
Server responses may arrive in more than one packet, though this
is rare due to nagle algorithm.
Also fixed IPv6 addresses being discarded from server responses,
which was caught by the new autotest.

Task-number: QTBUG-18564

Change-Id: I32d9e2978037fb3e1fff27b7e618b5da6d222f28
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-06-21 00:58:19 +02:00
Janne Anttila
d527f2b933 Fix qfile autotest build for WEC7
Change-Id: I6c4b4c91ea841ccb91ad685510caaecaf51baced
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-06-21 00:58:16 +02:00
Stephen Kelly
579ea489a4 Record if a metatype is a smart pointer to a QObject derived.
This allows QVariant/QMetaType software (such as QtDeclarative) to
deal with smart pointers in a similar way to how they can deal with
naked pointers (accessing properties etc).

This also adds a requirement that T be fully defined when
QSharedPointer<T> is inserted into a QVariant.

Change-Id: I29e12b8a6aa5f4aadbd62f92b89bc238f64b5725
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-20 15:45:07 +02:00
Stephen Kelly
668efc29fd Add some internal API for extracting a QSharedPointer<T> from QVariant.
The T must be derived from QObject, or it will fail to compile.

This will allow scripting or other 'wrapping' and runtime environments like
QtDeclarative to handle QSharedPointers to types derived from QObject
properly. A QSharedPointer<T> can be inserted into a QVariant, and
where T derives from QObject, a QSharedPointer<QObject> can be
extracted from the QVariant, and its properties are then accessible.

Change-Id: I68d6d89aceceb019267bd7301baa2047f9c09b90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-20 15:45:07 +02:00
Bradley T. Hughes
cf7c93b928 Change *-clang mkspec globs to *-clang*
Like with the numerous g++ mkspecs, we have mkspecs with suffixes, and
these mkspecs should still match the clang globs.

Change-Id: I9296408b5192bc72cc468d229a57923e3f5ab6f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-20 15:45:07 +02:00
Joerg Bornemann
5f9d386727 fix tst_QWidget::getSetCheck on Windows
Change-Id: Ie11a7576f8e618e2fedb31bd8071abb44b9f9f57
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-06-20 15:45:07 +02:00
Mitch Curtis
f74b26b6aa Fix unused parameter warnings in moc test.
Change-Id: I3467a8bf99464c2d3762a171b20508bb4b29ddb4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-20 15:45:07 +02:00
Oswald Buddenhagen
6d9c545d2b Merge "Merge branch 'buildsystem'" into refs/staging/master 2012-06-20 12:38:32 +02:00
Mitch Curtis
86f953a6d4 Make QDateTime::fromString()/Time::fromString() adhere to ISO 8601.
Currently QDateTime::fromString and QTime::fromString do not correctly
handle fractional minutes and, in some cases, fractional seconds.

In the case of reading fractional minutes, it has been decided to
ignore invalid characters outside of the 5 character portion that
we're interested in (see code comments in fromStringImpl() for
info on why we read 5 digits). The motive is that there is a
performance penalty for calling mid to get the portion of surplus
string and also for converting to it to a float. This is also in
line with what QDate does with surplus characters, for example.

Task-number: QTBUG-14418
Task-number: QTBUG-25387
Change-Id: Ib742fe80686aff3c3770b995678cf838fb4e3bb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-20 12:38:32 +02:00
Mitch Curtis
223ed436b5 Clean up QDateTime tests.
Clean up and consolidate different tests in tst_qdatetime.cpp
(that seem to be doing the same thing) into single tests.

Change-Id: Ib6ceb1cb7fb4c6eca672495f96d9cfd907853c85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-20 12:38:32 +02:00
Mitch Curtis
902638e379 Add leading zeros to years below 1000 in QDate::toString().
QDate::toString(Qt::ISODate) lacks prefixed 0's on years below 1000.
The ISO 8601 standard dictates that this should be the case.

Task-number: QTBUG-16476
Change-Id: I7e73152bba0f5894bcbaa3f4418732b74ce86bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-20 12:38:32 +02:00
Kent Hansen
2bfdc2b540 Add test for queued call of method with unregistered parameter type
Verify that this produces a warning containing the relevant typename.

Change-Id: I046c02585e410a211e9175600b1027dda83bdd9c
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-06-20 09:34:48 +02:00
Frederik Gladhorn
8b24ed162c Accessibility: Do not automatically add controllers
While I do like the idea, it currently relies on every
QWidget having QAccessibleWidget as a11y representation.

This crashes for example when using the itemviews and
asking them for relations.

Change-Id: Ie15a78dae620eefb97c646b9e802b13bdf864650
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-06-20 09:18:08 +02:00
Olivier Goffart
958aaf3770 Add qMove macro to support std::move
Change-Id: I373e07f479c11b172dab35ed7e5b62724aa50a1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-20 03:17:55 +02:00
Rohan McGovern
f681e99e29 tst_qfilesystemmodel: increased test's permitted runtime
This test has recently timed out a few times on Windows test runs, with
no relevant changes to account for the timeout. Double the permitted
runtime.

Change-Id: I93765c9ea592973495bfe3a2f63e63ed615eb542
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-06-20 03:17:05 +02:00
Oswald Buddenhagen
8b822825c5 make use of $$[FOO/get] properties
this cleans up a lot of hacks supporting the build of qt, including the
last bits of $QTDIR.

Change-Id: Id119886ed8097967dad6cf86ebd4e71d90c42841
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:39:58 +02:00
Oswald Buddenhagen
c85dc033dc add $$reverse() function
returns the list with the order of the elements reversed.
one can easily implement this with existing functions, but this is way
faster and more readable.

Change-Id: I12d306eb9fe58fc332622274ea6b658192529491
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:39:57 +02:00
Oswald Buddenhagen
083f7c501f add $$shell_quote() function
to be used in system() calls and when assembling EXTRA_COMPILER and
INSTALLS .commands by hand.

Change-Id: Id706cd56aa267a9fb4b14e3416692b4716fafa5b
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:57 +02:00
Oswald Buddenhagen
09e01856b0 add $$absolute_path() and $$relative_path()
just exposes QDir::fooFilePath() wrapped into QDir::cleanPath()

Change-Id: I7a7644084825fd8092a9910ac20f695c4d9351f6
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:57 +02:00
Oswald Buddenhagen
d8e6c49bfa add $$native_path() function
more or less QDir::toNativeSeparators(QDir::cleanPath())

Change-Id: I52deee1e8086559eda5833b387a0cf64d21cbcd9
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:57 +02:00
Oswald Buddenhagen
f97913f2da add $$clean_path() function
just QDir::cleanPath()

Change-Id: I2d51e2385939d8926c00f296537ab7f6757d9a79
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:56 +02:00
Oswald Buddenhagen
1261c9b2f4 add $$format_number() function
Change-Id: I04266c1f5fb72af94073f3f508cee59085e365b6
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:56 +02:00
Oswald Buddenhagen
bf984d5f24 add $$shadowed() function
return the build directory corresponding to a given source directory.
this is the identity function if not shadow-building. if input lies
outside the source directory, return empty value.

Change-Id: I2d2a6b1112bd19989fe29cfe19a12d39a0d208c1
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:56 +02:00
Oswald Buddenhagen
6a66fef520 add $$val_escape() function
this quotes the elements of a variable in a way suitable for re-parsing
as qmake code.

Change-Id: I0e6ea2478c43b5aeff45f485a48ac8c86705dd4a
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:56 +02:00
Oswald Buddenhagen
7da934d776 add mkpath() function
Change-Id: I8809b9ee4e85fbe8cec95641d659f237c5f51a26
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:55 +02:00
Oswald Buddenhagen
84614cabfa add write_file() function
this dumps the contents of a variable into a file. each element of the
variable is considered a line; line terminators are added. all missing
directories are automatically created.

Change-Id: Idafeb873cea64e6705c894b3ab0ef21df69e7170
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-06-19 16:39:54 +02:00
Oswald Buddenhagen
07581a87f8 remove some qmake -project boilerplate from project files
Change-Id: I5e6103db42b4fcca4ed4c2ffaec71e71e73d5b95
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-06-19 16:39:52 +02:00
Thiago Macieira
ba7f664a7f Fix tst_qfile opening of stdin/out/err: don't assume
The standard streams can be redirected to a file, so don't assume
anything, but try to get the actual size and position from the OS and
from the C library (stdout is usually buffered, so the result of lseek
might be different from ftell).

Change-Id: Ice4a0aa21726671928f56a13cc07cc0e4b52091d
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-06-18 13:45:28 +02:00
Konstantin Ritt
15db02cb11 tst_QChar: drop outdated testcase
Change-Id: I0c06643165b299c552c697f400608e29ae4e7f7a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-16 21:15:08 +02:00
Konstantin Ritt
ff1aba7d92 Make QTBF autotest support SMP code points in the test data
I didn't do this earlier since the current test data doesn't contain any SMP code points,
the Unicode 6.2 test data does - so, I can confirm this code really works.

Change-Id: Ieae35e8480a89e22d846fd038e79592fefbbf2ee
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-16 21:14:35 +02:00
Stephen Kelly
e83c3a0d33 Add automatic metatype declaration for QPointer and QWeakPointer.
Change-Id: Ic9a04fa68d0bb14ef07455a6559e59f4b887f38b
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-15 19:33:41 +02:00
Jani Honkonen
a85d15259c Fix QListView::scrollTo() when there are hidden rows
This is a cherry-pick of b0601630dd0ddabfaa3b97d042ee02b981d95988
from February

QListView does not consider hidden rows when scrolling to an item.
If there are hidden rows (or columns) before the selected item then
the visual index of an item is not the same as the row index
from the model. So scrolling will be off by the number of hidden
rows before the selected item.

Added a autotest for this also.

Task-number: QTBUG-21115
Change-Id: I01b097bce7f163cdb480a71b763c060cc006fdc7
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-06-14 10:11:26 +02:00
Shane Kearns
dd9bdf5654 Rewrite QNetworkReply downloadProgress autotest
The existing autotest was made invalid by the downloadProgress
signal choking patch.
Rewrote the autotest to download files from the test server
with some rate limiting applied to ensure more than one signal
is emitted.

Change-Id: I6026bacdf356b4e1796b80f6983e5bdce0d1bfce
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-06-14 05:26:39 +02:00
Shane Kearns
46e40214cf choke uploadProgress signals
The QNetworkReply::uploadProgress signal is intended for updating UI
elements such as a progress bar.
Limit the signal emissions to 10 per second to prevent overloading
the UI with updates.
As with the downloadProgress choke, this is implemented by dropping
signals that occur within 100ms of the previous emission.

The 100% signal is always emitted (bytesSent == bytesTotal)
When the upload size is initially unknown, this behaviour is still
provided by the upload device emitting a suitable readProgress
signal when EOF is reached.

Task-number: QTBUG-20449
Change-Id: I77e03c8a49109106e1c375ee00380293fd326b63
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-06-14 05:26:37 +02:00
Konstantin Ritt
d8c04d60db Make QUnicodeTables::script() support SMP code points
Instead of expanding the scripts table with script values for the code points
>= 0x10000, it has been merged with the properties table in order to
increase perfomance of the script itemization code (not affected yet).
(Stats: the properties table grew up in 97428-89800 = 7628 bytes;
        the old scripts table was of size 7680 bytes)

The outdated ScriptsInitial.txt and ScriptsCorrections.txt file has been removed
(they were just empty, the "corrigendum" script corrections should be applied
to Scripts.txt directly, *no customization allowed*!).

More script testcases has been added - at least one per supported script.

Task-number: QTBUG-6530

Change-Id: I40a9e76f681e2dd552fd4c61af0808d043962e79
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-06-14 05:22:13 +02:00
Toby Tomkins
3e9c45c4cc Fix namespace compilation on OSX.
Change-Id: Ib579ae298a5f894b8b02a5d56567870109bd29bd
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-06-14 03:03:38 +02:00
Thiago Macieira
23347033ea Fix QDnsLookup test again after public DNS servers changed
gitorious.org's IP no longer resolves back to gitorious.org.

This fix is temporary, again.

Change-Id: I85b5fe1c5e603d23dd3226b843ef42165d4c417b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-06-14 00:05:40 +02:00
Simon Hausmann
5230d62feb Partial fix for WebKit compilation on Windows
qdatetime.h uses std::min/max and on Windows windows.h (or some subsequent
header file) may under certain circumstances define min/max as macros.

The easiest way to prevent the windows header files from doing that is to
define NOMINMAX in the place right before windows.h is included. The other
way is to define min and max to min/max themselves to prevent windows.h
from doing its evil thing.

If a user of Qt (WebKit in this case) chooses the approach of defining
min/max to themselves and then includes qdatetime.h, then a subsequent
inclusion of windows.h doesn't work because qdatetime.h undefines min/max.

We should not enforce the type of workaround needed, therefore this patch
removes the workaround from qdatetime.h and requires user code that
happens to include windows header files before qdatetime.h (seldom case)
to choose either workaround.

Change-Id: I7347eec7369491a065e894cff557004e069453d5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-13 23:24:08 +02:00
Lars Knoll
087f279fff Don't use gcc extension for QByteArrayLiteral neither
This extension doesn't work for e.g. default arguments
in function declarations.

Change-Id: I32b7afa6e01b6af55fb2409179b4fd94cb04cd8d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-12 22:57:22 +02:00
Thiago Macieira
086d6e74d2 Now merge the QtShared::ExternalRefCount class into QSharedPointer
Completing the work of the previous commit: we don't need separate
classes. Merge into the main class's body.

Change-Id: I2f89b34cb6b7f5f9e8d8b809bebd86656f458644
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-12 20:09:26 +02:00
Thiago Macieira
55c6f09b3a Remove "delete value" from QSharedPointer
This allows a QSharedPointer to be used in contexts where the class in
question is still forward-declared. This produced a warning in Qt 4 due
to the expansion of the template, even if there was no chance of the
pointer being deleted there (because the reference count could not drop
to zero).

Now, not only is the warning removed, but you can actually have the
reference count drop to zero in a forward-declared class and it will
do the right thing. That's because the deleter function is always
recorded from the point of construction and we're sure that it wasn't
forward-declared.

The unit test for forward-declarations had to be rewritten. The
previous version was passing only because the QSharedPointer object
was created under the "tracking pointers" mode, which causes a custom
deleter to be used in all cases.

Task-number: QTBUG-25819
Change-Id: Ife37a4cea4551d94084b49ee03504dd39b8802c1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-06-12 20:09:09 +02:00
Stephen Kelly
32bc019ac1 Fix automatic declaration of QSharedPointer<T> metatypes.
QSharedPointer doesn't work like the other automatic template metatype
declarations because in some cases T* is declared as a metatype, but we
are interested in QSharedPointer<T> (eg QObject*). In other cases, T is
declared as a metatype and we are interested
in QSharedPointer<T> (eg char).

In particular the macro used before this patch was attempting to get the
metatype id of the element_type using for example qMetaTypeId<QObject>()
instead of qMetaTypeId<QObject*>(), which did not work.

Similarly, the variadic macro driven test is no good, because it was
testing QSharedPointer<QObject*> instead of QSharedPointer<QObject>,
so that is removed.

In the end, the only thing we can sensibly automatically declare as
metatypes are QSharedPointers to QObject derived types. That is also
the type that makes the most sense in a QML context anyway.

Change-Id: I13dd40147e2e6bedf38661f898102abaaaa96208
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-12 11:16:45 +02:00
Mitch Curtis
7462033cc5 Clean up and consolidate QDateTime-related tests.
Some test functions that only test QDate and QTime were in
tst_qdatetime.cpp. Upon moving these into tst_qdate.cpp and
tst_qtime.cpp, there were already some similar tests so I
consolidated them.

Change-Id: I5f8758bf8b4804ae9d3a482f49d21de9f7a1dc03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-06-12 11:05:39 +02:00
Thiago Macieira
290655c8a2 Fix compilation of tests/auto/corelib/tools with QT_STRICT_ITERATORS
Most fixes are simple and quite obvious. The ones more involved are
the ones to QArrayData, which had probably not been compiled with
strict iterators thus far.

Change-Id: Ic4ff84c34fd9a04fd686fecaa98149b1c47c9346
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-06-12 04:30:20 +02:00
Stephen Kelly
c5665a182d Only quit if there are no visible widgets or windows.
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>
2012-06-12 04:30:18 +02:00
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
Anselmo L. S. Melo
5645f3253f Fix auto tests build with gcc 4.7
Added #include <unistd.h> to tests/auto/network-settings.h,
so qtbase auto tests successfully build.
It is needed after the header dependency changes, part of gcc 4.7.

Change-Id: I76d1082f8454263f2c22c31a13aa3c1bf6a0c82f
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-05-23 00:42:20 +02:00
Jan-Arve Saether
018cb899d4 Replace (un)checkAction with toggleAction (3/3)
Remove all references to (un)checkAction.
This commit finalizes the intended change.

Change-Id: I79d3b30b5c3d9fbe276c2c94fed5971bb21d6c02
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-05-22 20:56:38 +02:00
Konstantin Ritt
25f40b2de2 replace remaining "const QChar &" with "QChar"
QChar is actually a ushort and passing it via const-ref is suboptimal

Change-Id: Ib806b90397de6a816142ed130a22c0fe10a85d79
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-05-22 20:56:38 +02:00
Thiago Macieira
1ca791faf5 Add the QUrl::FullyDecoded flag to the component formatting
This allows the QUrl component getters to return fully decoded data,
like they did in Qt 4. This is necessary for some use-cases where the
component like the user name, password or path are used outside the
context of a URL. In those contexts, the percent-encoded data makes no
sense, and the loss of data of what could be represented in a URL is
acceptable.

Also take the opportunity to expand the documentation of those getter
methods, explaining what the options argument does.

Discussed-on: http://lists.qt-project.org/pipermail/development/2012-May/003811.html
Change-Id: I89f743cde78c02f169c88314bff0768714341419
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-05-22 20:56:38 +02:00
Thiago Macieira
53d0624403 Add QUrl::ParsingMode to the component setters in QUrl
This allows one to instruct QUrl to ignore the percent-encodings and
interpret the data exactly as provided. This is useful in certain
use-cases where the data comes from a non-URL context.

The strict-mode checking of the components is not implemented
yet. Currently, the behaviour is equal to that of TolerantMode.

Discussed-on: http://lists.qt-project.org/pipermail/development/2012-May/003811.html
Change-Id: Ia5abe045a8ce7f9b50cbce3b5a7e3735e068d03a
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-05-22 20:56:38 +02:00
Thiago Macieira
f0ec001242 Port away from QUrl::MostDecoded
Since we're about to introduce QUrl::FullyDecoded, this
QUrl::MostDecoded value would be confusing. Replace its uses with what
was intended at the point in question.

Change-Id: Iefd87bc33d37bace507c5cb0f206fa902e08e2df
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-05-22 20:56:38 +02:00
Thiago Macieira
4793356ce7 Fix the idempotent recoding tests in tst_QUrlInternal
This was trying all the possibilities by brute force, but it turns out
that some combinations are not valid so they should not be
tested. What's more, it was using old values of the flags, so this was
actually testing nothing.

Change-Id: I6c2f5230d240fc23418df2d3a1ca905dbc47dd10
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-05-22 20:56:38 +02:00
Mitch Curtis
083af3c319 Fixed unused function warning in qsslcertificate test.
Change-Id: I4d402e486a8ceb965d008056f5f1bcb227f6f40c
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-05-22 10:27:40 +02:00