Commit Graph

3582 Commits

Author SHA1 Message Date
Lars Knoll
96232be146 Merge remote-tracking branch 'origin/api_changes'
Conflicts:
	dist/changes-5.0.0
	mkspecs/features/qt_module_config.prf
	qmake/project.cpp
	qmake/property.cpp

Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
2012-03-04 21:45:05 +01:00
Olivier Goffart
8db8a34f07 Fix documentation of the new connect functions.
Make sure that qdoc can find the same function signature in the header
than in the \fn tags in qobject.cpp

Change-Id: Iccf2ba4e8f6384e9c3bfc878a446120f03e8a813
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
2012-03-04 15:19:15 +01:00
Giuseppe D'Angelo
ddf4faf33f QRegularExpression: import PCRE under 3rdparty/
Imported only the minimum subset of PCRE version 8.30,
without documentation, tests, examples, etc. by using
the import_from_pcre_tarball.sh script.

Change-Id: Ib1112a6179789814cc3c90cbde59408d2ccd0f57
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-03 01:00:12 +01:00
Samuel Rødal
3280b91985 Cleaned up debug and warning output in xcb plugin.
Got rid of unnecessary debug output, and prefixed debug / warnings
with class name to provide more context.

Change-Id: Ia68e85ec0207de4d87d02226bdf6e4cddf464afc
Reviewed-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-02 23:16:25 +01:00
Thorbjørn Lund Martsum
87975f88ce QAbstractSlider - adding setRange as a slot
In many situations it would be very nice to have setRange
as a slot. It fits good with the rangeChanged signal -
and in some situations it does make sense to synchronize
scrollbars ranges.

Change-Id: I6bcb41ed6e009e5822b56b621e4e187fe52502a6
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
2012-03-02 23:16:25 +01:00
Sergio Ahumada
db1abf9f76 Change bugreports.qt.nokia.com -> bugreports.qt-project.org
Change-Id: Ia795098f24cf358b15067f54cd08dff0bd792bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-03-02 23:16:25 +01:00
Giuseppe D'Angelo
7ae38c49b7 Use QHash<K,V> instead of QMap<K,V> when K is a pointer type
Changes various internal usages of QMap when the key is a pointer type.
Being ordered by the pointer value itself, it makes very little sense
to use QMap<K*, V> (esp. in cases where the key is actually allocated
on the heap).

The usages have been found with the following script:

 #!/usr/bin/perl

 use strict;
 use warnings;
 use Regexp::Common;
 use File::Find;
 use feature ':5.10';

 my $container = qr/(?:QMap)/;

 sub process {
     return unless (-f and -r and /(\.c|\.cpp|\.h|\.txt)$/);
     open my $fh, "<", $_ or die "Cannot open $_: $!";
     while (my $line = <$fh>) {
         chomp $line;
         while ($line =~ /($container\s*$RE{balanced}{-parens=>"<>"})/g) {
             my $tmp = $1;
             $tmp =~ s/\s+//g;
             say "$_:$.: $line" if $tmp =~ /^$container\s*<[^,]+\*,/;
         }
     }
     close $fh;
 }

 find( { no_chdir => 1, wanted => \&process }, @ARGV );

Change-Id: Idd9819c3f4c48f98ef92831d5e8e5ac0fa42283c
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-02 23:16:25 +01:00
Casper van Donderen
95d83cb1b6 Remove the usage of deprecated qdoc macros.
QDoc now has support for Doxygen style commands for italics, bold
and list items. This change applies that change in QDoc to the
actual documentation.

Task-number: QTBUG-24578
Change-Id: I519bf9c29b14092e3ab6067612f42bf749eeedf5
Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-02 23:16:25 +01:00
Frederik Gladhorn
15e136d4e1 Mark overload of QAccessible::updateAccessibility as deprecated.
updateAccessibility(const QAccessibleEvent &event) should be used,
updateAccessibility(QObject *object, int child, Event reason) is deprecated.

Change-Id: I92b32579ff202681189e9581365d2891e5d1e994
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
2012-03-02 23:16:25 +01:00
mae
0f49137027 Name threads properly
When there is no QObject subclass with Q_OBJECT macro,
we must at least set an object name

Change-Id: Ib429a9b246d9d6b4b4cfb11593e4f358850677f2
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-03-02 23:16:25 +01:00
Uli Schlachter
9c757fac35 xcb: Check for SHAPE extension before using it
This change makes sure that the X11 server really supports the SHAPE
extension before it is used.

Before this, libxcb would disconnect from the server as soon as it was
told to send a SHAPE request to a server which doesn't support SHAPE. Oh
and of course it would do so without any good error message.

Change-Id: I5f9481e488925e74e62f229e9f637ef262020c04
Signed-off-by: Uli Schlachter <psychon@znc.in>
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-02 21:33:08 +01:00
Jørgen Lind
cd6e90c70a Remove the LIBS from platformsupport
The application / library that uses this should know it needs to link
to ie. udev, xrendr etc.

Change-Id: I9e3ffd4d98b3bd66abb8e621378b010da7feda7a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
2012-03-02 21:33:08 +01:00
Jan-Arve Saether
72b5afddb9 Fix get_accFocus() to return CHILDID_SELF when it returns itself.
This means that the AT client knows it should not have to ask for
the focus child anymore.
Previously, some clients (NVDA) kept on asking infinitely because of
this.

Change-Id: Ia2bd2e1088a899f7d1a0c9189024accdacfd693b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-03-02 18:36:07 +01:00
Jan-Arve Saether
c531fcc92e Improve debugging in the windows accessibility bridge.
set QT_DEBUG_ACCESSIBILITY=(1|0) to turn logging on or off

Change-Id: Ibd5b77699decf0cf02bc6b6cc656fa237de29124
Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
2012-03-02 18:35:21 +01:00
Miikka Heikkinen
db1aa6dd99 Fix QWizard autotest for Windows 7 Classic theme
QWizard always forced Aero style even if Classic theme was used.
Added a check for Classic theme into initialization.

Task-number: QTBUG-24618
Change-Id: I0793df62e022037835e1c1a311143f06cc4382b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2012-03-02 18:31:10 +01:00
Robin Burchell
db5c28fa0e Use correct types in QResource.
qHash() returns uint, not int, so change all interactions with hashing to use
uint to match.

This blocks the introduction of a new (better) hashing algorithm because it
currently breaks numerous tests: rcc would (correctly) write a uint hash value
to the qrc files, but QResource would attempt to mangle it around as an int.

This wasn't a problem with the old hash, because it deliberately threw away
data (h &= 0x0fffffff), possibly because of someone not being able to
diagnose precisly this problem.

Change-Id: I46fb42acc100fdd3bedd714f6dc91aeca91d0351
Reviewed-by: hjk <qthjk@ovi.com>
2012-03-02 16:07:47 +01:00
Kevin Krammer
08cc2d2779 Improving clipboard integration
Derive a data accessor class from QMimeData so application level code can
query MIME type availability through it or directly attempt to fetch
data by MIME type even if the type is not yet known to QBBClipboard.

Also make sure any MIME type used by the application in setMimeData
operations is checked for availability when being queried for formats.

Change-Id: If8174adf3f3383496a354d291ef7d36b9732be1d
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
2012-03-02 15:55:44 +01:00
Kevin Krammer
c0af324071 Fixing z-ordering of windows
The application root window is at z-order == 0, all platform windows created
for Qt windows are its descendants, so their base value for z-order needs
to be 1.

Change-Id: I7c9615ffac6757c31900a7640eb0ffdd6065b722
Reviewed-by: Sean Harmer <sh@theharmers.co.uk>
Reviewed-by: Nick Ratelle <nratelle@qnx.com>
Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
2012-03-02 15:55:38 +01:00
Stephen Kelly
6c2e57e688 Make the CONFIG and QT_CONFIG contents available downstream.
Change-Id: I62dbc5a695e41179de9f6acd11aa7bc592cac6f3
Reviewed-by: Clinton Stimpson <clinton@elemtech.com>
Reviewed-by: Alexander Neundorf <neundorf@kde.org>
Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
2012-03-02 15:55:29 +01:00
Jonathan Liu
286229ca14 Revert "Don't rely on mapFromGlobal in QGraphicsScenePrivate::itemsAtPosition."
This reverts commit 7c0d15a22266a425c9e9ac0120d6774e120fe01e.
The commit caused a regression whereby tooltips may be shown even if the
mouse is not over the item if it has the Qt::ItemIgnoresTransformations
flag and the QGraphicsView had been scaled.

Task-number: QTBUG-17517
Task-number: QTBUG-22663
Change-Id: Ib7fd788d9712c5e659fe07182f9505a4eb135ab2
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
(cherry picked from commit 15c14584199dc43e4a309fc331f3144009008128)
2012-03-02 15:33:04 +01:00
Bradley T. Hughes
70578e4fc7 Export QPaintEnginePrivate from QtGui
This allows the QCoreGraphicsPaintEngine to use QPaintEnginePrivate
members (e.g. pdev and drawBoxTextItem()).

Change-Id: I5bed3cb007ae469816afce619edd55f155b04fa9
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
2012-03-02 14:57:31 +01:00
Bradley T. Hughes
17ddce4692 Remove Q_BYTE_ORDER and -*-endian arguments from configures
Do not write Q_BYTE_ORDER to qconfig.h in the configures. Instead,
we #define Q_BYTE_ORDER in qprocessordetection.h, since many CPUs only
support a single endian format. For bi-endian processors, we set
Q_BYTE_ORDER depending on how the preprocessor sets __BYTE_ORDER__,
__BIG_ENDIAN__, or __LITTLE_ENDIAN__ (instead of using a compile test
to do so).

For operating systems that only support a single byte order, we can
check for Q_OS_* in addition to the preprocessor macros above. This is
possible because qprocessordetection.h is included by qglobal.h after
Q_OS_* and Q_CC_* detection has been done. Do this for Windows CE,
which is always little- endian according to MSDN.

Change-Id: I019a95e05252ef69895c4b38fbfa6ebfb6a943cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-03-02 14:48:00 +01:00
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
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