Commit Graph

3460 Commits

Author SHA1 Message Date
Miikka Heikkinen
62a654cc90 Fix QApplication autotest crash when running on multiple screens
Screens need to be destroyed in reverse order to ensure the primary
screen stays valid when other screens are destroyed.

Task-number: QTBUG-24300
Change-Id: I9d9d710aa67ec045baa8bf292833ffe7d9eea935
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
2012-03-02 14:45:23 +01:00
Friedemann Kleint
099029a342 Fix QPixmap::grabWidget() on Windows.
Do not draw on the backingstore DC when drawing
to a pixmap. Access the paintdevice for checking via
the QPaintEngine since QPainter returns the clipdevice,
which is a widget.
Fix warning about accessing handle of 0-window in the
test.

Task-number: QTBUG-24183

Change-Id: Ie91ea6ab9d09528c7ec1d35633f9a0ee667719b1
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-02 14:44:00 +01:00
Stephen Kelly
fb8c95bac0 Automatic metatype registration of two-template-argument types.
This commit is complimentary to the commit which introduced a similar
partial specialization for single template argument types:
6b4f8a68c8

If T and U are available as metatypes, then QHash<T, U> is too.

Change-Id: I09097b954666418b424c8c23577032beb814343a
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-02 13:22:54 +01:00
Rick Stockton
d505886dd6 Support 16+4 mouse buttons within the generic/evdevmouse plugin.
The Kernel's evdev module is capable of presenting up to 16 mouse
buttons, plus wheel events (UP, DOWN, LEFT, and RIGHT). This
patch updates our Plugin, so that it tranlates all of those button
numbers into corresponding MouseEvent Qt::MouseButton values.

Task-number: QTBUG-24590

Change-Id: Ib8cbb9500280c76f06a51ce95095e22ae84de1c6
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
2012-03-02 10:03:16 +01:00
Jason McDonald
51296085b9 testlib: Improve documentation of verbose test logging options.
Change the help output to show which options only work for plain text
logging.

Change-Id: I39eb7cd0793cdbe553c230334c6cd532b4929f61
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-03-02 01:06:22 +01:00
Laszlo Agocs
88374c7963 Add protocol type B support to the evdevtouch plugin
Also adds optional support for libmtdev (a helper library which
translates transparently from type A to B when using type A kernel
drivers).

Change-Id: Ic9c065b2fd130e9db2dd07e7dc103e9d45c08c99
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-02 01:06:22 +01:00
Oswald Buddenhagen
012f799254 revamp -sysroot and -hostprefix handling
instead of being a variable added to the makespec (via qconfig.pri),
QT_SYSROOT is now a property.

the QT_INSTALL_... properties are now automatically prefixed with the
sysroot; the raw values are available as QT_RAW_INSTALL_... - this is
expected to cause the least migration effort for existing projects.

-hostprefix and the new -hostbindir & -hostdatadir now feed the new
QT_HOST_... properties.

adapted the qmake feature files and the qtbase build system accordingly.

Change-Id: Iaa9b65bc10d9fe9c4988d620c70a8ce72177f8d4
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-01 23:18:23 +01:00
Oswald Buddenhagen
6663b5ebac exclude some code from the qmake build
Change-Id: Ic989a2cc5106496a2c5f13c863a0a87d5cd2d963
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-01 21:00:18 +01:00
Oswald Buddenhagen
8c7aa37aa7 dispose of BOOTSTRAPPING define
this is used only in qmake, not in other bootstrapped tools

Change-Id: Ie2841e69dbd82c86d2297ddf51443ee75760766c
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
2012-03-01 21:00:13 +01:00
Jan Arne Petersen
022ff04a6b Unset _NET_WM_USER_TIME_WINDOW before destroying the window
Otherwise metacity was crashing when a QWindow was destroyed immediately
after being activated, because metacity was trying to select events
(XSelectInput) for the already destroyed m_netWmUserTimeWindow.

Task-number: QTBUG-24492
Change-Id: Iedbe7bdd6b26110ca8bec6f33525209ae551ffd5
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-01 19:00:15 +01:00
Albert Astals Cid
e51e7b851f Take into account input shaping in findRealWindow
In previous commits we took into account bound shaping, but X also
supports input shaping, so make sure it's inside both input and bounding
shaping to consider the position as inside a window

My tests show that when unset Bound Shaping and Input Shaping return the
rectangle of the window itself, so we need to be inside both of the
rectangle sets to consider the position as a dragabble position for the
window

Change-Id: I77973e51168d2a6d274d166f29f32e1bc02c32c3
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-01 19:00:15 +01:00
Marc Mutz
a1c75534a4 QtGlobal: remove qIsDetached()
There's not a single in-tree user of this function, and
the concept is a broken one in MT programs: By the time
qIsDetached() returns, the result can already be
different due to another thread taking a copy, or a
copy in another thread being destroyed (note that this
doesn't require mutex use by the user, since we promise
(implicitly, if not explicitly) that you can copy from
const objects without holding a lock).

QTBUG-10813 talks about a use in QCache::trim(), but
677cf76340 removed it, so
there's no reason to keep it anymore.

Change-Id: I20380c12bdf00ac764b89d84392f0f34727b1971
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-01 17:03:29 +01:00
Marc Mutz
d3eb877951 QInputMethodEvent::Attribute: mark as Q_MOVABLE_TYPE
Change-Id: Ifb41afdcf17fa8192f37b4900c59e81d4e0bf60f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-01 17:03:29 +01:00
Jiang Jiang
933e35ae7e Revert "Don't render glyph with FT with fetchMetricsOnly"
Report https://bugs.webkit.org/show_bug.cgi?id=79561 shows that
this commit will cause significant slow down in text handling
operations. Though the exact reason is unknown we should revert
it first and find out the reason later.

This reverts commit 692064bcfd.

Change-Id: I16a56c3093bdfa2119ab6a6e9049ef2925468e29
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2012-03-01 16:43:37 +01:00
Bradley T. Hughes
d964981252 Remove ARMFPA support and Q_DOUBLE_FORMAT detection
Remove the -armfpa option the config.tests/unix/doubleformat*
detection. The places where we used QT_ARMFPA and Q_DOUBLE_FORMAT
has been removed as well.

Rationale: ARM FPA with GCC does not work with EABI. Qt currently
does not support compiling without EABI, making ARM FPA an
impossibility. It is unknown whether other compilers provide ARM FPA
support with EABI. Support for ARM FPA can be re-added in the future
should the need arise, but since ARM VFP is available for ARMv5 and up,
we should encourage implementors to instead use soft-floats or VFP.

Change-Id: I3671aba575118ae3e3e6d769759301c8f2f496f5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-01 16:26:55 +01:00
Pierre Rossi
cc78f47778 Allow using multi fontengine in QTextLayout with QRawFont.
This change enables us to instantiate a QFontEngineMulti that takes
the raw font's font engine as its primary engine but can use fallback
engines based on the platform. Since this can be quite expensive, we
defer the query for fallback families' names until it's needed and
we cache the resulting multi font engine.

Change-Id: I390dbc1cb2fe61d56867f29a03f313eb3eb49dc3
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2012-03-01 15:47:24 +01:00
Pierre Rossi
10ac807085 Add support for QRawFont in QTextLayout.
The purpose of this change is to allow shaping complex
text while using QRawFont.
This is needed for WebKit so that we can switch to
using QRawFont everywhere and be more in line with
what other WebKit ports do.
Since this change slightly bends the aim of QRawFont,
let's reserve this for internal use for now.

Change-Id: I5ec0881f50ce288350bd277570cb5f1fb70c355c
Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
2012-03-01 15:47:09 +01:00
Friedemann Kleint
6e483e8385 Windows: Use correct drop data in processDrop().
Fix Qt Designer Drag & Drop.

Change-Id: Iabed622efc5e23080f7a91b8d9e433e2c0cee063
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-01 15:44:43 +01:00
Marc Mutz
15c141511f QPair: specialise QTypeInfo based on the typeinfos of its arguments
Specialise QTypeInfo<QPair<T1,T2>> based on the properties of
T1 and T2:

- If either T1 or T2 is Q_COMPLEX_TYPE, so is QPair<T1,T2>.
- Otherwise, if either T1 or T2 is Q_MOVABLE_TYPE, so is QPair<T1,T2>.
- Otherwise, QPair<T1,T2> is Q_PRIMITIVE_TYPE.

Change-Id: I8aecbd37e3b7924f77f38967498deabf1a19ca24
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-01 14:26:06 +01:00
Morten Johan Sorvig
30974151c1 Cocoa: Implement QPlatformTheme:palette()
Causes a new test failure in QGraphicsProxyWidget::updateAndDelete,
expand the EXPECT_FAIL to cover that one as well.

Change-Id: If9da757206445d17510c4fac82a559de7b8c0563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-01 13:55:49 +01:00
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