Commit Graph

1394 Commits

Author SHA1 Message Date
Jonas M. Gastal
8bbf1a46a5 Removing QHttpHeader and QHttpResponseHeader.
QAuthenticator used it for the convinience of QHttpSocketEngine only.
QHttpSocketEngine has now been ported to use QHttpNetworkReply to parse
HTTP responses.

Change-Id: Idf6e70aa76613aad6e3d789d81ca1b4fd73575c2
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-19 14:31:10 +01:00
Bradley T. Hughes
a84d893bae Add "nswindow" resource to the Cocoa native interface implementation
This will return the NSWindow* for the given QWindow*. Port the QWidget
autotest helper to use the native interface and the "nswindow" resource.

Change-Id: I754b7e9288690ac3c99c3ec65c5526d5fe121234
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-19 11:31:22 +01:00
Bradley T. Hughes
e87813bfa2 Remove the tst_QWidget::retainHIView() test
Qt is Cocoa only now, and does not use HIView anymore, making this test
is meaningless. The testAndRelease() and createAndRetain() helper
functions are also no longer needed.

Change-Id: I26180a4670c8e7445741d3aab510c4da7b65388c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-19 11:31:22 +01:00
Joerg Bornemann
97a8dff3c0 remove NTFS junction and mount point detection
Qt now treats neither NTFS junctions nor mount points as symlinks.

Task-number: QTBUG-20431
Change-Id: I93f67d7438d441ceb53308d4a1f29335beedd547
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-19 11:31:22 +01:00
Joerg Bornemann
49d1b06898 Revert "fix NTFS mount points"
We agreed on treating neither junctions nor mount points as symlinks.
This will be handled in another commit.

This reverts commit 1656c4780c.

Change-Id: I41a87b6df9f7fba333df4c967ee9f0c1f3940952
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-19 11:31:22 +01:00
Bradley T. Hughes
9d0a41b1ca Disable 'make check' for tst_QWidget on Mac OS X
This test crashes, which can destabilize the CI system, so don't run the
test for now. It is still compiled as part of the build process, though.

Task-number: QTBUG-23695
Change-Id: I841fab7c56b8dba33e8d1b074f118b65790f34ef
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-19 11:31:22 +01:00
Bradley T. Hughes
3ad7cd3a60 Replace Q_WS_MAC with Q_OS_MAC in tests/auto/other
Change-Id: If805ea762047d07872a278956fc7637e5bafc6db
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-19 11:31:22 +01:00
Friedemann Kleint
57738689cd Fix hang in tst_qwidgetaction on Windows.
Increase timer interval.

Change-Id: I2cf40415d356c29ebd753a0e78f43aee474123ca
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-19 10:03:46 +01:00
Kurt Korbatits
3664d3b842 Changed xml unittests to work from installation directory
- Changed to use QFINDTESTDATA and TESTDATA

Change-Id: Ib738adfb6d0553e4c995ccaa51e34335f00f50f0
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-19 04:45:29 +01:00
Jan-Arve Saether
67a3698b3c Remove all references to QAccessible::(Covers|Covered)
These were not used in any bridges, and none of the bridges
(MSAA, Cocoa, AT-SPI/IA2) can hardly make use of this information.

Change-Id: If3cad6b6c1928535dd932f46c9ec6883a4a19c76
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-01-19 00:17:38 +01:00
Pekka Vuorela
711f367d8f Remove QInputContext usage from QWidget test
Change-Id: Ifcd600f5efd5bd079dd2f8d66803e34ffa6df37f
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-19 00:17:28 +01:00
Pekka Vuorela
a3a0b03735 QWidget editors to return correct value for Qt::ImEnabled
Qt::ImEnabled input method query was added for Qt5.
Enhancing source compatibility with Qt4 by setting query value
in QWidget if widget does not return any valid value.

Change-Id: I274c1f6c47a5cb08ecf550b25e5b358622e21d90
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-19 00:16:42 +01:00
Xizhi Zhu
8ecc2da31d Remove QNetworkConfiguration::bearerName().
It was added only to maintain source compatibility with Qt Mobility.

Change-Id: Iea8d40e401bd1f8d5115268e09b256eacca69ea0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-18 12:53:13 +01:00
Bradley T. Hughes
44cf5592ac Replace Q_WS_MAC with Q_OS_MAC in tests/auto/gui
Change-Id: I6d69ac96597f27575dd40e4c80c982f06fa88f51
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-18 12:51:18 +01:00
Joerg Bornemann
1656c4780c fix NTFS mount points
NTFS mount points are not treated as symlinks, because they might
not have a link target.
This is the case when a volume is mounted as a single mount point
without a drive letter.
This patch fixes building Qt in an NTFS mount point.

Task-number: QTBUG-20431
Change-Id: Ie2e15212e1a7ca7fa0067b7ca8857e243e42c21a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
2012-01-17 19:24:29 +01:00
Jiang Jiang
314da0ae01 Fix isolated Thai SARA AM handling
Since 5e07a3ac58f93bd5e09715d43b58c20950c2befa Thai text layout is
handled by libthai to special case of the SARA AM. It didn't handle
isolated SARA AM. This patch fixed it and added detailed explaination
on the special case.

The dotted circle should be shown rather than hidden.

Add an test case to verify that with Waree.

Change-Id: I4967715627cbe15f5a3e9ab3e3844420ab541aed
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-17 16:12:53 +01:00
João Abecasis
9e9f7a482a Don't use RefCount int operations
, as those are going away.

This cleans use of those operations in the QArrayData stack.

Change-Id: I67705fe0a2f8d99ea13739b675021356a5736f83
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: hjk <qthjk@ovi.com>
2012-01-17 15:37:47 +01:00
Morten Johan Sorvig
bc02ef882b Delete src/widgets/platforms/mac
This looks like the mac port but isn't any more,
remove it to prevent confusion.

Change-Id: I498f536d77d1a3c53e687f696ca6992539a1a90b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-17 12:19:29 +01:00
Bradley T. Hughes
147bbda067 Make tst_QGraphicsAnchorLayout1 pass on Mac OS X
On Mac OS X, tests are build with QT_DEBUG defined, but run against
libraries built with QT_NO_DEBUG, so the expected warning output is not
seen. Use a run-time check instead to know whether or not to expect the
warning output.

Change-Id: Ifb772b764d4135cc8f896827727939fd8cff5388
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 10:29:56 +01:00
Bradley T. Hughes
42744812dc Mark tst_QFileDialog2 failure as expected on Mac OS X
Change-Id: I678e1c714ac9c376484b4a3a5d9bfd2bd100e685
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 10:29:56 +01:00
Leandro Melo
85a14abd2e Join user state of removed text blocks
Note: Indentation of surrounding code was fixed.

Done-with: mae
(cherry picked from commit 8d3d3381c127f0f4dd9fc507c3069acddbf40535)
Change-Id: I8d3d3381c127f0f4dd9fc507c3069acddbf40535
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-01-17 09:09:03 +01:00
Kurt Korbatits
402a8c036b Changed qicon unittest to work from installation directory
- Changed to use QFINDTESTDATA and TESTDATA

Change-Id: Ic9fedac82d32f8484a9d915d9d91fdaabedc85e2
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-17 04:55:25 +01:00
Kurt Korbatits
50248b1dac Added check to qtemporaryfile unittest if run as root user
- nonWritableCurrentDir() function not valid test if run as root
  so added skip.

Change-Id: I772e8356e6f798f5acdf7688c55f3241ad012a43
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 04:54:37 +01:00
Kurt Korbatits
60f89f412d Added check to qtemporarydir unittest to check and skip if root
- nonWritableCurrentDir() function not valid test when run as root
  on unix platform so add skip.

Change-Id: I0c5ee685d3bdeaf3d5d2e0bb93ba7d7796fd1028
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 04:54:32 +01:00
Kurt Korbatits
74bf87aa4b Changed qpixmap unittest to work from installation directory
- Changed to use QFINDTESTDATA and TESTDATA

Change-Id: I962fb8093db5bd83208ebd59ec0cf82005add590
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 04:54:28 +01:00
Kurt Korbatits
502b64e06a Changed qpainter unittest to work from installation directory
- Changed to use QFINDTESTDATA and TESTDATA

Change-Id: If75ae2b8e39f6388f4e84ed4aa2681b5a5917e81
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 04:54:24 +01:00
Kurt Korbatits
5ef5b8f419 Changed qicoimageformat unittest to work from installation directory
- Changed to use QFINDTESTDATA and TESTDATA

Change-Id: Icbc823d87cdf6fd36a8ef10ade8e4bca7d9b1c3b
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-17 04:54:18 +01:00
Kurt Korbatits
5027368077 Changed qclipboard unittest to work from installation directory.
- made test depend on copier and paster to make sure they are built first.
- Changed to use installTestHelperApp() to deploy helper apps.

Change-Id: I39e4f2ddcc3c735e17256db5638bf8a3495362f6
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 04:54:12 +01:00
Kurt Korbatits
bd0c7aa315 Changed qimage unittest to work from installation.
- Changed to use QFINDTESTDATA and TESTDATA

Change-Id: I7aaf4d16b03373be0fef39fe05c0df0d947dc7e3
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 04:54:07 +01:00
Kurt Korbatits
b93ce4d78c Changed qimagewriter unittest to work from install directory.
- Changed to use QFINDTESTDATA and TESTDATA
- skip testing permissions if test run as root user

Change-Id: I5b308789202b01bdd0d630af65775ae23bf0cc4c
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 04:54:01 +01:00
Kurt Korbatits
7beeb932fd Changed qsharedpointer unittest to use build qmake over system one.
- If we can find the qmake belonging to the build, use that instead
  of qmake from the PATH for compiling subtests.

Change-Id: I9445754bb02dab11c3e1bbe9dc459ecc682689a4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-17 04:53:35 +01:00
João Abecasis
b3a4d3e328 Rename QArrayData::AllocateOption to AllocationOption
Change-Id: Id3e7c748b4b40d703ad1785c903c96bdd968390e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-16 20:40:16 +01:00
João Abecasis
f4c1e2c40f Enable QArrayData to reference external array data
By default, QTypedArrayData::fromRawData provides the same semantics as
already exist in QByteArray and QString (immutable, sharable data), but
more combinations are possible. In particular, immutable-unsharable
leaves the data owner in control of its lifetime by forcing deep copies.

As part of this, a new isMutable property is introduced in QArrayData.
This could be taken to be implicit in statics that are initialized with
a proper size but with alloc set to 0. QStringLiteral and QByteLiteral
already did this, forcing re-allocations on resize even before the
(static, thus shared) ref-count is considered.

The isMutable property detaches data mutability and shared status, which
are orthogonal concepts (at least in the unshared state). For the time
being, there is no API to explicitly (re)set mutability, but statics and
RawData mark data immutable.

Change-Id: I33a995a35e1c3d7a12391b1d7c36095aa28e221a
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-16 18:10:58 +01:00
João Abecasis
5b250d497f Merge remote-tracking branch 'gerrit/master' into containers
Change-Id: I2d358b912f1055ee6021d13de2f66fd459aaa355
2012-01-16 17:53:41 +01:00
Stephen Kelly
6acdb32561 Clarify docs that everything must be re-queried on model reset.
Change-Id: I05970302d4f52d092a7c65a45b9e5a3570b1d144
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-16 17:07:12 +01:00
Xizhi Zhu
5b1aa4c75d Fixed build break when bearer is disabled.
Change-Id: I29e88b046f6502c84acc9c6f566ecc328cf24e38
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-16 11:29:04 +01:00
Frederik Gladhorn
ba888bb8c8 Clean up and extend QAccessible::State.
The state should contain useful and clear information.
Some of the old enum/bitfield members were not really clear.
Make them follow Qt terminology and shift the burden of interpreting
them to the bridge.

Apart from the previous commit changing from enum to bitfield, these
flags have changed names:

unavailable -> disabled
mixed -> checkStateMixed
protected -> passwordEdit (in the last commit)

floating is completely removed, even MSAA documentation states it is unsupported.

Some new states have been added.
Documentation added.

Change-Id: I152256e77a061f28ee5780f527524c80a2c7e333
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-16 08:55:37 +01:00
Toby Tomkins
169b9cac64 Flag tst_qmenubar tests as unstable.
Task-number: QTBUG-4965
Task-number: QTBUG-11823

Change-Id: Ie8b5093867cf177197e405fdcf3205d4436c110a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 08:52:05 +01:00
Toby Tomkins
6b99b97556 Flag tst_QDoubleSpinBox::task255471_decimalsValidation test as unstable.
Task-number: QTBUG-23641

Change-Id: Iaa44ab20d2e50cd6fb0a1327efef35c1036f9e4c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 08:52:02 +01:00
Toby Tomkins
a2e5f36552 Flag tst_QComboBox tests as unstable.
tst_QComboBox::keyBoardNavigationWithMouse and
task_QTBUG_1071_changingFocusEmitsActivated tests are unstable.

Task-number: QTBUG-23639

Change-Id: Ib8363505213117c581ea2921ebc58d4c2ec4cf8c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 08:52:00 +01:00
Toby Tomkins
db549f90fa Flag tst_QTreeView::styleOptionViewItem test as unstable.
Task-number: QTBUG-23638

Change-Id: I8c07976001aeec5ba796d4b3e9ee421e32ba1360
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 05:30:36 +01:00
Toby Tomkins
5341880105 Flag tst_QItemDelegate::task257859_finalizeEdit test as unstable.
Task-number: QTBUG-23637

Change-Id: Ib08431ab1752c354f62646b3c207d9c24ac5eae5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 05:30:36 +01:00
Toby Tomkins
d4d14e28e6 Modify SSL Socket test exceptions on Ubuntu 11.10 x64.
Modified exceptions as most tests are now passing correctly. Three exceptions
still remain, two serverSideMode tests (ssl3-any, tls1.0-any) and a
verifyMode test.

Task-number: QTBUG-23575

Change-Id: I847e8c2e3484050b8d07ede9aec955c30f7ef5a1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 05:30:36 +01:00
Kurt Korbatits
d9a50fc1dc Moved largefile unittest to same level as qfile.
- Moved largefile from out of qfile unittest directory to be on
  same level as qfile.

Change-Id: I479b0b33594812759f8a6a7be61f8340f64234e9
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 01:55:31 +01:00
Kurt Korbatits
7940521fd9 Changed qrawfont unittest to work from installation directory.
- uses QFINDTESTDATA instead of SRCDIR
- Added check to test if fonts are present and generate one skip instead
  of 1200+ on platforms were no fonts are available for testing.
- fail if unittest fonts not found.

Change-Id: I9c051cf8cef6cd355f16647c614c86771dcf6150
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-16 01:55:26 +01:00
Kurt Korbatits
990e890b9e Changed unittests in corelib to use specific headers instead of super-headers.
Modified unittests to use specific class headers instead of
using super-headers like QtCore that pull in all the headers for
the module.
- Decreasing build time.

Change-Id: I9c3fd0767be15205893bb406f609c8283a2a3a5a
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 01:55:22 +01:00
Kurt Korbatits
f1da37e989 Changed qprocess unittest to work from installation directory.
- All subprograms installed as part of test instead of separate installs
  using installTestHelperApp() from testcase.prf
- Removed use of app_bundle for subprograms

Change-Id: I0a3de021800d36bd48479f63588b09fc7e60f32f
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-16 01:55:18 +01:00
Toby Tomkins
2087db0b20 Flag tst_QGraphicsWidget::updateFocusChainWhenChildDie test as unstable.
Task-number: QTBUG-23616

Change-Id: I664c77b16ac6b2ecd89d362a2c3c3028bd3246c0
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 01:42:26 +01:00
Toby Tomkins
e575e2316a Flag tst_qcalendarwidget::buttonClickCheck test as unstable.
Task-number: QTBUG-23615

Change-Id: I4ce9e415c29167ef9fdc584ac3543aa5f109bcf2
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-16 01:42:22 +01:00
Rohan McGovern
78f1dd251a Fixed failure of tst_qhostinfo since ~15 Jan 2012
This test hardcodes IP address / hostname pairs to be used for forward
and reverse lookups.

The reverse DNS entry for 62.70.27.69 has recently disappeared.  Replace
it with an IP / name pair which is (hopefully) much less likely to
disappear.

Change-Id: I03f589e1c0f4bde0b1a14e94b3c1047eeb81246e
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-16 01:38:36 +01:00
Jonas M. Gastal
bdce610022 Fixes examples/tests to use qinptr in QTcpServer::incomingConnection.
This is a fix for problems introduced by bf7f170.

Change-Id: If5dd8e031ef2efea578b3efb188c2e950e1ba41a
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-13 20:55:00 +01:00
Jonas M. Gastal
14b929e9c4 Cleaning up header includes.
QNetworkCookie doesn't need to know about QNetworkCookieJar and for
QNetworkCookieJar header a forward declared QNetworkCookie is enough.

Change-Id: I21145ce0f67a0a6bd68a46a5e757f82105cdf520
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-13 20:54:23 +01:00
Samuel Rødal
e50416066c Added application flags to translate between touch and mouse events.
The current way we do it of having the platform or touch plugin send
both mouse and touch events is not ideal. There's no good way to write
an application that works sanely both on a touch-only device and on a
desktop except by restricting yourself to only handling mouse events. If
you try to handle touch events you don't get any events at all on
desktop, and if you try to handle both, you end up getting duplicate
events on touch devices.

Instead, we should get rid of the code in the plugins that automatically
sends mouse events translated from touch events. This change enables
that by making the behaviour fully configurable in QtGui.

Two new application attributes are added to explicitly say whether
unhandled touch events should be sent as synthesized mouse events and
vice versa, and no duplicates are automatically sent as the current
situation. Synthesized mouse events are enabled by default.

We also get rid of the QTouchEvent::TouchPoint::Primary flag, which
was only used to signal that the windowing system automatically
generated mouse events for that touch point. Now we only generate mouse
events from the first touch point in the list.

Change-Id: I8e20f3480407ca8c31b42de0a4d2b319e1346b65
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-01-13 09:38:05 +01:00
Jason McDonald
0528d9dca7 Improve coverage of expectfail selftest
Add a test case for calling QEXPECT_FAIL in a data-driven test without
passing a specific data tag for the expected failure, in which the
expected failure should apply to the current data row.

Change-Id: I70a6592de77b1718c3a749fd2216e66f8f312805
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-13 04:04:17 +01:00
Jason McDonald
3dfdf34c1c Improve coverage of expectfail selftest
Add a test for the case where a call to QEXPECT_FAIL nominates a
different data row from the current row, in which case the call to
QEXPECT_FAIL should be ignored.

Change-Id: Iff774b89f9374fa26105acdd8769177272a95229
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-13 04:04:12 +01:00
Jason McDonald
fa07815892 Improve coverage of expectfail selftest.
Add a test for the case where QEXPECT_FAIL is called twice in a row
without an intervening verification step, which is supposed to result in
a failure.

Change-Id: Ie004652a76a2c35c2679945670ff5561e8f5b62e
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-13 01:41:14 +01:00
Jan-Arve Saether
1133c0dd22 Remove all references to QAccessible::(Up|Down|Left|Right)
It is now the resonsibility of the bridge to support this
(by querying for QAccessibleInterface::rect())

The windows bridge (currently the only bridge in need of this) has
already been updated to reflect this in commit
7dca461620

Change-Id: Ief1339ab6edc118e2d47e3875e09fa885db65c2f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-01-12 15:05:57 +01:00
Jonas M. Gastal
1453f74cc5 Make QFtp private.
All references to QFtp in documentation have been removed, QFtp's
documentaiton was marked internal. The QFtp example was removed.

Task-number: QTBUG-23199
Change-Id: Ifff83cac069fb350e8ebeae63e605850e65c0c30
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-01-12 14:38:55 +01:00
Samuel Rødal
16c2622fe7 Made it possible to report screen changes through QWindowSystemInterface.
This makes it possible for platform plugin independent code (such as
generic plugins) to report changes to screen properties. An example
would be an accelerometer plugin that reports orientation changes
without knowing anything about the windowing system.

Change-Id: I984984b6d064327772c264bc942269422451da37
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-01-12 12:08:19 +01:00
Friedemann Kleint
bffbcfd0cc Stabilize Language-Change test.
- Introduce separate state machine class with a timer instead of
  using semi-synchronous qWait(). Also invoke closeAllWindows()
  repeatedly should the file dialog be slow on Windows.
- Use QTemporaryDir for test data to avoid conflicts with
  remains from previous tests.

Change-Id: Ibd95176b44ff20d6f326dc3139fb386472f64c2b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-12 08:31:17 +01:00
David Faure
1319bd48c8 QTreeView: fix crash when starting a drag with hidden columns.
Crash was introduced by d639105759491 (pre-Qt-4.8 only)

Task-number: QTBUG-15834
Merge-request: MR-2725

(cherry picked from qt4 commit fd25323de7b5d5f3e0ffb1bd81ea4d251e071566)

Change-Id: I59959d3ba4c9bcb0d39bdbe58432817bbbfdd9f1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-01-12 08:31:17 +01:00
David Faure
22b7d21186 Set missing flags in the option when rendering QTreeView drag pixmap
QAbstractItemViewPrivate::renderToPixmap was not setting all the flags
that the normal QTreeView painting sets:
option.showDecorationSelected, option.viewItemPosition (so the drag pixmap
looked wrong on Windows 7, with rects around each cell), and then the
unittest also discovered that State_Children/State_Sibling wasn't set either.

Task-number: QTBUG-15834
Merge-request: 2517

(cherry picked from Qt4 commit d63910575949106f84dacf04abaa14fc866aa66b)

Change-Id: I0a5014d960543c3ed8fea73d6df578e7e521b0e0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-01-12 08:31:17 +01:00
Jason McDonald
188db2b817 Make expectfail selftest test XPASS.
Change-Id: I0f7943049995c7fa4ad70a05fd2fdac4bc9f6ff6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-12 06:41:39 +01:00
Jason McDonald
29d8d8faec Make selftest for QEXPECT_FAIL more robust.
Make the test fail if calling QEXPECT_FAIL with the mode set to Abort
does not cause the current test function to abort.  Previously, such an
error would not cause the selftest to fail and someone would have to see
the warning message in the test output to know that there is a problem.

Change-Id: I2bd58fafe6b51ea0ab86fde7c5afb781e4534ee4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-12 06:41:35 +01:00
Jason McDonald
a59bc6a6e4 Improve selftest coverage of QEXPECT_FAIL feature.
The existing expectfail selftest did not test QEXPECT_FAIL with a
data-driven test function.  This commit adds such a test.

Change-Id: I39fa9aa227b58779ce5268dd37bf55468e7269c5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-12 06:41:29 +01:00
Rohan McGovern
d3f6faedb5 Fixed findtestdata selftest on mac
This test relies on being able to set a custom QLibraryInfo::PrefixPath
for the duration of the test.  However, the test code neglected to
account for the following behavior on mac (from "Using qt.conf"
documentation):

  On Mac OS X, the Prefix is relative to the Contents in the application
  bundle.

Change-Id: Ie9b6d5ebfe8af7d7f332e827069b60a830d6c6f2
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-12 06:41:10 +01:00
Toby Tomkins
d26a71da18 Flag test as expected failure for Ubuntu 11.10 x64.
Change-Id: I05ff434581f48d4d3ede7ecb59208821a2ab3e7d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-12 06:25:25 +01:00
Toby Tomkins
605329eb1b SSL Socket withoutproxy failures on Ubuntu 11.10 x64.
Numerous failures in the qsslsocket autotest suite relating to
connections without using proxies. Some have been skipped due to
the number of failures, other more specific tests have been set
to expect a failure.

Task-number: QTBUG-23575

Change-Id: I35fccc65bcab303646617a57a33f5aa7f7a4323f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-12 06:13:29 +01:00
Toby Tomkins
c2a663dac3 Flag tst_qgraphicsview as insignificant, test are unstable.
Some of these test have had unstable results for multiple runs.
QTBUG_4151_clipAndIgnore and QTBUG_16063_microFocusRect seem to be the
unstable tests.

Task-number: QTBUG-16063
Task-number: QTBUG-4151

Change-Id: Idd108197c327446080dbd69dfe5c5fba6b2944cd
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-12 05:34:36 +01:00
David Faure
f65a10b733 Remove unused QT_NO_TEXTSTREAM.
It was checked in a few places, but it didn't actually remove QTextStream,
so it was pretty useless.

Change-Id: I8eaf28893cd6c7acbe1c0b69d58de90742aee755
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-11 22:17:46 +01:00
Stephen Kelly
0fd8816340 Add QModelIndex as a built-in metatype.
Change-Id: Ib87cfff8b4baee78189f3df5e20d2e1a00d690e1
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-01-11 19:32:34 +01:00
João Abecasis
2c52e9a5c1 Expand if condition for readability
Change-Id: I5057c236457587ad03b55019cb340cf59d9ecdb5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-11 17:17:29 +01:00
João Abecasis
5a92bc9760 Don't allocate when inserting overlapping data
(This is only for a test case, but still...)

Change-Id: Ied205860e5469000249e15a5478c10db53f1fdaa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-01-11 11:41:24 +01:00
Pekka Vuorela
8ae55a3484 Input direction/locale to come from platform input context
Change-Id: Ib049693211a08dcffc9dbe49add54e7feab38978
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-11 11:18:51 +01:00
Frederik Gladhorn
30ad53a0a6 Make QAccessibleInterface::indexOfChild() 0-based.
Makes the code nicer and more consistent with the rest of the world.

Change-Id: I5ba0ee39f5b0afd1a079a3cea9990d123955ed3f
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-11 11:18:51 +01:00
C. Boemann
d060b6f04f Add methods for font stretch and absolute letter spacing
We basicaly just rely on the methods in QFont

Change-Id: Iaf8cbf4d90d0c5b10b3a85983de7ca58763e0371
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-01-11 09:24:07 +01:00
Kurt Korbatits
de6d3d5b1d Changed selftests unittest to not fail but warn when valgrind not installed.
- Changed to detect valgrind at runtime and skip test instead of failing.
- subprograms inherit QT_QPA_PLATFORM value from parent if set.

Change-Id: I280acee389df1ee74ee6758a0dd1601226e103c7
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-11 04:09:32 +01:00
Kurt Korbatits
28bfa8f6cc Changed selftests unittest to work from installation directory.
- All subprograms installed as part of test instead of separate installs
- Added installTestHelperApp() to testcase.prf

Change-Id: I02fbbb299f095054c9216ad0e5f91f574fb0fe3d
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-11 04:09:26 +01:00
Friedemann Kleint
dc5ea80963 Tests: Remove duplicate QTRY_VERIFY/QTRY_COMPARE macros in bearer.
Introduce QTRY_VERIFY_WITH_TIMEOUT and QTRY_COMPARE_WITH_TIMEOUT
to be able to specify a timeout value.

Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>

Change-Id: Iaeaa4938eb14f2c431537055f626510cba183ce3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-01-10 19:54:03 +01:00
Friedemann Kleint
00d4b15112 tst_qgraphicsivew: Run Motif scrollbar range tests only at 96DPI.
Preparing the introduction of a change that uses the actual
QScreen resolution in the style helper.

Change-Id: I3fbb36b0d6a34904c875a2e3684d73124f534bed
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-01-10 19:53:33 +01:00
João Abecasis
25b8b2437c Add setSharable support to SimpleVector
Change-Id: I606064d86b58be1a6a57f64f4eb55a4a751a0811
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-10 17:06:16 +01:00
Stephen Kelly
20abd88e71 Make the supportedDragActions a virtual accessor.
Change-Id: I4001fcabc67e5b46465b3c9111c33247c52e5788
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2012-01-10 16:11:43 +01:00
Stephen Kelly
c3ad8c1c06 Make the roleNames a virtual accessor.
This is consistent with the rest of the API of QAbstractItemModel
(which is virtual) and removes the need for code like this
in the constructor (where it doesn't belong):

QHash<int, QByteArray> myRoleNames = roleNames();
myRoleNames.insert(Qt::UserRole + 1, "myCustomRole");
setRoleNames(myRoleNames);

in favor of

MyModel::roleNames() const {
  QHash<int, QByteArray> myRoleNames = QAbstractItemModel::roleNames();
  myRoleNames.insert(Qt::UserRole + 1, "myCustomRole");
  return myRoleNames;
}

which is consistent with all other QAIM API (eg, flags()).

This is a source compatible change.

Change-Id: I7e1ce17f8dab2292c4c7b6dbd3c09ec71b5c793b
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Marius Bugge Monsen <marius@cutehacks.com>
2012-01-10 11:37:28 +01:00
Jędrzej Nowacki
f85b9f8242 Reimplement QVariant to QDebug streaming.
New implementation fixes some commented code marked as FIXME.

Change-Id: If8f5bebedd65bcf8f839d804c2022ca79ef82ddf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-10 09:13:11 +01:00
Frederik Gladhorn
39a052c664 Accessiblity State as bit field.
We would like to add more flags that will be over the 32 bit boundary.
On Windows enums don't seem to digest values >32 bit.
This patch changes the state flags to be a bit field instead.

The windows part of the patch was written by Jan-Arve Sæther.

Change-Id: I2d1d87807f920ce4d4a5c7bfea8b1122ed44eb08
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-10 07:14:34 +01:00
Jason McDonald
5313c28b30 Update year in Nokia copyright headers.
The previous change missed some headers from years prior to 2011, and a
few new files were merged after the previous change.

Change-Id: Ib7d1a2b7062228c2a5373da64242b2ee1f0981e1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-10 07:12:41 +01:00
Xizhi Zhu
da3e8e761b Remove the unused QTRY_COMPARE macro from bearer auto tests.
The custom QTRY_VERIFY macro is needed since the one provided by testlib does
not support custom timeout.

Change-Id: I12bbc5efcb16c4f53514ad738d6115d217a55b05
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-01-10 07:12:41 +01:00
Xizhi Zhu
0e0eb207c4 Remove ICD plugin for bearer.
It's only used by Maemo and Harmattan, thus not needed in Qt5.

Change-Id: I8638f4fc63637be88d1aa584cde7e3a4116f2de6
Reviewed-by: Alex <alex.blasche@nokia.com>
2012-01-10 07:12:41 +01:00
Liang Qi
8c72dc5907 Add V3(md5) and V5(sha1) version for DCE in QUuid
Add the above versions based on RFC4122 standard.

Done-with: Hagen Rother
Task-number: QTBUG-23071
Change-Id: Ieb90925374d1e3c85011b899b8dd3bb1a608c561
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-01-10 05:12:20 +01:00
Kurt Korbatits
679c4c002d Changed selftests unittest to use specific headers instead of QtCore.
Changed selftests unittest to use specific classes of QtCore instead of
pulling in all of QtCore headers by using include <QtCore>
- Decreasing build time.

Change-Id: Ic53a70423ecafeb342cc05ae6d7dee795533d205
Reviewed-by: Kurt Korbatits  <kurt.korbatits@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-10 05:12:18 +01:00
Jason McDonald
226a7c77cb Improve QDateTimeEdit autotest.
Reinstate a check that was presumably disabled because it wasn't
checking for the right expected date.  At present pressing Enter in a
QDateTimeEdit without changing the date still emits the dataChanged()
signal.  By reinstating the test, we ensure that the behaviour can't
change by accident.

Change-Id: I1b766af6ced001a4191606247338dbc91049cb8d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-10 05:12:15 +01:00
David Faure
3e2f32547d If decodestring can't translate the string return Qt::Key_unknown.
Change-Id: Ie082b326e944a28b4e29984a527e3841a05b32f6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-10 02:02:29 +01:00
Sami Rosendahl
b6a43cfe9c Fix memory leak in QDomDocument entity text expansion
The created entity node's reference count needs to be decremented to 0
before it is added as a child, because appendChild will increment the
reference count to correct value of 1. Re-enabled commented-out test data
tst_QDom::setContent to exercise the code path with the leak.

Change-Id: Ieb015d68ba9bbb3f20dd47e76835ad15abb1738e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-10 02:01:41 +01:00
Stephen Kelly
acdd5fecb7 Avoid using 'check' as an identifier.
Avoids conflict with macro on Mac OS.

Change-Id: I79d78283b45bc97032d6a94139ee750ec01e9c0a
Reviewed-by: hjk <qthjk@ovi.com>
2012-01-10 01:44:35 +01:00
Stephen Kelly
4fe9ff1001 Avoid using check as an identifier.
Avoids conflict with Mac OS.

Change-Id: I72a1218d101fdf2fa40f80934a6157ed26e699a1
Reviewed-by: hjk <qthjk@ovi.com>
2012-01-10 01:44:31 +01:00
Stephen Kelly
7acac24869 Avoid using check as an identifier.
Avoids conflict with Mac OS.

Change-Id: I64856a64808dcd481f6075eb4f3a7cc19950bad3
Reviewed-by: hjk <qthjk@ovi.com>
2012-01-10 01:44:24 +01:00
Jędrzej Nowacki
3d7ce0e96a Add missing subdirectory to kernel.pro file.
QMetaPropery test was not build by CI.

Change-Id: I27407e8df674414c2d74f3aa1e4cbb809969c040
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-10 01:25:45 +01:00
Kurt Korbatits
aa500fde7c Changed qprocess unittest to use specific headers instead of QtCore.
Changed qprocess unittest to use specific classes of QtCore instead of
pulling in all of QtCore headers by using include <QtCore>
- Decreasing build time.

Change-Id: Ifc7911548e4a9323726093ac1d35e4ce38b5f8ad
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-10 01:25:40 +01:00
Jason McDonald
4c66ab91a9 Remove execute permission from files that don't need it.
Change-Id: Ib92875289cdd9831f35301c566fb567acc725bb6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-10 01:24:22 +01:00
C. Boemann
1222da803a Make sure cursor navigation in qtexttable works like user expects
Before the selection of cells NW of anchor showed some defects where
cells would not be selected as the user expects

Change-Id: Ia2b63f11b8d534e918ffb97b76339d60f1ca0389
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-01-09 23:09:40 +01:00
Stephen Kelly
510eb8da78 Make the meta type shortcut in this test more robust.
Change-Id: Ie9f5ea3a62c80b2a4255eda0995133d0471c7538
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-01-09 20:01:16 +01:00
Simon Hausmann
51d634ce2e Remove QtV8 library from QtBase
The QtV8 library is going to live in the qtjsbackend module.

Change-Id: I72251316163829411dda998b9503ce6f75b3606a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-09 19:54:07 +01:00
Stephen Kelly
f74c49bbaf Avoid using 'check' in QSharedPointer test.
Avoids conflict with macro on Mac OS.

Change-Id: Ia8301f52c879d941eece0fa6ae47a4c21d4e6490
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-09 19:04:57 +01:00
João Abecasis
f1e48d48fd Add AllocateOptions to QArrayData
This approach is better for future ABI evolution than using individual
bool parameters. QArrayData now also offers to calculate allocate
options for typical detach and clone operations: the CapacityReserved
flag is preserved, while cloning resets the Unsharable state.

Change-Id: I256e135adcf27a52a5c7d6130069c35c8b946bc3
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-01-09 17:19:30 +01:00
Stephen Kelly
7aeccb183a Remove the Q_TYPENAME define.
It is mostly not used (most places in Qt use typename directly), so
is already not very useful.

For example typename is used in:

QDataStream& operator<<(QDataStream& s, const QVector<T>& v)

Change-Id: I85337ad7d8d4ebbb424bfa2ab9a356456ff3e90f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-08 23:54:56 +01:00
Jonas M. Gastal
b3ce4470ae Removing QHttp class, its tests and its usage in examples.
Task-number: QTBUG-22750
Change-Id: I161fad772bfb26797e6ee9d69da925b6747c371f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-06 23:07:26 +01:00
João Abecasis
d91b4f0b13 Remove shared_empty and unsharable_empty from API
They still exist and help avoid allocation of "empty" array headers, but
they're no longer part of the public API, thus reducing relocatable
symbols and relocations in inline code.

This means an extra non-inline call on QArrayDataPointer::clear and
setSharable operations, which are (expensive) detaching operations,
anyway.

Change-Id: Iea804e5ddc8af55ebc0951ca17a7a4e8401abc55
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-06 21:22:07 +01:00
Jan-Arve Saether
7dca461620 Remove all references to QAccessible:: {Child|Ancestor|Sibling}
These are deprecated in favor of
QAccessibleInterface::child() and QAccessibleInterface::parent()

QAccessible::Sibling can be done with a combination of those two.
This is handled by the bridges, if required.

Change-Id: I2e2a6eb2a982e7c9001a393d69f0c5f1ae9c0970
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-01-06 19:24:23 +01:00
João Abecasis
3d61c5ca8f Add setSharable support in QArrayData stack
Making use of the same feature added in RefCount.

To keep with the intention of avoiding the allocation of "empty" array
headers, this introduces an unsharable_empty, which allows users to
maintain the "unsharable bit" on empty containers, without imposing any
actual allocations.

(Before anyone asks, there is no point to a zero-sized capacity-reserved
container so no other combinations are needed for now.)

Change-Id: Icaa40ac3100ad954fdc20dee0c991861136a5b19
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-06 17:25:09 +01:00
Stephen Kelly
9eacf32de9 Move the qitemmodel test to the itemmodels directory.
Change-Id: I67e1008bea0d94ffbc52aad453a29645261e109e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-06 17:21:25 +01:00
João Abecasis
51048e1f31 Adding detach to QArrayDataPointer
Detaching operations added to SimpleVector

Change-Id: I5f549582cf579569f08cb8d53a6d12fe32b862e6
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-06 14:25:42 +01:00
Robin Burchell
b08daaedd4 Remove all non-inline of qMalloc/qFree/qRealloc.
We're trying to deprecate these, so don't use them anymore.

The inline uses of these have been left intact, for the moment. Inline code will
need to create their own non-inline allocation methods (for future-proofing to
allow alterations in how e.g. individual containers allocate)

Change-Id: I1071a487c25e95b7bb81a3327b20c5481fb5ed22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-06 14:11:14 +01:00
Jason McDonald
db0361e9b1 Remove redundant class from QStringMatcher test.
The removed class was evidently attempting to promote protected members
of its base class to public, but the way this was done doesn't work and
doing so wasn't actually necessary for the test.

Change-Id: I15e0c31891da08cacee1054e15596a79a058b466
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-06 07:50:21 +01:00
Sami Rosendahl
e6b9382ae2 Add regression test for QTBUG-22660
QHttpNetworkReply crashed in Qt4.7 and 4.8 if a HTTP server responded with
gzip-encoded empty content without defining Content-Length in the response
header. This commit adds the test for the problem as a regression test to
Qt5.

Change-Id: Iddfb970a31d92a66fd1dd524811cf54bb06e5157
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2012-01-06 04:43:05 +01:00
Sami Rosendahl
d55cdcd59f Fix memory leak in QDomDocument DTD entity declaration handler
The created entity node's reference count needs to be decremented to 0
before it is added as a child, because appendChild will increment the
reference count to correct value of 1. Also added autotest DTDEntityDecl
to tst_qdom to expose the leak when executed under valgrind memcheck.
There was no previous direct test case for unparsed entity declarations in
DTD, only indirect coverage via regression test cloneDTD_QTBUG8398.

Task-number: QTBUG-22587
Change-Id: I394ae9fc32d5b84e4ca287c5db4dd7effde6128b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-06 02:59:59 +01:00
Sami Rosendahl
1bc31fa43d Fix memory leak in QDomDocument DTD notation declaration handler
The created notation node's reference count needs to be decremented to 0
before it is added as a child, because appendChild will increment the
reference count to correct value of 1. Also added autotest DTDNotationDecl
to tst_qdom to expose the leak when executed under valgrind memcheck.
There was no previous test coverage for the notation declarations in DTD.

Task-number: QTBUG-22588
Change-Id: I876186d1277ceb4414f803b58b62f51cc1474367
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-06 02:59:55 +01:00
João Abecasis
b29338e805 Add test for QVector::setSharable
Change-Id: Id31761bfb642d4ce515768c1ffe1e3088d883353
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-05 18:14:52 +01:00
Jonas M. Gastal
bf7f170607 Make socket descriptors qintptr.
Windows x64 uses 64 bits integer for sockets, to ensure compatibility we
should use ptr sized integers for our socket descriptors.

Task-number: QTBUG-19004
Change-Id: I4b56023874a4f1bad107c66c054fecfedde33d88
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-01-05 15:07:51 +01:00
David Faure
9498f1aa54 Fix compile error with qWarning() << myDateTime and QT_NO_DEBUG_OUTPUT
All QDebug operator << in custom classes were disabled by
QT_NO_DEBUG_STREAM, which was set by QT_NO_DEBUG_OUTPUT.

Now QT_NO_DEBUG_STREAM is never set automatically, but remains available
for reducing the feature set altogether (qconfig.h).

Remove check on QT_NO_TEXTSTREAM: this define is meaningless, it
doesn't even undefine QTextStream, and this is unrelated to QDebug
streaming anyway.

Change-Id: I5eeed0144fa684d0e790e9dfd9a4aeb956218c39
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-05 15:02:56 +01:00
João Abecasis
fed603fde5 Ensure shared_null(s) are statically initialized on VS 2010
This removes const qualification on data members of QConst*Data, which
was subjecting QString's and QByteArray's shared_null to the "order of
static initialization fiasco", with up-to-date VS 2010.

Furthermore, the const qualification in the places where it was removed
had little meaning and no value. It was unnecessary. As such, "Const"
was removed from the struct's names and "Static" used in its place, to
imply their usefulness in supporting statically-initialized fixed-size
(string and byte) containers.

A test case was added to QArrayData as that is meant to replace both
QStringData and QByteArrayData in the near future.

VS issue reported at:
https://connect.microsoft.com/VisualStudio/feedback/details/716461

Change-Id: I3d86f2a387a68f359bb3d8f4d10cf3da51c6ecf7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-05 13:59:24 +01:00
João Abecasis
9a890a519e Add support for setSharable in RefCount
A reference count of 0 (zero) would never change. RefCount::deref to
zero would return false (resource should be freed), subsequent calls on
the same state would return true and not change state. While safe from
RefCount's side, calling deref on a reference count of zero potentially
indicated a dangling reference.

With this change, a reference count of 0 is now abused to imply a
non-sharable instance (cf. QVector::setSharable). This instance is to be
deleted upon deref(), as the data is not shared and has a single owner.

In practice, this means an (intentional) change in behaviour in that
deref'ing zero still won't change state, but will return false, turning
previous access to dangling references into double free errors.

Users of RefCount wanting to support non-sharable instances are required
to check the return of RefCount::ref() and use RefCount::isShared() to
determine whether to detach (instead of directly checking count == 1).

New functions are introduced to determine whether RefCount indicates a
"Static" (permanent, typically read-only) or "Sharable" instance and
whether the instance is currently "Shared" and requires detaching prior
to accepting modifications..

This change formalizes -1 as the value used to flag persistent,
read-only instances, no longer reserving the full negative domain. The
concrete value is part of the ABI, but not of the API. (isStatic and
Q_REFCOUNT_INITIALIZE_STATIC are part of the API, instead)

Change-Id: I9a63c844155319bef0411e02b47f9d92476afefe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-05 13:59:14 +01:00
Pekka Vuorela
8ad583b7f9 Removed QApplication::setInputContext()
Obsoleted by platform input context. Setting a custom QInputContext
wouldn't work properly anymore.

Change-Id: I966573a82fdd7530544878513a655eae7b3ad67b
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-01-05 11:40:08 +01:00
Jason McDonald
1fdfc2abfe Update copyright year in license headers.
Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 06:36:56 +01:00
Jason McDonald
f599b5cd30 Fix memory leak in QAbstractItemModel autotest.
The test was allocating a new model on the heap each time init() was
invoked, but none of these models were deleted.

Change-Id: Ibe107b2dbc949a5f72940f67c08f4b0f46256c09
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 03:49:45 +01:00
Jason McDonald
ca81ec03d6 Prevent QFileInfo test from leaving temporary files behind.
Use a small helper class to ensure that the files created during the
test are removed afterwards, even if the test fails. Also, verify
creation of the files in the body of the test function, not in the
helper, as verifying in the helper won't terminate the test on failure.

Change-Id: I76eff20e54ef6a1ed71d9bbb31e00f41f3d14c38
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 03:49:45 +01:00
Kurt Korbatits
77ddb00a49 Changed tests: qmake,selftest and lancelot to use QFINDTESTDATA.
Changed these tests to use QFINDTESTDATA macro to detect location of testdata.
Checking for a specific file contained in the testdata so as not to be confused by empty directories
created during configure.

Change-Id: Iac2ac6304b6b9ac79e00886025b93ec0af5a8507
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-05 03:49:45 +01:00
Denis Dzyubenko
92f9678055 Registered QUuid in the metatype system as a builtin type.
Change-Id: I6be6129d9f6bf468ba8a5805cfa0f6f79199afb3
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
2012-01-05 02:17:04 +01:00
Samuel Rødal
07edbd23ed Introduced QOpenGLContext::aboutToBeDestroyed() signal.
This signal can be used to clean up OpenGL resources in a safe way
before the context is destroyed.

Task-number: QTBUG-20083
Change-Id: I45a4be01b06af4ee7196fa502116f099d50afeab
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-01-05 02:17:04 +01:00
João Abecasis
3fad9a846f Retire the generic Q_REFCOUNT_INITIALIZER macro
This was only being used to initialize static read-only RefCount
instances, where the value is hard-wired to -1. Instead of allowing
initialization with arbitrary values (which for a reference count can be
error prone) the intent of the macro is made explicit with its
replacement Q_REFCOUNT_INITIALIZE_STATIC.

Change-Id: I5b0f3f1eb58c3d010e49e9259ff4d06cbab2fd35
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-01-04 23:38:06 +01:00
Simon Hausmann
73187281c3 Fix QPainter::drawText with complex brushes
Commit d52fd497f6 introduced a call path to
QPaintEngineEx::drawStaticTextItem, which has a bug in using the pen's color
instead of the entire brush.

This patch replaces the use of the color with the pen's brush().

Task-number: QTBUG-23450
Change-Id: Ieb3bf352c840ff0d3fb4ac678caf7b13f4f9a8f1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-01-04 21:16:55 +01:00
Robin Burchell
ecb57cfc32 Pass notification of failure of watches onto the caller.
This is particularly useful for situations where the user might really want to
be notified about a failure, for instance, in a backup application.

Empty paths are not treated as an error in calling, as the user code cannot
really do anything sensible to handle this error, but empty paths should not be
used.

Change-Id: Iddb44fd39f4e3fac5c3f9f60fb7999e1833280a8
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-04 21:09:10 +01:00
Jędrzej Nowacki
08863b6fda Refactor QVariant handlers.
QVariant implementation is based on delegation to a handler. The handler
has rather simple construction, it is a set of function that implements
a switch statement over known types and redirects calls to a right
method of an encapsulated types instance. Unfortunately after qt
modularization project, it is not easy to use types directly from
different modules, as they can be undefined or completely unaccessible.
Which means that each module has to implement own handler to cooperate
correctly with QVariant. We can suspect that list of modules known to
QVariant will grow and it is not limited to GUI, Widgets and Core,
therefore it would be nice to have an unified, from performance and
source code point of view, way of working with handlers.

This patch is an attempt to cleanup handlers. Keynotes:
- Each handler is working only on types defined in the same module
- Core handler implements handling of primitive types too
- Custom types have an own handler
- Each handler is independent which means that dispatch between handlers
  is done on QVariant level
- Handlers might be registered / unregistered using same interface

Change-Id: Ib096df65e2c4ce464bc7a684aade5af7d1264c24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-04 14:25:25 +01:00
Joerg Bornemann
a4533b4503 fix invalid connection in tst_QProcess::lockupsInStartDetached
Change-Id: I06f2d56f5c45c13bbe08707e6baad4f2aece39b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-01-04 06:01:33 +01:00
Jason McDonald
0afe990714 Avoid QCOMPARE outside test function in QSettings test.
QCOMPARE and friends should only be called in a test function.  Instead
of calling QCOMPARE elsewhere, keep a count of the number of errors and
QCOMPARE that count with zero in the test function.

Change-Id: I9a264e91169a98c30980fdc04a3e45bfb0ca8063
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-04 06:01:33 +01:00
Jason McDonald
20f0196a2c Remove redundant debug code from QFileSystemWatcher test.
There is no need to print out the name of the backend used by each test
run of a test function as every message output by the test function will
have the name of the current data row included.

Change-Id: Ie69881d2ecedce728ea67b5aae1c1196776552a5
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-01-04 06:01:33 +01:00
Frederik Gladhorn
afd22f52f8 Accessibility: extend listview unit test.
Test more functions from Table Cell.

Change-Id: I43b8766138350ece781bdaba7ab10fde8542aa4f
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-01-04 02:17:20 +01:00
Bradley T. Hughes
68202f646a Make sure tst_QThreadStorage finds its subprocess
On Mac, the application's dir is in the bundle, so we need to "escape"
the bundle when looking for the an executable relative to the
application's dir path.

Change-Id: I5c01f7d816ec8cc30f5277202f4eefb0c49a2bc3
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-03 12:58:24 +01:00
Jason McDonald
fda36df6ba Use true and false in preference to TRUE and FALSE in tests.
Use the C++ boolean constants true and false instead of the C macros
TRUE and FALSE (which are actually integers), and use QVERIFY instead of
QCOMPARE for verifying simple boolean expressions.

Change-Id: Ie76dfcab6722df6b93b3fa62b0f3437901482932
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-03 02:57:12 +01:00
Robin Burchell
d4514b63c7 Remove support for dnotify QFileSystemWatcher.
Inotify has been available in Linux for some ~6 years now, 7 when Qt 5 will
actually be released, so I'd say it's safe to remove this fallback path now,
particularly as the autotest notes that it's broken.

Change-Id: I49dbb161d4765d63e92f512a6375323c7d37ccbe
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-02 18:19:36 +01:00
Stephen Kelly
f29e55448b Change the default value of QSortFilterProxyModel::dynamicSortFilter
The value is changed to true. It is a common bug that developers expect
this proxy model to reflect the source model when the source changes.
That requires setDynamicSortFilter(true), so we change the default to
optimize for the common case.

Change-Id: I9bf7efdbda10309fa77aed9391c33054aaae4a29
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-01-02 16:43:02 +01:00
Robin Burchell
fb7404e569 Implement (and unit test) simple QVarLengthArray::first()/last().
Pure syntactical sugar, to match up with what the other container
classes offer.

Change-Id: I0f97de011923d9d204cca0fa906b059dc5054a89
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-01-02 15:08:19 +01:00
Bradley T. Hughes
2bbf9befd8 Add Qt::TimerType argument to QAbstractEventDispatcher::registerTimer()
... and deprecate the old registerTimer() functions. The new pure-
virtual registerTimer() breaks source-compatibility. Subclasses cannot
be instantiated anymore, since the pure virtual function signature has
changed.

QAbstractEventDispatcher::TimerInfo is no longer a QPair. It is now a
struct with timerId, interval, and timerType members. This is a source
incompatibility that should only affect subclasses of
QAbstractEventDispatcher, which will need to pass 3 arguments to the
TimerInfo constructor instead of 2. If the subclass used QPair<int,int>
instead of the TimerInfo typedef, the QPair<int,int> declarations will
need to be replaced with TimerInfo.

Call the new registerTimer() function with the type from
QObject::startTimer(). Change all subclasses of QAbstractEventDispatcher
to reimplement the new virtual function. The type argument is unused at
the momemnt, except to ensure that registeredTimers() returns the type
each timer was registered with. Implementations for the various
dispatchers will be done in separate commits.

Author: Thiago Macieira <thiago.macieira@nokia.com>
Change-Id: Ia22697e0ab0847810c5d162ef473e0e5a17a904b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-02 10:44:00 +01:00
David Faure
05ca21411e Handle -1 (Invalid Key) and Qt::Key_unknown gracefully in encodeString.
Previously they would fall into the unicode handling and return very
strange values.

Change-Id: I62a53894c0983bf53fd79f924b40a6fd3ba02993
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-01-02 09:04:12 +01:00
Sergio Ahumada
628d3f85d2 tests: use contains(QT_CONFIG,private_tests) consistently
These tests used requires(contains(QT_CONFIG,private_tests)) in their
.pro file, but did not subtract themselves from their parent project
SUBDIRS when private_tests weren't enabled.

In the best case, this wastes a little time as qmake iterates over these
projects which won't be built.  In some worse esoteric cases, this may
break compilation or packaging.

Change-Id: If36b1b8f69c3509128786fec67899ae18ffaa2bc
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-01-02 01:37:42 +01:00
Toby Tomkins
7f4c45390d Flag udpTest as insignificant, fails on Ubuntu 11.10 x64.
This testcase fails on the Ubuntu 11.10 x64 platform, add flag to .pro
file so test is ignored on this platform.

Task-number: QTBUG-23380

Change-Id: I51831df8c8e9bfcf63d3689e37552ca1a62691cd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-30 15:17:02 +01:00
Pekka Vuorela
6576fda2ad Adapt QGraphicsView test to QPlatformInputContext
Change-Id: I9562a0b763fe7d77cd08451426bf2ceaec00acf9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-30 13:20:37 +01:00
Pekka Vuorela
b83e98d22c Adapt QGraphicsScene test to use QPlatformInputContext
Change-Id: Iaf61798cc78e57563fee088711d39090b722a946
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-30 11:28:20 +01:00
Jason McDonald
14e139f391 Prevent qDebug test bypassing the testlib message handler.
Several of the test functions in the QDebug autotest call
qInstallMsgHandler() to temporarily use a custom message handler.
Unfortunately, these test functions were then resetting the message
handler back to Qt's default handler at the end of the test.

QTestLib also calls qInstallMsgHandler() to set a message handler that
redirects debug/warning/fatal messages into the test log.  When the test
resets the message handler back to Qt's default handler, testlib's
message handler is bypassed for the rest of the test, preventing any
subsequent debug/warning/fatal messages from being visible in the test
log or subject to testlib's ignoreMessage() function.

This error also caused several of the test functions to fail if they
were run manually.  The "defaultMessagehandler" test would fail if it
was run before any other test function and the "assignment" test would
fail if it was run after any other test function.

This commit fixes these failures by using a helper class to ensure that
the previously active message handler is restored at the end of each
test function, even if the test function fails or throws an exception.

Change-Id: I51376724d164c8ad126e5b9be76890bf3e6a9fb0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 04:14:53 +01:00
Jason McDonald
d8f1749a74 Use QVERIFY2 to output verbose failure messages.
Change-Id: I2ce96d9d9f582e99c1d9f6dd6e6e80ce42d6e61d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 02:07:50 +01:00
Jason McDonald
fb83806138 Correct misspelt function names in QFutureWatcher test.
Change-Id: I60965f3475f83a7c42d2efc6ed8adf9a1403e144
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 02:07:50 +01:00
Jason McDonald
0372d5bf0d Correct misspelt function name in qtconcurrentmap test.
Change-Id: I79b54b4e0de6319add89d220d3c3306556ab4ccc
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 02:07:50 +01:00
Jason McDonald
8b66c46c18 Correct misspelt function name in qtconcurrentfilter test.
Change-Id: Ie7ea2defac407d099d7bb27cccfb34911b832626
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 02:07:50 +01:00
Robin Burchell
18d2528b6c Change test to use new QTRY_COMPARE/QTRY_VERIFY macros.
When verifying nonzero results (i.e. that something expected *did* happen),
using these macros allows bailing out of the timer much earlier than the
potential 5 seconds.

My running this on Linux goes from ~147 seconds to ~91 seconds.

Change-Id: Ie1e41252eb4eb295b5c8e795ded02f00eb7f9387
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-30 00:18:24 +01:00
Jason McDonald
4c1469f7da Improve QTextCodec::codecForLocale() test.
Don't call QSKIP when omitting the optional part of the test, as doing
so hides the fact that the rest of the test passed.

Change-Id: I9c102e8daeaf9586b2e510c4c9ce697ead290795
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-29 13:27:17 +01:00
Sergio Ahumada
78c27380c6 Fix printerPaperSize and some tst_qprinter test failures
Removing QEXPECT_FAIL accordingly.

Task-number: QTBUG-22296
Task-number: QTBUG-22562
Change-Id: I128a78897722cc067168ee50dbcbfc7537abdfcd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-29 13:18:20 +01:00
Jason McDonald
b4557829f4 Don't allow QThreadPool test to hang on failure.
Use QTRY_VERIFY() to fail after a reasonable timeout rather than putting
the test into an infinite loop.

Change-Id: Ie0917556e15999a94cc0587f3f4c11c0d743a228
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-29 01:39:04 +01:00
Jason McDonald
b2f2258719 Avoid repeatedly registering the same meta-type
Register the meta-type in initTestCase(), which is run once, rather than
in init(), which is run before every test function is run.

Change-Id: Ic62a2469da6a2a85254ffc7c4d893395202c50d8
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 08:16:47 +01:00
Jason McDonald
36eb666391 Improve qtconcurrentthreadengine autotest.
The threadCount() test function is unstable and had been disabled by
making it not be a slot.  It is better to disable it with QSKIP so that
the test output shows that the test function exists and is in need of
repair.

Change-Id: Iccdc8da31e0d15d922f7e9606835d1ff1a3a4966
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:34:15 +01:00
Jason McDonald
79b64957b0 Cleanup itemmodel autotests.
Avoid using bug tracker identifiers in test function names.  These
identifiers lose their meaning when the bug tracker is replaced.

Change-Id: Ia867f7c2ec2ab9ed546588843d532ac615a34031
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:34:02 +01:00
Jason McDonald
4ae3fea163 Remove old debug code from itemmodel tests.
Change-Id: I7c6aeed2d3b593a4dac89e54ef22743d5f736d42
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:33:50 +01:00
Jason McDonald
6b6406d659 Reinstate commented test data in QItemSelectionModel test.
The restored test data was marked as failing, but appears to pass, and
the available history does not explain why it was commented out.

Change-Id: I7e9e3ba72fc8fef42c91ee882efa98d25b3d8317
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:33:42 +01:00
Jason McDonald
613d0e407e Cleanup itemmodel autotests.
Bring the code closer to compliance with Qt's coding style guidelines
and eliminate excessive vertical whitespace.

Change-Id: Iaa29f8edf326ddb80cbadb6c18cca4fea88fd9b2
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 06:33:32 +01:00
Jason McDonald
9f843918f2 Remove empty functions from itemmodels tests.
Change-Id: I23775a334812b096192c7f44c4a3cb06f4b08705
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:50:35 +01:00
Jason McDonald
ea415e2060 Cleanup corelib autotests.
When using QSignalSpy, always verify that the signal spy is valid.  This
will cause the test to give a meaningful failure when spying on a
non-existant signal.  Without this change, tests that spy on a signal to
ensure that it is not emitted (i.e. by comparing the spy count to zero)
could pass erroneously if something went wrong when creating the signal
spy, as an invalid QSignalSpy will always return a count of zero.

Change-Id: I41f4a63d9f0de9190a86de237662dc96be802446
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:48:11 +01:00
Jason McDonald
1e7296f3f2 Remove mention of Trolltech in qlibrary autotest.
Task-number: QTBUG-19653

Change-Id: I8cf21bac41b08187528ba7004a7a23b9baa64b17
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:48:06 +01:00
Jason McDonald
9e0479496e Remove mention of Trolltech from QGraphicsScene autotest.
Task-number: QTBUG-19653

Change-Id: Iabebf17f5b09c17a767e81a0ccadd03513238a75
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:48:01 +01:00
Jason McDonald
12392e222a Remove mentions of Trolltech from QRegExp autotest.
Task-number: QTBUG-19653

Change-Id: I55ae6bed6fb2177cdc842de34ef31ae98d0d3237
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 04:47:56 +01:00
Jason McDonald
087c4c6bc1 Remove mention of trolltech from QThreadStorage test.
Task-number: QTBUG-19653

Change-Id: I6c74a15b6c6db415a545328b73b6dd704d69bfee
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 02:56:08 +01:00
Jason McDonald
9fe76bf6a6 Remove mention of Trolltech in QHttp autotest.
The data file named "trolltech" has nothing specific to Trolltech in its
contents.  Rename it to "testhtml".  The lack of a file extension is
intentional.

Task-number: QTBUG-19653
Change-Id: Idc5c5f4ffa447151e47f66ff7364f0fa8753a699
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-28 02:56:02 +01:00
Konstantin Ritt
ebe43992f9 add tests and benchmarks for QString::toLower()/toUpper()/toCaseFolded()
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>

Change-Id: I3929d4d8963c3cef6d2c6420d8ad1f7a45f7e042
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-25 21:58:57 +01:00
Peter Hartmann
1ddecb0aa2 network auto tests: add QNetworkReply test for pipelining
Reviewed-by: Markus Goetz
Task-number: QTBUG-21369
(cherry picked from commit a32bfdef6d6b45c916f143dcf8495a2e102c3eec)

Change-Id: Iecde23c56f128008c5172675601928d83180358a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
b9acd85b2f Fix crashes and non-portable functionality in QDBusDemarshaller QByteArray extraction
QDBusArgument QByteArray extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QByteArray when the value actually is e.g. a struct of
mixed types the byte array extraction will crash as it attempts to extract
the struct data as a fixed array.

The fix adds DBus type checks to QDBusArgument byte array extraction
operator implementations.
The checks invalidate extracting arrays of other types than bytes to a
QByteArray that worked with the unchecked implementation. The rationale
for this restriction is
1) extracting a QByteArray to a variant checks already that the array
   element type is byte
2) Results of extracting arrays of types wider than a byte to a QByteArray
   are architecture-dependent making such code inherently non-portable.

Task-number: QTBUG-22840
Change-Id: Ie20f2adc06c697a68055c803215fb408568fdd90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
b4398dc4e3 Fix crash in QDBusDemarshaller QStringList extraction
QDBusArgument QStringList extraction operator and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting a QStringList and the value actually is e.g. an array of
bytes the string list extraction will crash as it interprets the bytes as
char pointers.

The fix adds DBus type checks to QDBusArgument QStringList extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.

Task-number: QTBUG-22840
Change-Id: I4b67d75b59c5052d939f3a69f3e92dabdb3bdd6b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Sami Rosendahl
8f19f14274 Fix crash in QDBusDemarshaller basic string-like type extraction
QDBusArgument string extraction operators and QDBusDemarshaller that
implements the extraction do not check the type of the extracted value.
When extracting string-like basic DBus type that actually is e.g. an
integer the string extraction will crash as it blindly attempts to use the
integer as a pointer to char.

The fix adds DBus type checks to QDBusArgument string type extraction
operator implementations.
The checks are as permissive as possible provided crashes are avoided.
Previously supported functionality of extracting an object path or type
signature to a string type is retained.

Task-number: QTBUG-22840
Change-Id: I29be1ae592658ca268c65ed692e1d42619d52280
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 21:58:57 +01:00
Jason McDonald
bca775edaa Improve QSettings autotest
QTestLib-based autotests cannot perform verification steps in the test
class constructor.  This needs to be done in initTestCase() instead.

Change-Id: Ib1f7f838f052fa0fc5104603bdac01ffd8313aef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:19:46 +01:00
Jason McDonald
f4c7bbba13 Remove empty functions from QSet autotest.
Change-Id: Id6fac3a83e3f4385ee1978a19e6dc92605f4abdb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:19:05 +01:00
Jędrzej Nowacki
fe089823bc Build fix for tst_qprinter with c++11
GCC 4.6 fails to build the test because of narrowing conversion.

Change-Id: I927693789be7f3df7bd1a96c8924fc04716a03f0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-25 20:16:55 +01:00
Bradley T. Hughes
ae8c61db21 Finish removing Qt3 support
Remove the (-no)-qt3support options from configure, and remove the last
remaining references to Qt3Support, QT3_SUPPORT, and
QEvent::ChildInserted.

The compatibilityChildInsertEvents() tests in tst_QObject and
tst_QWidget have been renamed to childEvents(), which is a more
appropriate name.

Change-Id: Id0b45e9b177efcc8dceee8c9ed8afafedeeace2f
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-23 11:59:11 +01:00
Sune Vuorela
ef03396072 QCryptographicHash: allow to hash the content of a QIODevice
This adds a new function (and tests) to give the possibility of doing a
QCryptographicHash of a QIODevice, like a QFile or whatever people
needs.

It is a quite handy overload in many cases.

Change-Id: I22fd272f05571844641b3daefcc6746be4e5c7c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 19:47:47 +01:00
Shane Kearns
4954f71648 Fix http authentication to a different realm on the same server
This is a regression caused by the NTLMv2 authentication patch.
I have manually tested NTLMv2 authentication against MS IIS and reverting
these two lines does not break it.

Task-number: QT-5209
Change-Id: I64159cbe468e1a7f834f8726fd0c9d4ab4c54b38
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 16:10:33 +01:00
Jędrzej Nowacki
ee0a997bcd Fix movablity of QVariant.
After 8fd64d22ac (Make usage of internal
QVariant space.) change QVariant started to "inherit" movablity from
interned type.

This change fix it by interning only movable type in QVariant and by
using external allocation for not movable ones.

Obviously, this change has negative impact on QVariant it self, but
after it, QVariant will behave a lot nicer with our containers.

Change-Id: Ibffc95833918f65be737f52d694ee81a2036c412
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 16:09:34 +01:00
Friedemann Kleint
23382669b9 QTestLib-selftest: Unblock on Windows.
Do not run tests that pop up assert boxes.

Change-Id: Idac94398ff1109605eb33a042dab734eafb1a17a
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-12-22 15:11:32 +01:00
Jędrzej Nowacki
56f154c747 Allow QMetaType to register information about movability
We need that information to perform some optimizations in QVariant.

Change-Id: Id9a1716e49e4cedd17cd09a32fea4ff003ef61f2
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-22 13:20:40 +01:00
Harald Fernengel
d868c9945a Remove QT_NO_STL_WCHAR hack
We don't support gcc 2.95 any more.

Change-Id: I842f1f8ac64b9006516c104add0991830ac9a46a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-22 13:20:40 +01:00
David Faure
c02ca6752a Fix handling of invalid modifiers in QKeySequence.
When decoding a string don't assume valid modifier strings. If a
modifier string is unknown return Qt::Key_unknown instead of skipping
the modifier.
Currently 'Win+a' is decoded to 'A' but should be Qt::Key_unknown.

Change-Id: I1c82031159a8b3c19924a7c9e991bc6b1f90d617
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-22 13:20:40 +01:00
Morten Johan Sorvig
40cfdf30fa Enable Mac style on Mac OS X.
Add styles/qmacstyle_mac back to the build, modify
qstylefactory to load it on Q_OS_MAC.

Move helper functions from platforms/mac to
qmacstyle_mac.mm. QMacStyle should now be self-
contained and not rely on anything from platforms/mac.

Change-Id: I68fe40bb7f88c01269968bffd9579b7f3b932d4c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-22 13:20:40 +01:00
Shane Kearns
4be2430925 Test case for QTBUG-22875
Test the authentication cache works properly with "cancelled dialogs"
or if the user enters username/password incorrectly.
Expected behaviour is based on web browsers:
If cancelled, current request fails, and prompt again the next time.
If wrong password is given, prompt again and retry the current request.
If bad credentials are in the cache, prompt again

Task-number: QTBUG-22875
Change-Id: Ic02ccac8dbeb3f2580ca4ffe47d0773982c4ab25
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-22 06:02:32 +01:00
Shane Kearns
d62228a77e Fix compile error when configured with -no-exceptions
The test was skipped, but still tried to compile code that uses
exceptions. The throwing class it uses was conditionally compiled
out earlier in the file, causing an error for undefined class.

Task-number: QTBUG-23028
Change-Id: Ia2e05a8a0abbf0e913f6c41e85bfee8b85cbc8a5
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-22 02:28:09 +01:00
Friedemann Kleint
bc8f25c7e6 QTestlib: Make QImage comparison more verbose.
Introduce a specialization for qCompare(QImage,QImage) that
checks isNull, size and format and outputs verbose messages.

Check isNull, size similarly for QPixmap.

Add an autotest:
- Add test to cmptest and make it a GUI application since
  QImage requires QGuiApplication.
- Make testlib/selftests capable of running X11-GUI applications
  by passing DISPLAY.
- Ignore stderr output for cmptest
- Add test data

Change-Id: I2b29c7822fbeedf2b22c90889739ed7ff859ce92
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-21 22:59:28 +01:00
Bradley T. Hughes
f0710e1d95 Reimplement QGraphicsEffect::sourceChanged() properly
sourceChanged() takes one argument, not zero.

tests/auto/widgets/graphicsview/qgraphicseffectsource/tst_qgraphicseffectsource.cpp:125:
warning: 'CustomEffect::sourceChanged' hides overloaded virtual function
[-Woverloaded-virtual]
    void sourceChanged()
         ^
src/widgets/effects/qgraphicseffect.h:104:
hidden overloaded virtual function 'QGraphicsEffect::sourceChanged'
declared here
    virtual void sourceChanged(ChangeFlags flags);
                 ^

Change-Id: If227b7b79c4a2fc3d21f93e371510ddccb408d7d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2011-12-21 20:32:36 +01:00
Bradley T. Hughes
58170cea15 Reimplement QAbstractFileEngine::open() properly
The virtual function takes a QIODevice::OpenMode argument, not an int.

tests/auto/corelib/io/qfile/test/../tst_qfile.cpp:1942: warning:
'MyEngine::open' hides overloaded virtual function [-Woverloaded-
virtual]
    bool open(int ) { return false; }
         ^
src/corelib/io/qabstractfileengine.h:118: hidden overloaded virtual
function 'QAbstractFileEngine::open' declared here
    virtual bool open(QIODevice::OpenMode openMode);
                 ^

Change-Id: I92338dacb89c05d8c5cfbf8ce094dc519b84d3ba
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2011-12-21 20:32:24 +01:00
Pekka Vuorela
a32df45bec Remove QInputContext based test from QGraphicsItem tests
Was basically checking that a method call is a method call and
QApplication::setInputContext() sets the input context.

Change-Id: Ia8723fe245f2480d503f0140f61078dc074161fc
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-20 12:57:38 +01:00
Pekka Vuorela
db55b6aee7 Removed test for obsolete QInputContext
Change-Id: Idb3b909934434f8f55eb6e94aa814840ab628856
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2011-12-20 12:57:38 +01:00
Alan Alpert
cb9b7ceffb Revert "Revert "Add QObject::objectNameChanged(con... signal""
This reverts commit 9b17557f3b.

Justification: Temporary commit, see JIRA task.
Task-number: QTBUG-22985
Change-Id: I3df9eb5fdbdc133349dca5e192dcfcc9e758626c
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-20 11:15:21 +01:00
Jason McDonald
85a77cd5c8 Retire QTest::pixmapsAreEqual().
QTest::pixmapsAreEqual() was left in the Qt4 API for compatibility with
some old tests written for Qt3.  QCOMPARE() is the preferred way to
compare QPixmaps and provides superior diagnostic output when a
comparison fails.

This commit removes QTest::pixmapsAreEqual() from the testlib API and
replaces the last few remaining calls with QCOMPARE.

Change-Id: I051c0e7d3bda072855fcd262d82e8e540619233b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-20 06:17:42 +01:00
David Faure
8707c09fcd Fix QDir::removeRecursively so it doesn't follow symlinks to directories.
Critical bug... Good thing I had backups of my $HOME.

Change-Id: I43b3a80786c946b0aec797036c1164d436d521f8
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-19 20:48:16 +01:00
Shane Kearns
0443a51228 Fix QNetworkReply test cases that use the MiniHttpServer on windows
The "happy eyeballs" connection code means that IPv4 and IPv6 connections
are both attempted for a http request.
For a normal http server, this is no problem, but the MiniHttpServer in
the test code is very simplistic and cannot cope with more than one
client connected at the same time.
On windows this causes all these tests to fail with timeouts.
Changed the MiniHttpServer to listen on IPv4 only instead of Any address.

Change-Id: I81e249997d894d266001da474a351b1f5642599e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-19 19:08:57 +01:00
Olivier Goffart
87679491cb Do not call QueuedConnection slot on partialy destroyed object
This is a regression introduced in Qt 4.8
When QApplication::processEvents is called from a destructor, it is
possible that pending events would still be called on the already
destroyed subclass.
Prevent that by using the same pattern as in QMetaObject::activate

Change-Id: Ida50db07ae089264402dafcde7a41a066479d08b
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-19 14:06:12 +01:00
Frederik Gladhorn
74c9f9d83f Accessibility: childAt returns interface
childAt used to return an integer.
Return an interface instead.

Not requiring a direct child to be returned allows optimizing
by bypassing iterating through the hierarchy of accessibles.
For QtQuick this is the only sensible way of implementing this.

The bridges are still responsible for finding the top-most element.

The default implementation in QAccessibleObject is sufficient
to return direct children. The implementation in
QAccessibleApplication is therfore no longer needed.

Change-Id: Id7100dd5bcc3a98de516a7f4a12eaaa41cb46d26
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-19 12:27:45 +01:00
Stephen Kelly
211e434a05 Move proxy and selection models to QtCore.
Change-Id: I71097855cb9e28105238e496778f29f99f7fc84e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-16 13:00:57 +01:00