Commit Graph

5706 Commits

Author SHA1 Message Date
Jason McDonald
13d936b0f2 Make QWidget::isEnabledTo() and isVisibleTo() to take const pointers.
This commit addresses a long-standing Qt 5 to-do comment. Whilst a
trivial change, it is binary incompatible.

Task-number: QTBUG-259

Change-Id: I2fc7bfda488318dbabbbea9f5ff9d2b1d6ce0784
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-26 21:30:54 +02:00
Jason McDonald
6a1d1165c2 Make QGridLayout::getItemPosition() const.
This commit addresses a long-standing Qt 5 to-do. Whilst a trivial
change, it is binary incompatible.

Task-number: QTBUG-1433
Change-Id: I6e31e47fd5791cb6f1373e2696ffc95f7174f0b0
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-26 21:30:45 +02:00
Thiago Macieira
15e9b77cac Add support for detecting SSE2 and SSE3 on WinCE
Change-Id: Ic26ba2073d1f1d7e12338811b86f9b99ea8f1eac
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-26 18:39:29 +02:00
Thiago Macieira
7db5f0dd6a Use ADD/SUB instructions on x86 and x86-64 atomics instead of INC/DEC
According to the Intel Optimization Manual section 3.5.1.1 Use of INC
and DEC Instructions, those instructions modify only part of the flags
register, so they mey introduce unnecessary data dependencies on
previous flag-setting operations so that the resulting flags are
computed. Preferring ADD and SUB (rule 33) is recommended.

However, we don't do it for 16-bit integers. The reason is that the
presence of the 0x66 prefix may trigger a slower decoding codepath in
the processor (up to 6 cycles, as opposed to 1). The same Intel manual
talks about Length-Changing Prefix, which applies in particular to
instructions with 16-bit immediates. The assembler generally produces
uses the 8-bit immediate variant of the ADD and SUB instructions, but
to be on the safe side, we prefer to use INC and DEC here.

Change-Id: Ic03236ac600a5b4e087614d21df5d3c666ae064e
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-26 14:54:29 +02:00
Thiago Macieira
99802f0c14 Fix the 64-bit i386 atomic according to assembly output
The assembly output showed that GCC was generating some wrong code in
some conditions, so update the constraints so it will do the right
thing: the expectedValue constraint needs to be in/out with early
clobber. In/out because cmpxchg8b really does produce output and, even
if we don't care about it, GCC needs to be told that the registers
used (EAX:EDX) were modified. The early clobber is necessary so it
won't schedule EAX or EDX to be the same as the EBX_reg (the register
we'll xchg EBX with).

Since EAX and EDX are in/out and EBX can't be used, the only remaining
low register for the "sete" instruction is CL. So use it directly and
set ECX to be in/out too.

For whatever reason, it can't find enough registers in debug mode and
this expansion doesn't work. It looks like a bug though, since this
requires 4 registers and one memory operand and in debug mode it must
have EAX, ECX, EDX, ESI and EDI free for use. One of ESI or EDI is
used to xchg EBX with, which means there must be at least one more
free general register.

Change-Id: I1f11e68d776bf9ad216b34ca316a53129122fabe
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-26 14:54:08 +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
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
6ab6b0fc1c Disable QUrl support in QVariant in bootstrapped mode
The only use of QUrl in qmake, moc, uic and rcc is due to QVariant's
internals, so let's disable it. This means those binaries are now
probably a lot smaller since the parsing and IDNA code don't need to
be present.

Change-Id: Ie156b0817d119b2ba5d3dcb9712a9fea2ee7d4a1
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-24 16:30:58 +01:00
Jędrzej Nowacki
5e0406cbdf Get rid of compilation warning.
metaObject pointer will be used in future.

Change-Id: I1f335687ad1aa443def21efcb5d4a2eaf3583c44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-23 19:43:00 +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
Thiago Macieira
bd384427c4 Optimise QHostAddress a little
In QHostAddress::setAddress(SpecialAddress), avoid parsing strings.

Change-Id: Icb756b4c8b06c21dbc231f8c7f0b0dac29ed97c3
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-23 19:43:00 +01:00
Thiago Macieira
1882cf1c9d Add detection of AVX and AVX2 support in the compiler.
Intel CC 12.1 supports AVX2 but only with -march=core-avx2. The -mavx2
option produces a warning.

GCC 4.6 does not recognise any option.

GCC 4.7 recognises both -mavx2 and -march=core-avx2 so let's use the
latter for now. We may need to change to -mavx2 when there's an AMD
processor that supports AVX2 too.

Change-Id: I529240e6e6c2c0e3942d357e0320212d954fe4de
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-23 19:43:00 +01:00
Thiago Macieira
a1b30b49ef Remove detection for MMX support and related technology
This also removes the check for SSE, but the check for SSE2 and
further technologies is kept. If SSE2 is present, then SSE is too. We
don't have any code that uses the original SSE instructions only.

Remove the CMOV detection, since we don't use that anywhere and we're
not likely to ever use them..

Change-Id: I3faf2c555ad1c007c52a54644138902f716c1fe1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
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
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