Commit Graph

2236 Commits

Author SHA1 Message Date
Friedemann Kleint
99715fcfc9 Enable Windows font tests..
Application fonts have been added in
4f1820e3a7

Task-number: QTBUG-24193
Task-number: QTBUG-24195
Task-number: QTBUG-24196

Change-Id: I45d0bbb183562b7355e07ce7fa93b0046dfd4665
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-31 08:41:23 +02:00
Matt Newell
d5e9616e39 Add payload to QSqlDriver notification with PSQL implementation.
Postgres async notifications can contain a payload parameter
that is currently discarded. This patch provides the QSqlDriver
api change necessary to deliver a payload with each emitted
notification by adding a QVariant parameter to the notification
signal. It also provides the implementation for the qsqlpsql driver.
The qsql_ibase driver has been updated to reflect the change to the
notification signal signature.

The eventNotificationPSQL test in the qsqldatabase test has
been expanded to test proper payload sending and receiving.
All tests/auto/sql/kernel tests have been run with sqllite and
postgres with no regressions.

Task-number: QTBUG-13500
Change-Id: I9137f6acc8cfca93f45791ca930e0287d93d5d0d
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-03-31 08:40:55 +02:00
Matt Newell
9b423b6e69 Expand QtSql tests covering boundValues and boundValueName
Tests added that cover boundValues with positional binding,
and boundValueName.

Change-Id: I2962d76607b716d19d3e0be958109be2f032f2d9
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-03-31 08:39:53 +02:00
Matt Newell
aea6845069 Fix postgres notification support in the QPSQLDriver.
This patch fixes a critical bug in the qsqlpsql driver where
notifications aren't delivered when received. Any blocking libpq
function(specifically PQexec) will read all the incoming data
from the socket, including any pending notifications. This would
cause the socket notifier to never be fired for incoming
notifications that are already queued inside libpq. The qsqldriver
test case was skipping the postgres notification test because of
this bug, now its enabled and passing. In order to fix this
bug I made a wrapper function for PQexec in QPSQLDriverPrivate
that calls _q_handleNotification via QMetaObject::callMethod
QueuedConnection in order to deliver pending notifications
when control returns to the event loop. I also added a flag
to ensure only one call is made each time the event loop is
entered.

Change-Id: I19f5297094ae7ae46bfb0717e4fca744d69f7b92
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-03-30 23:51:11 +02:00
Honglei Zhang
06001ce008 Fix crash when an invalid filter is set
QSqlTableModel::headerData() generates a crash if an invalid filter
is set. QSqlQueryModel::indexInQuery() should check the index value
before applied to d->colOffsets[].
QSqlQueryModel::initRecordAndPrimaryIndex() is updated to sync the
size of rec and colOffsets.

Task-number: QTBUG-23879
Change-Id: Ic9f88bb288592aa6fb3c1415cc818632dadaab56
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-03-30 19:51:43 +02:00
João Abecasis
4ef5a6269c Add tests to verify QByteArray's zero termination
For data allocated and maintained by QByteArray, there's a guarantee
that data() is null-terminated. This holds true even for null and empty,
where logically the terminating character should never be dereferenced.

For tests that modify or generate QByteArrays, this ensures the
invariant is kept.

In the toFromHex() text, const-ness of temporary variables was dropped
to enable the test macro to be used, as the qualification didn't add
much to the test otherwise.

Change-Id: I7ee52e79e3a9df7de18c743f3698dab688e6bf0e
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-03-30 11:21:34 +02:00
Bradley T. Hughes
3fa70d9c74 Update tests/manual/windowmodality to test native dialogs
Window- and ApplicationModal native dialogs need to send WindowBlocked
and WindowUnblocked events as well. This will let us test that they work
properly.

Change-Id: Iaa4ddb79bb0872f9ab1e61336a5decb262472283
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-30 09:31:03 +02:00
Matt Newell
cff46983a8 Allow named bind values to be used multiple times per query
Prepared queries should be able to use a name parameter more than
once. Currently this will result in undefined behavior and crashes.
This patch fixes the bug and implements the needed test case.

Task-number: QTBUG-6420
Change-Id: I07d6537e432a9b2781e9ef3d9f597bceb054527e
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-30 09:31:03 +02:00
Thiago Macieira
ffd20af339 Revert to Qt4 behaviour that QUrl().isValid() == false
There are probably lots of places that rely on that behaviour, so go
back to what it was.

Change-Id: I4d1503a0ee105a50cdfaab52d9a5862a02c70757
Reviewed-by: David Faure <faure@kde.org>
2012-03-30 01:19:59 +02:00
Thiago Macieira
7f20dce264 Move the #include "tst_qurlinternal.moc" up to workaround a bug
I don't know if the bug is in moc or in qmake. But it bails out trying
to parse the .cpp file after the
tst_QUrlInternal::nameprep_testsuite_data function. If the #include is
placed above, it works. If it's placed below, it doesn't.

Change-Id: Ide554aa5aa3f1999e29604ba6d25ccdb09f6ef28
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
c9b78026f5 Fix the license headers for the files in the new-qurl branch
Change-Id: I469fed8b72111905e31553d0c82e62ced4009d75
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
66df11f4d1 Fix QUrl operator== and operator<
Don't crash when either side is null but not both sides.

Also make sure operator< is working properly and satisfies the basic
conditions of a type (such as that if A < B, then !(B < A)).

Change-Id: Idd9e9fc593e1a7781d9f4f2b13a1024b643926fd
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
64a10879cb Disallow spaces in URLs when parsing in StrictMode.
Change-Id: I16de68aff2b9e84cc800734c5875aaee9a2ea565
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
329ee8cedc Reimplement the StrictMode URL parsing
The strict mode check is now implemented after the tolerant parser has
finished, and only if the tolerant parser has not found any errors. We
catch the use of disallowed characters (control characters plus a few
not permitted anywhere) and broken percent encodings.

We do not catch the use of Unicode characters, as they are permitted
in IRIs.

In the tests, remove the old errorString test since it makes little
sense.

Change-Id: I8261a2ccad031ad68fc6377a206e59c9db89fb38
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
cff38329aa Re-introduce support for QUrl::errorString()
Note that QUrl can only remember one error. If the URL contains more
than one error condition, only the latest (in whichever parsing order
URL decides to use) will be reported.

I don't want too keep too much data in QUrlPrivate for validation, so
let's use 4 bytes only.

Change-Id: I2afbf80734d3633f41f779984ab76b3a5ba293a2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
74d2dba460 Port to the new QUrl API
The use of any broken-down components of the query now needs
QUrlQuery.

The QUrl constructor and toString() are now rehabilitated and the
preferred forms. Use toEncoded() and fromEncoded() now only when we
need to store data in a QByteArray or the data comes from a QByteArray
anyway. Change to toString() or the constructor if the data was in a
QString.

Change-Id: I9d761a628bef9c70185a48e927a61779a1642342
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
2591545ee1 QUrl: Always lowercase the scheme
Change-Id: I8d467014d22384f1be15fdd746e20b1153a82a4e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
1372d60bde Long live the new QUrl implementation.
Also say hello to QUrl's constructor and QUrl::toString being allowed
again.

QUrl operates now on UTF-16 encoded data, where a Unicode character
matches its UTF-8 percent-encoded form (as per RFC 3987). The data may
exist in different levels of encoding, but it is always in encoded
form (a percent is always "%25"). For that reason, the previously
dangerous methods are no longer dangerous.

The QUrl parser is much more lenient now. Instead of blindly following
the grammar from RFC 3986, we try to use common-sense. Hopefully, this
will also mean the code is faster. It also operates on QStrings and,
for the common case, will not perform any memory allocations it
doesn't keep (i.e., it allocates only for the data that is stored in
QUrlPrivate).

The Null/Empty behaviour that fragments and queries had in Qt4 are now
extended to the scheme, username, password and host parts. This means
QUrl can remember the difference between "http://@example.com" and
"http://example.com".

Missing from this commit:
 - more unit tests, for the new functionality
 - the implementation of the StrictMode parser
 - errorString() support
 - normalisation

Change-Id: I6d340b19c1a11b98a48145152513ffec58fb3fe3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
1c2144c39f Forward the methods dealing with the break down of query to QUrlQuery
Now that QUrlQuery exists, these methods are no longer necessary in
QUrl itself. Manipulation of the items should be done using the new
class.

They are now implemented using a temporary QUrlQuery. This is hardly
efficient but it works.

Change-Id: I34820b3101424593d0715841a2057ac3f74d74f0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
1aeb180386 Long live QUrlQuery
This class is meant to replace the QUrl functionality that handled
key-value pairs in the query part of an URL. We therefore split the
URL parsing code from the code dealing with the pairs: QUrl now only
needs to deal with one encoded string, without knowing what it is.

Since it doesn't know how to decode the query, QUrl also becomes
limited in what it can decode. Following the letter of the RFC,
queries will not encode "gen-delims" nor "sub-delims" nor the plus
sign (+), thus allowing the most common delimiters options to remain
unchanged.

QUrlQuery has some undefined behaviour when it comes to empty query
keys. It may drop them or keep them; it may merge them, etc.

Change-Id: Ia61096fe5060b486196ffb8532e7494eff58fec1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
b75aa795fe Refactor the URL recoder a little
Change it to operate on QChar pointers, which gains a little in
performance. This also avoids unnecessary detaching in the QString
source.

In addition, make the output be appended to an existing QString. This
will be useful later when we're reconstructing a URL from its
components.

Change-Id: I7e2f64028277637bd329af5f98001ace253a50c7
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
73e16b15a6 Remove the tolerant parsing function and make the recoder tolerant
The reason for this change is that the strict parser made little sense
to exist. What would the recoder do if it was passed an invalid
string?

I believe that the tolerant recoder is more efficient than the
correcting code followed by the strict recoder. This makes the recoder
more complex and probably a little less efficient, but it's better in
the common case (tolerant that doesn't need fixes) and in the worst
case (needs fixes).

Change-Id: I68a0c9fda6765de05914cbd6ba7d3cea560a7cd6
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
6028efa3ff Add the code that recodes URLs.
This one function is an all-in-one:
 - UTF-8 encoder
 - UTF-8 decoder
 - percent encoder
 - percent decoder

The next step is add the ability to modify the behaviour, by telling
the function what else it must encode or decode and what it should
leave untouched.

Change-Id: I997eccfd2f9ad8487305670b18d6c806f4cf6717
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-30 01:19:59 +02:00
Thiago Macieira
4c7e950aad Mark QUrl::{to,from}Punycode as deprecated since 5.0
These functions are now aliases to {to,from}Ace, which are usually
what you want. The original functions from Qt 4.0 had the wrong
semantics and wrong name. The new ones from Qt 4.2 execute the ACE
processing from IDNA (specifically, the ToASCII and ToUnicode
operations described in the RFC).

But so as not to be without tests, export the tests in unit testing
environment and test the punycode roundtrip. Note that the
tst_QUrl::idna_test_suite test tests *only* the Punycode roundtrip,
not the nameprepping.

Change-Id: I9b95b4bd07b4425344a5c6ef5cce7cfcb9846d3e
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-03-30 01:19:59 +02:00
Thiago Macieira
8fa2a41bd5 Move the QByteArray-based percent-encoding activities to QByteArray
Copy the unit tests that related to percent-encoding to
tst_qbytearray.cpp and use public functions to execute
QUrl::fromPercentEncoded and QUrl::toPercentEncoded.

Change-Id: I6639ea566d82dabeb91280177a854e89e18f6f8d
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-03-30 01:19:59 +02:00
Jędrzej Nowacki
d78fe5f8d3 Make QArrayData::shared_null zero terminated.
This is expected by QByteArray and QString

Change-Id: Ib668b144bdc0d2c793018c8f8d794f249eaf935c
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-29 23:26:34 +02:00
Lars Knoll
698b33fcce Properly detach when the modified object is a sub object
The clone() method didn't detach if we had enough memory
allocated, but didn't consider that the object being
modified is not the root object of the binary blob.

Change-Id: I9a479ae1c873b7fe9cff7e13c539e7a41961bf68
Reviewed-by: Cristiano di Flora <cristiano.di-flora@nokia.com>
Reviewed-by: abcd <amos.choy@nokia.com>
Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
2012-03-29 16:08:40 +02:00
Bradley T. Hughes
19109a7697 Remove modal child widget buttons from tests/manual/windowmodality
This functionality does not work anymore. Modality is tied to top-level
windows, not to any arbirtrary QWidget.

Change-Id: Ie7545cbcfbf4021850b215f014bb0f7274971327
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-29 16:08:40 +02:00
Jonas Rabbe
5185a28139 Fix a crash in QFactoryLoader
The change in plugin loading has meant that different plugins in the
same plugin folder will not be handled properly when loaded with
different instances of QFactoryLoader.
A solution is to only unload compatability plugins from
QFactoryLoader::update() since they are the only plugins that are
actually loaded in that method.
This auto test shows the error on the current version of QFactoryLoader
and passes with the fix described above.

Change-Id: I12001525d51bb631d6742c5965357598322f247c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-29 13:58:13 +02:00
Thiago Macieira
4fc7474805 Port QHostAddress to use the new IP utilities in QtCore
The new code now generates lowercase hex instead of uppercase, so
adapt the unit tests to pass.

Also, "123.0.0" is now considered valid (compatibility with inet_aton).

Change-Id: I07b5125abf60106dc5e706033d60836fb690a41f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-28 16:31:34 +02:00
Thiago Macieira
826c0723c1 Add support for IPv6 parsing and reconstructing the address
Similarly, only test against the libc function on Linux, as other OS
sometimes have different behaviour.

Change-Id: I9b8ef9a3d660a59882396d695202865ca307e528
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-28 16:31:34 +02:00
Thiago Macieira
70db6233e7 Add a function to parse IPv4 addresses in QtCore
In the unit test, check against inet_aton on Linux with GLIBC
only. Other platforms have this function too, but they sometimes have
different behaviour, so don't try to test them equally.

Change-Id: I1a77e405ac7e713d4cf1cee03ea5ce17fb47feef
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-28 16:31:34 +02:00
Debao Zhang
d2b1c2ef1f Remove WA_PaintOutsidePaintEvent
WA_PaintOutsidePaintEvent is only suggested to be used when porting Qt3 code
to Qt 4 under X11 platform. and it has been broken now.

Change-Id: Ie4297b2a449f1055ca10ada9efb930e6018b1efb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 11:22:11 +02:00
David Faure
a5a80da223 Allow auto tests to stay away from the user's configuration.
QStandardPaths now knows a "test mode" which changes writable locations
to point to test directories, in order to prevent auto tests from reading from
or writing to the current user's configuration.

This affects the locations into which test programs might write files:
GenericDataLocation, DataLocation, ConfigLocation,
GenericCacheLocation, CacheLocation.
Other locations are not affected.

Change-Id: I29606c2e74714360edd871a8c387a5c1ef7d1f54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-28 11:22:11 +02:00
Bradley T. Hughes
448b9c00be windowmodality test: Allow exec() with ApplicationModal dialogs
Add a checkbox to the main window and dialog .ui files to allow
exec()ing ApplicationModal dialogs.

Change-Id: I4d8a4be136d0f6b688938a8020a6ebcc69a9dfe8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-28 09:42:00 +02:00
João Abecasis
7c9e345551 Improve output on test failures
This adds checks to ensure Q_ALIGNOF is returning the desired alignment
for explicitly-aligned types.

The alignment check is now inlined in the test inside QCOMPARE so we get
slightly more informative errors:

FAIL!  : tst_Collections::alignment() Compared values are not the same
   Actual   (quintptr(&it.value()) % Value::PreferredAlignment): 64
   Expected (quintptr(0)): 0
   Loc: [tst_collections.cpp(3384)]

In this case, this is enough to notice "non-native" alignments are being
requested. Having test parameters otherwise hidden in template arguments
doesn't help the situation.

Change-Id: I05267fd25b71f183cfb98fb5b0a7dfd6c28da816
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 09:36:52 +02:00
João Abecasis
049157f4f1 Silence unused comparison result warnings (clang)
The intent is to force instantiation of template container classes and
semantics or behaviour are otherwise irrelevant in this context.

tst_collections.cpp:3036:15: warning: inequality comparison result unused
tst_collections.cpp:3037:15: warning: equality comparison result unused
tst_collections.cpp:3100:15: warning: inequality comparison result unused
tst_collections.cpp:3101:15: warning: equality comparison result unused

Change-Id: I70ad38b18dcbc43879e36a34b1da460aee5f7b07
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 09:36:43 +02:00
João Abecasis
9596f591b6 Fix loop conditions, after warnings from clang
tst_qmap.cpp:697:43: warning: inequality comparison result unused
tst_qmap.cpp:717:50: warning: inequality comparison result unused

Change-Id: I300f9e10b7748306b99c3c8c38f3cc2661a569ad
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 09:36:33 +02:00
hjk
6d13e9f295 Use "qt-project.org" instead of "trolltech" in the resource system
Task-number: QTBUG-23272

Change-Id: Idcdb9620910577b3c0fc9a792a0446665bd2eab6
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 07:50:06 +02:00
Thiago Macieira
bc4f74f586 Don't hardcode the order of elements in QHashes
Instead use QMap if we want a stable order.

Task-number: QTBUG-24995
Change-Id: I93f643df236f5078768f539615fa47163e5262e8
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-28 04:07:16 +02:00
Stephen Kelly
32068cb707 Remove comment about QVariantList and QVariantMap.
They predate Qt 4.5, but it looks like the comments are indicating
that QVariantList and QVariantMap types will use the basic template,
but that is not the case. Instead they will use the compare
specializations for QList<T> and QMap<T> respectively.

Change-Id: Iebf7e9b8aaa8a699ea720090fbf641dfecde0ff7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-28 03:18:56 +02:00
Thiago Macieira
2cf466312b Unit-test the additional QBasicAtomicXXX expansions
Test that they do expand properly and don't produce errors. This is
templated code, so it doesn't get tested fully unless we instantiate
them.

Also check that the alignments are correct.

Change-Id: I2a8ee2165167f54b652b4227411e209850974b8e
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-28 02:16:39 +02:00
Stephen Kelly
dc6a1d186e Remove workaround for QComboBox not having a USER property.
QComboBox does in fact have a user property
since b1b87a73012342dc1619a8e907ea9954d59ca564.

Change-Id: I24eb2ef267cec5d8a9f7348954b703fa6df04fa5
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: David Faure <faure@kde.org>
2012-03-28 02:02:07 +02:00
Stephen Kelly
c3e1abad4e Add USER properties to QDateEdit and QTimeEdit.
Both classes had such components before, but there were issues with
the NOTIFY signal not being in the same class as the Q_PROPERTY.

This patch solves that problem by using a signal of a different name.

Task-number: QTBUG-15731
Change-Id: Ibc7ce4dba8a6b88c05d62a90e14d0101c5cd3082
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2012-03-28 02:01:49 +02:00
David Faure
e5d5495526 Make QCoreApplication::applicationName() default to argv[0]
This makes it more useful in all the Qt apps that don't set it,
given that it's used internally by QTemporaryFile, QTemporaryDir,
QStandardPaths, QDBus, QAccessibleApplication, etc.

Qt4 compatibility in the deprecated QDesktopServices is preserved,
no fallback there.

Change-Id: I584463507cf917a3720793c6bd45d07c60f8356c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-28 00:51:32 +02:00
Stephen Kelly
df43b9a06a Don't use the pri depends line for link dependencies.
That is not what depends is for.

Change-Id: Iabf93e890f009bd6c8fcc18dde1891bf20a493f1
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-28 00:51:32 +02:00
João Abecasis
2e92714090 Make QTranslator testcase independent of Widgets
There isn't really a need for the dependency as LanguageChange events can be
caught in QObject::eventFilter, directly.

Change-Id: I39778fbe1663924d97705b514ae399cfd3749776
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 00:44:16 +02:00
Pekka Vuorela
2744105419 Protect QAbstractTextDocumentLayout::anchorAt() from preedit
Previously the method didn't take into account that hitTest()
returns visual index, i.e. containing the preedit, and thus was easily
hitting assertion. Need to compensate for that before checking for actual
link.

Change-Id: I119e7f91088b4db9d347a3da338f6df915ce9719
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-03-27 23:03:12 +02:00
Bradley T. Hughes
aea0b24d69 Add manual test for window modality
This test allows us to recreate any modal scenario. Multiple top-level
windows with any depth of window and application modal dialogs is
possible.

Change-Id: Ieef2c557d2f9ad2d2b2d2b598e9415f4c1e2dcb5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-27 19:26:45 +02:00
Kent Hansen
d236fe2214 Merge master into api_changes
Conflicts:
	src/corelib/global/qisenum.h
	src/dbus/qdbusconnection_p.h
	src/widgets/kernel/qwidget.cpp
	tests/auto/other/qaccessibility/tst_qaccessibility.cpp

Change-Id: I85102515d5fec835832cc20ffdc5c1ba578bd01d
2012-03-27 19:22:48 +02:00
Martin Petersson
854256cc69 QHttpNetworkConnection test: avoid integer divide by zero exception.
The speed calculation caused a dived by zero exception.

Change-Id: I83281c8e66b9c18e7d282920901ccac1e9444a68
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-27 17:16:26 +02:00
Friedemann Kleint
2c4845ce33 Fix some compiler warnings in tests.
- Unused variables
- Deprecated conversion from const char * to char *.

Change-Id: Iea0b9c4613ea74cead6d95ba12ad1028f531cbff
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-27 16:35:39 +02:00
Pekka Vuorela
0ee1b4a1de Reverted use of tentative commit use in QWidget editors
Feature to be reimplemented simplified. Cases when input method
needs to be reset with possibility to commit use
QInputMethod::commit() again.

Change-Id: Ibfe7aecc0799e7a76c7ac4f5d860971cfe6e97ca
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-03-27 12:51:38 +02:00
Jan-Arve Saether
8d28f263aa Fix IAccessible2 for Windows, enable MSAA/IAccessible for MinGW.
Commit 5e9089135b had some problems:
* It left out the cast to IServiceProvider in the refactoring of
   QueryInterface. This broke IAccessible2.
* It also failed to enable the codepath for MinGW inside wrap(), which
  effectively caused MSAA for MinGW to be disabled.

It also adds an autotest to the bridge (finally). It is simple,
but it should help avoiding committing stuff that completely breaks
the bridge.

Change-Id: I459d89c3bdb93e54ddea85872b50fc1dba0fe4a0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-27 12:29:46 +02:00
Alexei Rousskikh
7ecbc49c55 QJsonParseError improvements
- added human-readable error message
- improved enum value names

Change-Id: I86d4bb419f9581f85d61b6e090048f1943017f9e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-27 12:06:54 +02:00
Jason McDonald
b72fd8482e Uncomment disabled code in QSettings autotest.
The code in question was already commented out before the test was added
to the Qt repository in 2006.  After changing the code to use
QFile::rename() for portability, the test appears to pass.

Change-Id: I52a8578a47da419cabf5826b633cc4f2ac2c5218
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-27 09:11:04 +02:00
Rohan McGovern
4c655bef5e Mark tst_qdialog as insignificant on mac.
This autotest gives different results on consecutive runs, and is
therefore insignificant for the purpose of detecting regressions.

Task-number: QTBUG-24977
Change-Id: I5c4dfd663ce5df6b60ae47a29d332c06e3c0585f
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-03-27 03:36:33 +02:00
Bradley T. Hughes
9581e5895a Cocoa: don't show window when calling raise()
Calling raise() on a hidden window should not show it. The setVisible()
function will ensure that the window is raised (since we use orderFront
or makeKeyAndOrderFront). This fixes the failing
tst_QDockWidget::task169808_setFloating() test as well.

Task-number: QTBUG-24774
Change-Id: If34472ebbcd615c10654efafd54c84c03d10bc8c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-03-26 11:41:07 +02:00
Lars Knoll
8660f6e385 Fix measurement system for the UK
THe UK still uses the Imperial system at least for distances
and many other things.

Change-Id: I99379de35620114328ad6a7fc9b226a46692bedd
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-03-26 11:41:07 +02:00
Pekka Vuorela
bc0b37d6b6 Password editor mask delay stylable by platform plugin
Replaced hard coding as QT_GUI_PASSWORD_ECHO_DELAY with
a style hint.

Change-Id: I0b78ebad723dbe19d9b9496583203e31545874e2
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-26 11:41:07 +02:00
Laszlo Agocs
083052933f Test mouse events more thoroughly in QWindow autotest
Apparently there are still issues here and there (e.g. in declarative)
with properly recognizing more complex event sequences (like triple
clicks). The behavior of qtbase is correct but we need a test case
that makes sure the functionality will not regress.

Change-Id: I08c558fcfdde0dd06e194b4f0affc6f6896573bf
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-26 11:41:07 +02:00
Bradley T. Hughes
b2363a935c Fix QGuiApplication::keyboardModifiers()
Make sure that the keybaord modifiers are maintained properly when
handling window system events.

Change-Id: Ie75cbe5eb509c29e3d2291694f2de509fbf3098a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-26 08:47:48 +02:00
Kurt Korbatits
1dc7aed0e9 Fixed qthreadstorage unittest to work from install directory
- Added install of crashonexit sub program

Change-Id: I2cc3043d5c1b879665930552487b4fe54407fd25
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-26 03:42:10 +02:00
Thiago Macieira
1904970dad Work around what apparently is a GCC 4.6.0 bug
The QFlags::operator int() isn't being called, so GCC complains that
this isn't an integer expression.

Change-Id: I537d06fd4a52ecbcddf0ef67807b298c42d3e911
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-25 15:09:52 +02:00
João Abecasis
fe778b94bd Enable endianness conversions on q(u)int8
Lack of support for these types is not a real issue as endian
conversions on byte-sized types are no-ops. Still, the conversions are
useful as they facilitate writing of generic code. They can also be used
explicitly as a way to document in code an endian-specific binary
format:

     uchar *data;
     quint8 tag = qFromLittleEndian<quint8>(data++);
     quint32 size = qFromLittleEndian<quint32>(data);

This commit also adds a test for functions documented in the QtEndian
header.

Change-Id: I2f6c876ce89d2adb8c03a1c8a25921d225bf6f92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-25 13:12:24 +02:00
Frederik Gladhorn
b4ec690bbd Improve accessibility test to handle more text events.
Change-Id: I67ece6c9bb755e84c786b32e8e3396eaf634fda1
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-25 08:27:53 +02:00
David Faure
518a4cb5ab Restore Qt4 compat in QDesktopServices::DataLocation
"/data/" was appended to the base directory.

Change-Id: I220f2ce74c36b795bc49c7c84106feb0709d1547
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-24 19:07:22 +01:00
Jędrzej Nowacki
552e162a67 Update QLocale data from CLDR v1.8.1 to CLDR v1.9.1
Change-Id: Ic84bbc82b364b92605c1bba64b6ec815bff970cb
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-24 18:32:16 +01:00
Thiago Macieira
7e1aec215d QPrinterInfo: remove a test that is too early
If we want to have any chance of getting the missing printers
reported, we cannot check the size beforehand.

Change-Id: I450897fe53c04aeb1a4b217bd0c1f548c455a428
Reviewed-by: John Layt <jlayt@kde.org>
2012-03-24 17:07:52 +01:00
Thiago Macieira
387ec9c2a3 Fix compilation of tst_QSqlThread: no need to use QBasicAtomicInt here
Change-Id: Ib474fe62501ee1ee5e3d7008c3b561f8db79265c
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-24 17:07:52 +01:00
Frederik Gladhorn
cea1a6bcd5 Make sure windows send accessibility activated updates.
Both QWindow and QWidgetWindow should update with the
active state signal.

Change-Id: I0219f803aa0fb109765f0faa0aedb120c2a439f0
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-24 17:07:52 +01:00
Frederik Gladhorn
f195a8e2b6 Added QAccessibleGroupBox
Added a new accessible interface for QGroupBox, as QAccessibleDisplay
is not good enough when the QGroupBox is checkable.
AccessibleFactory was modified to return a QAccessibleGroupBox when
the accessible interface of a QGroupBox is requested.

Created tst_QAccessibility::groupBoxTest

Port to Qt5 of the patch by José Millán Soto <fid@gpul.org>

Change-Id: I6c23dcf5562b3ea269b04102e78463b65827188a
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
(cherry picked from commit c03ceb203c65d9e3485fad848bfc0c4b6ee3e9aa)
2012-03-24 15:10:00 +01:00
Jan-Arve Saether
015bc43da0 API cleanup: remove CoordinateType enum
The bridge can do the mapping to and from screen position.
This is now done in the windows bridge.

Change-Id: I5ca5df0fbeeb58202539f55a0f62717fb1685092
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-03-24 11:53:49 +01:00
Thiago Macieira
d8ddc8ae89 Add the Q_CORE_EXPORT macros to unit-test-exported code
Change-Id: If21658bd5e4af0fdcc403b054fc1b8f46b5fcfb0
Reviewed-by: David Faure <faure@kde.org>
2012-03-23 19:43:00 +01:00
João Abecasis
accfdc85e5 Fallback implementation of Q_ALIGNOF
For all practical purposes, the fallback introduced here returns the
desired value. Having a fallback enables unconditional use of Q_ALIGNOF.

For compilers that provide native support for it, Q_ALIGNOF is otherwise
 #defined in qcompilerdetection.h.

Change-Id: Ie148ca8936cbbf8b80fe87771a14797c39a9d30c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 19:43:00 +01:00
Jędrzej Nowacki
98c3b8a442 Add test cases to tst_QByteArray
Internally we construct QByteArrays from QStaticByteArrays. For example
moc is generating QStaticByteArray structure for every string it saves.
New test cases check if a QByteArray constructed from a QStaticByteArray
behaves as a not statically constructed one.

Change-Id: Ia4aa9a1a5bc0209507636c683a782dda00eae85c
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-23 16:43:43 +01:00
Kent Hansen
425b38ef95 Merge "Merge master into api_changes" into refs/staging/api_changes 2012-03-23 14:31:28 +01:00
Kent Hansen
3b512ae142 Merge master into api_changes
Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
2012-03-23 14:10:58 +01:00
Debao Zhang
2f2b783214 Remove QWorkspace.
QWorkspace had been called Q3Workspace before Qt4.0 finally released.
In a sense, it is a Qt3 support Widget. And QWorkspace has been
deprecated and replaced by QMdiArea at Qt4.3.

Change-Id: Iea1bf831c9960c23c2b21d51fdc7c13b303642ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-23 13:22:10 +01:00
Debao Zhang
f31e614245 Cleanup Q3* items
Cleanup Q3* items from QtCore and QtGui modules.

Change-Id: Id214a077a50e99d820c84e96e34866492a0130d8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-23 13:21:57 +01:00
Friedemann Kleint
3b69fa6bc7 Implement QSystemTrayIcon for X11.
Reimplement using a QWidget. Use X

Change-Id: I7f8326598fb7210d59bc1d682cdada4526d5b6dd
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-23 11:45:25 +01:00
Giuseppe D'Angelo
1fe7e557d7 Remove #if 0 sections from QRegExp autotest
Use QEXPECT_FAIL instead (QRegExp is bugged w.r.t. the specific
test data).

Task-number: QTBUG-22466
Change-Id: Id5af01fa0d5c0536845fd4db19d4264498a8675b
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-23 11:45:25 +01:00
Thiago Macieira
e20c473019 Move the UTF-8 data into a separate .cpp so I can use later
This allows me to keep the UTF-8 invalid data in one safe place. I
won't need to copy & paste it.

Change-Id: Icb909d08b7f8d0e1ffbc28e01a0ba0c1fa9dccf0
Reviewed-by: David Faure <faure@kde.org>
2012-03-23 11:22:40 +01:00
Marc Mutz
0defa2782f tst_qsslsocket*: don't inherit from QSharedPointer
QSharedPointer is about to become final.

Instead of inheriting from it to add implicit
conversions to and from QSslSocket*, make
QSslSocketPtr a typedef, and make the
conversions explicit.

Change-Id: I4eebb262ab5aef348f4d676f9e839325d4ed13da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 11:22:40 +01:00
Marc Mutz
e5ef496b5b tst_qsharedpointer: don't inherit from QSharedPointer
QSharedPointer is about to be made final. Instead
of inheriting from it to gain access to the
d-pointer, cast it to a layout-compatible struct
and access the pointer from there.

Assert liberally to ensure layout compatibility.

Change-Id: Ifc0fa6a6608e861469286673844325663f4f7fcc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 11:22:40 +01:00
Marc Mutz
167af3b6ca tst_qnetworkreply: don't inherit from QSharedPointer
QSharedPointer isn't meant to be used as a
base class.

Instead of inheriting from it to add implicit
conversions to and from QNetworkReply*, make
QNetworkReplyPtr a typedef, overload two
oft-used functions to take a QNetworkReplyPtr
in addition to QNetworkReply*, and otherwise
make the conversions explicit.

Change-Id: I1eff1793a19f2d5bad1cce8de74c0786675a50f3
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-23 11:22:40 +01:00
Lars Knoll
5cb0368516 Rewrite QMap to use a RB tree
QMap used to use a skiplist in Qt 4.x, which has variable
sized nodes and we can thus not optimise using custom
allocators.

The rewrite now uses a red-black tree, and all allocations
and tree operations happen in the cpp file. This will allow
us to introduce custom allocation schemes in later versions
of Qt.

Added some more tests and a benchmark. Memory consumption
of the new QMap implementation is pretty much the same as before.
Performance of insertion and lookup has increased by 10-30%. iteration
is slower, but still extremely fast and should not matter compared
to the work usually done when iterating.

Change-Id: I8796c0e4b207d01111e2ead7ae55afb464dd88f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 09:31:09 +01:00
Pekka Vuorela
337eedb316 Fixed QLineEdit to emit selectionChanged
Was not emitted when removed by input method event.

Change-Id: Ia2c0dcb09d42826188d4612f4c1705a41874a31d
Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
2012-03-23 00:41:38 +01:00
Miikka Heikkinen
b188221fee Fix QPrinter test in Windows
Fixed Q_WS_WIN flagging to Q_OS_WIN in QPrinter API and related
implementation to make API match the documentation and Qt 4.8.
Also Removed the unused internal HDC related functions from the API,
that were previously behind Q_WS_WIN flag.

Some of the properties tested are documented to be valid for native
print engine only in X11 environment, so skipped testing those in
non-xcb environments.

Copy collation is also apparently not supported in Windows native print
engine, though this seems to be undocumented, so skipped that only in
Windows.

At least one of the test blocks in tst_QPrinter::valuePreservation()
failed due to default printer not getting set properly, so fixed that,
too.

Task-number: QTBUG-24191
Task-number: QTBUG-22927
Change-Id: I44a5e3d647a1279fcc7f1e99de6881f9be330246
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-23 00:41:34 +01:00
aavit
b492f54b98 More UTF8 fix of raster autotest
This completes 6c98fd2, for systems where default codec is not UTF8.

Change-Id: I94795785d5d172558c40c06bd3ef4ffaba1624c5
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-03-22 18:59:45 +01:00
Shane Kearns
cae5299f48 Allow autobound UDP sockets to send to IPv4 and IPv6
When writeDatagram is called without first binding the UDP socket,
then bind it as QHostAddress::Any.
This allows the same socket to be used to sent to both IPv4 and
IPv6 destination addresses.

Allowing the OS to autobind the socket inside sendTo() may
result in a single protocol socket.

Task-number: QTBUG-5275
Change-Id: I2b76507e8a8a38369c6eafb61ce4191d1d6cc930
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-03-22 18:59:45 +01:00
Lars Knoll
349c0de091 Significantly speed up insertion into QJsonObject/Array
The code was only allocating memory for the next insertion
leading to a reallocation of the whole data for every
single insertion.

The code now reserves some space and uses a decent growth
strategy to avoid repeated reallocs.

Change-Id: I48b0feab71ba8ca73e7037f8460080f198b2f009
Reviewed-by: Jamey Hicks <jamey.hicks@nokia.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
bd112dab56 Make tst_qmovie work in shadow builds
Change-Id: I8fe4b5e98ce2fb1ac8420bf568f5c9c973165fbf
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-22 18:59:45 +01:00
Joerg Bornemann
1a414cbc26 Fix QSysInfo::WindowsVersion checking (QSysInfo::WV_NT_based is a mask)
Manual merge of the original fix 1ef309e9 in the Qt 4.8 repo.

Task-number: QTBUG-20480
Change-Id: Id08500c2dd16965af3942e65cff1f4afa24180b0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-22 16:13:21 +01:00
Samuel Rødal
787da35eb8 Fixed QInputMethod API to use isVisible() instead of visible().
Deprecate the old API for now as not to break existing usages.

Change-Id: I7abbbbe8a34951282537a9d74cded03743f44df7
Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-22 16:13:21 +01:00
Pekka Vuorela
7e90df7bf5 FocusAboutToChange event to be send before focus changes
Focus change happen as: FocusAboutToChange event -> focus change
-> FocusOut event -> FocusIn event.

Input method need to have focus when calling commit(). Notification
on focus about to be lost allows QWindow implementations to commit in
time.

Also changes QWidget documentation to match code reality.

Change-Id: I17a8a374a33dd700909f79e370b42348869261a6
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-03-22 16:13:21 +01:00
David Faure
f89bf2c153 Make comment() work in the C locale too.
The parser makes the default language en_US, and no mimetype xml says
<comment xml:lang="C">, so use the en_US string for the C locale,
rather than returning an empty string.

Change-Id: Iad7c142e8078abe357773249416e7ce9b3e29a92
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 13:29:50 +01:00
David Faure
5ec5ce3549 Return all expected paths in QStandardPaths::standardLocations
ApplicationsLocation and DataLocation were returning only the local path,
rather than system paths + local path.

Change-Id: I653d14e5bbe1e08c5fa1ecd5a6106336d1cd0369
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 13:29:27 +01:00
Teemu Katajisto
89b5244310 Cocoa: fix setting color with alpha channel value for color dialog
Make sure that if ShowAlphaChannel option is set then also setShowsAlpha
needs to be set for the panel before setting the current color, otherwise
alpha channel value is omitted.

Task-number: QTBUG-24320

Change-Id: Ifb3822711af8ffd0cf6cb4c8aab2b0020d296663
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-03-22 13:22:10 +01:00
Jędrzej Nowacki
5ea56e93f7 Reserve more space for built-in types in id space.
We are running out of type ids for built-in types, 255 is not enough.
QMetaType already contains about ~70 types, situation is maybe not
tragic now, but there is a great chance that we will want to add more
built-in types from different modules like jsondb or declarative. Then
it might be tight, because we are not allowed to reorganize type ids
(it would be a binary incompatible change).

This change was not possible up to now. Old moc generated code assumes
that type id can be safely stored in 8 bits.

This is source compatible change.

Change-Id: Iec600adf6b6196a9f3f06ca6d865911084390cc2
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-22 11:52:23 +01:00
Samuel Rødal
55fa3c189f Got rid of Map / Unmap events in favor of Expose event.
Since change 2e4d8f67a8 the need for Map and Unmap events has
gone away, as now the Expose event is used to notify the application
about when it can start rendering.

The Map and Unmap events weren't really used except by QWidget to set
the WA_Mapped flag, which we now set based on the expose / unexpose.

Also guarantee that a Resize event is always sent before the first
Expose, by re-introducing an asynchronous expose event handler. Since
an expose is required before rendering to a QWindow, show a warning if
QOpenGLContext::swapBuffers() or QBackingStore::flush() if called on a
window that has not received its first expose.

Change-Id: Ia6b609aa275d5b463b5011a96f2fd9bbe52e9bc4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-22 11:43:36 +01:00
Kurt Korbatits
d6d77d54aa Fixed path in qobject unittest
- Fixed path was failing to find sub program.

Change-Id: I86f1a6941e244c9bc25ad0441cc7a441607560b7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-22 06:49:08 +01:00
Kent Hansen
e1e0e83c5e Remove support for meta-object revisions < 7
For Qt5 we no longer want to support the older revisions due to the
dual codepaths that must be maintained, and because the format of the
meta-object data is quite different in revision 7.

The dual codepaths have been replaced by asserts that indicate the
revision in which the feature was introduced, and the older-revision
fallbacks have been removed.

It's not possible to build code generated by moc that has
revision <= 6 with Qt5 because the type of the
QMetaObject::stringdata member changed from const char * to const
QByteArrayData *. For the same reason it's not possible to build a
dynamic meta-object generator targeting revision <= 6 with Qt5.
Hence, too old meta-objects will be caught at compile time, and the
code will have to be ported to generate revision 7 (e.g., by running
Qt5's moc on the original class declaration).

Change-Id: I33f05878a2d3ee3de53fc7009f7a367f55c25e36
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-22 06:37:26 +01:00
Kurt Korbatits
bcba6ed252 Added extra tests to json benchmark
- Added toByteArray() and fromByteArray() benchmark tests.
  Performance tests to measure QVariantMap to bytearray
  and bytearray to QVariantMap.
  Use case: Interprocess communications via local socket

Change-Id: If5e94ff870890b2ebb665f3cc38f5c33b34547f4
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-22 00:00:28 +01:00
Kent Hansen
22d621dd99 QMetaMethod::typeName() should return "void" if the return type is void
QMetaMethod::typeName() is documented to return an empty string if
the return type is void. But after the introduction of
QMetaType::UnknownType (where void was made a distinct type),
returning an empty string causes the idiom

   QMetaType::type(method.typeName())

to break; the result will be QMetaType::UnknownType rather than
the expected QMetaType::Void for methods that return void.

New code should use the new function QMetaMethod::returnType()
instead, but it would be good if existing code still did the right
thing.

The consequence of returning "void" instead of an empty string is
that it breaks existing logic that uses the typeName() length to
determine whether a method returns void. But we judge this as the
lesser of the two evils; it's better to have a typeName() function
that is consistent and keeps the QMetaType::type(method.typeName())
idiom working, than to force the typeName() inconsistency for void
only to keep code that does "strlen(method.typeName()) == 0"
working.

The places in Qt that were relying on a zero-length typeName()
(testlib, dbus, declarative) have already been changed to use
returnType().

Also adapt QMetaObjectBuilder, which is internal API.

Change-Id: I70249174029811c5b5d2a08c24b6db33b3723d19
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-21 18:55:51 +01:00
Kent Hansen
b8d71ed60b Fix QMetaObject::normalizedType() for "void" argument
Since the introduction of QMetaType::UnknownType, void is a proper
meta-type, and the normalized form of "void" should be "void", not
an empty string.

Add more tests to ensure that we do remove "void" in the one case
where it actually should be removed (e.g. "foo(void)").

Change-Id: I72dc2d24da67cf52da00c678f50213cff1b92e25
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-21 18:55:27 +01:00
Robin Burchell
0f9e98a586 Fix directories never being unwatched after deletion on Windows.
This causes all sorts of problems, but is also blocking the introduction of new,
more detailed signals, because the backend never correctly identified the removal.

The object handle appears to be woken up before the directory is actually
deleted, thus causing QFileInfo::exists() to return true, and not doing the
removal dance. This behaviour isn't exactly documented (as far as I was able to
find out), but also seems to happen consistently, and Chromium also contains
a comment noting a similar issue.

Task-number: QTBUG-2331
Change-Id: Icfb6219b78e688852d7863a666a0ffc31bb4d573
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-21 12:32:16 +01:00
Giuseppe D'Angelo
cb32450c47 QRegularExpression: add QObject::findChildren overload
This actually involved tiding up QObject sources a little bit
to clearly separate QString / QRegExp overloads of findChildren.

The corresponding qFindChildren overload for MSVC 6 compatibiltiy
was *not* added.

Change-Id: I84826b3df9275a9bda03608a5b66756890eda6f8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-21 11:43:38 +01:00
Giuseppe D'Angelo
8659495202 QRegularExpression: support for QStringList overloads
Change-Id: Ia9017348742e41187684185d04b56d27edd383b5
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-21 11:43:30 +01:00
Jędrzej Nowacki
bfd2b30faf Crash fix in ~QVariant
QVariant handlers can not be unregistered. We are not able to guarantee
that such operation is safe and we do not want to.

Change-Id: Id9a12e6a8c750110e4a08eab1de3e07e5c408675
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-21 11:43:14 +01:00
Jiang Jiang
2cc5442b02 Remove hardcoded font names in QFont::defaultFamily()
QFont::defaultFamily() should not use any hardcoded font names like
"Helvetica" or "Times" as they might not be present in certain systems,
it should rather use abstract names like "sans-serif", "serif" and
"monospace" then let the platform plugin to decide which font map to
them.

Change-Id: I5aafb103a5238c17b10773711ad504806c6fc3ce
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-03-21 09:00:22 +01:00
Jędrzej Nowacki
37b0a8e7e6 Fix qDebug stream for an invalid QVariant.
This patch changes invalid QVariant qDebug stream value from
"QVariant(, QVariant::Invalid)" to "QVariant(Invalid)"

New tests were added.

Change-Id: Ia57d4fc2d775cc9fce28e03eba402c2173845b35
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-21 06:55:33 +01:00
Donald Carr
b936b95965 EGLFS: Integrate building into configure.
With the move to the QPA architecture EGL is now only required by
individual platform plugins and the configure script has been adjusted to
reflect this.

Change-Id: Ieadacef0b970f29752d9e3e36a007e5cbb005b0d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-03-21 03:03:29 +01:00
Kent Hansen
83e055424a Add QtJson types to meta-type system
Make QJsonValue, QJsonObject, QJsonArray and QJsonDocument
first-class meta-types.
This is an enabler for a lightweight integration with QML.

Change-Id: I4725efdd2746cf97fd26d3632a99e8eee849f834
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-20 22:22:41 +01:00
Marius Storm-Olsen
e67066eff6 Remove old bic test data
We will not be testing BIC of Qt5 against Qt4

Change-Id: I6f0eea3dd60eea1535749240a178a19605c981d0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-20 15:24:48 +01:00
Thorbjørn Lund Martsum
fcc01e6c37 QHeaderView - minor fix to setDefaultSectionSize
This fixes a situation where we (wrongly) assume that
a section with size 0 is hidden. However a hidden
section should be one that we have called hideSection
(or setSectionHidden) on.

Change-Id: Ic14eded2666022f27434dc55927323a74910549c
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-20 11:44:09 +01:00
aavit
6c98fd2e6c Fix raster autotest: consistently assume scripts in UTF8, not latin1
The Lancelot raster painting autotest assumed latin1 encoding of the
QPS scripts files, while the script engine would import subscripts
as UTF8. This fix standardizes on UTF8.

Change-Id: I9e7c1ee7b6ffe77ff68edc8423f00dfb9ab3e95b
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-03-20 11:44:09 +01:00
Frederik Gladhorn
c2e8db5841 Remove QAccessibleEvent child parameter.
This makes the api cleaner and generally the child should not be there.
It is only sometimes more convenient not to create a QAccessibleInterface
instance, so the functionallity is kept.

Change-Id: I26018a6d3e0549f4d79856775b4167c5660e229d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-19 23:00:10 +01:00
Jędrzej Nowacki
10df7967d9 Disable some tests and examples when --no-widgets is specified
There are many tests, examples that depends on widgets. This patch
disables some of them if Qt is configured without widgets.

Change-Id: I5460dadca736c54221874adcd518a7021725d90a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-19 20:16:04 +01:00
Frederik Gladhorn
477c43260e Accessibility: add text update events
Change-Id: Iece9d100b3f5a379d7d8e29dea67a10d0c918c06
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-19 18:07:30 +01:00
Miikka Heikkinen
4bcd8fc2de Fix infinite recursion crash in QPrinterInfo::supportedPaperSizes()
This function calls platform specific function
QWindowsPrinterSupport::supportedPaperSizes(), which then called back
to QPrinterInfo::supportedPaperSizes(), causing infinite recursion.

Fixed by providing a proper implementation for querying supported
paper sizes in QWin32PrintEngine - the same implementation was used in
Qt 4.8.

Task-number: QTBUG-24190
Change-Id: I64a2773d83596df19818bf2636f1255943d7851d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-19 18:02:39 +01:00
Kent Hansen
95d6f8a4cf Merge master into api_changes
Conflicts:
	src/corelib/tools/qvector.h
	tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp

Change-Id: I877256e95f3788e617437f4e9661a88047f38cd6
2012-03-19 10:03:48 +01:00
Kurt Korbatits
0f929bfa9a Fixed benchmarks to work from install directory
- Changed benchmarks to use TESTDATA and QFINDTESTDATA
- Fixed up targets all use tst_bench_ syntax

Change-Id: I5c2936702e248478f5df225ce38893158ee22d7f
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-19 01:18:20 +01:00
Frederik Gladhorn
36513264da Make copy and assign private for QAccessibleEvent.
Also make the handling of events in the test pointer
based since mac-g++ doesn't seem to like const
references the way they were before.

Change-Id: I7fe39978d4729b8e586be30978b74aa51ca7cfe6
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-18 21:42:38 +01:00
Kent Hansen
3f64a7b67b Add autotests for QMetaType::load() and save()
These were not covered at all by tst_qmetatype.

Change-Id: Ic957470ac78b2c15fe449efe17e1f178a41c3690
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-18 21:06:57 +01:00
Stephen Kelly
b20cbf7102 Move CMake macros and tests for dbus tools from qttools.
Change-Id: I9d589a2d33eb8fcac63443565bb3e2319be3e04f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-18 14:14:57 +01:00
Stephen Kelly
72367b1679 Bootstrap qdbuscpp2xml.
This involves invoking the Moc classes directly and using the data
structures it provides instead of invoking the moc exectutable and
parsing the generated code.

Change-Id: Ia5c654e8ef58d52d0d3376252c13e13885f80da3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-18 14:14:42 +01:00
Jędrzej Nowacki
5e497111db Add new test cases to tst_QMetaType.
Change-Id: I405ab5df9d9de3a0a0a71276b172a27ee01392e3
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-18 12:35:09 +01:00
Marc Mutz
d823646db3 containers: add C++11-style c{begin,end}() as alias for const{Begin,End}()
C++11 adds cbegin()/cend() functions for the same reason Qt has
constBegin()/constEnd(). This patch adds these functions to the
Qt containers with the same implementation as constBegin()/constEnd().

It also fixes the return types in the documentation of existing
constFind() functions (documentation only).

C++11 only adds cbegin()/cend() (and crbegin()/crend(), which Qt doesn't have).
In particular, it doesn't add cfind(), so I didn't supply these, even though
Qt comes with constFind().

This is a forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1365.

Change-Id: Ida086b64246b24e25254eafbcb06c8e33388502b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-17 09:10:57 +01:00
Olivier Goffart
0731c90eec moc: test signature with (void)
Change-Id: Id63ed21e9f5e7447ced877ec19a2786d20f439f0
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-03-16 17:37:18 +01:00
Miikka Heikkinen
2ea976c3a7 Fix font cache check in QFontEngineFT::recalcAdvances()
Cached font was used regardless of the format, resulting in incorrect
advance in some cases when default format differed from the cached
format.

Task-number: QTBUG-24188
Change-Id: I39e4156bd9ba743afa7e106e934c90227fbf2b8b
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-03-16 11:02:03 +01:00
Kent Hansen
440f452aa3 Merge master into api_changes
Conflicts:
	src/corelib/kernel/qmetatype.cpp
	src/gui/kernel/qplatformsurface_qpa.cpp
	tests/auto/corelib/tools/qtimeline/qtimeline.pro

Change-Id: Iff3fff34eeeb06f02369767ddfce44cfde505178
2012-03-16 10:01:29 +01:00
João Abecasis
c67efb6506 Fix invalid read, detected by valgrind
Commit 3fe1eed0 changed the QVERIFY in line 1354 to QCOMPARE. This was
done to work around a (not yet understood) compiler issue. That however
was wrong, as char pointers in QCOMPARE are assumed to point to
'\0'-terminated strings and will get dereferenced.

In this case the intent was to compare the actual pointer values, as the
pointers point past the end of the array and should not be dereferenced.

Explicitly casting to (void *) and using QCOMPARE will not only keep the
intent, it will hopefully also provide meaningful output on failures. As
such the fix was applied throughout the test.

Change-Id: Ib0968df492ccc11d7c391bb69037cd7241e55493
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-15 23:01:13 +01:00
Shane Kearns
1e4f035158 Revert "Disable 'check' target generation for network autotests for Windows."
Too broad disabling, will disable more selectively

This reverts commit 3efb0d50e5.

Change-Id: I29e25816646194b6a4b7d8ff69e0c0d074ac2a19
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-15 18:05:05 +01:00
Shane Kearns
8a811865ab Fix QDnsLookup autotest failure in CI environment
The DNS server can legitimately include NS and A records for
the authoritative name server in addition to the DNS records
that were requested.
These are now ignored when checking the reply (we only check
results that match the query, rather than failing if a result
is for a different host name than the query).

Task-number: QTBUG-24698
Change-Id: I327f31d58cdca50c7df6b32b275d7f28b56405f0
Reviewed-by: Jeremy Lainé <jeremy.laine@m4x.org>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-15 18:05:05 +01:00
Mark Brand
26450fe6a6 QSqlTableModel::removeRows() enforce edit strategy
For OnFieldChange and OnRowChange, we don't want more than one row in
the cache with uncommitted changes. This could happen if deletion in
the database fails while other changes are pending.

Chosen solution is to return false if other rows have pending changes.
Also, we only allow 1 row removed at a time.

Updated test, changes and documentation.

Change-Id: I68baf6d221789b4754e891535070011c759a2155
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-15 15:35:43 +01:00
Mark Brand
108748404b QSqlTableModel::setData(): no longer autosubmit for OnRowChange
The model can never do a good job of knowing when user moves to a
new row in the view. Faking it by detecting when another row
is changed was not a good solution because it cannot detect
when the last edited row is left.

Either the view should automatically submit when the user leaves
a row or the application should provide a way to submit.

This change made it possible to reuse the logic of flags() in
setData().

Change-Id: I2550e5b113bceba1a852fc21203babeca07c5748
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-15 15:35:32 +01:00
Mark Brand
3d7cec6577 QSqlTableModel: disallow insert if changes are pending
For OnFieldChange and OnRowChange, inserting rows should not be
allowed if there are pending changes in cache.

Change-Id: Ia794332959a35a1de87e798ba1a74ace3dfae68f
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-15 15:35:22 +01:00
Mark Brand
f6ca63f896 QSqlTableModel::setData()/setRecord(): fix incorrect row
For OnFieldChange and OnRowChange, before submitting new changes,
setData() and setRecord() attempt to submit pending changes and
revert them upon failure. However, they fail to consider that
reverting pending insertions removes rows from the model. As a
result, the new change can be applied to a row higher than intended.

One possible solution would be to adjust the targetted index for the
removed rows, so that the intended row is affected by the new change.
But this still causes the strange editing experience as rows jump
up just as they are being edited.

It does not seem right in the first place for the model to initiate
reverting changes. It should be up to the application to decide what
to do when data cannot be committed. In particular, setData() and
setRecord() should not have the side effect of reverting already
pending changes.

The chosen solution is simply to refuse new changes that don't make
sense for the edit strategy. For OnFieldChange, flag() will
indicate read-only when editing is blocked by a pending change.

Since setData() and setRecord() submit data immediately for
OnFieldChange, it no longer makes sense to resubmit changes
automatically before a new change.

For OnRowChange, setData() keeps the behavior of automatically
submitting a pending row before starting on a new row. This is
historical behavior and is probably motivated by the fact that
QTableView does not automatically call submit() when editing leaves a
row. The obvious shortcoming of this is that the last row to be edited
will not be submitted automatically. It also prevents us from flagging
rows other than the pending row as read-only.

For OnRowChange, setRecord(), being row-oriented by nature, should
submit the change immediately rather than waiting for the next call
to setRecord(). This makes setRecord() consistent with insertRecord().

Change-Id: Icb4019d8b7c53a7ee48f8121a7a525e8bc35d523
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-15 15:35:17 +01:00
Friedemann Kleint
1741f6890c UTF8-Codec test: Fix compilation with g++/C++0X.
Change-Id: I704f8d1b07ca371c36e4eecc52c80ac783e3da3c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-15 14:51:50 +01:00
Debao Zhang
65a2613e3e tst_qsharedpointer: Fix auto test fail under Windows 7
The tst_QSharedPointer generate another Process to test some invalid
codes, and it expect that the prcoess will crash and return a non-zero
value.

The process which is a console application was linked to windows
subsystem, and QProcess seems can not get its return value. This
cause the unit test fail.

In addition, when the process crash under debug mode, a debug error
report-dialog will appear, which is very annoying, so I suppress it too.

Task-number: QTBUG-24160
Change-Id: Ia1c872d4515c83b0aa516bcfe3783f59797d2d49
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-15 11:40:50 +01:00
Jason McDonald
07764b9c15 Verify expected warnings in QSettings autotest.
Use QTest::ignoreMessage() so that the warnings don't appear in the test
output and so that the test will fail if the warnings are not produced.

Change-Id: I418d78819fc9dbfd7da2a8b6c0a1ebfa967347e2
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-15 06:00:52 +01:00
Johannes Zellner
8a79e8b645 Remove unmaintained and broken VNC platform plugin
Change-Id: Ie0a07c3a6822870b095a20d997b63fb1635f20be
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Robert Griebl <robert.griebl@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
2012-03-15 02:45:31 +01:00
Rohan McGovern
329469d5a1 headersclean: omit -Wcast-align also on MIPS
These issues are permitted to go unfixed for ARM and MIPS, for the time
being.

Change-Id: Ibdf33dc42e3de19ef20e9dc50f12f451ea6dbf23
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-15 00:50:47 +01:00
Rohan McGovern
aac68052af Mark tst_qtimeline as insignificant on Windows
This test has been repeatedly unstable.

Task-number: QTBUG-24796
Change-Id: I603965c0189ad6da0cdf48527c4919c55e1918b4
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-03-15 00:50:47 +01:00
Mark Brand
9e87104295 QTableView: call model->submit() on row change
QTreeView already does this in the exact same way. It's necessary to
call submit() so edit strategy OnRowChange in QSqlTableModel will
work as expected.

Change-Id: Ib430143e8a71f3b0bcd842fcc772cc7ee4525f0a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-15 00:50:47 +01:00
Giuseppe D'Angelo
c005c75080 QRegularExpression: support for QString overloads
Added support for QString overloads taking a QRegularExpression.

Change-Id: I8608ab0b66e5fdd2e966992e1072cf1ef7883c8e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-15 00:37:56 +01:00
Morten Johan Sorvig
d6311a0651 Cocoa: Improve basic window handling.
Refactor NSWindow creation into createNSWindow and
setNSWindow. This is necessary to support QMacNativeWidget
where we re-use an already created window.

Implement popup window handling. Make sure the window
is displayed correctly and closes when it should.

Take control over window activation in order to prevent
infinite loops involving the QtCreator "cmd-k" window.
Activation events are for now not sent to popup-type
windows.

There is now a different set of test failures: add
and remove some QEXPECT_FAILs.

Change-Id: I229761b59f90c9815b968eacc2cbc9c20cc5047e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-03-14 23:02:12 +01:00
Thorbjørn Lund Martsum
b64426248d QHeaderView - renaming functions in Qt5
This patch renames the functions in Qt5 according to the
notes. It also renames resizeMode to be consistent.

The old functions are both marked with both QT_DEPRECATED
and '### Qt 6 - remove'

All usage of the function within the qtbase are also
changed to use the new functions.

Change-Id: I9e05fa41d232e9ca43b945fcc949987017f3aedd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-14 11:37:18 +01:00
Giuseppe D'Angelo
08790636f2 QRegularExpression: QMetaType and QVariant support
Removed the Q_DECLARE_METATYPE in favour of first-class support
inside QMetaType and QVariant.

Change-Id: I904236822bfab967dc0fbd4d4cc2bcb68c741adc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-14 10:53:24 +01:00
Jędrzej Nowacki
22494ea8e8 Unify QMetaType::TypeFlags detection.
Duplicated code was removed. As an side effect:
- one runtime flag check was replaced by a compile time check.
- is enum flag can be used together with built-in types.

Change-Id: I54173e7b07ce7e487d3cc21ba24dcccd28b5d049
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-14 09:45:07 +01:00
Jason McDonald
f4dfb55243 Uncomment disabled code in QResourceEngine autotest.
Resource files are expected to be readable.

Change-Id: Ife2b624e69b58e2fb996bc3e210a6e6c5c6852fe
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-14 07:51:45 +01:00
Jason McDonald
16045184e3 Tidy the QSettings autotest.
- remove unnecessary includes
- remove undefined private functions
- remove commented-out test function
- fix indentation
- clarify why part of tst_QSettings::setValue() is commented-out

Change-Id: I09e1a33896536e702f7ba65f266415536b4f9e0b
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-14 07:51:45 +01:00
Jason McDonald
360e5e0c08 Remove commented code from qtconcurrentmap autotest.
The removed code was already commented out when the test was added to
the Qt repository and does not compile when uncommented as it calls
non-existant overloads of QtConcurrent::FunctionWrapper1::operator().

Change-Id: I5a02efae4b89e2815b077474aa7cd0192dcb2730
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-14 07:51:45 +01:00
João Abecasis
91248b0f3b Silence 'narrowing conversion' warning in test
Seen with gcc 4.6:

tst_qarraydata.cpp: In member function 'void tst_QArrayData::grow()':
tst_qarraydata.cpp:1445:29: error: narrowing conversion of 'i' from
'size_t {aka long unsigned int}' to 'int' inside { } [-fpermissive]

Change-Id: Iad55659554b64ee34655640d606153f058a8cd05
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-13 23:55:30 +01:00
Frederik Gladhorn
2c515ea42c Print all accessibility event strings.
Change-Id: I2488fe86fb2c154a8b7d91c6e4f2cd9c9e7b9ecb
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-13 18:14:25 +01:00
Frederik Gladhorn
6d85d77a5d Clean up test, check radio button and checkbox.
Change-Id: I4dcfa2014256aee10feb08146ae6fc3f402ac8fb
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-13 10:11:22 +01:00
Frederik Gladhorn
76ddc9bc0c Autotest details of QAccessibleEvent.
Change-Id: Ieec33c23e7b18cfedf061088d6561203a5e7ac39
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-13 10:11:22 +01:00
João Abecasis
e104fe7266 Merge "Merge remote-tracking branch 'origin/master' into api_changes" into refs/staging/api_changes 2012-03-12 23:52:36 +01:00
Mark Brand
13c57d0f68 QSqlTableModel::isDirty(): new overloaded method
Checks if model has any changes to submit.

Includes new test covering isDirty(index) as well the new
overloaded function.

Task-number: QTBUG-3108
Change-Id: I0ccbda45d5d9f06434cf1e1c037a9efb76d0cc37
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-12 23:29:37 +01:00
Alexei Rousskikh
612040a0cd Trailing comma should result in an error during JSON parsing
1. QJsonParseError::MissingObject defined
2. QJsonDocument::fromJson() will result in defined error after parsing
of something like "{ 'key':1 , }" or "[ {'key':1}, ]"

Change-Id: I8e6234a03b8aca4e5ad6180f273f91066b86d7a1
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-12 21:38:51 +01:00
Debao Zhang
df19bffbd9 Move tst_qshortcut.cpp to QtWidgets
QShortcut belongs to QtWidgets instead of QtGui.

Change-Id: I9715399bb372a6ea4bd76109f87ba31a1e30a7e6
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-12 21:38:51 +01:00
Lars Knoll
d5098f2802 Merge remote-tracking branch 'origin/master' into api_changes
Conflicts:
	tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp

Change-Id: I884afc3b6d65c6411733a897a1949e19393573a7
2012-03-12 21:03:49 +01:00
João Abecasis
e57e2f3e32 Fix QString:mid and midRef, again
In commit 75286739 it was assumed that negative positions shouldn't
influence the size of the returned substring. That however changes
behaviour that was depended on even inside Qt.

With this change, the old behaviour is reestablished.

A negative value of n is still taken to mean "all the way to the end",
regardless of position, and overflows are still avoided.

Change-Id: I7d6ed17cc5e274c7c7ddf0eb0c3238e1159ec4f6
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-12 19:53:59 +01:00
Friedemann Kleint
6e278b8688 Implement QSystemTrayIcon for Windows.
No longer base the implementation on a QWidget which is not
necessary when all that is required is a message window listening
to task-tray messages. Export a service function creating a message
window from the Windows native interface and use that.

Task-number: QTBUG-20978

Change-Id: I01d0faeac777df4eee802c51d2bc722fce814080
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-12 17:33:15 +01:00
Debao Zhang
db390d46c3 Move the auto test of QPixmap::grabWidget() from QPixmap to QWidget
Change-Id: Id565fa1eb8fe13c62a93a5afa39a5701ce7b20ea
QPixmap::grabWidget is deprecated, which calls QWidget::grab() at present.
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-12 17:33:15 +01:00
Marc Mutz
edea0e1917 tst_exceptionsafety_objects: add virtual ~AbstractTester
GCC complained about undefined behaviour when
deleting subclasses of AbstractTester through
pointers to AbstractTester, and it's doing so
correctly...

Change-Id: Ie641281d8aafe32c5c9784e8aa39672ff0b699c7
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-12 15:37:40 +01:00
Frederik Gladhorn
ca737f566b Use QAccessibleEvent in test.
Change-Id: I4f9c0f503543caa5704a29c8ccd7c4134b455625
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-12 15:34:06 +01:00
Marc Mutz
6c2695d677 QtDBus: make some constructors explicit
This is a semi-automatic search, so I'm
reasonably sure that all the exported ones
have been caught.

Change-Id: I314d341ad0db4e9d4bbf353a9537c9422ad8a54b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-12 15:22:30 +01:00
Jason McDonald
c4342ddea0 Fix indentation of QWaitCondition autotest.
No functional changes - cosmetic change only.

Change-Id: I7332eaab31720776c70a7ef813d55db44bab83f7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 13:14:05 +01:00
Jason McDonald
074508c2ca Remove gcc 3.x-specific code from QtConcurrent and its tests.
Change-Id: I4dd0ce50b70a47a0a00f4c7ec18077a1bcbe5705
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 13:14:05 +01:00
Debao Zhang
4eeb07d886 Move tst_qprinter.cpp to QtPrintSupport
QPrinter and QPrinterInfo belong to QtPrintSupport.

Change-Id: I0c146e0c717be365e752c1eaf7dbe6765fb72da2
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-12 13:14:05 +01:00
Debao Zhang
57cf7c8a1b Clean up some auto tests of gui
These unit tests do not depent on QtWidget.

Change-Id: I95526125c563885c0531da7ebfee06bca9a87b1c
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-12 13:14:05 +01:00
Frederik Gladhorn
eb57da5b3f Update accessibility StateChange by custom event.
Subclass QAccessibleEvent to give details what changed in the
state change.

Change-Id: I9005d311e85a3c8bfa6e062833fa6a8a7dc6a4a4
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-12 13:14:05 +01:00
Debao Zhang
2e886cfbcb Move tst_qicon.cpp and tst_qpixmapfilter.cpp to QtWidgets
QIcon and QPixmapFilter belong to QtWidgets instead of QtGui.

Change-Id: I6d82811e04046edb0cc67c55970c161612e86d3f
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-12 10:48:40 +01:00
Jason McDonald
0e905e9138 Remove outdated assumption from QVariant autotest.
The test was assuming that "data()" is a special function in autotests,
but that hasn't been the case since early prototypes of testlib.

Change-Id: Ic24cf5dc539b55d12eba0a6ab17173e2ed698f21
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 05:26:21 +01:00
Jason McDonald
16a1d5c81b Fix compile warnings in QCoreApplication autotest.
- Use const_cast to avoid "deprecated conversion from string constant to
  'char*'" warning when building argv arrays from string literals.
- Use Q_UNUSED to avoid warnings on unused local variables.

Change-Id: Idd2c8279adc102b6ebc6af7486ba26fe9ed4e7c1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 05:26:21 +01:00
Jason McDonald
a71e12b170 Remove redundant and incorrect comment from QList autotest.
Change-Id: I3187d0d8ace120181a4c49bbc68f421ddf5acbe0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 01:50:20 +01:00
Jason McDonald
a4c0109e01 testlib: Improve formatting of QCOMPARE failure messages.
Make the various versions of the failure message align consistently so
that it's a little easier to compare the actual and expected values.  Of
course, the value won't align nicely unless the "actual" and "expected"
strings are the same length, but at least this commit makes that
consistent across all versions of the message.

Change-Id: If9ce231df3b5d279a06f6458fdb5da0aa4586068
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-12 01:50:20 +01:00
Glenn Watson
15c13b91e6 Add Q_IS_ENUM(), and provide as flag in QMetaType::typeFlags()
Add Q_IS_ENUM() macro to determine if a given type is an
enumeration. Use information from that in QMetaType::registerType()
to store whether custom registered metatypes are enums or not.
This information can then be accessed by calling
QMetaType::typeFlags(int type). This is used by the declarative
code to determine whether a custom type in a variant can be safely
cast to an integer, which is required to allow passing non-local
enums as signal/slot params.

Change-Id: I9733837f56af201fa3017b4a22b761437a3c0de4
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-11 23:58:39 +01:00
Jędrzej Nowacki
e3429f764b Crash fix in QMetaType::typeFlags.
The function is public, so it should validate input instead of crashing

Change-Id: Id67463b0b61ab74a76c1ede7f052bdbed37822b6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-11 22:04:21 +01:00
Debao Zhang
e9ed5853f4 Make tst_qsql.cpp independent of QtWidgets
Change-Id: I032902bea6fe2c7d9eb0491886fded7602ae2bcc
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-11 00:08:33 +01:00
Kevin Krammer
53d24330f7 Make tst_qapplication build when QT_NO_SHAREDMEMORY is defined
Change-Id: I8cfd0ff2e17e6d5c04b81a042c665bcbbca36256
Reviewed-by: David Faure <faure@kde.org>
2012-03-09 16:54:27 +01:00
Miikka Heikkinen
7c89d44d95 Windows: Fix QStyleSheetStyle autotest antialiasing issues
Antialiasing of fonts was causing two tests that relied on finding
at least a certain number of pixels of certain color to find one or two
too few pixels of that color and thus fail.
Fixed by increasing the amount of text displayed to make sure enough
pixels of correct color would be present.

Also removing the test insignification, as the test will now
pass completely when run under Windows Classic theme, which CI uses.

Task-number: QTBUG-24323
Change-Id: Ic0b614d33e4e4f5df18d53cb72a05db5d8b6b5e7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-09 16:54:27 +01:00
Sergio Ahumada
865fbbddc9 Mark tst_qtimeline as insignificant on Windows
Change-Id: If8f699f867d3950cced17b150cb5f02fddd1f9a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-09 12:32:30 +01:00
Friedemann Kleint
152eec7aa4 Merge "Merge remote-tracking branch 'origin/containers' into api_changes" into refs/staging/api_changes 2012-03-09 12:32:30 +01:00
Debao Zhang
38224d8d00 Make tst_qmouseevent.cpp independent of QtWidgets
Change-Id: I6759c7be44c2d890c1a745effdd70faa3467fe5b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-09 11:05:29 +01:00
Debao Zhang
37c46fee30 Clean up for some auto tests of the gui/kernel.
They are not dependent on QtWidgets.

Change-Id: Icbc0b0b6f0b72537fd3058cc038a1f5c4bf2aba7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-09 11:05:18 +01:00
Debao Zhang
9f86923b5c tst_qimagereader: does not depend on QtWidgets
Both tst_qimagereader.cpp and tst_qimagewriter.cpp do not depend on
QtWidgets.

Change-Id: I7e8b31c23db203c44ccb4cd4e8e747d18c5d7ed7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-09 11:05:04 +01:00
Marc Mutz
86abc87883 {QTouchEvent,QWindowSystemInterface}::TouchPoint: replace QList<QPointF> with QVector
QPointF is in the category of types for which QList
is needlessly inefficient (elements are copy-constructed
onto the heap and held through pointers). Use a vector
instead. This is consistent with the QPainter API.

Change-Id: Ie3d6647e05b40a33a7bb0598cbbcde4676e00836
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-09 10:29:23 +01:00
Giuseppe D'Angelo
824cc94921 QRegularExpression: minor fix to captureIndexForName
Although passing a null pointer to pcre16_get_stringnumber for
the compiled pattern should simply make it error out, it's actually
an undocumented behaviour, so let's stay safe and add an explicit
check.

Tests for this codepath are added.

Change-Id: Ifd9c87874f6812ba487104ec1a5bbc83c3b16761
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-08 22:00:53 +01:00
Giuseppe D'Angelo
b543141992 QRegularExpression: improve JIT memory handling
PCRE's JIT uses by default 32K on the pcre_exec caller's stack. This
is fine for most situations, but in some cases (esp. patterns with
lot of recursion) more memory is required.

Therefore, if a match execution fails due to exhausting JIT memory,
we let PCRE allocate up to 512KB to be used for the JIT's stack.

The pointer to the allocated memory is put in thread local storage
(so it can be reused from the same thread, if needed, and automatically
goes away when the thread dies).

Change-Id: Ica5fb7d517068befff88ebb198a603a26ec5d8a7
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-08 22:00:47 +01:00
Oswald Buddenhagen
59ae59977b use $$QT_BUILD_TREE instead of $$(QTDIR)
it's a "tad" more reliable

Change-Id: I7207daa6869d1682719cc357794cf6efff496225
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-08 18:55:24 +01:00
Oswald Buddenhagen
5f9d126ca8 remove strange .qmake.cache hacks
they are obsolete (qmake knows the qt build configuration anyway), and
messing with QTDIR is a recipe for disaster.

Change-Id: Ib3594f38ec3192a5f70771f8bc5d8fd435bbbd15
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-08 18:54:46 +01:00
Miikka Heikkinen
f5b2a09467 Windows: Removing insignification from QTextEdit test
The commit 660af10dee seems to have fixed
the test, so removing the insignification from it.

Task-number: QTBUG-24348
Change-Id: I564e90db53d10b54e22342a1cdbef6826929c63a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-08 16:06:56 +01:00
Lars Knoll
763790bb5c Fix a bug in the assignment operators for QJsonObject and Array
When objects or arrays where being used read only, several objects
can share the same d pointer, but will have different pointers into
the binary data. Correctly change the pointer into the binary
data even if the d-pointer is the same.

Change-Id: Ife0ea5ac5daf46586f855dccdf35b51ec696a623
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-08 16:06:48 +01:00
Jędrzej Nowacki
cf6dd5baca Crash fix in QMetaType::typeName.
The function is public, so it should validate input instead of crashing

Change-Id: Ifd9f1110f8631f942929d85db6a57eee7afffb6a
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-08 16:04:02 +01:00
Jędrzej Nowacki
f71487da3a Fix crash in QVariant::canConvert.
The function was crashing when an unsupported type id was given
as an input argument.

Change-Id: I2b0e3e6d43f6f248dc71532f8e6485efe68e8120
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-08 16:03:52 +01:00
João Abecasis
8141e34280 Skip test when implicit move operators not available
Besides rvalue-references, this test depends on the compiler to generate
implicit move operators on a derived class, based on the ones available
on its base class.

At least Visual Studio 2010 and some variations of clang 3.0 are known
not to generate implicit move constructors and assignment operators. Gcc
4.6 and up seem to support the feature.

Change-Id: Ied464ef678f517321b19f8a7bacddb6cd6665585
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-08 12:10:29 +01:00
João Abecasis
79f2480c86 Merge remote-tracking branch 'origin/api_changes' into containters
Conflicts:
	src/corelib/kernel/qmetaobject.cpp
	src/corelib/kernel/qvariant.cpp
	src/tools/moc/moc.h

Change-Id: I2cd3d95b41d2636738c6b98064864941e3b0b4e6
2012-03-08 12:02:41 +01:00
Debao Zhang
779b3188a9 Windows: Make QMenuBar autotest significant again
The bug has been fix by 7bc576771d .

Task-number: QTBUG-24326
Change-Id: Ifd37e9fe76cb24e49132f22909c95a55a230b1ed
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-08 10:10:30 +01:00
Giuseppe D'Angelo
84984af0e1 Remove usage of QtXml from rcc, add test
Ported from QDom to QXmlStreamReader. This enables removal of QtXml
classes from bootstrap.

A new rcc test was added, copying the data from the
QResourceFileEngine test. The new test runs rcc to create binary
resources, dynamically loads them under various locales and checks
that they do contain the expected files.

Change-Id: I15d23dfda45de851a421156951ce2a60af4c1f7f
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: hjk <qthjk@ovi.com>
2012-03-08 09:59:31 +01:00
Frederik Gladhorn
b55ed97e79 Call updateAccessibility with the right index.
In Qt 4 index 0 was the widget itself.
With the cleanup of child index this now changed.
The default constructor uses -1 as parameter to signify that
the widget is the cause, not a child.

Change-Id: I329a1cc91bf2d1d1d8534739acbddfe107f40364
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-08 07:28:21 +01:00
Jason McDonald
8854b74cf4 selftests: Improve reporting of problems with loading expected output
If the expected output file was missing (e.g. not included in
selftests.qrc), tst_selftests would trigger an assert inside QList by
calling QList::at() on an empty list.  Make tst_selftests detect this
error instead and give a meaningful error message.

When loading expected output for the crashes selftest, where there are
several alternative versions of the expected output, the code reused the
"exp" variable when loading the alternative test output files.  This
caused the last file loaded to be used unintentionally if none of the
alternative files had the correct number of lines.  Use a different
variable so that exp remains empty if none of the alternatives are
valid and a failure can be reported.

Change-Id: I35b2a3d905d069d3ee8dcb1447836eb68d5c8612
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-08 05:31:40 +01:00
Jason McDonald
d81b065bb3 testlib: Improve verbose and XPASS output
Previously, verbose (-v2) and XPASS test output showed all QCOMPAREs as
"COMPARE()", making it impossible to see what was compared and difficult
to match the output to the source of a test containing many calls to
QCOMPARE.

This commit changes testlib's internal compare_helper API so that string
representations of the compared expressions are always passed to
QTestResult::compare() when available, and can thus be shown in the
verbose and XPASS output.  The XPASS output has also been changed to
state explicitly that the comparison succeeded unexpectedly, bringing it
in line with the XPASS output resulting from a call to QVERIFY.

This commit also changes all calls to compare_helper() to call the
eight-argument version of the function, which simplifies much of the
calling code.  The now obsolete four-argument version of
compare_helper() has been changed to output a warning that it is
obsolete.  It will be removed once other modules have had some time to
catch up.

The improved XPASS and verbose output is demonstrated by the expectfail
and verbose2 selftests.

Change-Id: I8baa46d5dd30e6c43b26f366c34dc5b64aab5f7c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-08 05:31:40 +01:00
Shane Kearns
4bdc7e6f8b Mark unstable windows network tests
This is unfortunately still "most of them", because of QTBUG-24451
however some of the unit tests are still possible to test stably.

Also skipped test cases which would hang forever due to QTBUG-24451.

Bearer tests are not run, because they pass when test machine has no
wireless LAN, but fail or hang if it does (QTBUG-24503)

Change-Id: Icf99d45707102d2ef9219ed0b5ad521605716219
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-08 05:31:40 +01:00
Shane Kearns
3c52993361 Rework QNetworkProxyFactory::systemProxyForQuery autotest
Rather than requiring specific hardcoded proxies in the system,
it now checks the proxies returned by the system have the required
capabilities for the request.

Note the test will pass if no proxy is configured (as
QNetworkProxy::NoProxy has all required capabilities)

The test prints the returned proxy lists and elapsed time
diagnostic for manual comparison and debugging.

Change-Id: I621ef4d1d7264a98c3e8bd485c30bc1166fcbdf0
Task-number: QTBUG-19454
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-08 05:31:40 +01:00
Shane Kearns
75ab89d4d6 Mark tst_QNetworkReply::getThenDeleteObject as unstable
It's unstable on all platforms, because the reply can be finished
due to a race with the http thread. It isn't crashing (which the
test was trying to test for), but rather the QVERIFY(!reply->isFinished())
fails, which is an inconclusive verdict.

Change-Id: Ib815a7cedd220544a0c9cb83023e3334df4a0fb3
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-03-08 05:31:40 +01:00
Shane Kearns
fbd45a9311 tst_qnetworkreply - remove qRegisterMetaType duplicates
The metatypes are registered in the constructor, don't need to
register them in test cases as well.
Registering in a test case is bad practice, as it could result
in tests failing when run individually due to unknown metatype.

Change-Id: Ic4d65d0f5fe3cdd3ab57cf2512a4906d71205a05
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-03-08 05:31:40 +01:00
Shane Kearns
69c428a810 Add windows XFAIL to qnetworkreply autotest
The test case that depends on QLocalSocket consistently fails due
to bugs in QLocalSocket windows implementation

Change-Id: Ibfe9eb3590be4f72b52f14cd4fbe5be61f6cf70e
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-08 05:31:40 +01:00
Marc Mutz
278ddc9d5e chiptester benchmark: compile
The implementation uses QScrollBar, which is no longer
included by <QtGui>.

Change-Id: I2422cfccc427179ca71e9a3195f16bd637925fb3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-08 05:31:40 +01:00
Marc Mutz
a03a71e332 examples: use QVector<QPointF> instead of QList<QPointF>
QPointF is in the category of types for which QList
is needlessly inefficient (elements are copy-constructed
onto the heap and held through pointers). Use a vector
instead. This is consistent with the QPainter API.

Change-Id: Id0e910c067a60d12fbc175e7ee7da824834be374
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-08 05:31:40 +01:00
João Abecasis
12f221410f Merge remote-tracking branch 'origin/master' into api_changes
Change-Id: I89dc2e193bd01624c1fb50484610d516e39b1538
2012-03-08 01:27:39 +01:00
Friedemann Kleint
b319d44798 QCursor: Associate cursor with screen.
- Introduce cursor() accessor to QPlatformScreen.
- Remove screen member of QPlatformCursor (a
  cursor can be shared by multiple screens
  of a virtual desktop).
- Add QCursor::pos()/ QCursor::setPos() taking
  a QScreen-parameter, use primaryScreen() for
  old overloads.  QCursor::pos() can then query
  the platform cursor for the position and return
  the position even if the mouse position is outside
  the windows owned by the Qt application.
- Fix tests

Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>

Task-number: QTBUG-22457
Task-number: QTBUG-22565
Task-number: QTBUG-20753
Change-Id: Ia69f37343f95772e934eab1cd806bd54cbdbbe51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-07 22:43:43 +01:00
Debao Zhang
b7915a4d0d Fix dockwidgets behavior when window resized or central widgets is set.
When adding and showing a central widget in a QMainWindow then the
layout does not respect the size policy of the central widget.

This is a side effect of 059be19781a22d2e41f22072152589857d0fabf9

After the layout of QMainWindow is restored or the separator between central
widget and dock widgets is moved by user, dock widgets should keep their
size when the window if resized.

Task-number: QTBUG-15689
Change-Id: Idfccb7b4ae057a99f431c2ed54e3b9fcfb6ef54c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-07 19:52:27 +01:00
Giuseppe D'Angelo
eb70933398 QRegularExpression: add optimizations autotest
Exporting the counter that controls the optimization of a compiled
pattern lets us to forcibly optimize all patterns. Therefore,
two tests are now run: one with default optimization values
and another one which always optimizes the pattern.

The counter itself was renamed with a qt_ prefix and put
inside the Qt compilation namespace
(thanks to rohanpm for pointing it out).

Change-Id: I56602433d37adc127772b2d0d2cdaf2e49d43c71
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-07 19:18:22 +01:00
David Faure
a6a7cabcd3 Add QUrl formatting option "PreferLocalFile".
For the readonly case (e.g. progress dialogs), where local file paths
look much nicer to end users than file:/// URLs.

Change-Id: I899fed27cfb73ebf565389cfd489d2d2fcbeac7c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-07 16:13:44 +01:00
Olivier Goffart
5713dde8a1 Fix deadlock in QPropertyAnimation
Commit 1e6514a714 changed the mutex from
recursive to non-recursive, which could introduce dead lock if the
animation starts other animation (This is the case in QMainWindow
layouts)

Change-Id: I1b149b78a802748eb24b5700fffeca0b8555f005
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-07 12:48:49 +01:00
Friedemann Kleint
83cabda862 Add fonts to QPlatformTheme.
- Remove QPlatformFontDatabase::defaultFonts() returning
  a hash containing widget name ->font and the Windows
  implementation.
- Add enumeration and font accessor to QPlatformTheme. The value
  returned for the enumeration value overwrites the default font
  of the font database.
- Implement for Windows, Mac and KDE.
- Add more Windows palettes.

Task-number: QTBUG-23686

Change-Id: I8a2abdfd216df23daa7c9630c54264cdf61295db
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-03-07 12:43:32 +01:00
Miikka Heikkinen
f72cbc7ce4 Make QCursor manual tests compile on Qt5
These tests were not aware widgets had been split to different lib.

Change-Id: I58bde1304c876319a3cbb50f4d6a66e9f24b2886
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-07 10:08:37 +01:00
Jędrzej Nowacki
7df2422fa4 Remove abuse of QMetaTypeId from tst_qshortcut test.
Q_DECLARE_METATYPE macro is much better for a custom type registration
then a handwritten template specialization.

Change-Id: Ia15688d89f708fbff0c1da93e08052d31f3b3fc0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-07 09:44:01 +01:00
Andy Shaw
678ab52ccb Improve type detection for query results
When an aggregate function is used for a column in a SQL resultset then
it should ensure that the right data type is reported for that column.
This also concerns expressions when the returned column does not map
directly to a table column.

Test included for this.

Task-number: QTBUG-22038
Change-Id: I07487694c0ed393d46af06e232914fe923356a99
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-07 07:26:37 +01:00
Rohan McGovern
dd7a06d0c9 Refactor headersclean for usage from modules other than qtbase
headersclean enforces various rules which all Qt headers are supposed to
abide by.  It fails compilation if these rules are broken.

These rules should be followed also by modules hosted outside of
qtbase.  Split the test up so that it can be easily reused by other
modules.

Change-Id: Icf09cbfde411c926ed87914dc821e6dfc569b0de
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-07 03:49:59 +01:00
Jędrzej Nowacki
393356f5f6 Add benchmark for QMetaType::create().
A case of a custom type creation was not covered before.

Change-Id: Icd2a7d63633f8e40d9d4a8a26e0eb0896fc85ec8
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-03-07 00:10:15 +01:00
Lars Knoll
53bbea2328 Fix parsing of unicode escape sequences
Change-Id: I63a7cd3a571fb47c97157bcb2ca29c4239c600ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-07 00:03:07 +01:00
Giuseppe D'Angelo
6b78980593 QRegularExpression: fix autotest
Some minor fixes: obviously, a valid match always come from a
valid regular expression, but a valid regular expression can create
an invalid match (internal error during matching).

Also, testing an invalid iterator should silence the emitted
warnings.

Change-Id: I585bb99a81e22f108601fd66bf30b56e0229d68b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-07 00:02:39 +01:00
Mark Brand
888fed8065 QSqlTableModel: use selectRow() for field and row edit strategies
Calling select refreshes the query data but disrupts view
navigation.

For OnFieldChange and OnRecordChange it makes sense to only
select the row in question. This does not disturb view navigation.

Assume disruption of view navigation is not a problem
for OnManualSubmit because the user or application decides
when submitAll is called.

Task-number: QTBUG-2875
Change-Id: I1e5f68668fb9102f6296d67d543e80daa403f1c4
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-03-07 00:01:32 +01:00
Mark Brand
b979956ec4 QSqlTableModel: handle changes between submit and select
Once an insert has been submitted, the cached record behaves like an
update. For row bookkeeping, we still have to remember that it was
originally inserted and is not in the query rows.

Between submitting a delete and selecting, we remove the values
from the deleted record. This causes a blank row to be displayed.
Read-only flag is set for cells in deleted row.

Reverting between submit and select means going back to the last
submitted values.

When removing rows, it's better to process from highest row numbers
to lowest. This avoids complications with higher rows shifting down
when lower rows are removed.

Change-Id: I8752fa11f7a1b88f2a71b9e03a020ac37e62487f
Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com>
2012-03-07 00:01:07 +01:00
Giuseppe D'Angelo
efcd4d9470 QRegularExpression: add captureCount()
QRegularExpression::captureCount() returns the number of
capturing groups inside the regular expression pattern.

Change-Id: Ib90ce67c67d06ab2966f0c98bd91da21defc156d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-06 23:56:14 +01:00
Giuseppe D'Angelo
bd30234b59 QRegularExpression: improve operator==, add dedicated autotest
Trivial change: compare dpointers first, then the data.
Added test function for operator==.

Change-Id: I33ac64a59db4ccad56c30be17622187e42415f38
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-06 21:54:17 +01:00
Giuseppe D'Angelo
c7cb455a47 QRegularExpression: add QRegularExpression* set of classes
Added QRegularExpression, QRegularExpressionMatch and
QRegularExpressionMatchIterator as PCRE-enabled, regexp classes.
Documentation is included, as well as a first round of autotests.

Task-number: QTBUG-23489
Change-Id: Id47031b80602c913ccd2fd740070e3024ea06abc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-06 21:53:39 +01:00
David Faure
676304e706 Add test for QUrl::isLocalFile (there weren't any).
Change-Id: I839d2eee7b0651700516d6140635151a52a9fa40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-06 21:00:31 +01:00
Shane Kearns
c93f7b6948 Fix tst_QNetworkReply::httpWithNoCredentialUsage autotest
The test was testing the wrong thing, and passing even though
QNetworkRequest::AuthenticationReuseAttribute was not being
respected, until recently when I fixed username/password in URLs

Now the cache is properly bypassed when this attribute is set to
manual, and the autotest is updated to check this.

Change-Id: I87943515562d0b16b03504f0758ba265758d1c22
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-03-06 18:24:09 +01:00
Shane Kearns
299e7ffd6a Fix QNetworkReply ioGetFromHttpWithCache test case
Expiration date is calculated from max-age header when a response is
inserted into the cache. Because the test case is prepopulating the
cache outside of QNAM's control, the expiration date was uninitialised,
causing the test to fail.

This is due to a 2 year old change in QNAM, where max age calculation was
removed from cache retrieval, and more recent changes to QDateTime
where secsTo() returns 0 if one of the arguments is invalid.

Change-Id: Ieecd46123dde4ca0fd0be3ae79e70e1528ec02bc
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-03-06 18:24:01 +01:00
Stephen Kelly
eb24dfcccb Add template specialization of QMetaType for QObject derived pointers.
This makes it possible to do things like

QVariant::fromValue(new SomeObject);

without first using Q_DECLARE_METATYPE(Something*)

This functionality was originally part of
http://codereview.qt-project.org/#change,11710 but was rejected
because the functionality was based on specialization of
QVariant::fromValue which could be dangerous.

This new implementation doesn't have such danger.

Change-Id: I83fe941b6984be54469bc6b9191f6eacaceaa036
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-06 13:37:17 +01:00
Shane Kearns
00821ec710 QSslCertificate - make lazy initialisation thread safe
QSslCertificate can be copied around into multiple threads,
without detaching. For example, the https worker threads inside
QNetworkAccessManager.
There are const methods, which lazily initialise members of
the private class without detaching (i.e. caching results of
expensive function calls)
These functions now lock the d pointer using QMutexPool to
avoid concurrency related crashes.

autotest crashes 20% of the time in release builds without
the fix, passes 100 times in a row with the fix.

Task-number: QTBUG-20452
Change-Id: I64a01af8159216f2dd6215a08669890f6c029ca8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-03-06 12:25:22 +01:00
David Faure
c78957766a QMimeDatabase: Fix crash on empty filename
This is due to the search in the suffix tree starting at position
fileName.length() - 1.

Change-Id: I98501c1724c7dde2626351ace8ba19faa0d2e1e1
Reviewed-by: Ivan Komissarov <ABBAPOH@nextmail.ru>
Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
2012-03-06 12:10:42 +01:00
Rohan McGovern
7206f9c539 Stabilize tst_QCalendarWidget::buttonClickCheck
The window should be shown and activated before sending user input.

Task-number: QTBUG-23615
Change-Id: I2fc1738d9dc4ee7f03c81b040eed6389910a9d3c
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-03-06 01:34:55 +01:00
Rohan McGovern
443fd332f9 Stabilize tst_QShortcut
show() on a window is asynchronous.  Wait for it to complete before
continuing with the test.

Note the test already contained code for this, but it was inside of
a Q_WS_X11 block, making it dead code in Qt 5.

Change-Id: I06f892eea86278c56b1773a7e968bbe065f86260
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-03-06 01:34:53 +01:00
Rohan McGovern
961c3f958f Stabilize tst_QAccessibility::actionTest
show() on a window is asynchronous.  Wait for it to complete before
continuing with the test.

Change-Id: Icd0daa0c0e8f287171c57708bb2fce0b6cf0906a
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
Reviewed-by: Kalle Lehtonen <kalle.ju.lehtonen@nokia.com>
2012-03-06 01:34:50 +01:00
Frederik Gladhorn
f449cefc27 Remove AccessibilityPrepare event.
This event was completely unused.
In addition it leads to crashes on linux when
sending the Destroy accessibility update.

The Destroy event on linux would still query an accessible interface.
That in turn would trigger the event to be sent.

Change-Id: I8915527de067b8b70ba41b1361e3ef5d12866d7d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-05 18:46:43 +01:00
Miikka Heikkinen
82fd18fe36 Windows: Make QSettings autotest significant again
The latest windows run of CI has QSettings test passing, so remove the
CONFIG += insignificant_test from it.

Task-number: QTBUG-24145
Change-Id: I35c0d8d4f72ad49f9f21dcd486ab33a37ab95e15
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-03-05 16:37:16 +01:00
João Abecasis
7e4f329934 Base QList::setSharable on RefCount::setSharable
Change-Id: I2acccdf9ee595a0eee33c9f7ddded9cc121412c1
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-05 15:15:44 +01:00
Oswald Buddenhagen
deb3c134b5 remove injection of default_pre in infile()/$$fromfile()
this is a hack from the times when these functions were (ab)used to
inspect proper project files, but the inclusion was done with a clean
project, so that the included files did not have any functions to work
with.

Change-Id: I19925e8ead597ca38df040000c183e368b32c06d
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-05 14:46:12 +01:00
Robin Burchell
d94165ab32 Fix tst_QStyleSheetStyle::qproperty to not implicitly rely on QHash ordering.
Changing qHash() for string data affected the order of properties to be set,
causing 'checkable' to be set after 'checked'.

As 'checkable' state affects 'checked' as well (setting it to false), this means
that the test was unreliable, a bug, which was exposed by the qHash change.

Change-Id: I03a8dd7d07609683d99f0b2a40012a147d409c6e
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-05 14:09:24 +01:00
Jason McDonald
0862d7f78a testlib: Make verbose2 selftest use QCOMPARE as well as QVERIFY.
The verbose output for QCOMPARE is not very helpful.  Make the verbose2
selftest (which reuses the counting selftest) demonstrate this, so that
a future commit can demonstrate improvement.

Change-Id: I6b3bc8f5199e984aa11d0a67b76a8c916be86380
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-05 05:32:03 +01:00
Rohan McGovern
33f82d5b4e Merge "Merge remote-tracking branch 'origin/api_changes'" into refs/staging/master 2012-03-05 05:31:06 +01:00
Jason McDonald
d423fd0975 Avoid using internal testlib API in QDbusConnection autotest.
QCOMPARE should only be used in a test function because it makes the
test function return if the compare fails.  The test wants to compare
without returning on failure because the compare is inside a helper
function called by many test functions, so the test was calling
testlib's internal QTest::compare_helper() functions instead of
QCOMPARE.

This commit makes this code slightly less objectionable by calling the
public QTest::qCompare() instead.

Change-Id: Ida17a641e89f8a297d6a036449f44b33aa266368
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-05 03:44:01 +01:00
Lars Knoll
96232be146 Merge remote-tracking branch 'origin/api_changes'
Conflicts:
	dist/changes-5.0.0
	mkspecs/features/qt_module_config.prf
	qmake/project.cpp
	qmake/property.cpp

Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
2012-03-04 21:45:05 +01:00
Thorbjørn Lund Martsum
87975f88ce QAbstractSlider - adding setRange as a slot
In many situations it would be very nice to have setRange
as a slot. It fits good with the rangeChanged signal -
and in some situations it does make sense to synchronize
scrollbars ranges.

Change-Id: I6bcb41ed6e009e5822b56b621e4e187fe52502a6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-02 23:16:25 +01:00
Sergio Ahumada
db1abf9f76 Change bugreports.qt.nokia.com -> bugreports.qt-project.org
Change-Id: Ia795098f24cf358b15067f54cd08dff0bd792bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-02 23:16:25 +01:00
Jonathan Liu
b2fb578a11 Fix sizing in QGraphicsView itemsAtPosition auto test
The auto test may fail incorrectly depending on the width of the
QGraphicsView frame. To ensure more consistent test results, the frame is
disabled.

Change-Id: I8d70fb07e45803230954f776947d525e4cf9050f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-02 15:33:11 +01:00
Jonathan Liu
81dcb377e5 Add additional QGraphicsView tests for regression
Add additional tests for graphics view tooltip regression introduced by
7c0d15a22266a425c9e9ac0120d6774e120fe01e.

Task-number: QTBUG-17517
Task-number: QTBUG-22663
Change-Id: I5e0d0e19504730a3e14ac84712a366dbebe688e6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
(cherry picked from commit aaa46755dcc15b8baaa0d1b928828eb60e0babbc)
2012-03-02 15:33:06 +01:00
Miikka Heikkinen
62a654cc90 Fix QApplication autotest crash when running on multiple screens
Screens need to be destroyed in reverse order to ensure the primary
screen stays valid when other screens are destroyed.

Task-number: QTBUG-24300
Change-Id: I9d9d710aa67ec045baa8bf292833ffe7d9eea935
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-03-02 14:45:23 +01:00
David Faure
53229ec8f7 Add note about failing test when using shared-mime-info < 1.0
Change-Id: I3ba9d14d915a579b9e102114866f6c9e0344ba16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-02 14:44:44 +01:00
Friedemann Kleint
099029a342 Fix QPixmap::grabWidget() on Windows.
Do not draw on the backingstore DC when drawing
to a pixmap. Access the paintdevice for checking via
the QPaintEngine since QPainter returns the clipdevice,
which is a widget.
Fix warning about accessing handle of 0-window in the
test.

Task-number: QTBUG-24183

Change-Id: Ie91ea6ab9d09528c7ec1d35633f9a0ee667719b1
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-02 14:44:00 +01:00
Stephen Kelly
fb8c95bac0 Automatic metatype registration of two-template-argument types.
This commit is complimentary to the commit which introduced a similar
partial specialization for single template argument types:
6b4f8a68c8

If T and U are available as metatypes, then QHash<T, U> is too.

Change-Id: I09097b954666418b424c8c23577032beb814343a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-02 13:22:54 +01:00
Jędrzej Nowacki
362bde8e8e Introduce QMetaType::UnknownType.
QMetaType::Void was ambiguous, it was pointing to a valid type (void)
and in the same time it was signaling errors in QMetaType. There was
no clean way to check if returned type was valid void or some
unregistered type.

This feature will be used by new QMetaObject revision which will
store type ids instead of type names. So it will be easy to
distinguish between:
 void mySlot();
 MyUnregisteredType mySlot();

Change-Id: I73ff097f75585a95e12df74d50c6f3141153e771
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-02 12:57:29 +01:00
Jason McDonald
123eb803ef testlib: Add selftests for -v1 and -v2 command-line switches.
These tests don't have their own source code but rather reuse the
counting selftest with additional command-line options.

Note that currently the -v1 switch only changes the plain text output,
and the expected xml output is identical to that of the counting test.
This may change in the future however.

This commit also restores a couple of lists to alphabetical order, where
the findtestdata selftest was not sorted into the list correctly.

Change-Id: Ie38e255f8029157b34162b3864b5fa66e137d74a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-02 01:06:22 +01:00
Jan Arne Petersen
022ff04a6b Unset _NET_WM_USER_TIME_WINDOW before destroying the window
Otherwise metacity was crashing when a QWindow was destroyed immediately
after being activated, because metacity was trying to select events
(XSelectInput) for the already destroyed m_netWmUserTimeWindow.

Task-number: QTBUG-24492
Change-Id: Iedbe7bdd6b26110ca8bec6f33525209ae551ffd5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-01 19:00:15 +01:00
Olivier Goffart
2658a52017 Fix tst_qregexp with QStringBuilder
Change-Id: I1ac2a5c9ea5657ad2916465b77271e3d53c67cde
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-03-01 16:58:33 +01:00
Bradley T. Hughes
d964981252 Remove ARMFPA support and Q_DOUBLE_FORMAT detection
Remove the -armfpa option the config.tests/unix/doubleformat*
detection. The places where we used QT_ARMFPA and Q_DOUBLE_FORMAT
has been removed as well.

Rationale: ARM FPA with GCC does not work with EABI. Qt currently
does not support compiling without EABI, making ARM FPA an
impossibility. It is unknown whether other compilers provide ARM FPA
support with EABI. Support for ARM FPA can be re-added in the future
should the need arise, but since ARM VFP is available for ARMv5 and up,
we should encourage implementors to instead use soft-floats or VFP.

Change-Id: I3671aba575118ae3e3e6d769759301c8f2f496f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-01 16:26:55 +01:00
Marc Mutz
15c141511f QPair: specialise QTypeInfo based on the typeinfos of its arguments
Specialise QTypeInfo<QPair<T1,T2>> based on the properties of
T1 and T2:

- If either T1 or T2 is Q_COMPLEX_TYPE, so is QPair<T1,T2>.
- Otherwise, if either T1 or T2 is Q_MOVABLE_TYPE, so is QPair<T1,T2>.
- Otherwise, QPair<T1,T2> is Q_PRIMITIVE_TYPE.

Change-Id: I8aecbd37e3b7924f77f38967498deabf1a19ca24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-01 14:26:06 +01:00
Morten Johan Sorvig
30974151c1 Cocoa: Implement QPlatformTheme:palette()
Causes a new test failure in QGraphicsProxyWidget::updateAndDelete,
expand the EXPECT_FAIL to cover that one as well.

Change-Id: If9da757206445d17510c4fac82a559de7b8c0563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-01 13:55:49 +01:00
Shane Kearns
d19d25a68b Use QSystemError for QDnsLookup windows backend
The OS provides the error string in this case.
This gives more information to the developer seeing a generic
error.

Change-Id: Ia03642982f3513ee5a8a9fa98d918e948f8d97a5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-03-01 13:55:49 +01:00
Friedemann Kleint
5cd56df0f2 qmake-test: Fix jom/nmake handling on Windows.
The test fails if MAKEFLAGS is set up for jom since the test
always uses nmake. Remove MAKEFLAGS from the process environment.

Change-Id: Idaed3cc964832b83c282a59fc5257572c520b882
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-03-01 12:16:57 +01:00
Stephen Kelly
e174405862 Make some tests and benchmarks pass with QT_NO_QSTRINGBUILDER
Change-Id: I6c91a613007043d0f26ac11e98353a0b9ce646ae
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-01 11:02:28 +01:00
Friedemann Kleint
9e893f6810 Skip the network SSL test on Windows.
For SSL, this would require an OpenSSL library to be installed.

Change-Id: I2a320e7faf40ef925c90dbe539f912e4a8fc13fc
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-03-01 10:40:08 +01:00
Marc Mutz
1cd4d6b181 QEvent (and subclasses): make ctors explicit
Do this regardless of whether the event subclass
is public API or only used in examples. Examples
are examples, used by others as templates or even
copied verbatim, so they should also follow sound
engineering rules.

Anyway, there's only one in examples/...

Change-Id: I586ff16407a956c9e89288fdd4377eed73f45c0f
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-01 08:44:34 +01:00
Kurt Korbatits
95c5be8bc1 Changed qchar unittest to check return from QFINDTESTDATA
- Changed qchar unittest to check string QFINDTESTDATA
  returns is not empty.

Change-Id: Idb3997aaa5d5220272915c1e2538175205b3d6e8
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:39 +01:00
Kurt Korbatits
c5b928207e Fixed qlocale unittest to install subprogram syslocaleapp correctly
- It was trying to install syslocaleapp sub program as TESTDATA
  instead of an application.

Change-Id: I2117d11335bc2fd37a8ccc9a03b0337382f0177f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:19 +01:00
Kurt Korbatits
41b2992422 Changed qdir unittest remove() to check actual file removed
- Changed remove() test to check the file just removed is gone.

Change-Id: I0b6c176e624134402b5547866064f436ce063f16
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:17 +01:00
Kurt Korbatits
bc323b6fd3 Changed qlogging unittest to install subprogram
- Added install of app sub program so it works from install directory

Change-Id: Ia83643519752a3cbb59d6da2aed132d683a94bee
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:15 +01:00
Kurt Korbatits
5dd470aca6 Fixed qdir unittest rename() test to skip if run as root
- subtest not valid if run as root so added a check and skip

Change-Id: Iae993e20f272f9303a75062ef00d22b49df5e84a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-01 05:43:12 +01:00
Stephen Kelly
fb4dccee9a Fix build of QNetworkReply benchmark with QT_USE_QSTRINGBUILDER.
Change-Id: Ie46126aed0d2e83dc7784c027066c789d3fd7652
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-01 01:13:22 +01:00
Giuseppe D'Angelo
eafc667136 QRegExp: fix \i \I \c \C \p \P escape sequences
Those escape sequences have a special meaning in the XML Schema 1.1
regular expressions, but not in Perl-compatible ones.

An escape sequence that has no special meaning should match the
escaped character itself; this patch fixes QRegExp's behaviour in
that regard (previously, it added a character class matching
nothing).

Change-Id: I983f923baa7c2ec19938b96353f3a205e6c06d58
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-01 00:09:57 +01:00
Shane Kearns
46e4a9d523 Windows - fix getsockopt calls for narrower than int options
Windows unhelpfully writes to only one byte of the output buffer
when getsockopt is called for a boolean option. Therefore we have
to zero initialise the int rather than initialising to -1 as was
done before.
This in general only works for little endian architecture, because
the word would look like 0x01000000 on big endian. So I have added
some compile time asserts in the assumption that windows is always
little endian. This is ok for comparisons with 0/false, but not
comparisons with true or nonzero values.
In the case of IPV6_V6ONLY, it is documented as DWORD (unsigned int)
but on some windows versions it is returned as a boolean triggering
the warning. I removed the warning, as the conversion to int works on
both LE and BE since it is only compared with zero.

Task-number: QTBUG-23488
Change-Id: I3c586d1ada76465fc045a82661f289920c657a4c
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2012-03-01 00:09:57 +01:00
Marc Mutz
ff004175bc QFlags: mark as Q_PRIMITIVE_TYPE
I originally tried to put Q_DECLARE_TYPEINFOs into
Q_DECLARE_OPERATORS_FOR_FLAGS, to declare not only
the flags type, but also the underlying enum as
primitive, but too many users (arguably correctly)
used Q_DECLARE_OPERATORS_FOR_FLAGS at (non-global)
namespace scope where QTypeInfo would have been
specialised in the wrong namespace.

So specialise QTypeInfo for QFlags<T> only.

Change-Id: I4af6e29aefbd9460a3d2bc6405f03cdf6b1096bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 23:36:47 +01:00
Robin Burchell
b147da00c5 Remove qhash_faster.
It's not faster under _any_ metric than the new algorithm, and it loses a lot of
spread which is a bad thing.

Change-Id: Ic87258f1c887822ffea1cb1517355564fabc3c26
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 22:39:00 +01:00
Robin Burchell
1f4804452c Copy Qt 4's QString hash algorithm.
We must do this the same way we do all other hash algorithms for fair
comparison, as otherwise, the call to the PLT unfairly penalises
QHash<QString>'s results, as it's in a different shared object.

Change-Id: I69c891f5a97dcccdfcfbdbf32796f86242a42963
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-29 22:39:00 +01:00
Robin Burchell
57004b7fda Move data generation to initTestCase() method and store the results.
Per the comments on Ie4100a1ca4dbe7bf1cd73de883a9854377ac2f5e, having Q_ASSERT
was not a good idea, and data functions can't really handle
QVERIFY/QCOMPARE/etc, so do this in initTestCase instead.

Change-Id: I19e61dec7fe415bb1fa0f53a2920d99b8c7c8ea7
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 22:39:00 +01:00
Robin Burchell
0f3d9b1d84 Add test data for string forms of numbers.
Similar to the UUID benchmark, but won't have any non-numerical characters.

Change-Id: I7487c97cab96fd53c180fe12061e7be3ca96e883
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 22:39:00 +01:00
Robin Burchell
693a286600 Add a test using lots of similar strings.
This attempts to emulate a dictionary usecase of sorts, done in code to avoid
bloating the git repository by adding an actual word list.

Change-Id: I878bc4af8877ba780ee699932f240c0d9c8ff12c
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 22:39:00 +01:00
Miikka Heikkinen
70784b9069 QFileSystemModel autotest fixes
For some reason, hiding files via executing "attrib +h filename"
process didn't work realiably, so changed the file hiding to be done
via Windows native API.

Also changed the test to use QTemporaryDir to simplify temporary
directory handling a bit.

Task-number: QTBUG-24291
Change-Id: I4f02b16e2f9105bcf5e6c5bf136f55434a26e2f4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-29 20:10:21 +01:00
Shane Kearns
7d5b0e2b04 network cookies: check "example.com" != "example.com."
Only test code change, we already have the correct behaviour

Task-number: QTBUG-20001
Change-Id: I2296f405f47f9c8d15796e69f9d1854063e38d6a
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-29 17:46:06 +01:00
Laszlo Agocs
d87edf4e3e Remove internal class QVolatileImage.
This made sense only for Symbian where there was a special
CFbsBitmap-based backend present and it was used from the
Symbian-specific VG and GL pixmap implementations.

The generic version is merely a useless wrapper over QImage and is not
in use anywhere in the codebase.

Change-Id: I1dabe22dfb8cbbc35dce8e22703a3aff810fb5f9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-29 17:39:01 +01:00
Friedemann Kleint
bcb0f28a4d Fix tests of QMimeDatabase.
- Use temporary directories to avoid instabilities
  due to remains of previous failed tests and locked
  directories.
- Replace SRCDIR by QFINDTESTDATA(), reference only
  the freedesktop.org.xml contained in the Qt source
  tree by $$QT.corelib.sources.
- Improve some error messages, test suite instructions
  for Windows.

Change-Id: Idee8e3767ef0a8299df3bdaaac20334164878db0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: David Faure <faure@kde.org>
2012-02-29 16:52:19 +01:00
Friedemann Kleint
9b5cdccc02 Skip test tst_QTextScriptEngine::thaiWithZWJ on Windows.
Change-Id: I9286ae8b1200b2d6638d1257a872450a9886fce0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-02-29 16:52:02 +01:00
Stephen Kelly
98ecbf1f50 Fix build of QImageReader tests with QT_USE_QSTRINGBUILDER.
Change-Id: I789d99d0741bc178d2d7fd82558edc684eb6daf8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 16:51:17 +01:00
Stephen Kelly
e28be90dea Fix build of QWizard tests with QT_USE_QSTRINGBUILDER
Change-Id: Id276cdb9b84c61bf75a5bde149142f39f52f563e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 16:51:07 +01:00
João Abecasis
7919c0529e Add AllocationOption::Grow
This is meant to reduce the number of allocations on growing containers.
It serves the same purpose as the existing qAllocMore which is currently
used by container classes.

While only a container knows when it is growing, it doesn't need to care
how that information is used. qAllocMore is currently treated as a
black-box and its result is (basically) forwarded blindly to an allocate
function. In that respect, container code using qAllocMore acts as an
intermediary.

By merging that functionality in the allocate function itself we offer
the same benefits without the intermediaries, allowing for simpler code
and centralized decisions on memory allocation.

Once all users of qAllocMore get ported to QArrayData and
QArrayData::allocate, qAllocMore can be moved or more closely integrated
into qarraydata.cpp and qtools_p.h can be dropped.

Change-Id: I4c09bf7df274b45c399082fc7113a18e4641c5f0
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-29 14:31:15 +01:00
João Abecasis
f947093662 Test setSharable with "raw data"
Change-Id: I91774685e84416407aa1fa136f27fedb82545a12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-29 14:31:03 +01:00
Stephen Kelly
e1cc0d6bbc Allow QChar::SpecialCharacter with QStringBuilder.
Change-Id: I3c91fd516bb13e5534aa6f26ee9df745c990dfb5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 14:08:43 +01:00
Kent Hansen
3b844c16e0 Port QDBusMetaObject to Qt5 meta-property/method descriptor format
Adapts QDBusMetaObject to be in sync with the moc/meta-object
changes for property and method descriptors (storing the name and
argument count of methods, and more elaborate type information).

Now that the method name is stored in the standard method
descriptor, QtDBus doesn't need to store it separately anymore,
and the QMetaObjectPrivate::rawStringData() function can be
removed.

Change-Id: I04efdbe05b52bbd85405e1713509e55308ac42da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-29 12:50:14 +01:00
Kent Hansen
69e3e54486 Add QMetaMethodBuilder::parameterTypes() function
This function matches QMetaMethod::parameterTypes().
The implementation of QMetaMethod::parameterTypes() was moved to a
helper function in QMetaObjectPrivate, so that it can be shared with
QMetaMethodBuilder.

Change-Id: I4361713996dc4ea31a79c2fc74c813ee5e9c3069
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 12:50:14 +01:00
Kent Hansen
f95181c7bb Long live Qt5 meta-object method/property descriptors
This commit introduces two significant changes to the meta-object
data format:

1) Meta-type information (QMetaType type/name) information is
stored directly in the meta-data for both properties and methods;
2) The original signature (string) of a method is no longer stored
in the meta-data, since it can be reconstructed from the method
name and parameter type info.

The motivation for this change is to enable direct access to method
names and type information (avoiding string-based lookup for types
if possible), since that's typically the information language
bindings (e.g. QML) need. (moc already had all the desired
information about methods, but it threw it away!)

This change keeps support for the older (6 and below) meta-object
revisions, but the support will be removed after a short grace
period.

The following public QMetaMethod functions have been added:

name() : QByteArray
returnType() : int
parameterCount() : int
parameterType(int index) : int

The following internal QMetaMethod function has been added:

getParameterTypes(int *types) : void

This commit extends the meta-method data to include explicit
type/name data for methods. The new data follows the existing
(5-word) method descriptors in the meta-data. The method descriptor
format was modified to enable this. First, the descriptor now
contains the meta-data index where the method's type/name information
can be found. Second, the descriptor contains the number of
parameters. Third, the descriptor has a reference to the name of the
method, not the full signature.

Each entry of a method's type/name array contains either the type id
(if it could be determined at meta-object definition time), or a
reference to the name of the type (so that the type id can be
resolved at runtime).

Lastly, instead of storing the method parameter names as a
comma-separated list that needs to be parsed at runtime (which was
how it was done prior to this commit), the names are now stored as
separate entries in the meta-object string table, and their indexes
are stored immediately after the method type info array. Hence,
parameter names can be queried through the public API without
parsing/allocating/copying, too.

Task-number: QTBUG-24154
Change-Id: Idb7ab81f12d4bfd658b74e18a0fce594f580cba3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-29 12:50:14 +01:00
Kent Hansen
96f2365cf4 Rename QMetaMethod::signature() to methodSignature()
In Qt5 the meta-data format will be changed to not store the
method signature string explicitly; the signature will be
reconstructed on demand from the method name and parameter type
information.

The QMetaMethod::signature() method returns a const char pointer.
Changing the return type to QByteArray can lead to silent bugs due to
the implicit conversion to char *. Even though it's a source-
incompatible change, it's therefore better to introduce a new
function, methodSignature(), and remove the old signature().

Task-number: QTBUG-24154
Change-Id: Ib3579dedd27a3c7c8914d5f1b231947be2cf4027
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-29 12:50:14 +01:00
Kent Hansen
3f7a222414 Change the representation of meta-object string data
Up to and including meta-object revision 6, string data have been
stored as 0-terminated C-style strings, that were made directly
accessible as const char pointers through the public API
(QMetaMethod and friends).

This commit changes moc to generate an array of QByteArrayData
instead, and adapts the QObject kernel accordingly.

Generating an array of QByteArrayData (byte array literals)
means that the strings can now be returned from public (or private)
API as QByteArrays, rather than const char *, with zero allocation or
copying. Also, the string length is now computed at compile time
(it's part of the QByteArrayData).

This commit only changes the internal representation, and does
not affect existing public API. The actual (C) string data that the
byte array literals reference still consists of zero-terminated
strings. The benefit of having the QByteArrayData array will only
become apparent in the upcoming meta-object data format change, which
changes the format of property and method descriptors.

Support for the old meta-object string data format was kept; the
codepaths for old revisions (6 and below) will be removed in a
separate commit, once all the other meta-object changes are done and
affected code has been adapted accordingly.

Task-number: QTBUG-24154
Change-Id: I4ec3b363bbc31b8192e5d8915ef091c442c2efad
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-29 12:50:14 +01:00
Jason McDonald
b804b81288 Remove unused selftest data file.
The private git history shows that the test program associated with this
data file was missing from the original commit and was never
subsequently added.

Change-Id: I3401724ac04168158a48eb06436db83d3557711f
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-29 01:38:31 +01:00
João Abecasis
c4ad58ed22 Merge remote-tracking branch 'gerrit/master' into containers
Change-Id: I97ba222435ff50a9e5422e6f2c73e4bb8d1b865c
2012-02-29 00:58:13 +01:00