Commit Graph

5693 Commits

Author SHA1 Message Date
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
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
9848c8b92c QDirIterator: don't inherit from QDir
Remove the inheritance hack used in
QDirIterator to gain access to QDir's
d-pointer by simply making QDirIterator
a friend of QDir.

This allows to turn QDir into a final class.

Change-Id: I97efef8714bb194d62b9fe5192ce240a90f2bf97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 11:22:40 +01:00
Marc Mutz
3986b51274 QtDBus: don't inherit from QString, QVariant
QString and QVariant are about to be marked
Q_DECL_FINAL_CLASS, so change inheritance to
composition.

At least this was private inheritance...

Change-Id: I43caaa6c03041b8f0bd0f7987ddb4c6ff8309e50
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
Martin Petersson
f956f9a836 QLocalSocket: remove double buffer on qlocalsocket_unix
The QLocalSocket is using a QLocalUnixSocket which is a QTcpSocket
that has buffering enabled. Because QLocalSocket is a QIODevice it
also has its own read buffer. By opening the QIODevice Unbuffered
we only use the buffer in the QLocalUnixSocket.

Change-Id: I4b9091522f73b0831b20efb4a2a00c2603fc748b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-23 09:48:04 +01:00
Tasuku Suzuki
68f44a7f98 Check if Qt::ImEnabled is true before handling im events on Mac
Key events were not sent to items on graphics view after the change
412dbdf410. This is because the change
only checks if QGuiApplication::focusObject() exists. Qt::ImEnabled
needs to be checked too.

Change-Id: I2a78af717a7a1a5d84fbc8b521253bdc25b43286
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-03-23 09:48:04 +01:00
Morten Johan Sorvig
fd379ae7d3 Cocoa: Add window fullscreen button on OS X Lion.
Use the heuristic that windows that are not an
NSPanel and has the MaximizedButtonHint get the
fullscreen button.

Change-Id: I9a3520b7e4cd1833421d5d2f5b73da7edbfc3e74
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-23 09:48:04 +01:00
Morten Johan Sorvig
96e89ddbf9 Add QPA readme.
Change-Id: Ibc3a95f3560af909a45d147098184c2194187932
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-23 09:48:04 +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
Bradley T. Hughes
70a8833151 configure: Fix x86_64 detection
The regular expression should look for underscores in addition to
alphanumeric characters.

Change-Id: Idc3dbd67291ec1420f818d74fba8413b1e7cbcf1
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-23 07:50:57 +01:00
Thiago Macieira
16b7ddde10 Fix udev building after commit 7a169fb52a
Change-Id: I13fcc6f58376657d54d3c0efd02f5ffba2a79cca
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-23 02:44:08 +01:00
Pekka Vuorela
76bc2663dd Deprecate QInputMethodEvent::setTentativeCommitString()
Free form tentative commit proved to require too much fiddling on
rendered text vs. logical content. Needs simpler mechanism.

Change-Id: Ia4e341abf342d25675fd1129efb11094dde410b2
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-03-23 02:44:08 +01:00
Thiago Macieira
d13c254bef Whitespace fix for brace in qstring.cpp
Change-Id: Ia6cf0d2babd931c9ac2a441a9cfec35f2297dddb
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-23 00:44:10 +01:00
Thiago Macieira
18b26d1fbf Quick optimisations to QString: no const-ref for QLatin1XXX
Change-Id: I2c96adc6ae451f085024464791e53739b2d38bab
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-23 00:44:03 +01:00
Robin Burchell
69033cbf65 Use the same ifdef-based debugging as the other engines.
Just so I have a similar workflow all over the place.

Change-Id: I99df5042eac1b4fbf3613f339e8a4522f94ed1f5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-23 00:43:46 +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
Donald Carr
82c974f753 Deprecate QApplication::setGraphicsSystem
The QApplication::setGraphicsSystem() call is entirely vestigial after the
QPA rearchitecting of Qt. Deprecate it to give people a heads up that their
original intent no longer has any impact on their application.

Change-Id: I21838431db1057f7f7858b4a434ae0eebd2317de
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-22 21:03:13 +01:00
Lars Knoll
5b6741c39a Make QLocalePrivate::updateSystemLocale() reset the locale data on Unix
Reread the environment, and update the locale data on request.

Also fix a small bug where the time format wasn't inherited from
the LANG environment variable if LC_TIME wasn't set.

Change-Id: I619447603ade19d5587b427491cfd9c8fe814858
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 20:59:27 +01:00
Thiago Macieira
8df589bebc Make QLocale not depend on being friends with the global static
Don't assume that the global static is a function. Instead, create a
class that is friends.

Change-Id: I992f4d819b367899b19d95b4983e6b243f0ed932
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-22 20:59:27 +01:00
Thiago Macieira
6cdbfc6f94 Remove the workaround for GCC 3.3 on IRIX
GCC 3.3 is no longer supported. IRIX is no longer supported.

Change-Id: I1656a6fdcf2b244f0f6c812e71b0e793d37fb98b
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-22 20:59:27 +01:00
Girish Ramakrishnan
4cc9523a31 Make architecture detection more robust.
Any message/error in mkspecs or qmake feature files ends up confusing
the current arch detection logic. Instead, search for
"Project MESSAGE: .* Architecture: <arch>".

Change-Id: I308932a5b75f3a1fcbc4fe30c74faf2e83b2d752
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-22 20:59:27 +01:00
Thiago Macieira
31f9df5205 Fix compilation on ARM with C++11: narrowing conversion
Cannot have double-to-float conversions inside { } in C++11.

Change-Id: I13c27307efd703420b6667d919bb42c2ee82e6cc
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
76f2aa139a Fix the build of qt-freetype with -system-zlib
The static library needs to link to zlib too, so that the plugins
using this library link to zlib.

At runtime this doesn't make a difference because -system-zlib means
QtCore is linked to zlib and the system zlib shared library was
loaded, so the symbols are resolved. However, since -Wl,-no-undefined
was added to the build, the plugin must link to zlib explicitly too.

Change-Id: I10d6df8814e823079fee76ae6a7d5b55057c9daf
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
e2a8ad145e Fix the build of -qt-freetype
The symbol must be exported from QtGui for the plugins to be able to
see it.

Also, fix the build in namespaced case: cannot use extern in
QtPlatformSupport because it's not compiled into the Qt namespace.

Change-Id: I029533f3524e3cbf6c87aed79c1f2e7b55aebb9b
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
07029c23f1 Fix compilation: std::min is in <algorithm>
Change-Id: I89227bb9fca0f081a232c2ede10c4d455edb2ee9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
228392aff2 Save the pkg-config settings in config.status
Change-Id: I6fc14eaf071ff56325bbcabb0ae8971fcf07b370
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
14068bcf9f Add a non-implicit virtual destructor for QDashStroker
The base class has a virtual destructor, so the destructor is already
virtual. Make it non-implicit so that the virtual table and other
virtual inline methods don't get emitted everywhere.

Change-Id: I15296c1114086ff0b1da701ccd51525bec99d76b
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
79d0cae448 Add qpair.h to the HEADERS list
Change-Id: I81d078a80b2fba201da9440e3550c2b73adaf668
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
8466d091ae Remove the false information that IA-64 supports SSE2
This must have been a mistake. IA-64 processors used to contain an
IA-32 core, which supported SSE2. However, the IA-64 mode supported no
such thing.

Change-Id: I731c6018166af6b897cb697c68aad4ef3ae93132
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-22 18:59:45 +01:00
Oswald Buddenhagen
8d28fba3ed support relative Sysroot specification in qt.conf
permits relocatable qmake installations in, say, $sysroot/hosttools/.
note that it makes patently no sense to have a relative Prefix when
using a relative Sysroot.

Change-Id: I36e5149acb20a885c3cd244bc9d67aa48b01a56f
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-22 18:59:45 +01:00
Oswald Buddenhagen
a985fa5c51 make unspecified/empty HostPrefix fall back to Prefix
this is needed for backwards-compatibility, and generally makes sense.

Task-number: QTBUG-24839
Change-Id: I42b008a9dfb43cc2ebe49c8baa2c29f5d6a75897
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-03-22 18:59:45 +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
Samuel Rødal
63e56b90c5 Fixed QScreen::name() return value on xcb.
Previously the primary sceen number wasn't stripped before adding the
actual screen number, resulting in names such as ":0.0.0".

Change-Id: Ifbcf12dcf1c200fd6bc5e4b95a5d82483957e0d2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-22 18:59:45 +01:00
David Faure
ce4fb74ecd Fix assert in libdbus-1 from tst_qdbusmarshall.
Serializing an empty object path was crashing with
> arguments to dbus_message_iter_append_basic() were incorrect,
> assertion "_dbus_check_is_valid_path (*string_p)" failed in file
> dbus-message.c line 2555.
Thiago says this depends on the libdbus build settings, which is why
it didn't happen to everyone. OpenSUSE-12.1 here.

Change-Id: I657d28d5d915706a22abfd273aad88d20e2d112a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 18:59:45 +01:00
Shane Kearns
c878e2803b Add configure bootstrap generated files to .gitignore
Change-Id: Ic538f46eabdf3de96d79c6e2f56627e47933bbab
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@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
Damir Tatalovic
fa8e18c386 MIPS DSP configure detection and initial blend optimizations.
Adds new MIPS configure test and -no-mips_dsp and -no-mips_dspr2
configure options.

List of optimized implementations:

- comp_func_SourceOver
- comp_func_Source
- qt_memfill32
- qt_destFetchARGB32
- qt_destStoreARGB32
- blend [RGB32][RGB32]
- blend [ARGB32_Pre][RGB32]
- blend [RGB32][ARGB32_Pre]
- blend [ARGB32_Pre][ARGB32_Pre]

Change-Id: I35411858295b7b3f4895eb56e3b93397528903cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 18:59:45 +01:00
David Faure
3b2ccf1277 QStandardPaths: implement displayName() on all platforms.
It was only implemented on Mac OSX until now (all this came from the
QDesktopServices code).

Change-Id: I7fd81d80ca77cf0ca6c213f59813a6163abe7dc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.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
Donald Carr
8dd18751e1 Remove legacy font cache from 3rdparty
Change-Id: I5a02251565c0c72e8762c0b41cdf5802c7df1938
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-22 18:59:45 +01:00
Thiago Macieira
d6d4dcaf18 Fix cross-compilation that uses fontconfig / freetype
config.tests/unix/freetype.pri has a !cross_compile flag, so we must
find freetype using the proper detection methods. The detection was
inside an X11 section of configure, so move that out.

And use the results of that detection, now that QMAKE_CFLAGS_X11 isn't
used (since we're not building X11 in QtPlatformSupport).

Change-Id: Ic8f5cfb7263849bfb12967756def2b5aaa244872
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-22 18:59:45 +01:00