Commit Graph

1401 Commits

Author SHA1 Message Date
Kurt Korbatits
c5618fd880 Fixed qsharedpointer unittest to run from installation directory
- Only run invalidConstructs() tests if not cross compiled

Change-Id: If99fccdf9bca339507ca60c49aa89dc35c535d3d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-10 03:02:07 +01:00
Andrew Stanley-Jones
49b5306155 Add socketOptions flags to QLocalServer
QLocalServer had no way to set socket options
that more complicated servers require. The
first set of options allow setting of access
control on the sockets.

Change-Id: If4268c66462fc2e6cf1e70b1d5f56c76d2c69228
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
2012-02-10 03:02:07 +01:00
Thorbjørn Lund Martsum
73a5bc2aac QHeaderView - minor bug in visualIndexAt
This fixes a minor bug in VisualIndex triggered when calling
resizeSection with size 0 (but not hideSection).

It is mostly cosmetics - however hopefully there will soon
be a minor refactoring and there is really no need to make
strange code to keep a semantic bug.

However it is also doubtful to make a semantic change
while refactoring.

Change-Id: Ide153e421fd7a634062cb74867f4a49da4bf9cd6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-10 00:27:44 +01:00
Kai Koehne
be98fa32c7 Allow customization of qDebug output at runtime
Check the QT_OUTPUT_PATTERN environment variable in the default
message handler to customize the output of messages. Following
place holders are right now supported:
 %{message}, %{type}, %{file}, %{line}, %{function}

The original cleanupFuncinfo was written by Thiago Macieira.

Change-Id: I6ad25baaa0e6a1c9f886105d2a93ef3310e512a9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: David Faure <faure@kde.org>
2012-02-09 18:11:21 +01:00
Miikka Heikkinen
581f079b04 Make "nmake check" pass for corelib tests in Windows.
- Marked four tests insignificant due to failures, these need to be
  fixed later and then re-enabled:
  - tst_qfilesystemwatcher
  - tst_qsettings
  - tst_qlibrary
  - tst_qsharedpointer
- Skipped one invalid case (tst_QCoreApplication::argc())
- Ifdeffed around vsprintf issue in MSVC (tst_QByteArray::qvsnprintf())

Task-number: QTBUG-24157
Task-number: QTBUG-24146
Task-number: QTBUG-24128
Change-Id: I4db957a65fbf0093f5ae3dc1a04d792492818104
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-02-09 12:52:28 +01:00
Rohan McGovern
5cd73e5088 Fixed tst_qfileinfo::group crash if getgrgid fails
QVERIFY2 and gracefully fail with an error message, rather than
crashing, if getgrgid() fails.

Change-Id: I82a7290f83208486577988cc831d5d3cba20f98e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-09 10:47:33 +01:00
Andreas Holzammer
ef7fd67845 Replace Q_WS_WINCE against Q_OS_WINCE.
Window system Macros where deprecated so use
Q_OS_WINCE for now. This code will need
some refactoring, but this is the first
step to it.

Change-Id: I5876b80ee45d4b38ac63fc7d51e775dc70bbd485
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-09 10:45:38 +01:00
Rohan McGovern
adfca27ac0 Fixed tst_qobject::property for clang
The test was failing at:

  QCOMPARE(property.userType(), qMetaTypeId<CustomType*>());

The CustomType* metatype was not registered before this part of the
test.

qMetaTypeId<T> will register the metatype for T before returning it if
it is not yet registered, while QMetaProperty::userType() returns 0 if
the metatype is not yet registered.  However, the order of evaluation of
these two expressions in the above statement is technically undefined.

Apparently, gcc evaluates the arguments in order from right to left,
allowing the test to pass, while clang evaluates the arguments in order
from left to right, causing the test to fail.

Change-Id: I5059556e860cec29b57c31e4e26f46cf9e6055da
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-02-09 10:45:38 +01:00
Kurt Korbatits
805d895978 Fixed qstandardpaths unittest to handle being run as root
- testCustomRuntimeDirectory test skips if run as root

Change-Id: Idcc2a1db5d8a96b2ec0248b8b1c392fffc0b2e11
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:10 +01:00
Kurt Korbatits
951c0b7afa Fixed qdir unittest to handle being run as root
- Added checks to see if running as root and skip as needed

Change-Id: I4f94d5bfe511c6dfda315854b7cd1f64efe6e4f4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:05 +01:00
Kurt Korbatits
7f403f368e Fixed qfile unittest rename() failing as root
When run as root was able to move file to /etc directory but was
expecting a failure.

Change-Id: Ic2ac5506253f2a3395ed56e88a856542bf82ad6d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 06:53:00 +01:00
Jason McDonald
1fe0a4cc68 Make selftest.pri more readable/maintainable.
Change-Id: Ic5a74beebb718df4cce5a9b02cdfd6f6d4cec97d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:53 +01:00
Jason McDonald
52744f5053 Improve float selftest
Correct a bug in the test and use unique names for data rows.  The bug
was that the test assumed that QCOMPARE for float values 100001 and
100002 would fail, but it actually succeeds.  QCOMPARE for floats uses
qFuzzyCompare(), which succeeds if the numbers differ by no more than
1/100,000th of the smaller value.  Thus QCOMPARE(100001, 100002) passes,
while QCOMPARE(99998, 99999) fails.

Change-Id: Ia35d3126c2e3ebe91d64daa309048514a365d9fb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:50 +01:00
Jason McDonald
7b7b58ae09 Remove unused test results from testlib selftests.
Some of the subtests are only run with plain-text output format.  For
those subtests, the other output formats were unused and gradually
becoming out-of-date.

Change-Id: I4c10f7f5bab2d2cc7d2d2ad641fbf5d4df02b798
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:48 +01:00
Jason McDonald
7aa5a89eef Add data tag names to datetime selftest.
Change-Id: I73a0faab06df99521a48f106d93dd7b9a620148d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:45 +01:00
Jason McDonald
95d0b27711 testlib: Add selftests for skip and fail inside cleanupTestCase().
Change-Id: I9bbe774c3259338d452cd1eb1a6f37a85db15921
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-09 04:07:33 +01:00
Rohan McGovern
931f4501a6 Fixed tst_selftests on OSX 10.7
Our OSX 10.7 test machines send a SIGILL rather than a SIGSEGV to a
process which attempts to dereference a null pointer.

Change the "crashes" test to dereference an invalid pointer with a
value slightly greater than 0 so that we get the same crash behavior on
all (unix) platforms.

Change-Id: I700a2c7d654a9468af5e5996010a258695ed2ae5
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-09 03:31:08 +01:00
João Abecasis
0c97840708 Introduce Q_DECLARE_OPAQUE_POINTER
To hide the IsPointerToTypeDerivedFromQObject monstruosity :-)

Documentation for Q_DECLARE_METATYPE and qRegisterMetaType was updated
to mention requirements on registered types and how they can be
circumvented for pointer types with the new macro.

Change-Id: If83b037a8e2f28761eb903525e87008107298801
Reviewed-by: Harald Fernengel <harald.fernengel@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-09 00:32:41 +01:00
Stephen Kelly
ae85d7c965 Treat pointers to QObject derived types in QVariant specially.
It is possible to do this for example:

QVariant v = QVariant::fromValue<MyCustomQObject*>();
QObject *object = v.value<QObject*>();

This means that if a QVariant contains a pointer to a QObject
derived type, third parties can extract a QObject* and use its
properties without knowing the concrete type.

This is a source compatible change.

Change-Id: Iee9a9437e99cc2f40d1a4bfea47275482ef7161f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-02-08 14:43:18 +01:00
Mark Brand
7b726900ec QSqlTableModel::setRecord(): emit dataChanged() consistently
Previously, if any fields in the supplied record could not be matched
with a column in the target table, dataChanged() was supressed for all
columns for OnManualSubmit. This is not good because it prevents other
views from noticing the fields that *do* change.

It's simplest and probably more efficient just to emit
dataChanged() once for the whole row. Fewer signals need to be
processed and in typical cases much or all of the row is likely to
be changed anyway.

Change-Id: Ib56bf9a18e51b9cb85771acefcb2bf26e295a54e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-08 14:43:18 +01:00
Mark Brand
5953304bc5 QSqlTableModel::setRecord(): do not try to detect value changes
In an apparent attempt to be economical with emitting dataChanged()
and submitting SQL to the databse, setRecord() compares each field
value of the record with the old value, taking action only when
a difference is detected.  Several complaints against this code are:

-The comparision does not work on float type.

-It is really up to the application and database to decide this. The
model should make few assumptions. The application has the option to
omit fields from the record that should be ignored.

-The current behavior seems to assume that the "old" values are the
current state of the database, but the database may have changed since
the model was last refreshed.

-The code compares the value from record(), which probably
corresponds to the EditRole, with the DisplayRole value from data().

Change-Id: I11477c185eb411d442144dc682893d0df12d03d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-08 14:43:18 +01:00
Pasi Matilainen
6dc85408cd QTextEdit cursor position fix when moving left/right with selection
When text has been selected in a QTextEdit and the left or right arrow
key is pressed, the cursor moves one character beyond the start or end
of the selection, when it shouldn't move past the selection. Fixed by
moving the cursor to the right place when a selection is active.

Task-number: QTBUG-22853
Change-Id: I9ea1863436db98627a6fd041ce554cf10be26493
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
(cherry picked from commit 1b031759ddfdab9703dfecac13f1ed318da3dafe)
2012-02-08 12:37:22 +01:00
Harald Fernengel
a2bea730c2 Fix qlocalsocket autotest
Lackey is currently not built due to a qscript dependency. Mark the
test as an expected failure, so we can resume testing QLocalSocket
again. See QTBUG-24142

Change-Id: I2642ed30cf7a2068f30f63801c632fea7dae7691
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
2012-02-08 09:53:23 +01:00
Andrew den Exter
979cb5a09e Initialize dynamic meta object extradata.
QMetaObject::invokeMethod attempts to deference the extradata for
meta objects versions 6 and greater which is causing a crash in some
of the qtquick1 tests.

Change-Id: If5b2ca83b15de2cd558976c6b681dd5457c404d1
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-08 09:53:23 +01:00
José Millán Soto
4c9266fd16 Make copy and cut methods work in QAccessibleTextEdit
Correct the implementation of cutText and copyText in QAccessibleTextEdit so
they use cut() and copy() methods of QTextEdit

Cherry picked from Qt 4 - 36202cf8fca822492615d418bd563a40bee4af08

Change-Id: I86a531ed7059b1a928cb8515c2743d4d8b596b36
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-02-08 07:48:46 +01:00
Jason McDonald
26c41ed918 testlib: Clear ignored messages after every data row
Previously, ignored messages were only cleared at the end of each test
function, i.e. after all data rows were finished. This meant that if a
data row in a data-driven test function didn't cause all of the expected
messages to be generated, the remaining messages would be carried over
to the next data row.  This would result in errors about missing
messages being associated with the last data row rather than with the
correct data row.

This commit makes testlib check for missing ignored messages after
running each data row rather than only doing so after the last data
row.

This commit also adds a regression test to demonstrate that ignored
messages can no longer be carried over from one data row to another.

Change-Id: Ibee51aa6e96866fbcbcb4acee1a8340a86a6a4ba
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-08 03:13:23 +01:00
Jason McDonald
da18ada6bf testlib: Clear expected failures after every data row.
Previously, expected failures were only cleared at the end of each test
function, i.e. after all data rows were finished.  This meant that if a
data-driven test function called QEXPECT_FAIL and then didn't perform
any further verification steps to trigger the expected failure, the
expected failure would be carried over to the next data row, probably
causing the first verification step in the test function to XPASS (with
a seemingly irrelevant error message) for the next data row.

This commit adds the new function QTestResult::finishedCurrentTestData()
to cleanup after each data row is executed.  This function treats calls
to QEXPECT_FAIL without subsequent verification steps as a test failure.

This commit also adds a regression test to demonstrate that expected
failures can no longer be carried over from one data row to another. If
run against the previous version of testlib, the new test would report a
pass instead of an error.

Change-Id: Ida5c7f080815b0dca9531131fed582b0918334cb
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-08 03:13:21 +01:00
José Millán Soto
009cd671ec Do not check isActiveWindow in QAccessibleWidget::state
QWidget::isActiveWindow() was being checked in QAccessibleWidget::state
to determine if a widget is focusable. As a result, focusable widgets
were reported to be not focusable when the window was not active.

Change-Id: I73c47181ed132a84f0251cb67d0e20912e29a1a6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-02-08 03:13:10 +01:00
Rohan McGovern
3ae3aa0e51 Improved stability of tst_qsemaphore (especially on mac)
Timers are not entirely precise; if we ask for a timeout of
10000 milliseconds, we might time out in 9999 instead.
Also, we know the expected elapsed time in each case, so do a fuzzy
comparison against that time.

Previously the test was verifying that the elapsed time was greater than
or equal to the timeout in the case where a timeout was expected, which
means the test would not detect bugs which incorrectly caused the
timeout to occur later than it should.

(cherry picked from qt4 commit 9a2573dc13b3e8df6cd15bef64370ea407480fc7)

Change-Id: I91d0c81f989ab43a3c48f6abbb4c5b28e2b35402
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-08 02:10:51 +01:00
Rohan McGovern
f50a84008e Improved stability of tst_qhttpsocketengine
This autotest assumed that various network operations could always be
completed within 5 seconds.  Notably, it assumed that an attempt to
resolve a nonexistent hostname would always result in an error within
5 seconds.  In my testing, it usually takes 4-6 seconds to complete,
but occasionally takes as much as 13 seconds.

(cherry picked from qt4 commit c85faef67b6a7e8fcedb4ce800282d41f5b79ec1)

Change-Id: I982ecf6ebc1bb8ee2184cf5592cb2684474c870b
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-08 02:10:44 +01:00
Mark Brand
f5e1da12f0 QSqlTableModel::removeRows(): don't emit extra beforeDelete
Qt 5 seems like a welcome opportunity to stop emitting this
spurious beforeDelete signal.

Change-Id: Ib8628343ca9b8fdd85c154a206c7e2bf2c4c9dc1
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-07 22:05:51 +01:00
Jonas Gastal
63f634322b Don't allow cd'ing to above root.
Task-number: QTBUG-23893
Change-Id: Ifc6e22f135a1f6bff7c0fa8bef3ea7e1042ae819
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2012-02-07 22:05:51 +01:00
Shane Kearns
deea48ef6a Fix QFile autotest not to require elevated privilege to pass
The open test case tests opening a device path on windows.
As this requires privilege elevation, the test fails when running
nmake check from a console.
As the CI machines appear to run tests with admin privileges, first
check opening the device using the windows API. If that succeeds, then
opening using QFile should succeed. If that fails, the opening using
QFile should fail.
(Since Windows vista, members of the "administrators" group do not run
at elevated privilege all the time. The user needs to opt in via a
UAC prompt or "run as administrator". This is similar to using the
sudo command on unix)

Ran the test as administrator and normally. Now passes in both cases.

Change-Id: Ibd7682eceb61e35d4912fa0392df536f4331f6ed
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-07 20:03:43 +01:00
Kim Motoyoshi Kalland
ba1cf5dae3 Removed image format specific template functions in raster engine.
Simplified the raster engine by treating image formats in a more
generic way and removed some unused code.

Change-Id: Ib3979a1a6e3e6f17c5002248545779ec36fff7c9
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-02-07 15:52:01 +01:00
João Abecasis
5a92dd6124 Detect incompatibilities in repeated type registration
QMetaType used to register a typeName and factory functions for
creation/destruction of objects. While it would be possible for a single
type name to be registered matching different actual types and memory
layouts, there was little that could be done about it.

Now that QMetaType is tracking type information with a direct impact on
data layout and ABI (size and type flags) it is important that we check
and detect binary incompatibilities as early as possible.

[Such incompatibilities could arise from type name re-use (technically,
ODR violations) or, more commonly, as version mismatch between different
shared libraries or plugins.]

Only type size and flags are checked as function pointers to inline and
template or otherwise non-exported functions could trivially differ
across translation units and shared libraries.

When registering typedef types, a check is made to ensure the same name
doesn't get registered as different types.

Change-Id: I8211c3de75d4854ce8fafdb620d3a931c206e0c3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-07 09:47:51 +01:00
Jędrzej Nowacki
b8cf1d6bdc Remove QMetaType::unregisterType().
The function hasn't been working properly. It was not well tested, for
example it is undefined how QVariant should behave if it contains an
instance of an unregistered type.

Concept of unregistering types was inspired by plug-in system, but in
most supported platforms we do not unload plug-ins.

Idea of type unregistering may block optimizations in meta object
system, because it would be not possible to cache a type id.
QMetaType::type() could return different ids for the same name.

Currently QMetaType::unregisterType() is not used in Qt.

Change-Id: I878b6e8d91de99f9bcefeab73af2e2ba0bd0cba0
Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-07 08:53:18 +01:00
Jędrzej Nowacki
56265031b7 Align QVariant::UserType and QMetaType::User
There is no point in keeping separate values which should mean the
same.

QVariant::UserType was used also to construct a valid, null QVariant,
containing an instance of unknown custom type. The concept was strange
and useless as there was no operation that could be done on such
QVariant. Therefore it was dropped.

Please note that the patch slightly changes behavior of different
functions accepting a type id as parameter. Before QVariant::UserType
was an invalid type from QMetaType perspective (id 127 was not assigned
to any built-in type), but QMetaType::User points to the first registered
custom type.

Change-Id: I5c7d541a9affdcdacf53a4eda2272bdafaa87b71
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Andrew Stanley-Jones <andrew.stanley-jones@nokia.com>
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
2012-02-07 08:52:32 +01:00
Martin Petersson
a650500729 tst_qnetworkreply: remove no such signal warnings
The QNetworkReply finished signal does not have a bool parameter.

Change-Id: I87bd0410545f7a2fc2ab63cca90548f0585bf7a0
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
2012-02-07 08:42:58 +01:00
Jason McDonald
9221757cde Fix error in qgraphicsanchorlayout1 autotest.
QTest::ignoreMessage() cannot be called when creating test data rows,
but rather must be called when executing a row.

Change-Id: Ic958c4e5c15dd53a48479099b6b07803af6cb789
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-07 08:29:19 +01:00
Jason McDonald
cfd8a9a448 Fix error in qcssparser autotest.
QTest::ignoreMessage() cannot be called when creating test data rows,
but rather must be called when executing a row.

Change-Id: Ifceaff4c5a7f1b6408ec57196298e3f3038910c9
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-07 08:29:06 +01:00
Friedemann Kleint
8cb26f8511 Complete split of QtConcurrent.
- Fix exports.
- Fix tests.

Acked-by:  Thiago Macieira <thiago.macieira@intel.com>

Change-Id: I2df923ba74b468f5ee09b3a48ae3d09920751365
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-06 16:48:22 +01:00
John Layt
23457bd6d9 SIC: QLocale: Make QSystemLocale a private class
As discussed on list and approved by Lars and Thiago.

Make QSystemLocale private to give us time and space to change it to a
better implementation.

Change-Id: Ifd806972f3996c43a876f544f78c6557ad71cd75
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-05 17:50:04 +01:00
John Layt
1e3833bed8 QString: Make convert to number methods only use C locale
Ensure consistent conversions by not using the system default locale.

Change-Id: I60db9fc4f465c0254f3213419e57d7879aaddd65
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-05 17:49:42 +01:00
Lars Knoll
96501b0a18 Move QtConcurrent into its own module
Task-number: QTBUG-20892

Change-Id: I614500aafb6428915509983608bbb0ade4e4f016
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-05 17:49:16 +01:00
Jędrzej Nowacki
92b1124752 Add movability tests for QByteArray.
QByteArray is declared as movable but it was not tested before.

Change-Id: I4fb636f8705c3fd792a768872206203ee5fd4ddb
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-05 13:07:56 +01:00
John Layt
fc24979e43 QDateTime: Remove Julian Calendar
Convert QDate to only use Gregorian calendar and not Julian calendar
before 1582.  In future the Julian can be used via proper calendar
classes.

Change-Id: I547a3550332057a0ab1be616706630b6afaceffc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-05 00:26:07 +01:00
John Layt
8327fa7c11 QDateTime: Store Julian Day as qint64
Store the QDate Julian Day number as an qint64 instead of uint32 to
enable support for dates before 2 January 4713 BCE.  This changes the
possible date range to be approx 2.5 Quadrillion BC to 2.5 Quadrillion
AD. A qint32 was not used as it only covers 5 million BCE to 5 million
CE which does include Geological or Astronomical time.

The effective supported date range is currently 4800 BCE to 1.4 million
CE due to restrictions in existing conversion formulas.  The effective
range will be extended later with new formulas.

Change-Id: Ib4345369455b31d4edae8c933b7721e76414e914
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-05 00:26:07 +01:00
Kent Hansen
b184dd0a01 Bring qmetaobjectbuilder in sync with moc
qmetaobjectbuilder should generate meta-objects of the same version
as moc; in the future, when the moc version is bumped, QMOB has to
be adapted at the same time.

QMOB was generating version 4 meta-objects. This patch makes it
generate version 6 (the current version). This also fixes a bug with
using qt_static_metacall with QMOB (setStaticMetacallFunction()); it
was already using the version 6 qt_static_metacall signature, which
isn't compatible with version 4.

Also add tests that ensure that the QMOB-generated meta-object works
with real objects; in particular we want to test the codepaths in Qt
that check for version >= 4.

Change-Id: I64a151ea5c947a6f8b7a00e85a39866446c735e9
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-03 15:09:03 +01:00
Andy Shaw
5bab4744ba Handle the 'real' datatype correctly in the SQLite driver
The 'real' datatype should be seen as a QVariant::Double type and not as
a QVariant::String type otherwise it does not get presented correctly
when using a non Qt application to access it.

Test is included for QSqlQuery.

Task-number: QTBUG-16373

Change-Id: Ie323ce49eb95e4d6bb4c3814ba9a957a63f4b259
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
(cherry picked from commit b23631015c23a49e3b4d296ea0a6266bfce3d4f1)
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-02-03 15:09:03 +01:00
Pekka Vuorela
c802a5d272 Remove QInputContext
This has only been around as compatibility interface for Qt4
but is now replaced by QPlatformInputContext.

Change-Id: I677dbbea46311bf39f6c5ca9dc3fb5009abe924a
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-03 11:01:34 +01:00