Commit Graph

6075 Commits

Author SHA1 Message Date
Jędrzej Nowacki
4b023e2487 Remove duplicated template code.
Unify TypeDefinitions specializations. I'm not aware of any reason why
QVariant should have a separate set of supported types during
bootstrapping phase. It would cause only crashes.

As a side effect the patch reduces size of core and gui libraries.

Change-Id: I5140d9d3daee39a0171bc718bf46dab6b28085ec
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-03 03:29:55 +02:00
João Abecasis
97f251b8c3 Don't use qstrlen if string is not null
Change-Id: I4f9aec21af2ce24a1d27c6d140764e371bce5017
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-03 00:22:27 +02:00
Mark Brand
314b20e813 fix typo in change log
Change-Id: Id7c3cab500fb3f41fbced5a4012dc0ae5d108192
Reviewed-by: Debao Zhang <dbzhang800@gmail.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-02 23:06:30 +02:00
Honglei Zhang
50ad785bdd Convert Boolean value into integer
According to documentation, SQLite doesn't have a separate Boolean
storage class. Instead, values are stored as integers 0(false) and
1(true). In QSqlQuery::bindValue(), if a boolean value is bound
to a placeholder, it is converted to text true and false. This fix
converts boolean value to integer 0 and 1.

Task-number: QTBUG-23895
Change-Id: I4945971172f0b5e5819446700390033a1a4ce301
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-02 23:06:30 +02:00
Laszlo Papp
1967c14737 Use the relevant "\since 5.0" entry (proposed to public since 5.0)
Change-Id: I189166aeca8875401029128733401bf830d9ee71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 23:06:30 +02:00
Matt Newell
ccf25f1d28 QSqlDriver functions made virtual
Certain QSqlDriver functions were marked to be made virtual in Qt5.
subscribeToNotification, unsubscribeFromNotification,
subscribedToNotifications, isIdentifierEscaped, and stripDelimiters.

This patch makes them virtual and removes the no longer needed
Implementation counterpart functions. It also updates the relevant
drivers. This patch has no regressions on the tests in
tests/auto/sql/kernel/, tested with sqlite and postgres.

Change-Id: Ia2e1c18dfb803531523a456eb4e710031048e594
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2012-04-02 22:26:10 +02:00
Thomas McGuire
f5bc6db6c3 Add a native interface with the possibility to query the window group
This is needed for QtMultimedia, as it uses the native mmrenderer API
which expects to get passed the window group when creating a video
overlay window.

Change-Id: I07d790e6e20714741c04917068b41b71b8939fa4
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2012-04-02 21:02:56 +02:00
Stephen Kelly
6aded68111 Deprecate QItemSelectionModel::intersect().
It is already obsolete since the beginning of time (Qt 4.5).

Change-Id: Ia2f9d934f0c0bd2038d693a29d1315867a526dfe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-04-02 20:29:23 +02:00
Pekka Vuorela
5dd7cd5316 Adapt QNX platform input contexts to QGuiApplication::focusObject()
Change-Id: I4c5028f76b52e3838231eff2a599e85347c16598
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-04-02 19:02:17 +02:00
Marc Mutz
beb7dd5f14 QUuid: mark as Q_PRIMITIVE_TYPE
Commit 01674860ac marked
QUuid as Q_MOVABLE_TYPE, but it's even primitive:
Every bit pattern represents a valid QUuid object (if
not a valid UUID), and memcpy() can be used to obtain
a valid, independent copy of the object.

It might not be a POD, but its close enough.

Change-Id: I0fd2d11472590688a91e9ee424732e4d5ba15df8
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
2012-04-02 18:32:45 +02:00
Friedemann Kleint
8f2a088028 Fix MSVC warnings in tests.
- Unused variables
- conversion truncations
- Overflow in expressions like '-1 + sizeof()'

Change-Id: Ibbd18497951e9e7e9dccaf596cb4e864b69ec02c
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-04-02 16:56:48 +02:00
Shane Kearns
b08f74f089 Add support for PUT & POST to qget test
Due to some bugs that are not reproducable with a normal HTTP GET
This patch also adds the option to process multiple URLs
serially (using application level queuing) rather than the default
parallel (using QNetworkAccessManager queuing on 6 TCP connections)
& renames the authentication command line options to match wget.

Change-Id: I10915feb3bba23abbd7a72f9844c03f347f9bff5
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
2012-04-02 16:56:48 +02:00
Friedemann Kleint
565da6030f Change fatal exit in QPlatformFontDatabase to a warning.
Only warn if the folder containing the qpf2 files is not found.
The code path is triggered by the QPA 'minimal' plugin.

Change-Id: I12a32001ce867096627033b1d5fb894cab163853
Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-02 16:56:48 +02:00
Eskil Abrahamsen Blomfeldt
d354f7d514 Calculate correct bounding rect for glyph runs in QTextLayout
The positions returned by getGlyphPositions() in QFontEngine are
for the base line of the glyphs. We offset this by -ascent to get
the top of the actual bounding rect.

Task-number: QTBUG-22919
Change-Id: Id82c66ecfbdf58064f5ad26f4193fa55ac26bc7c
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-04-02 16:56:48 +02:00
Martin Petersson
967e9d6e28 QNAM: close the channel if bytesAvailable and nothing piplined
If there are still bytesAvailable on the socket and we have
nothing pipelined we should close the channel. This was not
done before as the chunked decoder did not read the last
CRLF. This has now been fixed so this close should be enabled
again.

Task-number: QTBUG-24875
Change-Id: I115b60f8d78bf1b83d3fd5887ab3eb9940b6bf00
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-02 16:56:48 +02:00
Jason McDonald
10b39adf34 Remove redundant virtual method reimplementations from QToolBar.
Task-number: QTBUG-23524
Change-Id: Ib682d2e2c2ea1078524e2c90cdb10bfec113d259
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 16:56:48 +02:00
Jason McDonald
7720edfade Remove unused dummy vars from print preview widgets.
These were private, so there are no source-compatibility implications.

Task-number: QTBUG-23524
Change-Id: I967941f0165ddda657bf1e1ac59b4bf5f2ce184f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 16:56:48 +02:00
Martin Smith
e700144157 qdoc: Don't lower case <shortdesc> in DITA.
The first letter of a short description no longer has a
lower case letter.

Change-Id: I98f04d2feba070a0a77161316773306386cc6b67
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-04-02 16:56:48 +02:00
João Abecasis
5e82bb9e6f Introduce QArrayDataPointer::needsDetach
While QArrayDataPointer offers generic detach() functionality, this is
only useful for operations that may modify data, but don't otherwise
affect the container itself, such as non-const iteration, front() and
back().

For other modifying operations, users of the API typically need to
decide whether a detach is needed based on QArrayData's requirements
(is data mutable? is it currently shared?) and its own (do we have
spare capacity for growth?).

Now that data may be shared, static or otherwise immutable (e.g.,
fromRawData) it no longer suffices to check the ref-count for
isShared().

This commit adds needsDetach() which, from the point-of-view of
QArrayData(Pointer), answers the question: 'Can contained data and
associated metadata be changed?'.

This fixes QArrayDataPointer::setSharable for static data (e.g.,
Q_ARRAY_LITERAL), previously it only catered to shared_null.
SimpleVector is also fixed since it wasn't checking Mutability and it
needs to because it supports fromRawData().

Change-Id: I3c7f9c85c83dfd02333762852fa456208e96d5ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 16:34:21 +02:00
João Abecasis
15e3ae6b9d Introduce QArrayDataOps::truncate
This enables a truncating resize() to be implemented. It is similar to
destroyAll(), but updates the size() as it goes, so it is safe to use
outside a container's destructor (and doesn't necessarily destroy all
elements).

The appendInitialize test was repurposed and now doubles as an
additional test for QArrayDataOps as well as exercising SimpleVector's
resize().

Change-Id: Iee94a685c9ea436c6af5b1b77486734a38c49ca1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 16:34:21 +02:00
João Abecasis
8c413f3eff Introduce QArrayData::detachCapacity
This follows QArrayData::detachFlags's lead. Given the (known) size for
a detached container, the function helps determine capacity, ensuring
the capacityReserved flag is respected.

This further helps aggregating behaviour on detach in QArrayData itself.

SimpleVector was previously using qMax(capacity(), newSize), but there's
no reason to pin the previous capacity value if reserve() wasn't
requested. It now uses detachCapacity().

Change-Id: Ide2d99ea7ecd2cd98ae4c1aa397b4475d09c8485
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 16:34:21 +02:00
João Abecasis
646dc6c5da Introduce QArrayDataOps::appendInitialize
Adds given number of default-initialized elements at end of array. For
POD types, initialization is reduced to a single memset call. Other
types get default constructed in place.

As part of adding a test for the new functionality the arrayOps test was
extended to verify objects are being constructed and assigned as
desired.

Change-Id: I9fb2afe0d92667e76993313fcd370fe129d72b90
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 16:34:21 +02:00
Pekka Vuorela
1e8f2ae34b Adapt windows input context to QGuiApplication::focusObject()
Change-Id: I8c18814d705b456d3285d7a5f2e1e0849af99b70
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-04-02 14:52:48 +02:00
Tarja Sundqvist
8129f45e65 QTBUG-24936: Ensure alpha cache is cleared when printing to PDF.
Added 'd->alphaCache.clear();' to qtbase/src/gui/painting/qpdf.cpp since
also the alpha cache needs to cleared when printing to PDF.

Task-number: QTBUG-24936
Change-Id: I12c41a98f4bd54c154fa47acebe0421e9a38a3ec
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-04-02 14:52:48 +02:00
Jiang Jiang
19194f02fd Fix a crash in cursorToX() when new block is added
When an empty new block is being added, the layoutData->memory data
will be 0, thus QTextEngine::attributes() will return 0. We should
only access the attributes pointer when some text actually exist.

Task-number: QTBUG-24718
(cherry picked from commit cac12f4592477d99ef6fffaad40345bf85ef53b5)

Change-Id: I203b283dd28653d4b57ba8bfffb259c773f67f19
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-02 14:52:48 +02:00
Jason McDonald
91c745241f Remove qdoc for obsolete methods of QSet.
The documentation related to functions removed in commit
bb5ae21c41.

Change-Id: I2412c02b26a64ee22d700b0dca2945b24f1b3f61
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-04-02 14:52:48 +02:00
Martin Petersson
0e6361d316 QAbstractSocket::waitForConnected check if host name is an IP address
If the current host name is an ip address we can create the QHostInfo
directly instead of performing a reverse lookup.

Task-number: QTBUG-18881
Change-Id: If239481e455f4f7fb74d978f685dc5d8e9f22c0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-02 14:52:48 +02:00
Robin Burchell
a84b42e619 Fix QTcpServer::listen() returning true when the port is in use on OS X.
Way back in the mists of time, someone added SO_REUSEPORT to socket binding,
which was great, because otherwise it meant that multiple UDP sockets couldn't
share the same port on OS X (as platforms with SO_REUSEPORT apparently don't
support rebinding with SO_REUSEADDR).

However: SO_REUSEPORT also means that *any* bind on a port will succeed, which
is most definitely not wanted in the case of TCP sockets, so check the socket
type before performing the actual bind.

Also test that multiple listens don't take effect.

Change-Id: I2f8d450bcfb8a7f3abd8918a4e789a850281dd13
Done-with: Thiago Macieira
Done-with: Shane Kearns
Task-number: QTBUG-6305
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-02 14:52:48 +02:00
John Tapsell
97282527ae Harfbuzz-thai - fix buffer overflow when setting item attributes
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>

Change-Id: I92de853b57e2e06211193a2b30ac7c308374c961
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-02 14:52:48 +02:00
João Abecasis
e4682cc880 Add missing include on 32-bit builds
Commit cc3ff3c1 introduced uncoditional use of _BitScanForward on
Windows, so adapt include conditions to match use of function.

Change-Id: I46ea4212ea3a01d9c4ecb19377b21e9b0f16e179
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 14:35:29 +02:00
Robin Burchell
c82d40749d Fix multicast join/leave when binding to QHostAddress::Any.
On OS X and Windows, this was not working, because the socket was being bound
in v6 mode (due to ::Any being for dual mode), but the address passed was a v4
address, meaning it took the wrong codepath. Linux, strangely, apparently works
anyway.

This is fixable in OS X (by using the v6 join path when bound in v6/dual mode),
but the same fix doesn't work on Windows, failing with WSAEADDRNOTAVAIL.

Don't allow this behaviour, and provide a sane error message telling the user
what to do instead.

Done-with: Shane Kearns
Task-number: QTBUG-25047
Change-Id: Iaf5bbee82e13ac92e11b60c558f5af9ce26f474b
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-02 12:49:38 +02:00
Yuchen Deng
c7f8f459bd Fix build all failed for 'TEMPLATE = aux'
NMAKE : fatal error U1073: don't know how to make 'all'
Stop.

Change-Id: I387a417d37e38811706a1ff460df8ee581c6a33f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-02 12:41:32 +02:00
Martin Smith
9bd4106297 qdoc: Add the \hr command
Now you can out put a horizontal line
anywhere in your text.

Change-Id: I9b8bbbd6aa312e8386fb1a3b165876d76057f784
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-04-02 12:30:16 +02:00
Martin Smith
9b0c0823c0 qdoc: Allow documenting a C++ class as a QML type.
Now qdoc can handle the case where a C++ class is
documented as a QML type of the same name, or as
both a C++ class and a QML type of the same name.

And collisions pages are created for both the HTML
and the DITA XML output. A collision page is created
when two items have the same name. The collision
pages will be augmented later to include the list
of pages where ambiguous links to one of the items
listed on the collision page are actually located,
so the writer can go back to those links and add
the appropriate qualifier.

Change-Id: I5a9632b2d2209e0784392047056bed8962005624
Reviewed-by: Martin Smith <martin.smith@nokia.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-04-02 12:30:04 +02:00
Kai Koehne
f733a0044e Logging: Make sure documentation shows up
Move the documentation for qDebug, qWarning, qCritical, qFatal,
QMessageHandler, QtMsgHandler, qtInstallMsgHandler,
qInstallMessageHandler from qlogging.cpp to qglobal.cpp. For some
reason it's not picked up from qlogging.cpp otherwise.

Also, tweak the output so that e.g. qDebug and friends are correctly
listed as macros.

Change-Id: I8cabf04bae0e8ae9a31a40ebe2d3272c3a33653b
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-04-02 12:28:20 +02:00
Kai Koehne
63ef43b288 Improve documentation for QMessageLogger
Change-Id: I6c52b74b9fa0d894492f335e2f303f927ee6307b
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-04-02 12:27:57 +02:00
Pekka Vuorela
89e3506e5b Document preedit details on QTextLayout
Change-Id: Ic73f6d2c748b2ac02b1a8b8c0b00721793557cfd
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-04-02 12:04:55 +02:00
Holger Hans Peter Freyther
2340c5d92e device: Add device support for the Broadcom 97425 platform
Add mkspec for the Broadcom 97425 platform using the new device.pri
support. This allows to build Qt with the application libraries provided
by Broadcom.

Change-Id: Icad442be5da071e4f936e41236d4136234c5d16f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-02 11:44:14 +02:00
Martin Petersson
41ad3ee7cb Set QNetworkInterface::IsPointToPoint on Windows
This was never set on Windows Xp or later as we only checked for this
in the old interfaceListingWin2K() function.

Task-number: QTBUG-10170
Change-Id: Ib0808a945d9d1b31019967a69e668ec216702799
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-04-02 11:39:08 +02:00
ABBAPOH
85e9ab3e79 Remove extra lines in mimetypes
Change-Id: Ic7ec295b2a0b23a21f44f880f29df13503f8ef3a
Reviewed-by: David Faure <faure@kde.org>
2012-04-01 22:15:37 +02:00
ABBAPOH
8fe62fe459 Remove QMimeTypeParserBase from doc
Change-Id: I64d6b4f3209316e28bddb98f221a2c5a45e3e3d0
Reviewed-by: David Faure <faure@kde.org>
2012-04-01 22:15:37 +02:00
ABBAPOH
864cd133a6 Fix wrong method signature in documentation
Change-Id: Ib1b4ce93e8d584e07e69253231c3c993627f00db
Reviewed-by: David Faure <faure@kde.org>
2012-04-01 22:15:37 +02:00
Pekka Vuorela
6a4bf73c07 Added some convenience API for platform input contexts
QPlatformInputContext now gets notified on changed focus and
has inputMethodAccepted() telling whether current focus object
accepts input method events.

Also adapted IBus plugin to use this. Key event filtering for
focused objects without input method support got fixed by the
change.

Change-Id: I6910aa6af2459d752a5763f0ae88fa8c34e5b165
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-04-01 20:13:51 +02:00
Pekka Vuorela
1f5e058f79 Testability for password mask delay
Unit test to override mask delay value so running it is not dependent
on platform style hint.

Change-Id: Ic5cc12d32cf97e64729b3af54250bdc05c0c95ad
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-04-01 20:13:51 +02:00
Rafael Roquetto
d5bc8ab811 Fix platforms.pro scope to match all QNX platforms
Change-Id: I4d8963bcdf91482cff9938df583178ac493b4b09
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-04-01 18:13:11 +02:00
Martin Petersson
3dbf98c715 QNetworkAccessFtpBackend: remove entry from QNetworkAccessCache
When FTP login fails we fail to remove the entry from the cache.
This is because the cache key is created from the url with the
userInfo. So this needs to be set again to match the key used
when inserted.

Task-number: QTBUG-11824
Change-Id: Ib3fd2d737581653ae59c56d0810d42e2d8dc2176
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-04-01 14:13:45 +02:00
Casper van Donderen
e6f7852bb4 QDoc: Fix assert and remove duplicate description.
Change-Id: Idac8488c1a2ba8cabe584244a0ea9a824a31cd65
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-04-01 09:22:28 +02:00
Friedemann Kleint
c039ad21b5 Fix inputMask accessor of QLineControl.
Do not append blank character if it is the default.

Task-number: QTBUG-20834
Change-Id: I17f6ac4058f295f25ff49f33c41bd9ee40b75811
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-31 21:27:19 +02:00
Giuseppe D'Angelo
989b7f2337 QRegularExpression: operator<<(QDebug, PatternOptions) improvements
Avoid building a QStringList and then joining the strings with pipes;
directly append the flags to a QByteArray instead.

Change-Id: Ic352b756ed1e3b6b579b9ca412636a2b394d2eb5
Reviewed-by: hjk <qthjk@ovi.com>
2012-03-31 18:31:29 +02:00
Robin Burchell
47728445a5 Remove all calls to, and deprecate qMalloc, qRealloc and qFree.
Callers should just call the standard allocation functions directly.

Adding an extra function call onto all basic memory management for the sake of
making it instrumentable in rare cases isn't really fair to everyone else.

What's more, this wasn't completely reliable, as not everything was using them
in a number of places. Memory management can still be overridden using tricks
like LD_PRELOAD if needed.

Their aligned equivilents cannot be deprecated, as no standard equivilents
exist, although investigation into posix_memalign(3) is a possibility
for the future.

Change-Id: Ic5f74b14be33f8bc188fe7236c55e15c36a23fc7
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-31 16:46:40 +02:00