Commit Graph

6108 Commits

Author SHA1 Message Date
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
Pekka Vuorela
d3c6664fb0 Change documentation to refer to up to date property name in QtQuick
Change-Id: I78550862a2b1eb14f89c5ad01cc3718cf83606d2
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-03-29 13:23:55 +02:00
Jędrzej Nowacki
11f8eb2e34 Add an assert to QMetaObjectBuilder.
Constructors and destructors don't have a return value, but every other
method return at least "void".

Change-Id: Ie621aff83e44c187e950910d5c0684ba1a6579b8
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-29 13:20:36 +02:00
Jędrzej Nowacki
fb650b0271 Compile QArrayData in bootstrap phase.
This change will be needed during migration from QByteArrayData to
QArrayData.

Change-Id: I0c8d6f9ed3ef7c33af62736af55259a8f9a70c0f
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-29 11:28:41 +02:00
Friedemann Kleint
4451010026 Determine font smoothing gamma in initialization.
Avoid calls to QStyleHint and QPlatformIntegration from
threads.

Change-Id: I851ef029ea348f182e0b42536d0a994960aa9187
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-29 08:48:43 +02:00
Andy Shaw
6eae3cec5a The scaling should not effect the width of a cosmetic pen
When the scaling effects the pen width so that it is less than 1 pixel
in width then it would use the QCosmeticStroker to draw, however this
should not be the case for cosmetic pens that are not less than 1 pixel
in width as the scaling does not change their width.

Task-number: QTBUG-25006
Change-Id: I142db0f3a7ee02aa87171495d5a7a7011100814e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-29 06:22:07 +02:00
Thiago Macieira
2d35844ee5 Fix operator precedence order.
Clang (I guess it was clang) reports:

io/qipaddress.cpp:276:34: warning: operator '?:' has lower precedence than '+'; '+' will be evaluated first [-Wparentheses]

Fix the precedence by wrapping the ternary expression in parentheses.

Change-Id: I1c995dc8e2b1b831480ea8f8a695f7f89c08fcac
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-03-29 02:07:38 +02:00
Casper van Donderen
c1e05824ad qdoc: Add simple return types such as void to output.
Change-Id: I2c9b2bc982f9fa3390a7b5bd322df9e015e53824
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 23:15:32 +02:00
Casper van Donderen
05d1929685 qdoc: Use otherprops attribute for DITA signals/slots.
Change-Id: Id85860abfb8abdf0b7bd95a65384576d8970096b
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 23:15:32 +02:00
Thiago Macieira
cc3ff3c1f6 Make qsimd.cpp also complain if required features are missing
Record in a variable the features that the compiler used for code
generation when Qt was compiled. Then complain if those are
missing. This is required in qdrawhelper_plain.cpp to make it disable
the plain build, keeping only the AVX, Neon or SSE2 builds. This code
works for GCC, ICC on Unix and Clang.

MSVC support is pending. It will involve defining the same macros
from qsimd_p.h when the compiler support is detected.

Other compilers are unknown. The only relevant one would be Sun Studio
for x86, but I have no access to it to find out what macros it
predefines.

Change-Id: I25f2d90b3c7ac7bd0442f4b349b6ee3bd751a95b
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 22:32:40 +02:00
Harald Fernengel
3df8a12f05 Compile fix for Linux Standard Base
Change-Id: I1a6dba065c45bf732c0174ed0a6492cc80478985
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-28 21:24:43 +02:00
Thiago Macieira
2ad8b63762 Fix warning introduced in Intel CC 12.1
Change-Id: Ie50b0bf0741637a3acfc39360804590f3c133332
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-28 21:24:43 +02:00
Thiago Macieira
d6d997a36f Ensure that qdrawhelper.cpp is compiled with vectorisation active
The GCC option -ftree-vectorize is enabled only at level -O3, so force
-O3 if this is an optimised build. Also, ensure that we're using SSE
for floating point math if we're in x86 (32-bit) builds.

No change is necessary for the Intel compiler, since it enables
vectorisation by default at any non-zero -O level.

These options are not possible with MSVC.

Change-Id: If1169a73cd8a3e8b34d9e21f281b78897b9aec3e
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 21:24:43 +02:00
Thiago Macieira
af3c7d35b6 Fix qmake's use of Q_ASSERT with side-effects.
The nice side-effect of having Q_ASSERT use the condition twice is
that we break code that has side-effects.

Change-Id: Ia0b7ed2a8030c8e222612af95eb2d58671433110
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 21:24:43 +02:00
João Abecasis
cbe8c10146 Clean up and make robust the file loading code
The used_mmap variable was set to true the first time an mmap operation
was successful, but it was never reset back to false. While that can be
a good indicator that future calls might succeed it is not a guarantee.
Not properly resetting could mean we'd unmap memory allocated with new,
instead of deleting it.

Since that variable is only used inside defined(QT_USE_MMAP) blocks, its
declaration is scoped the same way.

While mmap is still handled "by hand", use QFile for the other
operations. Calling mmap here is less than ideal, as it prevents use of
other memory mapping methods, such as native Windows APIs, but is less
intrusive as it allows QTranslator to retain control over lifetime of
the map. Using QFile for remaining operations reduces the number of
filesystem operations.

The file size is now checked to be minimally sane (<4GB), the limit of
the 32-bit variable that will hold mapping's length. Translation files
should be expected to be much smaller in practice, but there isn't a
sane hard-limit. The file format is broken down to sections, each of
which has a 32-bit length.

Finally, when loading a file fails, release resources immediately,
instead of delaying to next load attempt or the destructor.

Change-Id: I5cc1b626a99d229e8861eb0fbafc42b928b6a122
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 20:22:57 +02:00
Girish Ramakrishnan
4ba9cecec2 Remove sysroot detection
configure parses the compiler from the mkspecs using an awk script.
The detected compiler is then used to determine sysroot support.
The awk script is currently unable to handle loading of qmake
features and thus configure will not detect the compiler correctly.

This is the case when using device profiles. The qdevice.pri is loaded
through the qmake feature file device_config.prf.

One possible way to fix this is to move this detection after qmake is
built and make this a .pro based config.test. However, this cannot be done
because the sysroot is actually baked into the qmake binary as the
QT_SYSROOT variable.

The solution is to remove this check completely and let the build fail
when Qt starts compiling with --sysroot.

Change-Id: I6c3b7ec2c8e5e390d6f5b1e602d656682d610b98
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 19:34:42 +02:00
Girish Ramakrishnan
d29b56f604 Document configure's -sysroot option
-sysroot has been undocumented so far.

Change-Id: I552f9233778de9490a3479292f0cda9c8c439282
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-28 19:34:42 +02:00
Rafael Roquetto
68ecbffb30 Remove the virtual keyword from reimpl. methods
Qt Coding Standards state that "when reimplementing a virtual method, do not
put the virtual keyword in the header file'".

Change-Id: I89ae34eee78ad5b58a3e41845384a656225ed658
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
2012-03-28 19:34:42 +02:00
Kevin Krammer
5d117fd427 Refactoring virtual keyboard class into non-singleton
Getting rid of the singleton gives us better control over when the
virtual keyboard handling class is instantiated and configured.

Also notify screens about keyboard height changes and let them
notify through QWindowSystemInterface instead of "guessing" the
screen in QQnxVirtualKeyboard.

Change-Id: I71a7f6b5e9d5455563404f6abe7a0daec567a12d
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-28 19:34:42 +02:00
Kevin Krammer
a80a2c6da2 Move screen event processing into its own class
The event handler class can then be reused when we have proper
BPS event support available from corelib

Change-Id: Iafe645e69248597377045c711108ce0acbe3984b
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-28 19:34:42 +02:00
Friedemann Kleint
f5c5708f6e rcc: Add a note about the usage of the source code for Qt Designer.
Change-Id: I672b470fcbd37b024451e7ed5f241643a1ab85a6
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-28 17:43:58 +02:00
Simjees Abraham
91bdfd3020 irrelevant qDebugs from QGuiApplication removed.
removed the qDebugs that are not relevant for the user and were printed when the
app was started from QtCreator.

Change-Id: Iae49d6c780a4d3cfd55b3e149555294e150f3f52
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 17:22:39 +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
Thiago Macieira
7adbc9b234 Remove the -no-stl option from configure
This was decided on the mailing list. See:
http://lists.qt-project.org/pipermail/development/2012-March/002442.html
http://lists.qt-project.org/pipermail/development/2012-March/002465.html

Change-Id: I7681e5cc743b20f6d4e29d2aea45c50df41a0b98
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-28 16:31:34 +02:00
Thiago Macieira
d43fe0b672 Remove the old code using MMX registers.
There are only 8 MMX registers, each 64-bit wide, and they alias the
x87 registers. The access to the MMX register cannot use the new
VEX-prefix instructions either.

All of the functions being replaced are either present in the
qdrawhelper_sse2.cpp and qdrawhelper_ssse3.cpp files, or the plain C++
function in qdrawhelper.cpp is vectorised when compiled with
-ftree-vectorize (enabled in -O3), if SSE2 support is enabled.

All x86-64 processors have SSE2, so this is a net improvement for
64-bit builds. For 32-bit builds, without further support this will
cause the code to use non-vector or x87 instructions, which aren't the
best. The solution will come in another commit.

Change-Id: I4a22d8a2516b79172867510202d0fd627db54807
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-28 14:54:12 +02:00
Martin Petersson
b754deb055 QNam: try to read the last CRLF when chunked encoding is used.
When chunked encoding is used we should try to read the last CRLF after
the last zero-lenght chunk, with chunk size coded as 0.

Task-number: QTBUG-19480
Task-number: QTBUG-20924
Change-Id: Ida40593fec8788bff713a31cfe6a7c2d86354a91
Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-03-28 13:22:11 +02:00
Friedemann Kleint
b2d205b587 Windows: Fix handling of -nomake.
Add to list of disabled build parts (see
b9a498bf51).
This fixes the tests are currently built in developer-build
despite "-nomake tests".

Change-Id: I43282112e03328dd89d8c874ca31b0483742ddb3
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-28 13:01:01 +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
Debao Zhang
5e80eb7917 Remove AutoCompatConnection
The default type when Qt 3 support is enabled. Same as
AutoConnection but will also cause warnings to be output in
certain situations.

Change-Id: I64bf3c39a740afb716820bfd3173936fda213f4a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.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
Frederik Gladhorn
6c45614cbe Add missing accessible child id.
In the deprecated function the child parameter got lost.

Change-Id: Ieeef19100bffaaa6079185dae6ae5bf82dcd7a60
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-28 09:42:00 +02:00
João Abecasis
99e7ad660f Ensure QTypedArrayData is just a shim over QArrayData
Change-Id: I6f41ca054d0e0a0c4642f0b841b3b3df9559f818
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-28 09:37:27 +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
Casper van Donderen
3198247ccf qdoc: also allow \page index as head of ditamap.
QDoc previously only supported having \page index.html as root of the
ditamap, this is hard to understand.

Change-Id: I9f99bf53440aad372bb72b59e7bfa1a0427cb652
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 05:07:08 +02:00
Casper van Donderen
89be197b92 qdoc: Add CLI option to not generate example docs.
Change-Id: I059ae76430adada020d338905b39ba3089c89615
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 05:07:08 +02:00
Casper van Donderen
419b4abed6 qdoc: Rename QML classes to QML types in ditamap.
Change-Id: I7b1a10d0d25a0a79fb018ab9138f2ef32470475d
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 05:07:08 +02:00
Casper van Donderen
1f742095ce qdoc: Do not write index.dita multiple times in ditamap.
Change-Id: I69719237d0ab567ce2a606c96b38f6baa2a601b5
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 05:07:08 +02:00
Casper van Donderen
291f436ab6 qdoc: Implement \uicontrol command.
Change-Id: I10381cd69d32352c590ec5a7d4041465af57b88b
Reviewed-by: Martin Smith <martin.smith@nokia.com>
2012-03-28 05:07:08 +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
Thiago Macieira
e7a6dacf80 Unify the atomic implementation for x86 architectures
It's almost exactly the same code in both files, so let's have one file
only. That means we need an #ifdef for the special case of 64-bit types
on i386.

Also take the opportunity to add a comment explaining how this works.

Change-Id: I50d274fa026806ae511b1045aa8a5c25daaa0edc
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-03-28 01:51:40 +02:00