Commit Graph

1019 Commits

Author SHA1 Message Date
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
João Abecasis
7d16ea4033 Introducing QArrayDataPointer
This class provides RAII functionality for handling QArrayData pointers.

Together with QArrayDataHeader and QArrayDataOps, this offers common
boilerplate code for implementing a container which, itself, defines its
own interface.

Change-Id: If38eba22fbe8f69038a06fff4acb50af434d229e
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-14 17:35:40 +01:00
João Abecasis
9c04f721a6 QArrayDataOps::insert
Inserting elements anywhere in the array requires moving the elements
that follow out of the way and writing in the new ones. Trivial for PODs
and almost as much for movable types.

For "complex" types, we start by extending the array with placement new
and copy constructing elements. Then, copy assignment resets the
elements that were previously part of the array.

QPodArrayOps uses non-throwing operations. QMovableArrayOps provides
full rollback in the face of exceptions (strong guarantee).
QGenericArrayOps enforces that no data is leaked (all destructors
called) and invariants are maintained on exceptions -- the basic
guarantee.

With 3 different implementations, 2 of which are non-trivial, this
operation is a good showcase for QArrayOpsSelector and the different
implementations. As such, it warrants its own commit.

Change-Id: I21d9b4cb8e810db82623bcd1d78f583ebf3b6cb7
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-14 15:55:47 +01:00
João Abecasis
4da0b5fc02 QArrayDataOps: generic array operations
This class, the selector and underlying implementations provide
specialized operations on QArrayData, while allowing for optimized
implementations that benefit from type-specific information.

Currently, offering a generic implementation and specializations for
PODs (trivial ctor, dtor and move operations) and movable types (can be
trivially moved in memory).

Change-Id: I2c5829b66c2aea79f12f21debe5c01f7104c7ea3
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-14 14:09:53 +01:00
João Abecasis
bd0b49efe0 Add test for GCC bug #43247
A bug has been reported against GCC 4.4.3 (present in other version as
well), where the use of an array of size 1 to implement dynamic arrays
(such as QVector) leads to incorrect results in optimized builds as the
compiler assumes the index to be 0.

This test tries to ensure QArrayDataHeader is not affected by this bug,
as QVector currently is.

Change-Id: Id701496bae4d74170de43399c1062da40eb078e7

Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-11 12:07:21 +01:00
João Abecasis
390eec325b template<class T> struct QTypedArrayData
QTypedArrayData is a typed overlay for QArrayData, providing convenience
and type-safety. It adds no data members to QArrayData, thus avoiding
compiler-generated warnings for aliasing issues when casting back and
forth.

Change-Id: I969342a30989c4c14b3d03d0602e3d60a4cc0e9d
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-11 12:07:13 +01:00
João Abecasis
0806bc2d1b Allocate/free support in QArrayData
Centralizing QArrayData memory management decisions in one place will
allow us to be smarter in how we allocate header and data.

At the moment, these are allocated as a single block. In the future we
may decide to allocate them separately for "large" data or specific
alignment requirements.

For users of QArrayData this remains transparent and not part of the
ABI. The offset field in QArrayDataHeader enables this.

This also hard-wires allocation of empty arrays to return shared_empty.
Allocating detached headers (e.g., to support fromRawData) will thus
require explicit support.

Change-Id: Icac5a1f51ee7e468c76b4493d29debc18780e5dc
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-09 22:49:08 +01:00
Oswald Buddenhagen
4714f86c54 Merge remote-tracking branch 'gerrit/master' into containers
Change-Id: I01f94564c17d68872839be5396c24b661e53d571
2011-12-09 17:11:20 +01:00
João Abecasis
d8374aebc6 Fixes for tst_QTemporary(File|Dir)::nonWritableCurrentDir
- Check path/fileName is empty upon failure, variable was unused
- Use /home instead of /, as / is writable by admins on Mac

Change-Id: I705471fda8b73843e98b30eb52aa0a73634ec075
Reviewed-by: David Faure <faure@kde.org>
2011-12-09 14:15:37 +01:00
Laszlo Agocs
4222603f8e Extend touch events.
The capability flags indicate which information is valid in the touch
points. Previously there was no way to tell if e.g. the value returned
by pressure() is actually the value provided by the driver/device or
it is just something bogus due to pressure not being supported.

The points' flags return information about the individual touch
points. One use case is to differentiate between touches made by
finger and pen.

Velocity, if available, is now also exposed.

Each touch point can now contain an additional list of "raw"
positions. These points are not reported individually but are taken
into account in some way by the underlying device and drivers to
generate the final, "accurate" touch point. In case the underlying
drivers expose these additional positions, they are made available in
the lists returned by the touch points' rawScreenPosition().

The raw positions are only available in screen coordinates to prevent
wasting time with mapping from global positions in applications that
do not use this data. Instead, apps can query the QWindow to which the
touch event was sent via QTouchEvent::window() and can call
mapFromGlobal() manually if they need local raw positions.

The capability and device type information is now held in a new
QTouchDevice class. Each touch event will contain only a pointer to
one of the global QTouchDevice instances. On top of type and
capability, the new class also contains a name which can be used to
differentiate between multiple touch input devices (i.e. to tell from
which one a given QTouchEvent originates from).

The introduction of QTouchDevice has three implications: The
QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent
need to be changed (to pass a QTouchDevice pointer instead of merely a
device type value), and each platform or generic plug-in is now
responsible for registering one or more devices using the new API
QWindowSystemInterface::registerTouchDevice.

Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-09 14:15:37 +01:00
Shane Kearns
2c4879a767 Remove QtWidgets dependency from QTcpSocket autotest
QMessageBox was being used to test nested event loops. This has been
changed to use QEventLoop directly.
Also, there was an unnecessary use of QPushButton to trigger a test
case, which has been removed.

As a result, 3 test cases can be run on VXWORKS, and one more test case
on Windows that were previously skipped.

Change-Id: Ic65ed441cd37d242f89df3ef3b8638a1458d9cf3
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-09 12:25:14 +01:00
Shane Kearns
002cb5d2c8 Fix unstable test case
tst_QTcpSocket::disconnectWhileLookingUp required the host lookup +
connect + disconnect procedure to complete in <50ms, which is not always
true.
When disconnecting (rather than aborting with close()), wait for the
disconnection to complete with a timeout of 5 seconds.

Task-number: QTBUG-21043
Change-Id: I3b59abf9a8eb2c6d99416e1a8ec6b528885b656e
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-09 12:25:14 +01:00
Friedemann Kleint
e8efad1b22 QProcess-test: Fix executable location on Windows.
The executable needs to be in the test directory
as it expects it sub-executables from there.

Breakage introduced by 3385fb91e1

Change-Id: Ic1f3db70851f65e2f12041c3a16cb8f0b7bdf35e
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2011-12-09 12:25:14 +01:00
João Abecasis
12dffdae75 Promote openStandardStreams sub-tests to top level
Commit a72468e820c2922540737c053eef27d033c2e77b split the test into two
functions, but kept them combined in a single slot for QTest to invoke.

That being the case, we might as well have them as test functions of
their own right. Should work nicer with test failures, skips and such.

Change-Id: I62c1fc7777c08b3e87a5903632d73dc1e1d97e1a
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-12-09 10:17:55 +01:00
Friedemann Kleint
45374d0886 QPixmap test: Re-enable tests of Windows bitmap/icon conversion.
- QPixmap::to/fromWinHICON/BITMAP() became free internal
  functions (see b8d330904b)
- Improve QImage check function similar to
  11732d133b

Change-Id: I80ff066964ce6c339a6b9bfa5a0e10421dca162a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-09 08:24:28 +01:00
Friedemann Kleint
a479e0cfae Tests: Fix the language change test.
- Use correct overload for QTranslator::translate()
- Fix LTR source text
- Use QDir::TempDir correctly (check for slash).
- Do not copy executable on Windows (which is locked), use
  arbitrary data instead.
- Use Q_OS_MAC

Task-number: QTBUG-21402
Change-Id: I6ba1c7c764d4c847278eaff9a96c8cd312ac204d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-09 08:24:03 +01:00
Friedemann Kleint
2509a5b5a4 QFile-test: Do not fail when run with redirected stdout/stderr.
Check whether stdout/stderr is sequential.

Change-Id: Ia6311e265f0da03dce5b05d78a2058e0c2098bbf
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-09 08:23:53 +01:00
Friedemann Kleint
04cac41e58 QProcess-Test: Improve error handling.
In case a subprocess fails to start.

Change-Id: I1372c07de8f3580a8e7aadd6874da15bf273ac53
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-09 08:23:27 +01:00
Bradley T. Hughes
60e93449d2 Re-enable 'check' target for tests/auto/gui on Mac OS X
Failing tests are marked with CONFIG+=insignificant_test.
tst_QTextLayout currently asserts, so it has been disabled to prevent
destabilization of the CI system.

Change-Id: I7bd836ee14085689c8a0f0ce8e3c80d81a55eb94
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-09 02:39:06 +01:00
Stephen Kelly
4ebceaba39 Forward the contents of the parents argument through this proxy.
Change-Id: Ifabc2a7deec8ea045bf9a9f46fb3a97410dd33f2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-09 02:39:06 +01:00
Stephen Kelly
50ef3ae2f3 Notify about moves in the source model more efficiently.
Change-Id: I5ea2a2dddc1b39a3d2b405bda815f42df7c07c75
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-09 02:39:06 +01:00
Shane Kearns
9138890bd6 Fix failing setSocketDescriptor test in QTcpSocket
setSocketDescriptor fails because socket is in the wrong state.
This is timing dependent, if qt-test-server is still in the DNS cache
then the test failed.
 - clear the DNS cache to avoid the host lookup state being skipped.

Change-Id: If159d514b1aa9b62a4834f6352d5e7b0a00a5724
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-09 01:01:01 +01:00
Joerg Bornemann
f7d11b216a testProcessSpacesArgs fixed
Target names with spaces must be quoted.

Change-Id: I913ef386353fc75991c8db4e3205ab511fc1f1a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-09 01:01:01 +01:00
David Faure
5cb05091d2 Improve/cleanup qtemporarydir (and qtemporaryfile) unit tests
To follow the comments in the review by João Abecasis.

Change-Id: Ie566705d3b4071b8628d269246aadcde4866f34f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-08 21:12:57 +01:00
David Faure
ca1af75fb2 Fix QTemporaryDir unittest on Mac OS X
mkdtemp(10*X) replaces all 10 chars on Mac, while on linux it only
replaces the last 6. Adjusted the too-strict tests to allow for
both possibilities.

Change-Id: Ie6d57bd4947254ad7a39e75ac0e8881cebeaa428
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-08 16:00:53 +01:00
Friedemann Kleint
11732d133b QPixmap test: Make lenientCompare() more verbose.
- Output cause of failure
- Streamline code

Change-Id: I597e8cf0178c2417ea55c2319398a48d839b4474
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-08 08:51:35 +01:00
Friedemann Kleint
dd2b5b88be QTestlib/Selftest: Fix Windows.
- Do not run with empty environment. At least PATH
  is required at least (Qt + MSVC/MinGW runtime)
- Account for MSVC's different formatting of double numbers.

Change-Id: Ic7b1cf4a16a88c5384347b2651b011ac13c92d70
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-08 08:51:35 +01:00
Frederik Gladhorn
1e37a053ed Create a class to contain accessibilty enums.
This is needed in order to expose the enums to qml.
Do not inherit QAccessible.

Change-Id: I220a0ea3add2d790e4fa6e93ce3deda762859e1a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2011-12-08 08:51:35 +01:00
Jason McDonald
ad80d42f8e Remove unused overload of QTest::qExec.
The overload of QTest::qExec() that takes a QStringList is not used
anywhere in Qt's autotests, despite having been in the qtestlib API
since Qt 4.4.

This lack of use most likely derives from the fact that none of the
QTEST_MAIN macros use the overload, and more than 99% of Qt's tests
use those macros to avoid explicitly calling QTest::qExec().

Change-Id: I264b21d7fe1a9f2d565f748cf8bbe32414a73bb0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-08 03:04:55 +01:00
David Faure
c44a67e6f3 Port externaltests.cpp to QTemporaryDir
Change-Id: I6097ea92dd4b300cb562510e0ea27cee3c01b466
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-07 18:58:43 +01:00
Friedemann Kleint
ebfdb73b75 qtbase: Remove QSound.
Which currently causes tests not to compile on Windows
due to missing symbols in QtWidgets (QSound::QSound() ,etc).

Change-Id: I87f0a403e61c3a67f9a758f114e33db1012e33e8
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-07 14:37:41 +01:00
Richard Moore
2757a5fe8c Check we're connected before startClientEncryption()
The docs say this is required, but we don't check it and instead
segfault right now.

Change-Id: I825b00a312a481c5383af127333c0c4698188348
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-07 12:55:28 +01:00
Jason McDonald
b989444f35 Use QTRY_VERIFY to test asynchronous behaviour.
QTRY_VERIFY waits for a condition to become true while regularly
processing events.  There is no need for a custom solution to this
problem.

Change-Id: Ia65c90cbdb165b543f5c78f9bac3cfadd77dfb3f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-07 07:53:30 +01:00
Jason McDonald
7fcc55034c Use QTRY_VERIFY to test asynchronous behaviour.
QTRY_VERIFY waits for a condition to become true while regularly
processing events.  There is no need for a custom solution to this
problem.

Change-Id: Ia23e2fb61cdc5c3a3a8a729cd4356ba930fe7cb7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-07 07:53:26 +01:00
João Abecasis
d5d073f874 SimpleVector as a test case for QArrayData
SimpleVector is meant solely as a test case and reference container
implementation based on QArrayData functionality.

It shall not replace QVector or friends.

Change-Id: I5c66777c720f252c8e073a2884c6d5f1ac836d0e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-07 02:01:42 +01:00
Bradley T. Hughes
b6e9ff22a3 Fix tst_QSharedPointer invalidConstructs:forward-declaration failure
When using clang, the forward-declaration test fails to link, unlike
with other compilers. The standard says that deleting a forward-declared
pointer is undefined behavior, so the link failure is a valid result of
trying to do so.

Change-Id: I527b91c15b7d51d9522d95af0630e7dacd26bb30
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-06 18:37:54 +01:00
João Abecasis
bce08ba220 Introducing QArrayData
Modeled on QByteArrayData/QStringData/QVectorData, the intent is to
unify book-keeping structs for array-like data and enable sharing of
code among them.

As in those structures, size (and alloc) data member(s) specify the
number of *typed* elements the array does (and can) hold.  The size or
alignment requirements of those objects is not tracked in this data
structure and needs to be maintained by its users.

Contrary to QByteArrayData and QStringData, QArrayData's offset member
keeps a *byte* offset to the actual data array and is computed from the
beginning of the struct.

Shared-null and -empty functionality is provided by QArrayData and
shared among all users.

Planned features include setSharable (force deep copies), fromRawData
(detached header and data allocations) and literals a la QStringLiteral
(static immutable instances), thus covering the functionality needed for
QByteArray, QString and QVector.

Change-Id: I9aa709dbb675442e6d06965efb8138ab84602bbd
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2011-12-06 16:57:17 +01:00
Shane Kearns
7abd5d950d Skip untestable interfaces in QTcpSocket::bind autotest
bind() test failed if there is an autoconfigured IPv4 address.
e.g. bluetooth adaptor that is not attached to a network.
Or WLAN adaptor in peer-peer mode.
- solved by skipping the autoconfigured IPv4 addresses in the same way
  as IPv6 addresses are already skipped

bind() test fails for proxy
- skipped, QTBUG-22964 created

Change-Id: I9a799ae8db421783f474e97cf876d6e265516397
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
2011-12-06 11:57:11 +01:00
Jason McDonald
e3640d1bdd Remove TESTED_CLASS/TESTED_FILES comments from tests.
These comments were mostly empty or inaccurate.  Appropriate naming of
tests and appropriate placement of tests within the directory tree
provide more reliable indicators of what is being tested.

Change-Id: Ib6bf373d9e79917e4ab1417ee5c1264a2c2d7027
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-06 02:19:25 +01:00
Jason McDonald
5d74683b7a Don't mark selftest subtests as testcases.
The subtests are intended to be executed by tst_selftests and therefore
don't need to have "CONFIG += testcase", which causes 'make check" to
treat them as stand-alone tests.

Change-Id: I1b47e0186be99c591bb1e03bbec6386518f8a449
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-06 02:19:25 +01:00
Jędrzej Nowacki
d242d78339 Make tst_QVariant::canConvertMetaTypeToInt more verbose.
Change-Id: If17cbd1154c4fd3c006648b28e91a009de5b373b
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2011-12-05 17:23:00 +01:00
Jason McDonald
260a2e52b2 Fixing naming of selftests.
Make the test object names correspond to the test program names, so that
it is easier to see which test produced each block of test output.

Change-Id: Ib19a955938b549f27cdcaac83bfa9150285b396d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-05 09:02:15 +01:00
Jason McDonald
4bca278d63 Don't set graphics system at start of test.
QApplication::setGraphicsSystem() is a no-op, and even if it wasn't it
would be unwise to force a graphics system that isn't guaranteed to be
included in the Qt build, without including any logic to skip the test
if setting the graphics system failed.

Change-Id: Id9a0a87586872088625de7840b5032d0c3cc48a1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2011-12-05 07:28:47 +01:00
Rohan McGovern
2d8d258f1d Fixed tst_selftests findtestdata subtest for shadow builds.
This test uses qt.conf to enforce a predictable tests install location.
This was not working in the shadow build case, as qt.conf was only
present in the source tree; embed it as a resource at :/qt/etc/qt.conf
so it works in the shadow build case too.

Change-Id: Iec708d9686c29a1fc5ff0020dc11a93a593d20c5
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2011-12-05 06:00:04 +01:00
David Faure
e999c543a0 New class QTemporaryDir.
As discussed on qt5-feedback / development lists.

Change-Id: If1733369d12daa29054776ec2cbd78e63679768e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-02 21:04:34 +01:00
Honglei Zhang
4d696d53b0 Fix tst_qsql crashes on Mac OS X
In tst_qsql, there are function calls to  QApplication(argc, 0, false), where
argc is zero. According to the documentation, argc must be greater than
zero and argv must contain at least one valid character string. The
misuse of this API has no problem on any platform other than Mac OS. This
commit has fixed the crash by passing valid dummy parameters.

Task-number: QTBUG-22811
Change-Id: I42b26d66f0becb7a942896e6ddcaea52ff720a48
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2011-12-02 17:35:11 +01:00
Bradley T. Hughes
ad8edac53c Remove QInternal callbacks and internal functions
After commit 79f675a1e0, the connect and
disconnect callback API effectively becomes useless. Now that these
callbacks cannot/do not, it makes little sense to keep the backdoors
added for Qt Jambi support.

Remove them for now. Should the Qt Jambi team want/need to port to Qt 5,
we can re-add them, possibly designing a better API for doing so as
well.

Change-Id: I6209a1d647d683c979d5294b632b8c12c0f9f91c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2011-12-02 15:59:58 +01:00
David Faure
1bb51cb8b1 Implement QDir::removeRecursively
Task-number: QTBUG-4592
Change-Id: I363e2c24d1c0ada975b8b927d7c6e776b8aae579
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2011-12-02 15:59:58 +01:00
Honglei Zhang
8c74fe5c7a QSqlRelationalTableModel doesn't follow relations on the first column
QSqlRelationalTableModel doesn't follow relations on the first column
of a table. The DisplayRole and the EditRole for indexes on column 0
are always the same. The bug is found in QSqlRelationalTableModel::data.

Task-number: QTBUG-20038
Change-Id: Ie1e98b5f46ffc171113f2d51b9b19ff5febb1c3c
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2011-12-02 15:59:58 +01:00
Bradley T. Hughes
409b3b42a2 Remove cast and assignment operators from QAtomicInt and QAtomicPointer
This is a source incompatible change. There is concern that the
convenience of the implicit cast and assignment operators can lead to
misuse. Several commits have already been done that remove excess use
of the implicit cast, which is a *volatile* read every time it's used.

Users of the QAtomic* API should have to think about when they are
loading the value, and if they do or don't need the acquire memory
barrier on load. The code that people would write using this API is
meant to be multi-threaded, concurrent, and correct. The API should not
allow them to inadvertently, possibly unknowingly, shoot themselves
in the foot.

SC-break-rubber-stamped-by: Lars Knoll

Change-Id: I88fbc26d9db7b5ec80a58ad6271ffa13bbfd191f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2011-12-02 13:21:32 +01:00