Commit Graph

3540 Commits

Author SHA1 Message Date
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
Shane Kearns
762a721f7f Fix buffer overrun crash running MSVC2010 win32 Qt on win64
When loading dnsapi.dll as a plugin, we experience crashes because
the calling convention is not specified.
The default is _cdecl, but __stdcall (via the WINAPI macro) should
be used for windows APIs.
Mismatched calling convention results in corruption of local variables,
probably because the stack pointer is incorrect and SP offsets are
used in optimised builds rather than frame pointer offsets.

Since the library has been available since Windows 2000, I don't
think that we need to load it dynamically.
(Unlike the unix version where it isn't part of the LSB)

Also checked that the current release of mingw works.

Task-number: QTBUG-24227
Change-Id: I37c0a6aa0c133799c2a6dd9391ca1435ba2539ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-01 13:55:49 +01:00
Marc Mutz
4908cf2a55 QBoolBlocker: make constructor explicit and disable copying
Change-Id: If294eff3f84f837ed554c572527d46a89660de9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-01 13:55:49 +01:00
Gunnar Sletta
e759f62124 Set texture parameters before allocating the texture.
Some drivers use this as a hint to decide on weither to preallocate
mipmap memory or not.

Change-Id: I2fd438a9625b658c7f30fe39a9d63ba5396f9679
Reviewed-by: Kim M. Kalland <kim.kalland@nokia.com>
2012-03-01 13:55:49 +01:00
Jan Arne Petersen
fe092d1a6d Add support for _NET_ACTIVE_WINDOW on xcb
Use a _NET_ACTIVE_WINDOW client message instead of xcb_set_input_focus
for activating toplevel windows on xcb.

According to the Extended Window Manager Hints the right way to activate
a top-level window is using _NET_ACTIVE_WINDOW (when it is supported by
the WM). Other approaches like calling xcb_set_input_focus should be
avoided when possible, since the WM cannot intercept them.

Change-Id: I9be4901f56cbcfb563baf73ccd71ff17a9bdc1d2
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-01 12:16:57 +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
Jørgen Lind
ba5dd0d6c0 Added QPlatformScreenBuffer
And moved the pageflipper into its own file

Done with: Paul

Change-Id: I0af34075ce8673a66025cb761c0fe4ff6c0ab0fe
Reviewed-by: Jason Barron <jason.barron@nokia.com>
2012-03-01 08:22:07 +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
Holger Hans Peter Freyther
f885a526ac SHA-2 code does not compile on FreeBSD
The code fails to compile with the below error:
qcryptographichash.cpp:55: error: conflicting declaration 'typedef quint64 uint64_t'
/usr/include/sys/types.h:99: error: 'uint64_t' has a previous declaration as 'typedef __uint64_t uint64_t'

FreeBSDs types.h defines the used defines. Maybe it would be less
ugly to switch the code to quint*, or use a define to do so, or to
have basic os detection for stdint.h, not to include sys/types.h.

Change-Id: Ic62ae4b742c1123b4b7e17158d216374e609f59f
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.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
Morten Johan Sorvig
8034bc9e83 Don't use deprecated QWheelEvent::delta()
Replace with pixelDelta() and angleDelta().

Change-Id: Ie4b8b6fd39a5f8a28433554000940faef2f2542c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 21:05:01 +01:00
Morten Johan Sorvig
0d68a5aabf Remove Mac qDebug ifdefs.
Make qDebug work again with the new logging framework.

Change-Id: Ib88a83182429636b274d6284933d5ea00db7279c
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-29 21:04:46 +01:00
Friedemann Kleint
3a72a1c7ed Refactor the QPA dnd interface.
- Give QPlatformDrag a synchronous drag() function returning
  the Qt::DropAction
- Move the base functionality for asynchronous event handling
  to the platformsupport library as QBasicDrag (extendable base class
  handling drag icon and providing new virtuals)  and QSimpleDrag
  (sample implementation for drag within the Qt application).
- Change the Windows implementation accordingly.
- Change XCB to be based on QBasicDrag.
- Clean up QDragManager.

Change-Id: I654f76f0e55a385ba189bd74f3ceaded6a8fe318
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-29 20:10:30 +01:00
Stephen Kelly
3f1a4be302 Make loadAcquire const.
Change-Id: Iad2d60d1abe363a3b85eaf152861d0979a997d81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-29 19:11:54 +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
Olivier Goffart
eb4828bbfd Add operator<<(QTestData &, QStringBuilder)
So this code still compiles with QStringBuilder
QTest::newRow("foo") << foo + bar;

Change-Id: Ie82a21c8fd07ec2d27ad85015aa1a0c4e94700d6
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-29 17:29:33 +01:00
Jamie Kirkpatrick
3b80f1c4d5 Fix a double-release when loading NIB files
Change-Id: I0c2c2a932b433a84e136da8e262739951a1d8c6e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-29 17:20:06 +01:00
Jason Barron
76afa1556c Make QJsonPrivate::String compile on big endian platforms.
Was missing a variable declaration and an explicit cast.

Change-Id: I4f0fb9c3d9b8472adf0d91036442adc1fe255c7e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-29 17:09:00 +01:00
Morten Johan Sorvig
39e616c159 QPlatformTheme: Add virtual destructor.
Change-Id: I78aab57cc16ef4542bfb88c81dd6a9d8b4c4d853
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-29 16:52:13 +01:00
Marc Mutz
1ff1486d53 QCryptographicHash: make constructor explicit
The copy constructor of QCH is disabled, so there's
no point in providing an implicit conversion from
the Algorithm enum anyway, so make the ctor explicit.

Change-Id: I4ea74ffb0963b4f49415da17778c3e6050454a6b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 15:53:21 +01:00
Oswald Buddenhagen
486bde8372 make qlibraryinfo table-driven
switch blocks are noisy. this is nicer.

reshuffled the LibraryLocation enum to make table lookups possible and
future-safe.

using pointer-free tables to avoid adding data relocations.

Change-Id: I70ec2c2142ce02a15e67284e4b285d754d930da3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-29 15:53:21 +01:00
Oswald Buddenhagen
da08210494 remove pointless ifdefs
configure always defines all of these constants. the exception is
SettingsPath which is unix-only, so make the #ifdef explicit about that.

Change-Id: I339d2d7cb9d188a8e74d79310c3a80b5d4dbb806
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-29 15:53:21 +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
Stephen Kelly
612152fad8 Make qobject_p.h not need qvariant.h.
Move definition of ExtraData to the implementation file.

As a side effect, we need to include qhash.h
in some other places.

Change-Id: I8bb4ec0940ae51c7d6961c9a51adb80fd444e1e3
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 14:08:33 +01:00
Stephen Kelly
85e050b0b3 Make qlocale.h not depend on qvariant.h.
As a consequence, we have to add more explicit includes.

Change-Id: Ib3137031f0554b846c7bbd08f1f7df10dfeb8e61
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 14:08:29 +01:00
Marc Mutz
8b33be0054 QScopedValueRollback: make constructor explicit
I'm not even sure whether you could implicitly
convert a T& into a QScopedValueRollback<T>,
seeing as the constructor takes a non-const
reference, but it looks wrong without explicit
and

  QObject o = new QObject(parent);

also won't compile even with implicit QObject(QObject*)
under a conformant compiler because of the disabled
copy constructor, and we still make QObject(QObject*)
explicit, so add it here, too.

Change-Id: I722a6e8431644e450fe2b401ccfb707a8e982380
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
2012-02-29 13:52:01 +01:00
Stephen Kelly
ec234625c0 Remove include for no-longer-supported compiler.
Change-Id: I162da3e373a0191f69e50e110114ef78c2d5fc66
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 13:43:02 +01:00
Rohan McGovern
98dd1781d9 Merge master -> api_changes
Includes fixes for tst_qfiledialog2, tst_qtextedit autotests on mac.

Change-Id: I49cac26894d31291a8339ccc1eb80b6a940f0827
2012-02-29 09:23:14 +10:00
Thorbjørn Lund Martsum
e500946de9 QHeaderView - remove sectionCount variable
A previous patch ensures that we have exactly one section in a Span.
( see SHA : b800d8b94a )

Therefore we no longer need the sectionCount variable. We have
assess to it through the sectionSpan.count.  To keep this patch
quite simple the variable sectionCount has been changed to a
function returning the count value.

Change-Id: Ibc419eafa38ab64b08f93074cb6ae4b8518995f6
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-29 00:05:38 +01:00
Stephen Kelly
6363672163 Add support for QT_NO_SIGNALS_SLOTS_KEYWORDS
QT_NO_KEYWORDS can be used for example to ensure that foreach can
not be used, but Q_FOREACH must be, that slots must not be used but
Q_SLOTS must be, etc.

Typically they are used to avoid symbol conflict with other
libraries that may use the same keywords (I think boost uses
signals).

For 3rd party libraries, it makes sense to use Q_SLOTS and Q_SIGNALS
instead of slots and signals, so that downstreams can still choose
to use QT_NO_KEYWORDS in their code.

The most convenient way to enforce that currently is to define
QT_NO_KEYWORDS when building the 3rd party library. However, that
has the inconvenient side effect of making foreach, forever and emit
not usable within the library implementation.

This patch makes it possible for the 3rd party library to use
QT_NO_SIGNALS_SLOTS_KEYWORDS to exclude signals and slots without
affecting whether the other keywords can be used in the library
implementation.

Change-Id: If1e16a4fa384bd3a2ddd737143499f8b587bc4f8
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-29 00:05:38 +01:00
Marc Mutz
aac821c220 QRingBuffer: make constructor explicit
This is a private class, but it's so close to
the classical Stack(int) example for explicit
that I just have to make this ctor explicit,
too:

   QRingBuffer rb = 0; // oops: meant '*rb'

now no longer compiles.

Change-Id: I7d58c1f08c1b14d14930426159c5c8db71b4cf4d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 00:05:38 +01:00
Marc Mutz
b72bcea864 QPair: don't copy-initialise 'first'/'second' in the default ctor
Why would we want copy-initialisation if we can
have the default constructor?

Change-Id: Id2de36d42ef9f63793ff4e3ec36202d3f2bf5f30
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 00:05:38 +01:00
Marc Mutz
4a82f78dea QPair: remove user-defined copy assignment operator
The compiler-generated copy assignment operator is fine,
and the user-defined one prevents the compiler from
synthesising a move assignment operator.

Change-Id: I044104a2fd4d7522a910d5c2a68d11dabeca99c4
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-29 00:05:38 +01:00
Oswald Buddenhagen
672e5a4e88 don't abuse $$fromfile() for inspecting entire projects
a project can rightfully expect a sane environment. $$fromfile() does
not necessarily provide that. so instead use include() with a target
namespace.

Change-Id: I8d6d30ab1b760d4930c9b4453bc92f8f8ad0b0ae
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-02-29 00:05:38 +01:00
Stephen Kelly
018e78575c Make the CMake files work with directory overrides.
This allows us to create correct CMake config files when Qt is
configured with directories outside of the prefix (which Qt allows),
and also allows us to use correct values when a 'longer' relative
lib directory is used such as lib/x86_64-linux-gnu.

Change-Id: I6f88255a23752dc5b84cb20ce13fdeeee9d5ad51
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-28 21:07:16 +01:00
Bradley T. Hughes
c7a059e376 Compile SHA-2 code on systems without stdint.h
stdint.h is a C99-ism, which isn't available everywhere. The sha.h
header tells us we need 4 typedefs. Add these to qcryptographichash.cpp
before including sha.h and comment out the stdint.h include in sha.h.

Change-Id: I1ede9569fa7eaa84de3befeb3c58cc6a05aa522c
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-28 18:53:32 +01:00
Pekka Vuorela
44174332c9 Rename remaining references to QInputPanel
Change-Id: I747d37d10c78af6ad00322d5bd8d29c6b343828c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-28 14:38:36 +01:00
Sean Harmer
87366cc7ab Initial import of the Blackberry QPA plugin for Qt5
This is dependent upon the following Change Id's:

I5ebcffb7153f4216d69921d4818051e6b3d14d8a
Iec065f528f5edd848be580807a607488dc2e401f

Change-Id: I234e3c4272d7474d8f8e20fc4fea20d95c829cb5
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-02-28 12:39:35 +01:00
Olivier Goffart
0d9714f445 moc: Only generate IndexOfMethod for signals.
moc is currently generating code to convert from a pointer to member
function of a slot or signal to its index.

The idea was that it could be usefull for slots to have the new syntax
do the same as the old one (connecting signal index to slot index). But
in practice, the new syntax do not use the IndexOfMethod for slots.

Also, it does not work for all the slots (no Q_PRIVATE_SLOT,
no static slots)

So since it is not used, and that it would take room in the binaries to
generate all the code to get the index of slots, we remove it.

If ever we need it, we can still add it later.

Change-Id: Ia417e3e524d7915ca86433ea86c66ac2b299c81a
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
2012-02-28 12:36:40 +01:00
Marc Mutz
3518db0bbe QDomNode: don't needlessly call virtual functions
Commit 4dabe78387 changed
these functions from virtuals to inlines that check the
return value of the remaining virtual function nodeType().

However, two of the functions call nodeType() more than
once, which we know will return the same result each time,
but requires a compiler with interprocedural optimization
capabilities to figure out by itself.

So instead of repeatedly calling nodeType(), call it once
and store its return value in a temporary, and use the
temp for further comparisions.

Change-Id: Idbeafb7fd93d275d475218c6df2ad7fdc9162cc5
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-28 11:54:52 +01:00
Debao Zhang
ced029e87d Fix QSettings autotest fails under Windows
The Windows registry and INI files use case-insensitive key.

This is a side effect of 1d01bc1e83

Task-number: QTBUG-24145
Change-Id: I862bddae68ef27569e6ffa901f98ca107d3f300b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-28 09:12:03 +01:00
Friedemann Kleint
838f828a1d QComboBox: Use platform theme hint to determine popup geometry.
Change-Id: I1f81be1394455715c5dfcd2d426758c4c7cd91fc
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-28 09:12:03 +01:00
Mark Brand
52dab54986 QSqlTableModel: unify code for cache-clearing before select
The code in submitAll() had the same goal as the code in select,
so it has been unified. The new code in select() avoids sending lots
of dataChanged() signals for rows that are going to be removed
by QSqlQueryModel anyway.

Change-Id: Ic22e038223720185e47ed0cc573147745ecc8fc9
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-28 09:12:03 +01:00
Mark Brand
53338de52b QSqlTableModel::isDirty(): simplify and improve logic
Change-Id: Ic1332befa9078a94f872e38ff779e5b4cec7c100
Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
2012-02-28 07:29:00 +01:00
Jason McDonald
cbc777374a testlib: Improve the silent logging mode
Previously the silent logging mode suppressed passes, skips and internal
testlib info messages, but did not suppress debugging output, making it
hard to see the fails in a noisy test.  This commit changes silent mode
so that it suppresses all output except test failures and fatal errors,
making silent mode truly useful for seeing just the important test
output.

This commit also adds a selftest to verify the behaviour of silent mode.

Change-Id: I75420aead03682306210746a87e2a3b608b58fc6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-28 05:56:03 +01:00
Jason McDonald
8cacf68cdf testlib: Remove commented-out code from plain text logger.
Change-Id: Ica2e294d1f08cac4697d037dbc2803012e0ba58a
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-28 05:55:56 +01:00
Jan-Arve Saether
99d5decbcf Make accessible interfaces private for Qt 5.0
Since we're not yet confident if they serve their purpose well enough,
we have decided to make them internal so that we are free to tune them
later

Change-Id: Id79d154e0537aca07303afea5d057cfcb0773384
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-28 01:14:17 +01:00
Jiang Jiang
7df4890d8a Fix divide by zero when glyphWidth is 0
Change-Id: Ic0108b76b8d73cc977f8d64e036a65cb93db4684
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-02-28 01:12:08 +01:00
Marc Mutz
6c1bdc1854 QFontMetrics: make conversion from QFont to QFontMetrics explicit
There is no user of this in qtbase, and I don't think
this is a desireable feature anyway.

Change-Id: Ifebba5872b0eadb0daba3c3cd5f8b19abeed5c12
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-28 01:02:36 +01:00
Sean Harmer
c2baf45c73 Prevent stack corruption when using OpenGL Core Profile
When an OpenGL Core Profile context is requested the function
glGetStringi() is used to query the supported extensions as
glGetString(GL_EXTENSIONS) has been removed in the core profile.

The signature for glGetStringi used in Qt missed off the APIENTRY calling
convention. This results in stack corruption on windows each time
glGetStringi() is called leading to a crash.

Change-Id: Iff62c42e2bb5fc4a5c0561fae97ddc5a8ae3a45e
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-28 00:29:04 +01:00
Holger Hans Peter Freyther
394e45199f directfb: Switch to the new style plugins
The plugin might advertize more keys than supported at runtime. E.g.
the directfbegl key might not be available. I would like to have a
directfb.json.in and then generate the right file or if moc would
pre-process the file...

Change-Id: Ia8ad4e1367c06f5e35d02822d4f830ce1e9dc577
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-02-28 00:17:17 +01:00
Matthew Vogt
f79768cd39 Remove Q_DECLARATIVE_EXPORT and Q_QTQUICK1_EXPORT
Theses definitions are no longer required in qtbase.

Task-number: QTBUG-23737
Change-Id: Ib11e5840086b44120adabe83a1b068c991920f2f
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-27 23:14:41 +01:00
Bradley T. Hughes
b51296c064 Add SHA-224, SHA-256, SHA-384, and SHA-512 support to QCryptographicHash
This adds Sha224, Sha256, Sha384, and Sha512 enum values to
QCryptographicHash::Algorithm. The implementation comes from RFC 6234,
http://tools.ietf.org/html/rfc6234, which is added to
src/3rdparty/rfc6234. Only the headers and SHA-2 code is included in
src/3rdparty/rfc6234 (the SHA1, HMAC, and HKDF code is not included).

Change-Id: I85139fd118291f15efc22899a5ddd1cc83810cfb
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-27 22:24:00 +01:00
Olivier Goffart
bc6ad75d18 Remove use of deprecated conversion from QKeySequence
Note: UNICODE_ACCEL is Qt3 compatibility and is equal to 0

Change-Id: I808a66772abceb3822d515d69386728264eb1b40
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-27 22:24:00 +01:00
Thorbjørn Lund Martsum
05e24901a1 QHeaderView - minor cleanup in viewportEvent
This is an improvement to a previous fix with
SHA e62e71162606fec134600955a89b7e0c34a7840b

We actually never want to call resizeSections if the parent is hidden.
Therefore we can both simplify and improve the code with this patch.

When we do show/hide on parent then the visible status is updated
before we get into this code. I have verified the patch on the code
from:

Task-number: QTBUG-14234

Change-Id: If7bfa3b3813c97b4a545e48423526e9cfe118de4
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-27 20:52:45 +01:00
Olivier Goffart
e2f295e27c Detect QMetaType::QReal from the definition of qreal
Instead of relying to complex preprocessor expression that need to be
maintained to be kept the same as in qglobal.h

This aslo fix the case where QT_COORD_TYPE is defined (It is meant to be
defined to float or double, any other type would not make sense)

So now there should hopefully be only one place to change if one need to
adjust the type of qreal

Change-Id: I778312112603173562dbe675ab491b53d6cd2174
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-02-27 20:52:45 +01:00
Miikka Heikkinen
64e0560ff4 Fix submenu positioning
Submenus are now positioned to the correct side of the parent menu
based on layout direction, if there is enough space on screen to fit
the menu. If there is insufficient space, then the menu is positioned
to the other side of the parent menu. In case that also causes submenu
to be partially ofscreen (very wide menu relative to the screen),
then the submenu will be aligned with the screen edge and will overlap
the parent menu. This seems like a lesser evil compared to having
submenu partially offscreen, which could obscure important details
such as checkmarks.

Task-number: QTBUG-23568
Change-Id: I6a9ab2c232713a2ee5a6dde3227c40419d46bd3d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-27 20:52:45 +01:00
Oswald Buddenhagen
5bbfe4d6d8 remove over-uses of $$list()
not sure why anyone would do *that* ...

Change-Id: Id91e9e8bd602a9d9275ade2ca86aaa4f4698ff72
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-02-27 20:52:45 +01:00
Debao Zhang
446d63be1b Fix tst_qmenu.
Clear away Q_WS_WIN/Q_WS_X11 from QMenu. Using the hint returned by the
QPlatformTheme.

Task-number: QTBUG-24325
Change-Id: Iaa4da26c74273d7cfc1fbec6519c52d09e10f7bb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-27 20:52:45 +01:00
Debao Zhang
63017136a1 QClipboard: Fix autotest fails
tst_qclipboard.cpp still has Q_WS_WIN which must be clear away. After
clean up, auto test will fail under windows: When setMimeData() is
called, dataChanged() signal will be emited twice.

The solution for QTBUG-24184 has partially solved the problem, but it
still there. Make sure emitChanged() only called by QPlatformClipboard
will give our more control for this.

Task-number: QTBUG-24484
Change-Id: I23566c6d3b32828b6865234c311af3635fe9e299
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-27 20:52:45 +01:00
Friedemann Kleint
5a0eb4e768 Fix icon loading in style sheets.
QIcon was moved to QtWidgets, while the parser is still in QtGui.
Introduce a QCss::IconValue struct that contains the icon data
and convert to QIcon in widgets.

Change-Id: I09ac8a12a4b02bdca91ee2e8fcc28c86b5a001e7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-27 18:30:38 +01:00
Olivier Goffart
c06e932c73 Move the QString comparison operator as non member function
The operator== and similar should not be member of the class. This
ensure a symertry.

Indeed, consider this code
  string == string1 + string2;
  string1 + string2 == string;

The first line compile fine even if QStringBuilder is used, because
QStringBuilder will be converted to QString implicitly.

But the second line do not compile if the operator== is a member of
QString, because the implicit conversion rules do not apply.

For this reason, the symetric operators should not be declared as
member.

Change-Id: I3f7c11fab45a9133f7a424bdfcb894f97da9282b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-27 14:04:03 +01:00
David Faure
3d3b3de83a QtTest: add missing \since 5.0 to the new macros
Change-Id: I8f7060c41df1e0bf1a8c35930400a31a4239a3d6
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-27 13:55:21 +01:00
Giuseppe D'Angelo
136c2bf184 QRegExp: fix crash
Fixes a crash when invoking various QRegExp methods on an object
*before* doing any match. For instance fixes:
  QRegExp re;
  re.matchedLength(); // crash

Task-number: QTBUG-23352
Change-Id: I9c239ff790a139c7820ef1aeced89d31320ae6b0
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-27 13:54:24 +01:00
Oswald Buddenhagen
568e714fdf remove library version matching from qt.conf
this feature was introduced in feb 2005 by Sam with this comment:
> I have implemented a versioning into the keys and do environment
> expansion there as well, these aren't immediately usefull but Marius
> and I agreed that distributors will probably want such features at
> times. The versioning fallbacks will be usefull to us over time no
> doubt.

imo the versioning is a contestant for the most useless feature ever:
- (linux) distributors couldn't care less - they simply configure qtcore
  correctly. additionally, the packaging policies state that no config
  files should live in the binary dir at all, so no qt.conf for them.
- ISVs don't care, because they ship their software with a particular qt
  version anyway.
- SDK distributors don't care, because it doesn't solve any real problem
  for them: a) they will isolate the (qmake) versions and b) a
  distinction based on version number (as opposed to build
  configuration) is utterly useless in the first place.

i left in the variable expansion, as it could at least theoretically be
useful for creating relocatable packages. debatable - the file it easy
enough to modify at installation time.

Change-Id: Ida8a50b16d55d8d8613d1a98a51df56753f6a6e3
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-27 13:51:04 +01:00
Friedemann Kleint
efde205586 Use new plugin system in qtbase.
- AccessibleWidgets
- Windows printer support
- Examples

Change-Id: Icc162bd7fc284b3c76d9966210f983728085c743
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-27 13:28:21 +01:00
Jędrzej Nowacki
6df396286a Simplify QMetaTypeSwitcher.
We do not need to distinguish between different types in the switcher.

Before this patch it was not possible to overload
DelegateObject::delegate with a pointer type. Now it is fixed.

Change-Id: Icd73a53e73e5e66b1b6f6407ba4e0f79e584d930
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-27 13:19:00 +01:00
Stephen Kelly
184c9e346e Optimize space for the QEventLoopQuitLocker.
Use a union and a type enum instead of three pointers.

Change-Id: I02b11733a4f2e95099064fa9325497d4e04ac615
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-27 12:57:30 +01:00
Jędrzej Nowacki
beab403d9f Reduce QtCore lib binary size by around ~3KB, by removing template code
Reusing a template is much better then creating a new one, even if it
should inline the same code.

For some reason replacing T* by void* force gcc to remove a few bytes
per template instantiation too, it is not really significant, but it
alows us to simplify the code.

Benchmarks don't show any regressions.

Change-Id: I4fdf1e4dc311b23021eb5758605602937d05b183
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-27 12:57:02 +01:00
Olivier Goffart
ec739707d7 Remove deprecated usage of QKeySequence from qguivariant
The implicit conversion operators are deprecated.

Change-Id: I0e94c0671413da1ab58c6c7b8bb31614e2696409
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
2012-02-27 12:49:33 +01:00
Olivier Goffart
96cfca6151 Remove usage of deprecated QAbstractItemModel::setRoleNames
Change-Id: If41bf0d6d50969156269c67a15e006d38edc8e1f
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-27 12:48:57 +01:00
Olivier Goffart
b58631ce47 Don't use deprecated QAbstractItemModel::reset()
Change-Id: Idf9971668a372a12ba319d954c35e157d8a08bd1
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-27 12:48:48 +01:00
Jędrzej Nowacki
51f2a0c331 Cleanup usage of QVariant::Type.
QVariant::Type is marked as obsolete. It is not possible to get rid of
it completely, in a source compatible way, but at least we can remove it
safely from a method arguments list.

Change-Id: I26b58099bfa6d32f3a583a8ae0047f0bb36bcd0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-27 12:47:52 +01:00
Stephen Kelly
1a49a529ee Remove more support for unsupported GCC versions.
Change-Id: I827c9f982a7d7d20913b99c8fdaf98437a0a73db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-27 12:45:31 +01:00
Olivier Goffart
67ac8d72d5 QTestlib: no need to use the preprocessor to distinguish qreal
The code paths are actually the same, so merge them.

Change-Id: I456b8a9a825cccdd80cd6a52a0a6737cde252363
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-27 11:30:31 +01:00
Marc Mutz
643fd1afdd QFontEngine: remove unused and buggy grayPalette()
QFontEngine::grayPalette() mistakenly returns an
empty vector, so even if there's a user (the class
it exported, after all), it cannot correctly use it.

So, just remove it.

Change-Id: Id5f70139e5f6ed9a2a3f28400cd0750d14cb7dc0
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-02-27 09:23:45 +01:00
Matthew Vogt
5bb1408927 Allow moc to handle symbols that have been redefined.
Allow moc to produce the desired identifiers when used with C++
symbol names that have been redefined, for example by -Dfoo=bar.

Two changes are required: firstly, when encoding a type name, the
components of the name must be checked for substitutions that have been
defined for that token (note that this is not done here by correct
pre-processing, but only by processing the resultant table of
definitions).  Secondly, the arguments to the SIGNAL, SLOT and METHOD
macros must be allowed to be substituted during macro expansion rather
than stringized directly.

This is a temporary change to prevent breaking existing projects
that depend on the declarative module.  After clients have had an
opportunity to update their code to the use the new interfaces,
it can be removed.

Task-number: QTBUG-23737
Change-Id: I39e6844cebf6ca7984af6028160b8a3797ac44a5
Reviewed-by: Martin Jones <martin.jones@nokia.com>
2012-02-27 00:18:53 +01:00
Marc Mutz
2a771cef4a QFlags<>: let the compiler generate copy ctor/op=
The user-defined copy constructor and
copy-assignment operators were 100% equivalent
to the ones the compiler would generate, so
let the compiler generate them (so we reap
move constructors, too, even though they're
not needed on this class).

Change-Id: Iecdd579fa5a819d083ec9b2f25734ddba85515e6
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-26 23:43:10 +01:00
Olivier Goffart
3688fac040 RemoveRef should not remove the const
This does not fix anything, because AreArgumentsCompatible already
do all the type checks.
But it make RemoveRef consistant with std::remove_reference

Change-Id: Ic42c872356172d7f5ea10de050254b5d10e50a6e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-26 13:23:49 +01:00
Marc Mutz
5f65d8ea25 QFixed: make constexpr
Make most QFixed{,Size,Point} members constexpr.
See f3141c58ba for rationale.

Change-Id: I0b44f59bb768e1f79c57e1c9a0dc67afb515e03f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-26 13:23:49 +01:00
Marc Mutz
3e4a3bafb6 QFixed{,Size}: reformulate some functions in a constexpr-friendly way
The main change is the addition of a new constructor
that passes its argument into 'val' verbatim. In order
to disambiguate it from the existing QFixed(int)
constructor, it takes a second 'int' argument. This
is too ugly for public API, so it's private, and only
used by static QFixed fromFixed(int), which is the
existing named constructor with the same semantics.

The rest of the changes simply reformulate their
operations in terms of fromFixed().

This makes them ready to be constexpr'ed.

Change-Id: I2a3813d62bd4124064755de6b00526a60fc82c1d
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-26 13:23:49 +01:00
Giuseppe D'Angelo
47525e6896 uic: remove unused QRegExp #includes
QRegExp is not used, so they're unnecessary.

Change-Id: I3480bcbe013a0bf15e2ee4fa30862fe035820eea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-26 11:58:25 +01:00
Marc Mutz
7679fcfeb5 QPrinterInfo: remove unused variable
Change-Id: I1a3db07e7fe25066a6b13ca41854566ccb1298df
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-26 11:58:16 +01:00
Olivier Goffart
5cc1a87250 Remove usage of deprecated QRect::unite
Change-Id: I1920da995fde6ff2a8b2e3facddeee6e3c17b44c
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-02-26 11:39:40 +01:00
Marc Mutz
4550f0db21 QStringMatcher: make constructor explicit
Change-Id: I3a8f37d2132eb84bef336afed60aff6e2350366d
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-26 10:53:25 +01:00
Marc Mutz
3ec9aac6c9 QXmlStream{Reader,Writer}: add explicit to constructors
Change-Id: Ib70b7a8f15aaf2e59deddcb0b89eb7e976893280
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-26 10:53:25 +01:00
ABBAPOH
4f4491e0b6 Fix doc according to current method signature
Change-Id: I23d0f7a88f4c092c1e7cd2742fdf6e6f68ad485a
Reviewed-by: David Faure <faure@kde.org>
2012-02-26 10:40:14 +01:00
Marc Mutz
8397a44bed QByteArray: deprecate QT_NO_CAST_FROM_BYTEARRAY-protected operators
The QByteArray::operator const {char,void}*() implicit
conversions are a source of subtle bugs, so they right-
fully can be disabled with QT_NO_CAST_FROM_BYTEARRAY.

  const char *d = qstring.toLatin1(); // implicit conversion
  while ( d ) // oops: d points to freed memory
     // ...

But almost no-one ever enabled this macros in the wild
and many were bitten by these implicit conversions, so
this patch deprecates them.

I would have liked to remove them completely, but there
are just too many occurrences even in Qt itself to hope
to find all conditionally-compiled code that uses these.

Also fixes all code that needs to compile under
QT_NO_DEPRECATED (in qmake/, src/tools/).

I984706452db7d0841620a0f64e179906123f3849 separately
deals with the bulk of changes in src/ and examples/.

Depends on I5ea1ad3c96d9e64167be53c0c418c7b7dba51f68.

Change-Id: I8d47e6c293c80f61c6288c9f8d42fda41afe2267
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-26 09:14:11 +01:00
Olivier Goffart
ddf4b378f1 Inline and mark as deprecated images's serialNumber()
These function are marked as obsolete since Qt 4.3

The motivation here was too fix QPixmap::serialNumber which is marked as
QT_DEPRECATED_SINCE but was not inlined.
But then I took the oportunity to do the same with all the other
functions.

Change-Id: Ic50a7857461fc402b2f2b4528c83e53e8e28ea30
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-26 02:23:01 +01:00
Marc Mutz
d91add71e7 QSslError: fix wrong #endif placement
This would break a namespaced Qt when QT_NO_DEBUG_STREAM
was in effect. Unlikely to hit, but nevertheless fixworthy.

Change-Id: Ie2a4cf4334a6a610c84233ab1ca89b928386c91a
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-25 15:28:11 +01:00
Friedemann Kleint
1118f28b86 Fix a crash in QSystemLocalePrivate::uiLanguages().
Use the correct calling convention. Discovered by the mimetype
test in Qt 5.

Change-Id: I79b97325dd69466885a64c238935107bf14e9a0d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
(cherry picked from commit bc6e35d94325f4b18caec7ce0824c5beab95cdd7)
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-25 14:04:22 +01:00
Olivier Goffart
71660ee565 Fix compilation without QT_DEPRECATED_SINCE
QAbstractItemModel::reset() is deprecated

Change-Id: I2d9aa9fade1660df14945ca11123341fce504050
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-25 12:37:53 +01:00
Teemu Katajisto
e430ddfafc Implement isSharing() and isValid() methods for QCocoaGLContext
Shared resources may have been used when initializing NSOpenGLContext
but QCocoaGLContext did not implement isSharing(). This caused
default implementation to return false always and therefore shared
resource test case failed.

Implemented also another missing method, isValid().

Task-number: QTBUG-23061

Change-Id: Ia912450035b584ea90a02a7d88d6ae531c3cbadf
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-25 11:43:35 +01:00
Marc Mutz
6ee0135e9d QFutureWatcher: Make constructors explicit
Change-Id: I363665725869993b10985004c1c6441ded435dbc
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-25 11:43:18 +01:00
jian liang
bf66eebbc2 Fix to exit of adopted thread watcher in Windows
Don't register the thread handle and QThread object pointer to watch list
for adopted thread watcher thread in Windows. Otherwise the watcher thread
will never exit and can't clean up its own QThreadData and QAdoptedThread
object.

Task-number: QTBUG-23961

Change-Id: Ia84326cf3cfd978d2b003ccc1bb6861db950e899
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
2012-02-25 08:23:51 +01:00
Friedemann Kleint
71fe29711f Use new plugin system for SQL drivers.
Change-Id: I1d4db9ecc7e1cbca66674d13748070f4b19d5b8c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-24 22:38:28 +01:00
Friedemann Kleint
5f320e2f97 Use new plugin system for network bearer plugins.
Change-Id: Ic4a28d379033518f75d0e3e449ddf012109ed9ea
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-24 22:38:15 +01:00
Marc Mutz
b1995f2c96 rcc: micro-optimization
Declare a char array instead of a pointer variable.

Change-Id: I2beff815d05b6dc9c35bb0a55d7294189afbf17e
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-24 17:47:56 +01:00
Friedemann Kleint
ed7f78acba Fix tst_qlineedit.
- Fix key handling in QWidgetLineControl according to
  the keyboard scheme returned by the QPlatformTheme,
  remove #ifdefs.
- Do the same in the test.

Task-number: QTBUG-21402

Change-Id: I36d836584e7122309061af72819a4147cadd0a74
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-24 16:21:37 +01:00
David Faure
5ae1caed43 qmimetypeparser: more optimized definition of string constants
Change-Id: I0cbc0fef63814ab037bea66ab35b3aa8b6ec800c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-24 16:21:37 +01:00
David Faure
92f37f00f9 Remove unused toolTip member variable (qt3 leftover)
Change-Id: Ia68fb00afb81a0f521f9fbc3f0dbfc7e43075bbe
Reviewed-by: laurent montel <laurent.montel@kdab.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-24 16:21:37 +01:00
Thorbjørn Lund Martsum
12c2a3d852 QHeaderView - fix setOffsetToSectionPosition a bit
It might be silly to have sections with size 0 without using hideSection.
Nevertheless we should still use the principle of least surprise.

It does not make sense that hiding a row 'far' away should affect
the semantics of setOffsetToSectionPosition on lower indexes.

Change-Id: Iaf847eba2ea4d28fc7bcfe3a27d62f432f6f61e0
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-24 14:55:06 +01:00
Morten Johan Sorvig
5a2efb490b QWheelEvent high-resolution delta support.
Support pixel-based deltas as well as sending
dx and dy values in the same event. Keep source and
behavior compatibility with Qt 4.

New API:
QPoint pixelDelta() const
QPoint angleDelta() const

Deprecate delta() and orientation().

Both pixel-based deltas and combined updates are
necessary for smooth trackpad-based scrolling on
OS X.

Qt 4 compatible behavior is achieved by sending an
extra wheel event in cases where the initial event
has a combined dx and dy update. This extra event
sends dx in delta() and orientation(), with pixelDelta()
and angleDelta() set to null.

Modify the Cocoa implementation to provide pixel
deltas. It is expected that not all platforms can
provide these. Angle deltas will always be available.

Change-Id: I20c10f0df338ddcd6a3f7a4d40949ed5ae3b4795
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-24 14:55:06 +01:00
Thorbjørn Lund Martsum
e8952aba29 QHeaderView - change not needed if to Q_ASSERT
This removes an if that should always be false. If it isn't
false we had more logical indexes than sections.

Unless visualIndices and logicalIndices are both 0-sized
(meaning that visual and logical indexes are the same)
then they better have exactly as many indexes as sectionCount.
Otherwise there must be inconsistent data - some logicalindex
would refer to non-existing visual sections or some
visualindeces wouldn't be hit by logicalIndices.

Change-Id: I2dc92f40895438d912bba20612131baf63df4fbe
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-24 14:55:06 +01:00
Marc Mutz
9387a9de6d QMimeMagicRule: declare as Q_MOVABLE_TYPE
Change-Id: I3725696e7369eb59eeb08095ffe0b8aa7537b4f3
Reviewed-by: David Faure <faure@kde.org>
2012-02-24 14:55:06 +01:00
Jan-Arve Saether
cbf2575740 Minor fixes for RelationFlag.
* Document AllRelations
* Assigned new values (starting from 1) for the remaining members of
  the enum.

Change-Id: I55ec197f24ff7d43ff3c0d101edd33b9615f9287
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-02-24 14:55:06 +01:00
Stephen Kelly
9c92df82dd Remove unused QT_NO_QWS_SHARE_FONTS
Change-Id: I47e8111d6caffd9b45096e52695acaa55945c612
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-02-24 13:20:08 +01:00
Stephen Kelly
5a3496ce88 Remove QT_NO_QWS_MULTIPROCESS
Change-Id: I1d6731dc5268919d0c36d5d27285321742be708f
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-02-24 13:20:00 +01:00
Stephen Kelly
de5ebd342f Remove unused define QT_NO_COP.
It used to relate to QCop and QWS, which are no more.

Change-Id: Ie70c64a3a6ef60664009108b79eed7f33ea59f32
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-02-24 13:19:54 +01:00
Jonathan Liu
e5d362f333 Fix Windows -no-freetype build
The localizedName and getEnglishName functions were defined in
qwindowsfontdatabase_ft.cpp but used in qwindowsfontdatabase.cpp.
However if -no-freetype is specified during configure then
qwindowsfontdatabase_ft.cpp is not compiled which results in an
undefined reference. To resolve this, the functions are moved to
qwindowsfontdatabase.cpp which is always compiled whether -no-freetype
is specified or not.

Change-Id: I085d84cecb29065ba5e6495b52eef7a678947bdc
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
2012-02-24 13:18:46 +01:00
Johannes Zellner
7b4e718b84 Add UDev helper class for evdev plugins
Adopt evdevkeyboard plugin to use new UDev helper

Change-Id: Ie914c77dde9a28a8cf7f7cd972acd963c13bc698
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
2012-02-24 11:29:43 +01:00
Samuel Rødal
9610458e0c Use "OpenGL" instead of just "GL" in documentation.
Change-Id: I81a0beebc0241b9699ce321174e13a93e76e45e8
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-02-24 10:03:36 +01:00
Alan Alpert
bb5c7b75a8 XCB No longer lists ThreadedOpenGL capability
Even with the more recent libxcb, it's a bit flaky. Just don't list
having this capability until it is more stable.

Change-Id: I1c2b39d757803fc23295944bc9a00e39ff4e1bbf
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-02-24 10:03:36 +01:00
Debao Zhang
4df6e05849 Clean up some Q_WS_WIN
Q_WS_WIN does not exist any more.

Change-Id: Icb7f542cfcd4d21e994f246ff665583cb6b57610
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-24 08:37:29 +01:00
Oswald Buddenhagen
d91cf1e53b clean up qmake-generated projects
remove "header" and assignmets which are defaults or bogus,
reorder some assignments.

Change-Id: I67403872168c890ca3b696753ceb01c605d19be7
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-24 05:18:30 +01:00
Stephen Kelly
bd5096d012 Add the QtMain windows library to the CMake files.
Change-Id: Iff8b9bdd4b069721103e1cd5854e56b6116d7549
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-23 23:46:01 +01:00
Mark Brand
3d763dc83a QSqlTableModel: rename parameter to avoid name clash with method
Change-Id: Ib8fa6b0ca71ffdd9f1f8416c448b5c830988ed08
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-23 23:43:53 +01:00
Mark Brand
3a863280dc QSqlTableModel: avoid extra QMap lookup
The consensus on #qt-labs seems to be that there is little or no
point in checking with contains() before using value(), even if
the map does not contain the key in most cases.

Change-Id: I34740a91d5c3af65e20937a5ae3b4bab32406440
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-23 23:42:59 +01:00
Mark Brand
5d516234be fix style
Change-Id: I8ad0b4d15484662be7b38daa797a688727377c88
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-23 23:42:41 +01:00
Mark Brand
083af1b8cf QSqlTableModel: document edit strategy behavior
Change-Id: Ib674288e950837aa343cf1206ed081386b1fff0d
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-23 23:42:30 +01:00
Mark Brand
b2c37a8138 improve documentation language style
Change-Id: Ic7daa90fff764578bd8122986a73c2ea6280e784
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-23 23:42:17 +01:00
Samuel Rødal
804e93462e Added documentation for QOpenGLContext and QOpenGLContextGroup.
Change-Id: I00e3e3b3fd37b27b31d4705de3c8c34be9211707
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-02-23 16:38:45 +01:00
Kent Hansen
ca028e1fe0 Bump the moc output revision
Commit aee1f6cc41 changed the values of
some built-in meta-type ids. Since the ids of built-in types are
directly encoded -- not as the symbolic QMetaType::Type name, but as
a raw integer -- in the flags for meta-properties, the moc output
prior to that change is incompatible with the current output.

Change-Id: I970484825137a4f19c80726cfe2024e741e3e879
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-23 16:38:45 +01:00
Martin Petersson
19a562a923 QSslSocket::verify certificates when on-demand loading is used
Task-number: QTBUG-24350
Change-Id: I5a328efe6606f5d438bb4787a5c02a425ce42aca
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-23 16:38:45 +01:00
Martin Petersson
031389e62e QWindowsPipeWriter could terminate the process to early
When the QWindowsPipeWriter is deleted it will wait
for the thread to exit. This wait was set to 100 ms
which will not always be enough time for the thread
to exit, in that case the thread will be terminated.
This will increase the timeout to 30 seconds that
should be more then enough time for the thread to exit
by itself.

Task-number: QTBUG-4425
Change-Id: I9b1910c0213376c622c091be050df2a1c4c6b190
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-23 16:38:45 +01:00
John Tapsell
2b23d7214f QTextEngine - treat a fullstop (0x2E) as the same script as the preceeding text when dividing up strings
Many languages use a fullstop to indicate an abbreviation, making the
fullstop part of the word.  For languages like thai, it is required to
pass the fullstop along for correct word breaking.

Change-Id: I5ad0ddbc66ea96e08913446dad8fd3c5d5dd0905
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-02-23 15:07:58 +01:00
John Tapsell
785e95ef0a Harfbuzz-thai: Hide ZWJ and ZWNJ characters and show Inherited characters
Thai is not supposed to have ZWJ and ZWNJ characters or any other of the
Inherited Unicode Scripts
(http://www.verisigninc.com/assets/idn-inherited-unicode-script.pdf)
- they don't have a mapping to the thai encoding tis620 which libthai
requires.  However it is an unfortunate fact that there are many websites
etc that liberally place these ZWJ and ZWNJ characters throughout thai text
to force word boundaries, so we must also deal with them.

We deal with all Inherited characters by mapping them to the invalid code ~0
in tis620 encoding, following what libthai does internally in its own tis620
encoding functions, and then replacing this character with the original
unicode and setting dontPrint to true to hide the ZWJ and ZWNJ
characters.

Includes a unit test to check the behaviour.

Change-Id: I1ee8388b650cb5fc61bcb265efb9843c73f327ac
Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-02-23 15:07:58 +01:00
Stephen Kelly
cf2ca62dcd Require compiler support for deprecated constructors.
Change-Id: I1d4cdcbbddb7895e6529e4f6b5295312e9a3a0e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-23 15:07:58 +01:00
Stephen Kelly
52c253fa33 Remove QT_ASCII_CAST_WARN_CONSTRUCTOR
GCC version < 3 which it was created for is not supported anymore.

Change-Id: I0b4df4c99600cacbaafbf0bc4270cd4978600956
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-23 15:07:58 +01:00
Jędrzej Nowacki
60c6ed0e04 Rename QMetaTypeSwitcher::UnknownType to NotBuiltinType.
UnknownType suggest that a type is unknown to QMetaType, but
QMetaTypeSwitcher is not checking for custom types.

Change-Id: I6b8b692e0f20bed286c713672b35fb15757d389e
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-23 15:07:58 +01:00
Sean Harmer
cc6f28e2d6 Fix fontconfig.pri file to allow QPA plugins to build
Change-Id: I5ebcffb7153f4216d69921d4818051e6b3d14d8a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-02-23 15:07:58 +01:00
Stephen Kelly
b067f6cfe3 Add the quitlock feature to QThread.
Change-Id: Ib44ee9739499ba4c5f0fecbef3976251ea22836d
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-23 15:07:58 +01:00
Marc Mutz
c951908bc2 QString: add from{Ascii,Latin1,Utf8,Local8Bit() overloads for QByteArray
One of the more frequent uses for QByteArray::operator const char*()
is in passing a QByteArray to QString::fromLatin1().

But this is highly inefficient, since the bytearray already knows
its size, but since its demoted to a const char* in passing to
fromLatin1(), it forces the latter to call strlen() _again_.

The solution, then, is to add overloads for QByteArray that
pass the array's .size() as a second argument to the two-arg
fromLatin1() version.

Change-Id: I5ea1ad3c96d9e64167be53c0c418c7b7dba51f68
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-23 14:57:06 +01:00
Jan Arne Petersen
422b6ba9ec Add WindowDoesNotAcceptFocus flag and use it in xcb
Add window flag to support windows which should not get the input
focus.

Sets the input field in the WM_HINTS structure of the window to false
if the WindowDoesNotAcceptFocus flag is set on a window in xcb.

Change-Id: Ifbc10695b83484c17dca0eb13ea826d74f174833
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-23 13:25:26 +01:00
Samuel Rødal
88b69ab0c4 Fleshed out the QWindow documentation to be less sparse.
Change-Id: Ia3873687a2c3e0dd85c56e4f9e34d2e194e2ff50
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-02-23 11:57:00 +01:00
Samuel Rødal
04652b9856 Added documentation for QSurfaceFormat.
Change-Id: I3b42b09e6e42092c098e4fc20c5ba7dd7e354116
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-02-23 11:57:00 +01:00
Friedemann Kleint
a6e20e4874 Handle theme change in QApplication/QGuiApplication.
Re-initialize palette and fonts.

Change-Id: Ib312747886a31e8370f8d99536d52cbcf8afe8a4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-02-23 10:24:50 +01:00
Debao Zhang
d2f65aa470 Fix conflict between QMainWindow::restoreState() and QWidget::setStylesheet()
If QMainWindow::restoreState() then QWidget::setStylesheet() were called
before the QMainWindow is shown, the size of QDockWidget can not be
restored.

QWidget::setStylesheet() will generate QEvent::StyleChange event, which will
cause the function QDockAreaLayout::fitLayout() to be called before the layout
of MainWindow is activated. Although the state info has been stored in
a QMainWindowLayoutState variable by QMainWindow::restoreState(), but
QMainWindowLayout::setGeometry() still isn't called at present. So
QDockAreaLayout::fitLayout() will force the size of dockwidgets
and centralwidget to be calculated using the wrong geometry, which will
break the state restored by QMainWindow::restoreState().

This is a side effect of 692e9103ebb85b90e79377206d5d03b704d43d42.

Task-number: QTBUG-15080

Change-Id: I8cda6a529d178f7467a59b780db80df0a44d4769
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-23 10:14:24 +01:00
Andrew den Exter
ef9a86db56 Fix rounding error in QInputMethod::cursorRectangle().
Use QRectF consistently to avoid the rounding done in the conversion
to QRect.

Task-number: QTBUG-24463
Change-Id: If9ea858ebabf8c449ea058b9d379d4a57cb6c82d
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-02-23 09:33:27 +01:00
Debao Zhang
1501f1ddd4 QMenuBar: Clean up Q_WS_WIN
- Replace Q_WS_WIN with Q_OS_WIN
 - Remove useless #ifdef Q_OS_WINCE which located in another #ifdef
   Q_OS_WINCE

Change-Id: I6279b6d74902ab3ca6bdb7292c2936a76e3e6952
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-23 09:21:22 +01:00
John Tapsell
c065ac562a Harfbuzz-thai - When calling HB_OpenTypePosition we must set doLogClusters to true for thai
This bug resulted in word wrapping not working correctly for thai.

Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
(cherry picked from commit 7495f2c7c55917a98c903547858be923028b7827)

Change-Id: Iedb26a10078c6cc4e90d090176ab63499293d69d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-02-23 09:17:39 +01:00
John Tapsell
5b4a44f83d Harfbuzz-thai - fix to_tis620 function for latin characters
This was an obvious typo - a missing "else" in a group of if statements.

Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Reviewed-by: Adrian Yanes <ext-adrian.yanes@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
(cherry picked from commit a784bdcabe895ab927cbc28118d427c6e932b9fc)

Change-Id: Icbd458034e42cf7f2af33c1ecc9b0e4f1aa8724a
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-02-23 09:17:27 +01:00
Marko Kenttala
034ac599f6 Fix height of some Thai characters
Some Thai characters with two above glyphs were higher than fonts ascent. This
caused them to be clipped in for example qtcomponents buttons.

Added checking for this and calculation of new lower offset between glyphs if
needed.

Task-Number: ou1cimx1#898104
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Sami Merilä <sami.merila@nokia.com>
Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
(cherry picked from commit d7c7bf721c93fe7629f725c181b52ad9ca645a7a)

Change-Id: Ie4ac69de75f50b68b2ba87353d83098846f319f4
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
2012-02-23 09:17:08 +01:00
Andy Shaw
8bf009e216 Silence coverity warning about sizeof(Node*) vs sizeof(Node) in QList
Coverity was complaining about QList::node_copy using sizeof(Node *)
instead of sizeof(Node).  The complete message from Coverity is:

"Passing argument "from" of type "struct QList<QObject *>::Node *" and
argument "(to - from) * sizeof (struct QList<QObject *>::Node *) /*4*/"
to function "memcpy" is suspicious. Did you intend to use "sizeof(struct
QList<QObject *>::Node)" instead of "sizeof (struct
QList<QObject *>::Node *)" ? In this particular case sizeof(struct
QList<QObject *>::Node *) happens to be equal to sizeof(struct
QList<QObject *>::Node), but this is not a portable assumption."

Task-number: QTBUG-24443
Change-Id: I583887a8b4177a224664065e14f8780a9586c9a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-23 05:35:40 +01:00
Stephen Kelly
5942556d65 Use the CMake definition of Windows for CMake macros.
Change-Id: I599ddaaf9176f76f2e144c893e607757957dfef2
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-23 01:36:14 +01:00
Rick Stockton
eec25d44e4 Suppport up to 27 mouse buttons from DirectFB Plugin.
Previous to this update, our plugin accepts only 3 moue buttons
(from DirectFB, to be translated into Qt::MouseButton values.)
This update changes our Plugin, so that it will successfully
translate up to 27 mouse button numbers. It is unclear, to the
author, which configurations of DirectFB on Linux might be
capable of actually sending high-numbered mouse button Events
to Qt. But, if/when a DirectFB configuration does so, this
change makes Qt ready to recognize and work with the button event.

Task-number: QTBUG-24335

Change-Id: I8839ed386eb3d261a187355a244e80d511399ea8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-23 01:31:59 +01:00
Robin Burchell
949127264d Remove unneeded code to convert to ASCII/Latin1.
This isn't used, and isn't wanted with the upcoming utf8 switch.

Change-Id: Ibec0fa7f36549df6a1c240353ffcd44beb2976f0
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 20:51:47 +01:00
Stephen Kelly
13c7de63a1 Don't do macro self-expansion for moc anymore.
Change-Id: Ia34cc244a160c6c4abe6dacd7a2ce29bc4fc7bfb
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-22 20:51:47 +01:00
Stephen Kelly
126eaa7cdd Remove unused Q_CANNOT_DELETE_CONSTANT
Change-Id: I697f3f786d84fa766b3bc48d93fc265deee5fdcf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 20:51:47 +01:00
Stephen Kelly
26cf615c96 Add the QT_LIBINFIX to the CMake config files.
Change-Id: If7bec54eca2d28cba314ce94a1ab1831c024ad31
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-22 19:25:06 +01:00
Stephen Kelly
58cd93efe6 Remove detection of GCC versions which are not supported anywhere.
Change-Id: If254af51880e20be486b14f5237e6e1d4e4d6af3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 19:25:06 +01:00
Stephen Kelly
f783ec5347 Remove use of Q_BROKEN_DEBUG_STREAM.
No supported compiler defines it, and it was not used consistently
so it didn't work anyway.

Change-Id: Icc9e911e22daaedaee3d9316c15d19be26cd2e72
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 19:25:06 +01:00
Stephen Kelly
4d0d49a92c Use QMAKE_SUBSTITUTIONS conditionals
Instead of generating CMake conditionals.

Change-Id: I3d987cc08666270e618222be9292558e73bc961e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-02-22 19:25:06 +01:00
Friedemann Kleint
541949aed2 Add further theme hints to QPlatformTheme.
- Add hints for QDialog/QDialogButtonBox.
- Add hint for available popup-menu area.
- Add keyboard scheme hint replacing
  QGuiApplicationPrivate::currentKeyPlatform()

Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>

Task-number: QTBUG-24204
Task-number: QTBUG-24315

Change-Id: I6653786b0dcb49a6fc264d3b9891dbfee502bd3e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-22 17:28:51 +01:00
Marc Mutz
53bb87d1d2 QEasingCurve: fix a missing */
Change-Id: I344342e950158c9dc832f1cd181d92899ddb1651
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 17:21:26 +01:00
Stephen Kelly
7d79e99768 Fail with #error early if the compiler does not support bool or explicit.
The fail mode for bool is moved from later in qglobal.h, and explicit is
used unguarded throughout Qt, so the macro is already useless.

Change-Id: Iff26892b025ba155e360a1f2dc93a67a6622dbc1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 16:21:32 +01:00
Robin Burchell
186692f81f Remove custom text codec for C strings.
This setting is extremely harmful, as code cannot know whether or not to expect
it. It also made the behaviour of QString::fromAscii and ::toAscii unintuitive,
and caused a lot of people to make mistakes with it.

Change-Id: I2f429fa7ef93bd75bb93a7f64c56db15b7283388
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-22 14:00:32 +01:00
Samuel Rødal
9d173c9218 Updated QApplication / QGuiApplication to match Qt 5 reality.
Removed obsolete Q_WS_X11/WIN/MAC stuff as well.

Change-Id: I8b65a0348a8cb170f3f060023fc6d9d982949b7e
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
2012-02-22 13:58:39 +01:00
Pekka Vuorela
5d49ca960c Fix typos
Change-Id: Ic0389d36bad001935376fb29d8c925b7ff908e4f
Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com>
2012-02-22 13:54:31 +01:00
Laszlo Agocs
349e04eb7c Migrate evdev plugins to the new plugin system
Change-Id: I7eb283646b7529080c8c2f41c267b0135c8f57e4
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-22 09:46:08 +01:00
Caroline Chao
949b7452e0 CodeCoverage: Move installCoverageTool call.
Call it from qtest_qParseArgs() instead of qExec(). This will allow to
remove the code coverage calls from quicktest.

Both the installation and the saving of code coverage data are now
gathered in testlib.

Change-Id: If3baedb0cff9d894e6f232b947af7e3158703d9d
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
2012-02-22 07:25:49 +01:00
Marc Mutz
f3141c58ba QtCore: add constexpr to geometric classes
This turns code like QPoint(12, 12) into a compile-time
expression, under a C++11 compiler, and allows to define
arrays of these types that end up in read-only memory,
just like PODs would.

Some constructors and QLine::pointAt() needed to be
adjusted to fit into the empty-body/only-return-expression
requirement for constexpr constructors/functions.

Change-Id: Id11ee2752c948930c3e40a91d1f6d7c97db7a373
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 00:07:31 +01:00
João Abecasis
7bbe79fe5f Drop file-engine abstraction from public API
This abstraction imposed serious performance penalties and is being
dropped from the public API.

In particular, by allowing file names to be arbitrarily hijacked by
different file engines, and requiring engines to be instantiated in
order to decide, it imposed unnecessary overhead on all file operations.

Another flaw in the design with direct impact on performance is how
engines have no way to provide (or retain) additional information
obtained when querying the filesystem. In many places this has meant
repeated operations on the file system, where useful information is
immediately discarded to be queried again subsequently.

For Qt 4.8 a major refactoring of the code base took place to allow
bypassing the file-engine abstraction in select places, with
considerable performance gains observed. In Qt 5 it is expected we'll be
able to take this further, reaping even more benefits, but the
abstraction has to go.

[Dropping this now does not preclude that virtual file systems make an
appearance in Qt at a later point in Qt 5's lifecycle. Hopefully with a
new and improved abstraction.]

Forward declarations for QFileExtension(Result) were dropped, as the
classes were never used or defined.

Tests using "internalized" classes will only fully run on developer
builds. QFSFileEngine was removed altogether from exception safety test,
as it isn't its intent to test internal API.

Change-Id: Ie910e6c2628be202ea9e05366b091d6d529b246b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-22 00:07:31 +01:00
jian liang
4b30882a3f Fix potential race condition in data structure of adopted thread watcher
Fix potential race condition in data structure of adopted thread watcher
in Windows. Since QVector is not thread safe, it is not safe to read and
append data to qt_adopted_thread_handles or qt_adopted_qthread
simultaneously in qthread_win.cpp. This patch fix this race condition.

Change-Id: I2d0c7a4cdde5390d38d15c98343f0fc6ddd24aba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-22 00:07:31 +01:00
Richard Moore
28401bf747 Merge overloads
Fixes ### Qt 5

Change-Id: I2846593616635440e17c8a9ce518780561992b84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-22 00:07:31 +01:00
Richard Moore
5f5f9f33be Merge overloads.
Fixes a Qt 5 TODO

Change-Id: Ide3159a5b979bd8e8a1edefff7fccb98dbe9a78e
Reviewed-by: Pierre Rossi <pierre.rossi@nokia.com>
2012-02-22 00:07:31 +01:00
Jonathan Liu
e8ecf3ad03 QElapsedTimer/Win: Fix 64-bit integer overflow
The ticksToNanoseconds function in qelapsedtimer_win.cpp multiplies
ticks from performance counter with 1000000000 which can sometimes
result in 64-bit integer overflow. This can cause the elapsed time to
reset or jump around.

Task-number: QTBUG-23150
Change-Id: I464503e03cbe64e13906e773beafbf88e7dc256a
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f30a91ba9d98de1a0ebee5608ba289ac35871a8c)
2012-02-22 00:07:31 +01:00
Andrew Stanley-Jones
c354b4f12f Fix error in addrlen field
addrlen must be initialize to the amount of space available
in the buffer.

Change-Id: I52945d780bba9d22aeaa7ac5a35a0e54dbea60dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 22:31:00 +01:00
Stephen Kelly
361cd9f9b2 Give the compile flags an EXECUTABLE_ prefix.
The fPIE flag should only be used with executables.

Change-Id: If799ae4a7fe2492af3aac67651659a52d365024a
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 22:31:00 +01:00
Simon Hausmann
1386e68b2b Add GL_BGR to the list of defined GL constants, right next to GL_BGRA
We use this one in WebKit's OpenGL texture mapper and it would be
convenient to have it here if it's not defined by the platform.

Change-Id: Idae33e49773e21c6290b164bccd4f209cf9820a2
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-21 22:31:00 +01:00
Oswald Buddenhagen
249489d141 regenerate unicode tables after rittk's patches
Change-Id: I60b416fc2dc2f0ccbcf13288a9ba2a42547269ec
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
9514138a5c optimize QString::toLower()/toUpper() for special cases, step 2
from now, QUnicodeTables::specialCaseMap[] starts with a placeholder; so,
if somethingCaseSpecial is true, then somethingCaseDiff is always greater than 0

Change-Id: Ibb1870512836eee71b1521564c0745096c05b2f9
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
5f04962132 optimize QString::toLower()/toUpper() for special cases, step 1
reorganize QUnicodeTables::specialCaseMap as follows:
specialCaseMap contains sequence entries in form { length, a, b, .. }

Change-Id: Iea1f80bc2f4dc1f505428dad981cde26daaa52c7
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
20faf6408a optimize QString::toCaseFolded()
use the codepath similar to QString::toLower()

Change-Id: Ica1948c5e9c82199307d9f823e07d42b50d59480
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
34be7e1625 optimize handling of surrogate pairs in toLower()/toUpper()
high surrogate part never changes on upper/lower casing
(which tested explicitly in the qunicodetables generator),
thus we can copy the high surrogate part in the loop

Change-Id: I24642b35eea7596c6ad494f2a7bc670f10b759a8
Merge-request: 70
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Olivier
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 22:31:00 +01:00
Konstantin Ritt
432a756048 replace 'const QChar &' with 'QChar ' where appropriate
as QChar is actually an ushort and there is no point in taking its
address.

Merge-request: 69
Change-Id: Idcc9d621e5627514ade006aa12a789a88929d48b
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 21:05:25 +01:00
Bradley T. Hughes
c8160ea1db Move QSysInfo out of qglobal.h and into a separate header
qsysinfo.h is still included by qglobal.h, but it may be possible
to remove the include from qglobal.h and instead include qsysinfo.h
only where needed (e.g. qendian.h, qdatastream.h).

Change-Id: Ifa2c72e0dae206d88eaa192e15a906297673c048
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 19:33:16 +01:00
Marc Mutz
ca588f40db QEasingCurve: implement copy assignment operator inline
Implement the copy-assignment operator inline, using the
copy-swap idiom. This makes assignment strongly exception
safe, but also simplifies maintainence, because op= is
formulated in terms of the copy constructor now.

Change-Id: I803c9100a520d659b685992237cb76fd114222c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 19:15:48 +01:00
Shane Kearns
3f91cde588 Test for QT_NO_SSL instead of QT_NO_OPENSSL
Change the ifdefs in our own code (except openssl backend) to use the
new configure flag.

Change-Id: I8774734771c66b22164b5fae8fdb27814ac3df7b
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-21 15:28:40 +01:00
Shane Kearns
49a7c2fe6e Make https requests fail fast when configured without ssl support
Restored the Qt4 behaviour where attempting a https request using
QNetworkAccessManager fails with ProtocolUnsupportedError instead
of timing out or hanging.

Covered by existing autotests.

Task-number: QTBUG-17189
Change-Id: Iceb1ba6558c7d2b1af8ddf8d4ea9315a5b44d970
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-21 15:28:40 +01:00
Marc Mutz
ae445b20fa QEasingCurve: simplify and fix copy constructor
The copy constructor used the default Private constructor,
followed by the application of the compiler-generated
copy assignment operator, and finally replaced the config
member with a copy of itself.

This is needlessly inefficient.

Worse: it's incorrect: if config->copy() throws, then
*d_ptr is leaked.

Solution: implement the copy constructor for Private,
and use it in the copy constructor of the public class.

Effect: everything that can throw now prevents the new
Private class from being created, and the compiler ends
up cleaning up after us.

Change-Id: I09ed18bb39ee7cd81aaa8ba01676fc202502a8e3
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
60f7473782 QHash: more robust use of qDebug()
I'm sure 'line' can't contain anything resembling a format string,
but better safe than sorry.

Change-Id: I0aa0f4a5a03d97b18d6a866c27fa721fcbe0f77b
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
3a8da4a484 QEasingCurve: implement move constructor
The move constructor sets other.d_ptr to zero. This is safe, because
after being moved from, the object is left in a state in which it
can be safely destroyed (delete nullptr is a no-op).

It cannot meaningfully be used anymore (most members will crash with
a nullptr dereference), but in most cases, the moved-from object
cannot be accessed anyway (not a named object), and if a named object
is moved from, it must have been through explicit std::move(), as in
the test case.

The STL makes better guarantees (moved-from containers are .empty()),
but I don't think it's worth introducing a null state into
QEasingCurve just for supporting a use-case that should be
considered a bug anyway.

Change-Id: I4115b7386cdea6960507da6843a0d0196d8e4139
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
6a6178702e QEasingCurve: implement move-assignment operator
Implemented as in QPen etc.

Change-Id: I65b43c6ec7308ca4b44f614594c15c41ab2f89f9
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
5d6b2d5e34 QEasingCurve: add member-swap
Implementated as in QPen etc.

Change-Id: Ia08551bf7902b60e115d1b1d2353030597e34841
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-21 15:28:40 +01:00
Marc Mutz
689311a568 QEasingCurve: mark as Q_MOVABLE_TYPE
The private data doesn't contain any back-links to the public
class, afaics. So QEasingCurve qualifies for movable.

Change-Id: Id8ab186fc0a25740458341256b53425dc40bce37
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 15:28:40 +01:00
Tor Arne Vestbø
95c759ee0c Use requested window format to match rest of the patch in 38257651
Otherwise we end up with an error at runtime:

  QEGLPlatformContext::makeCurrent: eglError: 3009, this: 0x4b5c58

Change-Id: I1e794f427243e40f0a8f572a936b9fb756e89f8a
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-21 14:01:29 +01:00
Harald Fernengel
c69106d1bf Rename Q_MUTEX_LINUX to QT_LINUX_FUTEX
As requested by Thiago

Change-Id: Ie5b00cf4e530e19d360d0bc588f0f051e04b338f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-21 13:52:52 +01:00
Friedemann Kleint
4fad7ae76a moc: Fix loading of plugins in release mode.
Generate the plugin meta data with "debug" set to false/true
in two code sections #ifdefed QT_NO_DEBUG.

Do not use the value of QT_NO_DEBUG set at moc compile
time which does not work in release mode/Windows.

Change-Id: I0252795ed063bebb2c3b3784f880e64845b5b7e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
2012-02-21 13:49:02 +01:00
Friedemann Kleint
b071aeccc0 Streamline QPalette initialization code.
Share the brushes to reduce memory usage by QBrushData.

Change-Id: I04044b4c54b1f6a35a73d8bb4d299661ec0136a5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-21 13:30:46 +01:00
Friedemann Kleint
4e4fd63371 Use new plugin system for Input Context plugins.
Change-Id: Ifd1f63499afba546a745815762263a58ebf66460
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-21 12:54:07 +01:00
Thorbjørn Lund Martsum
13f3346d34 QHeaderView - create a union to save some space.
Beside saving some space it also ensures a bit faster vector operations
(remove and insert memcpy) - and lower the risk for a cache-miss.
(Many operations seems to be about 5-10% faster in the benchmark).

Change-Id: If8109e2146c25f642015906375dfbb449706ce8e
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 12:52:00 +01:00
Thorbjørn Lund Martsum
a4e4c31007 QHeaderview - many sections removed performance boost.
When the QHeaderView model rowCount is decreased then the headerview
needs to remove some sections.

If e.g swapSections had occured then qheaderview before this patch did
a very slow removal by removing one section at a time and for each section
it restored visual and logical indexes.

By temporarily storing the logical index on the section we
can reduce the execution time of this a lot. The old code is only
faster when we remove one index (and is kept for that situation)

There is a complexity in difference (and many factors in our
qheaderview benchmark (the trunc part))

Change-Id: If45eab17fbca3364d458b004980570b5d013e4bd
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-21 12:51:46 +01:00
Bradley T. Hughes
84438a77cc Remove qMacVersion()
Add QSysInfo::macVersion() instead, to match the windowsVersion()
function.

Change-Id: I783e59583ca21653d25586156cbb0cb1f301868b
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-21 12:48:04 +01:00
Richard Moore
4dabe78387 Remove many unneeded virtuals.
Cleanup a ### Qt 5 TODO.

Change-Id: I384e868ecc3ca4d80e4e71bb54d402f4ec1337a8
Reviewed-by: David Faure <faure@kde.org>
2012-02-20 22:06:50 +01:00
Richard Moore
83176f27a4 convert length functions in QDom from uint to int.
Fixes a ### Qt 5

Change-Id: I7a385f2b704d38ae626094f27b06a918d4a9bc48
Reviewed-by: David Faure <faure@kde.org>
2012-02-20 22:06:36 +01:00
Richard Moore
4c05bc811c Merge overloads.
Fix a ### Qt 5 by merging the overloads.

Change-Id: If33e7592191c81b32caa6d68c73dbf2282437886
Reviewed-by: David Faure <faure@kde.org>
2012-02-20 22:06:24 +01:00
Andreas Holzammer
451bc47407 Include qt_windows.h for Windows CE.
The include is needed for OutputDebugString,
as it is defined in winbase.h. To include
use the centralized header.

Change-Id: I486da20d7b054cee352be085e65a0ede1394653d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-20 19:52:57 +01:00
Xizhi Zhu
2b50e20578 Merges several overloaded functions in QCoreApplication.
The source compatibility is kept.

Change-Id: If66053b271d65062b3c0ce6ec66c8394a37b4e3e
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-20 19:51:41 +01:00
Shane Kearns
4bb020f50b Windows - fix connecting to a socket using IPv4 mapped IPv6
Connecting to an IPv4 mapped IPv6 address (e.g. ::FFFF:127.0.0.1)
requires the IPV6_V6ONLY socket option to be cleared.
This was causing tst_qtcpserver::ipv6ServerMapped autotest to fail.
The same change is not required on MacOS X - the test passes there.

Task-number: QTBUG-24351
Change-Id: I6c08b19f0daa12765da2d44792ffb17299322695
Reviewed-by: Markus Goetz <markus@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-20 18:20:20 +01:00
Friedemann Kleint
054114a459 Remove QPlatformIntegration/QPlatformTheme from QGuiAppPrivate.
Forward-declare instead.

Change-Id: I3851994e8bc05b389e94e948478339ba33d521c1
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-20 16:52:59 +01:00
Jan-Arve Saether
d1dd2b2441 Remove QAccessibleInterface::relationTo().
QAccessibleInterface::relations() replaces both relatedTo() and
some of the RelationFlags that navigate() handled before.

Change-Id: I4b9d2c28ba3d753efe7cc9bfa0ad68bed3ee02fd
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-02-20 15:17:08 +01:00
Kent Hansen
bdc7756617 Port QDBusAdaptorConnector meta-object to revision 6
We want to drop support for old revisions in Qt 5.

This commit brings the QDBusAdaptorConnector meta-object in sync with
current moc output.

The QtDBus implementation was assuming that the relaySlot() slot
would be created at index methodOffset() in the meta-object, but
since revision 4 that's no longer the case (signals always come
first). Made the code more robust by actually querying the
meta-object what the index is.

Change-Id: Ie0791680cc2e9e5fb1472c4462c391f92ea22ea6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-20 15:17:08 +01:00
Kent Hansen
441f89befa Remove unused QtDBus meta-object extensions
The inputSignature and outputSignature fields were not being used
anymore.

All tests still pass.

Change-Id: Icbc8fdcd5179a2b1b4843d58b90af925f6bef133
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-20 15:17:08 +01:00
Marc Mutz
f9327fecc1 QPoint/QPointF: inline manhattanLength(); QLineF: inline isNull()
There's no reason for them not to be, and it's a prerequisite
for making these functions constexpr.

Change-Id: I03c9965147b51014c7af60a4c2d7f25a3f6e21a7
Reviewed-by: David Faure <faure@kde.org>
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
2012-02-20 15:17:08 +01:00
Bradley T. Hughes
3c21a62cbe Move QTypeInfo out of qglobal.h and into a separate header
qtypeinfo.h is still included from qglobal.h, and defines QTypeInfo
as well as all the specializations for built-in and default Qt types.

Change-Id: I24116174de288a730cbb7aa2f80d346d2b2f9408
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-20 15:17:08 +01:00
Samuel Rødal
b0a803213e Added note in QPlatformWindow::setGeometry() docs about position policy.
Change-Id: I0ac76b7aac1aa717592c34f414b1dd8fbee92be2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-20 15:17:08 +01:00
Marc Mutz
49b08f96e8 uic: use QStringLiteral() instead of QString::fromUtf8() where applicable
Many (most?) strings written aren't in fact UTF-8, and we can check at
compile-time which are and which aren't, so don't hard-code fromUtf8()
but use the much more efficient QStringLiteral() where applicable.

This is low-hanging fruit. This patch only optimises US-ASCII string
literals, not those that are latin-1 or even UTF-8, because that would
require more extensive changes to the original fixString() function.

Likewise, there are also other calls to QString::fromUtf8() being
generated (e.g. in the pixmap code) that could benefit from being
turned into QStringLiterals, but their code paths are more involved
than those this patch fixes.

This patch at least suffices in turning all the setObjectName()
arguments into QStringLiterals, which was the main goal.

The autotest baseline has been updated with the new expected results.

Change-Id: Ic1ef67f500f9ff92d36164d515f4e004ef2a10bc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-20 15:17:08 +01:00
Joerg Bornemann
f8d6a164de fix QProcess for Windows XP
CreateNamedPipe supports the flag PIPE_REJECT_REMOTE_CLIENTS since
Windows Vista. On earlier Windows versions the system call would fail
with ERROR_INVALID_PARAMETER.

This does not open a security hole on Windows XP as there can be only
one pipe instance.

Change-Id: I5a1c7fdf756678009857317c7b563c884afeef2c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-20 13:28:34 +01:00
Jan-Arve Saether
d2f1901807 Remove QAccessibleInterface::navigate()
This is replaced by parent(), child() and relations()

Change-Id: Iabff6ec56176a1ca8465d6480860f6e0174fd134
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-02-20 11:46:16 +01:00
Harald Fernengel
46bfd84fdc Use standard unix mutexes on LSB
LSB doesn't allow syscalls, so fall back to the normal _unix
implementation

Change-Id: I8aba6147da8b46e3f85b0454cf9aca219811c9fe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-20 11:45:01 +01:00
Kent Hansen
4a0565b443 Move QMetaMethod::parameterTypes() implementation to helper function
Because of an upcoming change to the meta-object data format, the
ability to extract parameter types from a signature will be needed by
meta-object builders (such as QMetaObjectBuilder) soon.

Change-Id: I1f21b2be41761a5db2f1a05976fad29eb3aebb03
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-20 11:29:54 +01:00
Kent Hansen
f83724a0f2 Port QSignalEventGenerator meta-object to revision 6
We want to drop support for old revisions in Qt 5.

This commit brings the QSignalEventGenerator meta-object in sync with
current moc output.

Change-Id: Id5f4954b08cf49169850bd77543b2a7ab8274c18
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-20 11:29:42 +01:00
Kent Hansen
989670737f Use QMetaMethod::isValid() to check method validity
The signature() method will soon be replaced by a function that
returns a QByteArray rather than a pointer, and calling it will be
more expensive than calling isValid(). Plus, isValid() looks nicer.

Change-Id: I6844988c84dcadf876fc86bc71c8b310a21f88de
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-02-20 11:29:03 +01:00
Kent Hansen
5640b0b443 Add QMetaMethod::isValid() function
This function provides a proper way of determining whether a function
returned by QMetaObject::method() is valid. (Checking whether
signature() returns a 0 pointer, which e.g. testlib does, is not an
ideal API -- especially given that signature() will soon be removed
and replaced by a function that returns a QByteArray.)

Change-Id: I644f476b09904925f2042945f5d0ad744482b682
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-20 11:28:38 +01:00
Kent Hansen
9c1680a7ed Fix typo in QByteArray(QConstByteArrayData) constructor
There is no "str" member in QConstByteArrayData, it should be "ba".

Change-Id: Ife76460e9332733480c1ceded21e78388656092d
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
2012-02-20 11:28:28 +01:00
Kent Hansen
3d2c8d76ec Don't call metaObject() several times
It's sufficient to call it once per invokeMethod.

Change-Id: I1db826027eca87c799f216d65e27c801a23e64e2
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-20 11:28:18 +01:00
Kent Hansen
44ab16f93d Small moc cleanup: Pass lists by const reference
generateFunctions() shouldn't (and doesn't) modify the list of
functions, so the list should be passed by const reference.

Change-Id: If5ff810e5623e734816c3089eb8b3fd4f54f2345
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-20 11:28:10 +01:00
Kent Hansen
fec37f0e9a moc: Get rid of implicit conversions to const char *
moc mostly operates on QByteArrays. When an actual const char * is
needed, it should be explicit.

Change-Id: I0b3e262830128306688f4512a4b59ce8966c2579
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-20 11:28:04 +01:00
Kent Hansen
cbe21c59a0 Minuscule moc cleanup: Don't declare i in function scope
This is not C.
Furthermore, the function-level i was already shadowed in several
places by "for (int i = 0; ..." blocks later in the function.

Change-Id: Ic1777f78d9838bc2921d68337be05de454bbeabe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-02-20 11:27:55 +01:00
Jonathan Liu
7d8f5777be Fix compilation with MinGW-w64
This fixes a "cast from 'void*' to 'int' loses precision" error and adds
a missing argument to qWarning.

Change-Id: I38544c4e317a3f6d1ecf26ebb3e35c66b1878d24
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-20 09:37:24 +01:00
Bradley T. Hughes
3cb078a23c Rename Q_PROCESSOR_POWERPC to Q_PROCESSOR_POWER
IBM's POWER and the PowerPC architecture have been merged into a single
ISA, the Power ISA (see http://www.power.org). Use this unified name in
Qt.

Change-Id: Ia41492b0031d890843e43c5f7ecd1e60c65bb75b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-20 09:36:51 +01:00
Holger Hans Peter Freyther
52072a8c8a qwidget_p.h: Remove DontSetCompositionMode from the internal flags
This flag was used by QWS to set or not set the composition mode
when filling the background. E.g. this was used by 'transparent'
windows to set the alpha bits. QPA didn't have this enabled in 4.8,
the code paths are gone in Qt5 and it is the responsibility of the
QPlatformBackingStore to initialize the alpha bits properly.

Change-Id: I4011d842b718d6a40b19922b5f75c597e63079c8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-20 09:36:51 +01:00
Holger Hans Peter Freyther
3ad9896361 qpa: Verify that the platform returns a WId that is not WId(0)
This is motivated by visiting a customer that re-implemented the
::winId method and returned WId(0) that resulted in a crash. Currently
there is only a comment inside the implementation of the ::winId
default implementation. Add a note to the API documentation, add
a Q_ASSERT to check if our assumption holds true.

Change-Id: I8607a4efc4f561f7849c976cd2454f6fbcb20eaa
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-20 09:36:51 +01:00
Richard Moore
ad1a013878 Remove dead method.
Fix Qt 5 TODO

Change-Id: I9a12cc07ebc7c039bbeb53922b0539f177b226f8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-20 09:36:51 +01:00
Jason McDonald
eb52d78e90 testlib: Report one test result per benchmark test.
Prior to this commit, a benchmark test could report 0..n passes and 0..m
fails or skips, where n is the number of accumulation iterations used to
collect benchmark data and m is the number of times the test function
was invoked.  Depending on the type of benchmark measurer being used,
this could result in a very large volume of test output and inconsistent
pass, fail and skip counts between test runs.

This commit changes the behaviour so that each benchmark test reports
one pass, fail or skip, regardless of the number of iterations used to
collect benchmark data.

This commit also prevents benchmark data being reported in the test
output if the benchmark test failed or skipped, as any benchmark data is
of dubious value in such cases.

The latter change in behaviour requires a minor modification to the
badxml selftest, which now tests quoting of literal strings in xml test
output for both passing and failing benchmarks.

Finally, this commit also adds a new selftest specifically for verifying
correct behaviour for benchmarks that fail or skip.

Task-number: QTBUG-24313
Change-Id: I3426dc659a7511b62fd183a031c7235bc753f497
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 08:05:58 +01:00
Jason McDonald
f64f428b81 testlib: make XPASS output slightly less confusing.
Prior to this commit, when an unexpected pass occurred the test output
showed the message "XPASS : tst_foo::function() 'expr' returned FALSE",
where the problem was actually that the expression evaluated to true
when it was expected to be false.

This commit changes the output to make it clear that the expression
evaluated to true unexpectedly.

Task-number: QTBUG-22118
Change-Id: Id22c178073d3b75789675ca37a8ef019029b1f91
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-20 03:27:02 +01:00
Andrew den Exter
02140e973b Remove unnecessary image height adjustments from layout.
cb8445f032 removes an implied +1 from
document line height so we need to remove the compensating -1 from
image ascent/descent for image heights to be correct..

Change-Id: I310c06bcf1ce2eefef42c2828faa0eb435ad71cf
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
2012-02-20 01:57:38 +01:00
David Faure
b164911b7f Import QMimeType / QMimeDatabase into QtCore.
History of the development before the import:
ssh://codereview.qt-project.org/playground/mimetypes.git

Mimetype definitions come from shared-mime-info where available (UNIX systems),
loaded using a mmap'ed binary cache generated by update-mime-database.
As a fallback if no cache is found, we parse the raw XML files otherwise.

This makes the MIME type support fast and with very low memory usage on UNIX,
and it makes it easy to use on Windows (no dependency on shared-mime-info,
Qt even includes a freedesktop.xml file to use if none are found on the system).

Change-Id: I27b05008216ff936dc463bd80d3893422bfb940e
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-18 22:19:43 +01:00
Gunnar Sletta
2e4d8f67a8 Introduced QWindow::isExposed().
The visible property along with show/hideEvent tracks the
windows visibility from the application perspective and is
really a request. The exposeEvent() along with the isExposed()
accessor is used to notify the application of the actual
state of the window in the windowing system.

Change-Id: I7f5b7ed74a168e34aaa21ce0ae9042ddfb0bf6d8
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-18 20:45:23 +01:00
Thorbjørn Lund Martsum
466107107a Adding hasHeightForWidth as a virtual Widget funcion
Just implements what the note states (and removes the private function)

Change-Id: I9a6fd5134460712accf09ba01691df8b9b1f5d0d
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-02-18 18:40:15 +01:00
Andrew Christian
908a080006 Added error reporting to QJsonParser
Change-Id: Ib2390c0faf1ed7ada3fc185abce83740ad112929
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-18 18:08:06 +01:00
Marc Mutz
f63b23afda QEasingCurve: return QVector for cubic spline representation
QEasingCurve internally holds the spline data in a
QVector<QPointF>. For the return from cubicBezierSpline(),
the vector is transformed into a QList<QPointF>.

This involves copying, and into an inefficient (for QPointF
payloads) container at that, so deprecate cubicBezierSpline()
in favour of a new toCubicSpline() returning the QVector
directly.

Change-Id: Ie4827fe7c6e289ad97a0b09772e47298779c76ca
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-18 18:07:23 +01:00
Richard Moore
1703558330 Trivial doc fix
Change-Id: I9b63e0b63f225b245eec68ea4211cb0f2ccf9bb5
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
2012-02-18 13:13:22 +01:00
Bradley T. Hughes
7e2afb9168 Document Q_PROCESSOR_* macros
All known processors and their variants/revisions are documented. I
added Q_PROCESSOR_MIPS_V based on the MIPS64 online documentation, which
documents MIPS64 as a superset of MIPS IV and MIPS V.

Change-Id: Ie2796d4f03499283aa2c96d60f5e37bd74a36ab0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-02-18 02:32:46 +01:00
Friedemann Kleint
e0d9fade03 Fix qclipboard autotest on Windows.
Emit changed signal only if the clipboard is not owned,
in which case QClipboard does it.

Task-number: QTBUG-24184
Change-Id: I27420583a718a5f8cd93b9d361b1e422a75df300
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-02-18 00:00:21 +01:00
Shane Kearns
844b096d67 Fix error handling in QHostInfo windows backend
If the DNS server returns a non authoritative host not found response,
then windows returns WSATRY_AGAIN error code.
This is now reported as HostNotFound and not UnknownError

Change-Id: I212985acd4e85ff4b2bdb6c57ec403405a7695fb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-17 20:23:25 +01:00
Friedemann Kleint
400c865f29 Windows: Fix QWindow-test.
- Save & Restore style and geometry when switching to
  full screen and back since it is not a real state on
  Windows.
- Obey the positioning policy in setGeometry.

Task-number: QTBUG-24185

Change-Id: I18dea4fd372e0b2e46273a7a27e0c6f4f4bde771
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-17 20:09:58 +01:00
Rick Stockton
3ca194eb12 qnamespace.qdoc: Add doco for new values of Qt::MouseButton
QtTBUG-22642 added about 25 new values for the Qt::MouseButton Enum.
This change adds documentation for the new values. Note that the
special value 'Qt::AllButtons' is documented at the top (next to
the other special value, 'Qt::NoButton'.) The new internal value
'Qt::MaxMouseButton' is listed as a \omitvalue.

Task Number: QTBUG-22642

Change-Id: Iaec623754156fff8a2c73e357fef82e1fe36354b
Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-02-17 19:52:30 +01:00
Stephen Kelly
1b08a48588 Only define QT_NAMESPACE if it is used.
Fixes non-namespaced builds.

Change-Id: I0ec3c29f58042313dfa864f15c2b2d47914cdedb
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-02-17 16:42:28 +01:00
David Faure
7e970eb58c Ensure that Qt public headers compile with strict flags
Those from
http://wiki.qt-project.org/Coding_Conventions#Conventions_for_public_header_files
(unfortunatey -Wold-style-cast cannot be used due to the glibc macro bswap_16)
and many Qt defines that disable casts.

Change-Id: I97ac707a101df9819e8c031fa75a31b30e20247f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 16:42:28 +01:00
Rafael Roquetto
77172b25fe QProcess documentation typo fix and improvement.
The word 'momentaneously' does not exist.

Change-Id: I3d2201d5b7b3a01af5989bb1c3fcd55110d5482c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Till Adam <till@kdab.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-02-17 16:42:28 +01:00
Simon A. Eugster
45053fffc4 Mention QT_NO_STL in the QString documentation
Defining QT_NO_STL disables STL functions (toStdString() etc.) too.

Change-Id: Id5c8e12d933af6af63ee7f80fa2d5d7577cd689a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 16:42:28 +01:00
David Faure
e5bcb4844d No need to stat with QFile::exists before QFile::open, for reading.
Change-Id: I14ca7f8a377bca39004defc96d69d62c151181f5
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Jeremy Katz <jeremy.katz@nokia.com>
2012-02-17 16:42:28 +01:00
Shane Kearns
aee4cbf22a Remove unnecessary locking from QNetworkProxy constructor
QGlobalNetworkProxy (a singleton) had two phase construction, with
the second phase being called from QNetworkProxy's constructor.
This isn't necessary, and has been reported as causing deadlocks.

Although constructing socket engine handlers has side effects
(they add themselves to a list on construction and remove themselves
on destruction), this appears to be safe. The socket engine handlers
are only used while holding the list mutex, and any socket engines
created don't have any reference to the factory that created them.

With the new version, it is possible that two instances of
QHttpSocketEngineHandler and QSocks5SocketEngineHandler exist
temporarily if a Q_GLOBAL_STATIC initialisation race occurs.
This appears safe, because the loser of the race deletes its
handlers, which remove themselves from the global list as above.

Task-number: QTBUG-13088
Change-Id: I8cf520da717d8ab7d862ab89c6de13aea6d60ac3
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 15:04:22 +01:00
Friedemann Kleint
d5a65cb526 Fix warnings about missing file.
Change-Id: I8644d2b80bab9c18f666d742da389e84bf3f124c
Reviewed-by: Xizhi Zhu <xizhi.zhu@nokia.com>
2012-02-17 15:04:19 +01:00
Shane Kearns
b4a538ea1c Fix handling of urls containing username/password in QNetworkAccessManager
QNetworkAccessManager was ignoring the supplied credentials, although
webkit seems to support these urls at a higher level.

Following the behaviour of browsers:
We use supplied credentials if authentication is required.
We add supplied credentials to the authentication cache.
We emit authenticationRequired signal if the credentials were wrong.
We do not use previously cached credentials for that url

Synchronous http requests fail, if the credentials were wrong.

Task-number: QTBUG-18107
Change-Id: If46e8eab1511ba8a0f4bbe0d4efaabc4df0b8ab4
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 15:04:07 +01:00
Shane Kearns
d425a0dad3 Fix incorrect use of QObject::disconnect in synchronous http request
In certain circumstances, this could cause the request to time out
(and repeatedly send bad authentication credentials to the server)
instead of failing with AuthenticationRequiredError.

Change-Id: Iff66b32f1d7268f21fd77b6620aae4b5d49d857f
Reviewed-by: Richard J. Moore <rich@kde.org>
2012-02-17 15:03:53 +01:00
Shane Kearns
6f7bd6532d Update documentation to show NTLMv2 is supported
This feature was implemented in 4.8, but documentation was not
updated at the time.

Task-number: QTBUG-18181
Change-Id: I657d7ab7aaf43b73b7bf8fd1cb76086522cf5c2b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-02-17 15:03:18 +01:00