platform/upstream/qtbase.git
9 years agoDoc: Fix QDoc warnings for QOpenGLFunctions and QOpenGLExtraFunctions
Topi Reinio [Mon, 24 Aug 2015 11:43:13 +0000 (13:43 +0200)]
Doc: Fix QDoc warnings for QOpenGLFunctions and QOpenGLExtraFunctions

    - Use \a commands when listing the arguments for OpenGL methods
    - Document functions taking a single argument of type 'void'
      verbatim. Otherwise, QDoc refuses to generate their docs
    - Add constructor docs for QOpenGLExtraFunctions (copied from
      QOpenGLFunctions).

Change-Id: I64a436365572a80319ba0a8eaba2f5d9b751e84d
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoDoc: Update online documentation template
Topi Reinio [Wed, 20 May 2015 13:01:10 +0000 (15:01 +0200)]
Doc: Update online documentation template

Update the online documentation template with following fixes:

   - Improve responsivess for narrow screens: TOC and sidebar
     now collapse into drop-down menus
   - React to hashchange events: When the user edits the anchor
     tag in URL and presses enter, the page is scrolled
     correctly to bring the selected section title into view.
   - Handle Ctrl and Meta keys correctly
   - Improve colors for target section highlighting
   - Minor CSS fixes

Task-number: QTWEBSITE-634
Task-number: QTWEBSITE-657
Change-Id: I7221f38cf4988497f0f24ee66e62b7b7d770a121
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoremove pointless function separator comments from tst_qprocess
Joerg Bornemann [Mon, 24 Aug 2015 13:25:57 +0000 (15:25 +0200)]
remove pointless function separator comments from tst_qprocess

Newer test functions don't have those. Removing those comments makes
the code consistent.

Change-Id: I542b89e797ef061395ce1fc87d848195e6f81f35
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
9 years agoBe more tolerant with multiple differerent metatype registrations
Olivier Goffart [Fri, 14 Aug 2015 14:09:21 +0000 (16:09 +0200)]
Be more tolerant with multiple differerent metatype registrations

There is a qFatal in qmetatype.cpp that checks that the flags are the same.

There is a binary compatibility break because if any cause build with Qt 5.5
is loaded, this qFatal will quit the application, due to the change in
commit 54a09a41885e65fea4ca20d0e3d90d8f4e9e80c5:

  Type flags for type 'QtMetaTypePrivate::QPairVariantInterfaceImpl' [1034]
  don't match. Previously registered TypeFlags(0x103), now registering
  TypeFlags(0x107). This is an ODR break, which means that your application
  depends on a C++ undefined behavior.

This is a false positive since it is an internal type, the MovableType in
QMetaType is only being used for performance reason, it is perfectly fine
to change it.

This commit changes the qFatal to complain only about flags that could
only be caused by a binary incompatible change.

Change-Id: I87b9bf8cf54b6c7f4b1277d411ce5107642435ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoibus: Return correct scan code to windows
Takao Fujiwara [Tue, 25 Aug 2015 05:54:31 +0000 (14:54 +0900)]
ibus: Return correct scan code to windows

ibus keycode is qt scancode - 8 and needs to be returned to app windows
as the right value.
Use QWindowSystemInterface::handleExtendedKeyEvent() instead of
QCoreApplication::sendEvent() in qtbase 5.6 to follow
QXcbKeyboard::handleKeyEvent().
Also qApp->focusObject() returns QMdiChild which is a QWidget and
that is not a QWindow.

Task-number: QTBUG-47833
Change-Id: Ie634a86d7790d8093cfca2dc8666f726844ae654
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
9 years agomkspecs: add option to enable boot2qt platform
Samuli Piippo [Mon, 24 Aug 2015 10:40:29 +0000 (13:40 +0300)]
mkspecs: add option to enable boot2qt platform

Add configure time option to enable boot2qt platform using DISTRO_OPTS.
On embedded, the QtWebEngine is supported only on boot2qt platforms.
To have QtWebEngine CI tested on embedded, we need a way to to enable
boot2qt platform for existing mkspecs.

Change-Id: I218da5b8071041ca1c95eb218b2d552fcc9980d2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
9 years agoHarmonize input context selection
Bernd Weimer [Mon, 23 Mar 2015 10:53:16 +0000 (11:53 +0100)]
Harmonize input context selection

Input context selection works differently across platforms. On some
platforms it is not possible to request a specific context at all
(e.g. Wayland). This will be unified, depending on the environment
variable "QT_IM_MODULE", you will get:
- null:  default (platform) context, if defined (otherwise no context)
- empty: no context
- set:   set one, if it exists and is valid (otherwise no context)

[ChangeLog][Platform Specific Changes] Haromnized input context selection.
QT_IM_MODULE environment variable will be taken into account.

Change-Id: Ic8f826fbc6ace25941cd19b9b086943e848fbe01
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Nedim Hadzic <nedim.hadzic@pelagicore.com>
9 years agoDetect which C++ standard edition the compiler defaults to
Thiago Macieira [Sat, 1 Aug 2015 20:31:35 +0000 (13:31 -0700)]
Detect which C++ standard edition the compiler defaults to

Change-Id: I2991557a5cc74cd18e88ffff13f670bf25d5423e
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
9 years agoFix module reference in license header
Louai Al-Khanji [Mon, 24 Aug 2015 09:04:57 +0000 (12:04 +0300)]
Fix module reference in license header

Change-Id: I8efa30869e716d827e8463ef4285f8ff9357cc0e
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoRemove unused kms plugin
Louai Al-Khanji [Mon, 24 Aug 2015 08:44:58 +0000 (11:44 +0300)]
Remove unused kms plugin

The old kms plugin has been replaced by EGLFS's KMS backend. The EGLFS
backend is smaller and has more features.

The kms plugin cannot be built automatically since Qt 5.5 and is
therefore also not tested for changes in QPA API by the CI. Therefore
removing the plugin from the tree should not be a regression from the
previous release.

Change-Id: Icb9ea8c4a5d6421397a2e3f2e2195fb6bfad2293
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoImprove description of configure script's -kms switch
Louai Al-Khanji [Mon, 24 Aug 2015 08:30:12 +0000 (11:30 +0300)]
Improve description of configure script's -kms switch

Change-Id: I05e69d10ca0df9f99dca2c172e1791371124e75c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoDocument QStateMachine::running property in single place
Louai Al-Khanji [Mon, 24 Aug 2015 07:32:51 +0000 (10:32 +0300)]
Document QStateMachine::running property in single place

This fixes a number of qdoc warnings due to e.g. missing documentation
for setter argument.

Change-Id: If9ae43f70f0e42fe8b8a4f04f49d522cd7d69099
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix documentation typo
Louai Al-Khanji [Mon, 24 Aug 2015 07:31:44 +0000 (10:31 +0300)]
Fix documentation typo

Change-Id: Ic6271a19999555ef2a1dfa90cebfb92b270a3809
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix qdoc warning by documenting function argument
Louai Al-Khanji [Mon, 24 Aug 2015 07:31:16 +0000 (10:31 +0300)]
Fix qdoc warning by documenting function argument

Change-Id: I3d80af0b1226fbe601619420dbb35106bb3d4eec
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoAdd #ifdef to avoid qdoc missing function warning
Louai Al-Khanji [Mon, 24 Aug 2015 07:29:56 +0000 (10:29 +0300)]
Add #ifdef to avoid qdoc missing function warning

Change-Id: I1cba5543a519030a5b06bc80b6fd7410327c86c8
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix warning due to undocumented function argument
Louai Al-Khanji [Mon, 24 Aug 2015 07:28:31 +0000 (10:28 +0300)]
Fix warning due to undocumented function argument

Change-Id: Ia3a54f296b1edcdce5950bf7acad1b4436d9564a
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoFix warning due to undocumented function argument
Louai Al-Khanji [Mon, 24 Aug 2015 07:27:46 +0000 (10:27 +0300)]
Fix warning due to undocumented function argument

Change-Id: I00654b72a654c7b2a762ace773a9caef37b1bdd5
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix invalid documentation function reference
Louai Al-Khanji [Mon, 24 Aug 2015 07:26:57 +0000 (10:26 +0300)]
Fix invalid documentation function reference

Change-Id: Iccf62e3f2f7843c14dd6540400241bdd264ad376
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoMove QCoreApplication::quitLockEnabled documentation to single place
Louai Al-Khanji [Mon, 24 Aug 2015 07:24:18 +0000 (10:24 +0300)]
Move QCoreApplication::quitLockEnabled documentation to single place

Moving the documentation to one spot reduces repetition, is more
canonical, and avoids a warning due to undocumented function argument in
the setter.

Also document the default setting.

Change-Id: Idcedacf4bf101909689025d044e96801255a3332
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix permissions on qalgorithms.h
Thiago Macieira [Fri, 21 Aug 2015 21:46:03 +0000 (14:46 -0700)]
Fix permissions on qalgorithms.h

Commit 046f3254838715079b853ab4e15eed4ef464fb30 accidentally made it
executable.

Change-Id: I7de033f80b0e4431b7f1ffff13fc9872fa64ae9d
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
9 years agoFix compilation with ICC on Windows
Thiago Macieira [Fri, 21 Aug 2015 20:58:39 +0000 (13:58 -0700)]
Fix compilation with ICC on Windows

Unlike MSVC, ICC *does* support constexpr, but on Windows it will not
define __GNUC__, so we ended up in the multi-line alternative. That is
not permitted in C++11, only in C++14.

qalgorithms.h(659): error: statement may not appear in a constexpr function

Change-Id: I7de033f80b0e4431b7f1ffff13fc96245ee9a846
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
9 years agoAvoid recreating QVariantLists when extracted from a QVariant
Jocelyn Turcotte [Mon, 10 Aug 2015 19:39:04 +0000 (21:39 +0200)]
Avoid recreating QVariantLists when extracted from a QVariant

Wrapping a QVariantList in a QVariant to pass it to QML would
trigger a deep copy each time QML would try to access elements
in the list (specifically in QQmlListAccessor::at).

This reverts a part of 8c4deff51c8064f5a15cae0342bfa66b6663662b
by specifying the associative array conversions explicitly without
including the current type in the list of types to convert through
an iteration.

Task-number: QTBUG-41403
Change-Id: If9fddfe6d36f789ac4aa61a7c32677cd1dd077d8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
9 years agoFix double initialization of QRgba64 with C++14
Allan Sandfeld Jensen [Fri, 21 Aug 2015 08:28:50 +0000 (10:28 +0200)]
Fix double initialization of QRgba64 with C++14

Use constructors with C++11/C++14 where it is allowed to avoid hack
that caused double initialization and thereby performance regression
with C++14.

Change-Id: I7ae86df8aa34000b2c186e22bd9917303354b794
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoExtend the image viewer example.
Friedemann Kleint [Fri, 21 Aug 2015 08:17:58 +0000 (10:17 +0200)]
Extend the image viewer example.

Add:
- Save As
- Copy
- Paste from clipboard into new image

Change-Id: Ibbc308e9bbd2ce407119cd9358874f5c22a6bb83
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoQTabletEvent manual test: show events/sec and frames/sec, proximity
Shawn Rutledge [Mon, 10 Aug 2015 12:43:59 +0000 (14:43 +0200)]
QTabletEvent manual test: show events/sec and frames/sec, proximity

Task-number: QTBUG-47464
Change-Id: I476586bb15dd5113cf6463b1dc6f05e5bb26127a
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoQTabletEvent manual test: show event timestamp
Shawn Rutledge [Wed, 19 Aug 2015 11:28:06 +0000 (13:28 +0200)]
QTabletEvent manual test: show event timestamp

Task-number: QTBUG-39459
Change-Id: Ieac0d7b28a3ca651681d286d4700ef7b9b1675b5
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoxcb: set QTabletEvent's timestamp from the window system event
Shawn Rutledge [Wed, 19 Aug 2015 11:39:23 +0000 (13:39 +0200)]
xcb: set QTabletEvent's timestamp from the window system event

The intention is for it not to include any delays that Qt's event
processing has introduced.  And we are already doing it this way
for touch and scroll events.

Task-number: QTBUG-39459
Change-Id: Ie01cc2f8c6290ab66ef1b9180471afaa3da2e9da
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoQInputEvent: document that timestamp() is in milliseconds
Shawn Rutledge [Wed, 19 Aug 2015 11:57:20 +0000 (13:57 +0200)]
QInputEvent: document that timestamp() is in milliseconds

Task-number: QTBUG-39459
Change-Id: Ie76f3c2f6fe81746d3ea646f0c2f0d47ec3ef252
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoWindows: set QTabletEvent's timestamp from the window system event
Shawn Rutledge [Wed, 19 Aug 2015 12:27:51 +0000 (14:27 +0200)]
Windows: set QTabletEvent's timestamp from the window system event

Task-number: QTBUG-39459
Change-Id: I8439846482a52b358bcdc4d8a5f6f4b9bbe55fa5
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoQLoggingRegistry: Look up logging configuration in Qt data path
Kai Koehne [Fri, 19 Jun 2015 11:38:58 +0000 (13:38 +0200)]
QLoggingRegistry: Look up logging configuration in Qt data path

Distributions like Fedora would like to disable logging globally, without
having to patch Qt. Fedora right now therefore adds a
/etc/xdg/qtlogging.ini file, which unfortunately though also messes with
Qt versions compiled by the user.

This patch lets QLoggingRegistry look up logging configurations also
in QLibraryInfo::DataPath, which would allow to tweak the values per
Qt installation.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1227295

Change-Id: I0fca304a47f45739d0c08a9e4e715673bf10aa80
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
9 years agowinphone: Fix keyboard show/hide calls
Andrew Knight [Sun, 23 Aug 2015 20:51:26 +0000 (23:51 +0300)]
winphone: Fix keyboard show/hide calls

These need to occur on the XAML thread.

Change-Id: Id42a37df95b09e6d3c0a1b6e593bbf8cbfe5a129
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
9 years agoRemove vestiges of Qt's own sockaddr_in6 and sockaddr_storage
Thiago Macieira [Mon, 10 Aug 2015 04:56:26 +0000 (21:56 -0700)]
Remove vestiges of Qt's own sockaddr_in6 and sockaddr_storage

We weren't using qt_sockaddr_storage, so it's not a problem. But since
we're not using it anyway, we don't really need it. The storage is only
needed if we needed to get a bigger socket address and that only happens
with Unix sockets (paths).

sockaddr_in6, however, was just wrong. Some systems derived from BSD,
like OS X, have a sXX_len field containing the length of the socket
address structure and our qt_sockaddr_in6 was missing sin6_len. As a
result, setting sin6_family was just plain wrong on little-endian
systems. Like all modern systems running BSDs and OS X...

Change-Id: I7de033f80b0e4431b7f1ffff13f900f004c55443
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNativeSocketEngine Unix: do the same as for Windows
Thiago Macieira [Thu, 12 Mar 2015 01:58:29 +0000 (18:58 -0700)]
QNativeSocketEngine Unix: do the same as for Windows

Change-Id: Iee8cbc07c4434ce9b560ffff13ca9d9858cf7111
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNativeSocketEngine Windows: bring bind() in line with Unix
Thiago Macieira [Thu, 12 Mar 2015 03:13:16 +0000 (20:13 -0700)]
QNativeSocketEngine Windows: bring bind() in line with Unix

The IPv4+IPv6 dual stack code that has been in Qt since 5.0 has been
giving test failures for tst_qudpsocket: some binds that shouldn't
succeed do succeed. Instead, copy the core code from the Unix version so
the two OSes will behave the same way.

The one difference in behavior between Windows and Unix is that on Unix
you can bind an IPv4 address to a multicast IP and on Windows you can't.
So I left the "correction" that was in the original code, but I'm unsure
if it is the right thing to do. Are people expecting to join the
multicast group this way?

Change-Id: Iee8cbc07c4434ce9b560ffff13caa1c3d5a7e8fd
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNativeSocketEngine Windows: simplify the conversion to struct sockaddr
Thiago Macieira [Thu, 12 Mar 2015 01:41:23 +0000 (18:41 -0700)]
QNativeSocketEngine Windows: simplify the conversion to struct sockaddr

We have qt_sockaddr, which has enough storage for our needs and is a
union of all the types. We don't need them to be separate like that.

Change-Id: Iee8cbc07c4434ce9b560ffff13ca9cb960ccf1d7
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNativeSocketEngine: add code to send extra IP header data
Thiago Macieira [Wed, 11 Mar 2015 00:03:42 +0000 (17:03 -0700)]
QNativeSocketEngine: add code to send extra IP header data

Change-Id: Iee8cbc07c4434ce9b560ffff13ca48c053bd88ed
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNativeSocketEngine: add code to receive IP header data
Thiago Macieira [Tue, 10 Mar 2015 23:20:20 +0000 (16:20 -0700)]
QNativeSocketEngine: add code to receive IP header data

Change-Id: Iee8cbc07c4434ce9b560ffff13ca466263abcb1b
Reviewed-by: Richard J. Moore <rich@kde.org>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
9 years agoQNativeSocketEngine: use sendmsg/recvmsg instead of sendto/recvfrom
Thiago Macieira [Tue, 10 Mar 2015 22:09:29 +0000 (15:09 -0700)]
QNativeSocketEngine: use sendmsg/recvmsg instead of sendto/recvfrom

We'll need to use these functions instead of the ones we're currently
using in order to access the ancillary data.

Note that on Windows the two functions aren't globals, but must be
obtained via ioctl, which means they can fail. If they do, we fall back
to using WSARecvFrom/WSASendTo

Change-Id: Iee8cbc07c4434ce9b560ffff13ca4284acd24132
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoAutotest: Print errno in case of failure
Thiago Macieira [Thu, 20 Aug 2015 21:49:17 +0000 (14:49 -0700)]
Autotest: Print errno in case of failure

Change-Id: I7de033f80b0e4431b7f1ffff13fc4a02e1c1a2a5
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQAbstractSocketEngine: introduce QIpPacketHeader for datagrams
Thiago Macieira [Tue, 10 Mar 2015 22:01:21 +0000 (15:01 -0700)]
QAbstractSocketEngine: introduce QIpPacketHeader for datagrams

This commit changes the readDatagram() and writeDatagram() virtual
functions to take a QIpPacketHeader as meta data, instead of a
QHostAddress/quint16 pair. As previously, the header is an "out"
parameter for readDatagram() and an "in" parameter for writeDatagram().

The header pointer in readDatagram() is allowed to be null if the
PacketHeaderOptions indicates WantNone. Otherwise, it must not be null.
The extra options parameter is introduced because we may not always want
all the metadata upon reception. For sending, we know what to include or
not based on what's set in the incoming header parameter.

QIpPacketHeader splits sender and destination because we'll be able to
return both on datagram reception.

Change-Id: Iee8cbc07c4434ce9b560ffff13ca4213255008c7
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoSet QAction::NoRole on dock widget view actions.
Friedemann Kleint [Thu, 20 Aug 2015 09:18:56 +0000 (11:18 +0200)]
Set QAction::NoRole on dock widget view actions.

Prevent the actions from being shuffled around in OS X
menus since the default is QAction::TextHeuristicRole.

Task-number: QTBUG-47739
Change-Id: Ib68bb7c51eb9278a99d277473f9d4cfcf740431c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoRemove Q_DECLARE_TYPEINFO that causes a build error
Thiago Macieira [Tue, 11 Aug 2015 07:42:41 +0000 (00:42 -0700)]
Remove Q_DECLARE_TYPEINFO that causes a build error

ICC doesn't like it
qdbusintrospection_p.h(162): error: explicit specialization of class "QTypeInfo<QDBusIntrospection::Argument>" must precede its first use

It's used by the QVector in the same class

Change-Id: I7de033f80b0e4431b7f1ffff13f958971617b657
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoAdd support for same-file intrinsics with Clang 3.7
Thiago Macieira [Sat, 18 Jul 2015 05:23:50 +0000 (22:23 -0700)]
Add support for same-file intrinsics with Clang 3.7

It supports the same feature that GCC does

Change-Id: Ib306f8f647014b399b87ffff13f1f3159898741b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
9 years agolibinput: Fix key mapping
Laszlo Agocs [Tue, 18 Aug 2015 09:51:45 +0000 (11:51 +0200)]
libinput: Fix key mapping

Prevent generating 2 character long 'text' strings with some garbage as
second char.

This matches how xcb works.

Change-Id: I88a248a89c80b0e100c1c4871cfab4f2c287535e
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
9 years agoFix pointer size detection when cross-compiling
Laszlo Agocs [Wed, 19 Aug 2015 11:21:35 +0000 (13:21 +0200)]
Fix pointer size detection when cross-compiling

The initial configure fails to build the pointer size test correctly
due to the missing --sysroot argument. This breaks 64-bit targets
as the pointer size is set to 4. A subsequent configure correctly
builds and picks 8 up, but we expect the first attempt to work as well.

Task-number: QTBUG-47840
Change-Id: Iaf9450635f1bbc12e18062fa0a51f35cf690ce08
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
9 years agoPolish the imageviewer example.
Friedemann Kleint [Thu, 9 Jul 2015 11:25:16 +0000 (13:25 +0200)]
Polish the imageviewer example.

- Remove unneeded member variables.
- Use member initialization in the constructor.
- Use new connection syntax in createActions()
  to assemble the menu there, removing the createMenus()
  function.
- Fix coding style issue (braces)
- Avoid empty label showing up by setting the scroll
  area invisible until an image is loaded.
- Set a new image only if image read succeeds.
- Add status bar with information message.

Task-number: QTBUG-46848
Change-Id: I32d5af70d8eb71ec16dd58a0b98c32eb2bd988d7
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agowinrt: Hide status bar on windows phone.
Samuel Nevala [Mon, 17 Aug 2015 11:57:46 +0000 (14:57 +0300)]
winrt: Hide status bar on windows phone.

Task-Id: QTBUG-47789
Change-Id: I9ca5f336ba9ee7524d4a4bbff3bbf4fbbb56fd54
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
9 years agoFix Clang warning about copy elision
Thiago Macieira [Tue, 11 Aug 2015 19:39:29 +0000 (12:39 -0700)]
Fix Clang warning about copy elision

Found by Clang 3.7:

qcommandlineoption.cpp:287:12: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]

Change-Id: I7de033f80b0e4431b7f1ffff13f97fb480001d36
Reviewed-by: David Faure <david.faure@kdab.com>
9 years agoDoc: Remove invalid uses of \relates command
Topi Reinio [Wed, 19 Aug 2015 11:24:59 +0000 (13:24 +0200)]
Doc: Remove invalid uses of \relates command

A function cannot be both a member and a non-member of the same class.

Change-Id: I07d1e04c09fea2ba1171b3692e716660044cd37a
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoqdoc: Check and warn if \relates is used incorrectly
Topi Reinio [Wed, 19 Aug 2015 11:18:39 +0000 (13:18 +0200)]
qdoc: Check and warn if \relates is used incorrectly

There are instances in the documentation where a member function
tries to set itself also a related non-member of its parent. This
should be treated as invalid behavior, as it likely causes also
problems during deletion of the node tree.

QDoc now checks for and warns about these instances.

Change-Id: I951e0de6be4d48618c60b8a0382e2c70700cc402
Task-number: QTBUG-47751
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoqdoc: Improve resolving related non-members and their overload numbers
Topi Reinio [Wed, 12 Aug 2015 09:00:19 +0000 (11:00 +0200)]
qdoc: Improve resolving related non-members and their overload numbers

There were several problems related to resolving related non-member
(RNM) functions for classes. This commit does the following changes:

  - Overload numbers for RNMs are now calculated at the time the
    \relates command is processed, instead of a separate step.
  - If a \relates refers to an entity outside the module boundary,
    write the argument passed to it as-is into the index file.
  - Delay the destruction of QDocIndexFiles singleton, to resolve
    the RNMs read from the index files prior to generating docs.
  - Remove the redundant call to normalizeOverloads() for single-
    exec mode as unnecessary.

These changes ensure that all RNMs are listed in the documentation
for the node that they belong to.

A remaining issue is that if a function relates to a class outside
the module boundary, that function documentation will be empty
because the doc content is not stored into the index file (for
obvious reasons). Single-exec mode does not have this problem.

Change-Id: I33f038120728932cd9fd70da28d9090023068bd6
Task-number: QTBUG-47589
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoExclude ANGLE from translations.
Friedemann Kleint [Wed, 19 Aug 2015 06:59:59 +0000 (08:59 +0200)]
Exclude ANGLE from translations.

Fix lupdate warning:
qtbase/src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp:20: Ignoring definition of undeclared qualified class

Change-Id: Ica6b560ce7f80319f4fc9d550f91d6baf61a8241
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
9 years agoQHostAddress: Improve code generation
Thiago Macieira [Mon, 10 Aug 2015 20:08:15 +0000 (13:08 -0700)]
QHostAddress: Improve code generation

Mostly related to IPv6, because Q_IPV6ADDR is an array of char, so the
compilers were generating byte access to each value. Instead, force
access as 32- and 64-bit in most places that make sense (64-bit access
decays to 32-bit on 32-bit machines). In one isLoopback(), this is now a
128-bit access for best improvement.

Some smaller improvements relating to SpecialAddress by combining the
three IPv4 special addresses.

Change-Id: I7de033f80b0e4431b7f1ffff13f932b1cd7b5d21
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoDisable the testlib watchdog if a debugger is present
Simon Hausmann [Sat, 15 Aug 2015 22:03:30 +0000 (00:03 +0200)]
Disable the testlib watchdog if a debugger is present

Currently this is only implemented on Linux and Windows. But it's an
improvement nevertheless when debugging Qt unit tests :)

Change-Id: Iea307dad0e12c24f305c16f0a1805e7c246ee372
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
9 years agoqthread_win.cpp: Fix compiler warnings by MSVC2015 (64bit).
Friedemann Kleint [Fri, 31 Jul 2015 13:52:11 +0000 (15:52 +0200)]
qthread_win.cpp: Fix compiler warnings by MSVC2015 (64bit).

thread\qthread_win.cpp(121): warning C4312: 'reinterpret_cast': conversion from 'DWORD' to 'Qt::HANDLE' of greater size
thread\qthread_win.cpp(343): warning C4312: 'reinterpret_cast': conversion from 'DWORD' to 'Qt::HANDLE' of greater size
thread\qthread_win.cpp(416): warning C4312: 'reinterpret_cast': conversion from 'DWORD' to 'Qt::HANDLE' of greater size

Change-Id: I5e60e4bb91a32491562748755d34a2c5a1e264b4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
9 years agoPolish widgets/dialogs/standarddialogs example.
Friedemann Kleint [Tue, 21 Jul 2015 12:59:22 +0000 (14:59 +0200)]
Polish widgets/dialogs/standarddialogs example.

Add missing options for QFileDialog, QFontDialog.
Resize and position depending on screen size in order
to look correct on high resolution screens.

Change-Id: I1d9af481270d6a3e49878aaf32b59aea8fa543b4
Reviewed-by: hjk <hjk@theqtcompany.com>
9 years agolinuxfb: Use libinput by default when available
Laszlo Agocs [Mon, 17 Aug 2015 16:27:35 +0000 (18:27 +0200)]
linuxfb: Use libinput by default when available

Can be overridden by setting QT_QPA_FB_NO_LIBINPUT.

On systems where libinput is present it is usually a better choice
to rely on it instead of evdev*.

Change-Id: I8532c923bacd605434cfca1c7e314cb95d41b372
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
9 years agoeglfs: Use libinput by default when available
Laszlo Agocs [Mon, 17 Aug 2015 16:04:34 +0000 (18:04 +0200)]
eglfs: Use libinput by default when available

Can be overridden by setting QT_QPA_EGLFS_NO_LIBINPUT.

On systems where libinput is present it is usually a better choice
to rely on it instead of evdev*.

Change-Id: I78857ff91c837f58fdc7d1e119260bd6819fbf4e
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
9 years agolibinput: Rename logging category to prevent clashes
Laszlo Agocs [Mon, 17 Aug 2015 16:01:03 +0000 (18:01 +0200)]
libinput: Rename logging category to prevent clashes

Anything linking to platformsupport may use the same name so use
something less generic.

Change-Id: I657dd5dfcad9cf22585fcb17eda62deaf26ea6c4
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
9 years agoAdd Intel NUC device makespec
Laszlo Agocs [Mon, 17 Aug 2015 14:07:03 +0000 (16:07 +0200)]
Add Intel NUC device makespec

Change-Id: I2ffaadd06f27da8ec8f44d7d698e84e1fe780270
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
9 years agoMerge dev into 5.6
Oswald Buddenhagen [Mon, 17 Aug 2015 17:55:41 +0000 (19:55 +0200)]
Merge dev into 5.6

Change-Id: I061f2513ef58f696e75b11928d89aaaf059659a3

9 years agoQHostAddress hashing: use qHashBits
Thiago Macieira [Fri, 14 Aug 2015 03:45:29 +0000 (20:45 -0700)]
QHostAddress hashing: use qHashBits

Instead of constructing a temporary QByteArray, which could conceivably
fail, to hash those bits.

Change-Id: I7de033f80b0e4431b7f1ffff13fa376302d9720f
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNetworkInterface: remove fallback code for Windows pre-XP and CE pre-4
Thiago Macieira [Wed, 12 Aug 2015 01:04:50 +0000 (18:04 -0700)]
QNetworkInterface: remove fallback code for Windows pre-XP and CE pre-4

All versions we support have support for the WinXP-style functions we
need, so we don't need the Win2k fallback.

Change-Id: I7de033f80b0e4431b7f1ffff13f99175a507a2ed
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoFix thread-safety of qnetworkinterface_win.cpp:resolveLibs
Thiago Macieira [Wed, 12 Aug 2015 02:39:43 +0000 (19:39 -0700)]
Fix thread-safety of qnetworkinterface_win.cpp:resolveLibs

Change-Id: Ia4b5103c9c590c24de9a43c5c7097b0c7b83e679
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNetworkInterface: make the name lookup search numbers in string forms
Thiago Macieira [Tue, 11 Aug 2015 23:42:34 +0000 (16:42 -0700)]
QNetworkInterface: make the name lookup search numbers in string forms

That's how QHostAddress::scopeId() stores them, so we ought to look them
up the same way.

Change-Id: I7de033f80b0e4431b7f1ffff13f98cf87d45ebc6
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNetworkInterface: Merge the two sections of code that do SIOCGIFxxx
Thiago Macieira [Tue, 11 Aug 2015 22:23:55 +0000 (15:23 -0700)]
QNetworkInterface: Merge the two sections of code that do SIOCGIFxxx

The separation was accidental due to refactoring. It does not need to
exist.

Change-Id: I7de033f80b0e4431b7f1ffff13f988adc47d57d5
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQNetworkInterface: prefer SIOCGIFINDEX over if_nametoindex
Thiago Macieira [Tue, 11 Aug 2015 22:21:30 +0000 (15:21 -0700)]
QNetworkInterface: prefer SIOCGIFINDEX over if_nametoindex

On Linux (on a bad system without getifaddrs), the ioctl for
SIOCGIFINDEX should be faster than if_nametoindex. The ioctl on the
already open socket will require one syscall, while if_nametoindex will
require at least one more (to open the socket), probably more.

Change-Id: I7de033f80b0e4431b7f1ffff13f9888bf2044105
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agodoc: Add a few missing const keywords in \fn commands
Martin Smith [Fri, 7 Aug 2015 11:46:57 +0000 (13:46 +0200)]
doc: Add a few missing const keywords in \fn commands

This adds "const" to a few \fn commands for new operators
in QHash and QMap.

Change-Id: I93cf7aaf88fcb4db17de5810b555b978e8119e20
Task-number: QTBUG-47669
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoqdoc: Instantiator::objectAt now appear in docs
Martin Smith [Tue, 11 Aug 2015 09:58:02 +0000 (11:58 +0200)]
qdoc: Instantiator::objectAt now appear in docs

There was a bug in bool CppCodeParser::splitQmlMethodArg(),
which has now been fixed. The bug occurred when there was a
"::" in the return type.

Change-Id: Id31ed0d4a03d84e76fb69403441a3491ec884ddc
Task-number: QTBUG-47438
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
9 years agoqdoc: Allow formal parameters in link targets
Martin Smith [Thu, 6 Aug 2015 11:47:44 +0000 (13:47 +0200)]
qdoc: Allow formal parameters in link targets

This update allows qdoc to handle \l commands for linking
to functions, where the formal parameters are included in
the link target.

For example, \l {QWidget::find(QString name)} will only match
a member function of QWidget that has a single parameter of type
QString. The parameter name is not used in the search.

Change-Id: I8a31c9a7ed632f12a0e6d8a33cbb5cd361098317
Task-number: QTBUG-47286
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoQProcess: discard unwanted output from the child process
Alex Trotsenko [Thu, 13 Aug 2015 15:59:03 +0000 (18:59 +0300)]
QProcess: discard unwanted output from the child process

Drop process output to nullDevice(), if an application does not request
forwarding, redirecting or reading from the device channel. This
prevents from accumulation of unnecessary data which can not be read.

Change-Id: Ia311a8c658a46cf580ffa9484c5369f3fc5f98a7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
9 years agoAdd QMainWindow::resizeDocks
Olivier Goffart [Thu, 19 Mar 2015 16:47:13 +0000 (17:47 +0100)]
Add QMainWindow::resizeDocks

This API allows to programatically resize QDockWidgets

Task-number: QTBUG-32001
Change-Id: I58072a391f8e7f325a26745b5bedd3fe49508e91
Reviewed-by: Jocelyn Turcotte (Woboq GmbH) <jturcotte@woboq.com>
9 years agoAdd QHostAddress::isMulticast
Thiago Macieira [Tue, 17 Mar 2015 01:59:49 +0000 (18:59 -0700)]
Add QHostAddress::isMulticast

This complements QHostAddress::isLoopback. The only missing check now is
for the "Any" address types, though operator== is quite fast nowadays.

Change-Id: Iee8cbc07c4434ce9b560ffff13cc2691e15014b6
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoQtTest: Add QHostAddress support for QCOMPARE failures
Thiago Macieira [Tue, 17 Mar 2015 23:42:51 +0000 (08:42 +0900)]
QtTest: Add QHostAddress support for QCOMPARE failures

Change-Id: Iee8cbc07c4434ce9b560ffff13cc6dad04a5a554
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoFix warning of unused variable
Thiago Macieira [Tue, 11 Aug 2015 22:22:53 +0000 (15:22 -0700)]
Fix warning of unused variable

Only happens on systems without getifaddrs, which we aren't usually
testing.

Change-Id: I7de033f80b0e4431b7f1ffff13f9889f5cfdea5b
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoOSX FreeType: Add support for sub pixel font rendering.
Sérgio Martins [Wed, 10 Dec 2014 13:42:45 +0000 (13:42 +0000)]
OSX FreeType: Add support for sub pixel font rendering.

Task-number: QTBUG-42839
Change-Id: Iea4552d766936a55fd177e4287591d2715202d9c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoOSX FreeType: respect hinting preference
Andreas Hartmetz [Thu, 4 Jun 2015 16:21:03 +0000 (18:21 +0200)]
OSX FreeType: respect hinting preference

Task-number: QTBUG-42839
Change-Id: I2bccd7bda74ccbbb752181f1caea7ecf4672c01c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoQHostAddress: don't inline the parse() function
Thiago Macieira [Fri, 14 Aug 2015 04:01:14 +0000 (21:01 -0700)]
QHostAddress: don't inline the parse() function

It's called everywhere due to QT_ENSURE_PARSED and it's big. There's no
need to duplicate it everywhere.

Change-Id: I7de033f80b0e4431b7f1ffff13fa383f29114712
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoMove setter for QFont::HintingPreference to QFontEngineFT.
Andreas Hartmetz [Thu, 4 Jun 2015 16:07:30 +0000 (18:07 +0200)]
Move setter for QFont::HintingPreference to QFontEngineFT.

Preparation for also using it from QCoreTextFontDatabase.

Change-Id: I9cbef59c21f343a88a5cb3fdbee1ed4791d7a36e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
9 years agoFix a typo
Timur Pocheptsov [Thu, 13 Aug 2015 07:17:13 +0000 (09:17 +0200)]
Fix a typo

'Do', not 'dot' in the help's text.

Change-Id: Ib0ccdd50ae62085571c5f932650b9209fa966d79
Reviewed-by: Richard J. Moore <rich@kde.org>
9 years agoCall sendWindowSystemEvents() on deferred flush
Morten Johan Sørvig [Thu, 4 Dec 2014 20:18:04 +0000 (21:18 +0100)]
Call sendWindowSystemEvents() on deferred flush

Calling it directly is less confusing than calling
it indirectly via the "else" branch in
flushWindowSystemEvents.

Change-Id: I085deff09162137606922a5af7ead23e21497b11
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
9 years agoPropagate keyboard event accept status
Morten Johan Sørvig [Sat, 22 Nov 2014 14:11:36 +0000 (15:11 +0100)]
Propagate keyboard event accept status

Set the accepted bit on the QWindowsystemInterface
keyboard event after processing the key event.

Change-Id: I2d8c9382f14840e464153870dff909000e64ddcd
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
9 years agoPropagate event accepted state to platform plugins
Morten Johan Sørvig [Sat, 22 Nov 2014 14:10:34 +0000 (15:10 +0100)]
Propagate event accepted state to platform plugins

Add en "eventAccepted" field to WindowSystemEvent,
where the event subclasses can record the event
acceptance status. Make handleWindowSystemEvent()
return the accepted status.

This works for synchronous event processing only. If
the event is placed on the QPA event queue then there
is no way to return the accepted state immediately.
In the latter case handleWindowSystemEvent() always
returns "true".

Change-Id: I081aecc54f43588d42d3aaeec7f8458f06937601
Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
9 years agoAdd QPlatformWindow::windowFrameGeometry()
Morten Johan Sørvig [Thu, 6 Aug 2015 20:44:09 +0000 (22:44 +0200)]
Add QPlatformWindow::windowFrameGeometry()

Convenience accessor for use by the Wayland
platform plugin.

Change-Id: I420209138cfc285f8396913548b9e158a35ee9c1
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
9 years agoMake QT_SCALE_FACTOR work on Wayland
Morten Johan Sørvig [Thu, 6 Aug 2015 20:42:18 +0000 (22:42 +0200)]
Make QT_SCALE_FACTOR work on Wayland

Propagate the line stride when creating the high-dpi
backing store image.

Change-Id: I15f41965d8eaf1d01ddac0a1a012b71148f757e3
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
9 years agoRemove Q_DEAD_CODE_FROM_QT4_MAC sections
Morten Johan Sørvig [Fri, 23 Jan 2015 09:55:20 +0000 (10:55 +0100)]
Remove Q_DEAD_CODE_FROM_QT4_MAC sections

The native OS X color dialog wrapper is now implemented
in qcocoadialoghelper.mm in the Cocoa platform plugin.

Change-Id: Idc4088df93960dd68507d11a9895277e34a18b96
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
9 years agoUse QScopedPointer for library paths
Ulf Hermann [Thu, 26 Mar 2015 09:20:11 +0000 (10:20 +0100)]
Use QScopedPointer for library paths

This way we can remove some life cycle management code.

Change-Id: I8e0c9db0a8c5f0941bbd834380d3e3b3a9d2f306
Reviewed-by: Adam Majer <adamm@zombino.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoQAbstractSocket::canReadLine(): remove code duplication
Alex Trotsenko [Wed, 15 Jul 2015 15:11:38 +0000 (18:11 +0300)]
QAbstractSocket::canReadLine(): remove code duplication

Contents of the QIODevice's buffer is handled in the base
implementation.

Change-Id: I5a3d68e4e8dcb16d7f5ad695ac43127b8047a061
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoRemove temporary string allocations when reading prepared statement.
Milian Wolff [Mon, 22 Dec 2014 17:25:13 +0000 (18:25 +0100)]
Remove temporary string allocations when reading prepared statement.

Instead, we use the binary MySQL encoding and copy the data directly
into the QVariant of the desired type. This gets rid of the temporary
string allocations and greatly improves the performance of the added
benchmark. On my machine, the results are:

Before:
     0.562 msecs per iteration (total: 563, iterations: 1000)
     1,922,479.330 instructions per iteration (total: 1,922,479,330, iterations: 1000)

After:
     0.381 msecs per iteration (total: 381, iterations: 1000)
     774,132.957 instructions per iteration (total: 774,132,958, iterations: 1000)

Note that the same could be applied to floating point data types in
the future. Additionally, special support for MYSQL_TIME structure
coult be added to get rid of the string conversions there.

To ensure everything keeps working, a new auto test is added as well
that verifies the select statements and insertions of integral data
into a MySql table works as intended.

[ChangeLog][QtSql] Improve performance when reading integer values
from MySQL databases via prepared statements.

Change-Id: I21dd9277661971ded934546f09535014b63f8eb8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
9 years agoDoc: Remove the section about IPv6 site-local addresses
Thiago Macieira [Tue, 11 Aug 2015 23:45:29 +0000 (16:45 -0700)]
Doc: Remove the section about IPv6 site-local addresses

Site-local addresses were deprecated in RFC 3879 (September 2004) and
RFC 4193 (October 2005) replaced them with Unique Local Address. ULAs
are part of the global range but supposedly unique to an organization.

Change-Id: I7de033f80b0e4431b7f1ffff13f98d2124c5cffc
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
9 years agoFix -Wcast-qual warnings
Thiago Macieira [Tue, 11 Aug 2015 07:09:46 +0000 (00:09 -0700)]
Fix -Wcast-qual warnings

qwidget.cpp:12864:70: error: cast from type ‘const QWidget*’ to type ‘void*’ casts away qualifiers [-Werror=cast-qual]

Change-Id: I7de033f80b0e4431b7f1ffff13f956cb26108af7
Reviewed-by: Martin Smith <martin.smith@digia.com>
9 years agoMerge the multiple implementations of getting the local hostname
Thiago Macieira [Wed, 8 Apr 2015 21:14:16 +0000 (14:14 -0700)]
Merge the multiple implementations of getting the local hostname

This commit moves the functionality from QtNetwork's QHostInfo to
QtCore. Note that due to Windows ws2_32.dll's quirky behavior of
requiring WSAStartup before calling gethostname, this change required
moving the initialization to QtCore too.

On Linux systems, gethostname() gets the name from uname(), so we bypass
the middle man and save one memcpy.

Change-Id: I27eaacb532114dd188c4ffff13d32655a6301346
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agowinrt: Refactor platform plugin for XAML support
Andrew Knight [Wed, 12 Aug 2015 09:43:54 +0000 (12:43 +0300)]
winrt: Refactor platform plugin for XAML support

By using XAML as the platform compositor, many benefits are possible:
 - Better input context handling for tablets
 - Better multiple window support (including non-fullscreen windows)
 - Support for transparent windows and window opacity
 - Integration with native platform controls
 - Simpler orientation handling on Windows Phone with built-in transitions

This patch applies only the minimal parts to make XAML mode work just as
the raw D3D mode. It does this by:
 - Moving all OpenGL parts into QWinRTEGLContext. This will allow us to
   have non-OpenGL windows later (e.g. Direct2D raster surfaces).
 - Moving more window-specific parts into QWinRTWindow. Each window creates
   a SwapChainPanel which can then be used for ANGLE (or Direct2D) content.
 - Moving non screen-specific parts into QWinRTIntegration.
 - Having QWinRTScreen create the base XAML element Canvas.
 - Running certain calls on the UI thread where necessary.

The following code parts were removed:
 - The UIAutomationCore code in QWinRTInputContext, as this is incompatible
   with XAML automation.
 - The D3D Trim and device blacklist, as these have been fixed in ANGLE.
 - Core dispatcher processing in QEventDispatcherWinRT. Now there is only
   one native event dispatcher; it is always running and never needs to be
   pumped.

Future commits should address:
 - Maintaining the window stack list and visibility using the XAML Canvas.
 - Allowing for windows (e.g. popups) to be sized and positioned instead
   of fullscreen.
 - Using the XAML automation API to improve the platform input context.

[ChangeLog][QPA][winrt] Windows Store apps are now composited inside a
XAML container, allowing for tighter integration with the native UI layer.

Change-Id: I285c6dea657c5dab2fda2b1bd8e8e5dd15882c72
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
9 years agowinrtmain: Start in XAML mode
Andrew Knight [Wed, 5 Aug 2015 05:15:06 +0000 (08:15 +0300)]
winrtmain: Start in XAML mode

This allows the platform plugin to start using XAML interfaces in the
windowing system.

Change-Id: Ifcd29b8b8d83b138af69786dfc6a1adec21be37e
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
9 years agoANGLE: Use pixel sizes in the XAML swap chain
Andrew Knight [Sat, 8 Aug 2015 18:42:03 +0000 (21:42 +0300)]
ANGLE: Use pixel sizes in the XAML swap chain

This is necessary for Qt applications, as they render to GL in physical
pixels. This is consistent with the CoreWindow swap chain behavior.

This includes a partial revert of "ANGLE: Improve Windows Phone Support"
as the modifications to SwapChain11 are incompatible with the XAML swap
chain.

This change only affects Windows Runtime targets.

Change-Id: I401ae81028a9dfdb9da37f51c60844467c476f76
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
9 years agoANGLE: check for out of date swap chain even when size is empty
Andrew Knight [Wed, 5 Aug 2015 06:02:47 +0000 (09:02 +0300)]
ANGLE: check for out of date swap chain even when size is empty

This allows the XAML swap chain to work properly, as otherwise it never
got a resize after it was passed into ANGLE with an empty size. This is
fixed by upstream commit 3799c3014a9e4ba4a3853c014a7127254ec19d50, so no
patch is necessary for Qt's local copy.

Change-Id: I43b030fa74f6b30c2aa42a36db2031a84eedf60b
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
9 years agoQStandardPaths: on Windows, add APPDIR and APPDIR/data for GenericDataLocation
David Faure [Wed, 12 Aug 2015 09:10:27 +0000 (11:10 +0200)]
QStandardPaths: on Windows, add APPDIR and APPDIR/data for GenericDataLocation

This allows multiple applications installed into the same directory,
to share data files without polluting a more global directory
like C:/ProgramData.

Change-Id: Id5f4f9bc9d2ccb7ec677babcc08c1c5a641178f6
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoDon't try to dynamically resolve dbus symbols if QT_NO_LIBRARY
Ulf Hermann [Mon, 20 Jul 2015 13:13:48 +0000 (15:13 +0200)]
Don't try to dynamically resolve dbus symbols if QT_NO_LIBRARY

Change-Id: I9e307653229c04746d66d3a9f3b3e46ea9a42381
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
9 years agoFix warning about unused local variables
Thiago Macieira [Tue, 11 Aug 2015 07:48:14 +0000 (00:48 -0700)]
Fix warning about unused local variables

qopenglengineshadermanager.cpp(430): warning #177: variable "none" was declared but never referenced
qopenglengineshadermanager.cpp(431): warning #177: variable "br" was declared but never referenced

Change-Id: I7de033f80b0e4431b7f1ffff13f958e4a4cca16e
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
9 years agoforkfd: Add support for FreeBSD's pdfork(2) system call
Thiago Macieira [Sat, 14 Mar 2015 07:21:35 +0000 (00:21 -0700)]
forkfd: Add support for FreeBSD's pdfork(2) system call

pdfork(2) has semantics very close to what we want in forkfd, but not
quite. Differences:
 - we still get SIGCHLD and need to do a wait4
 - no support for atomic FD_CLOEXEC and O_NONBLOCK

On the SIGCHLD case: this commit is an improvement over the generic Unix
case, since we no longer need to install a SIGCHLD handler and do not
need to keep the arrays for matching PIDs and file descriptors. That
matching is done entirely inside the kernel.

However, since SIGCHLD is still sent to the process, an uncooperative
SIGCHLD handler can still "steal" our response. At least Glib is
documented not to reap children it wasn't explicitly asked to watch for
(source code matches), but other libraries are known to do waitpid(-1)
(e.g., EFL's Ecore). At least now the behavior is consistent: we will
never install a handler, so the behavior won't depend on the order in
which the handlers are installed.

Change-Id: Iee8cbc07c4434ce9b560ffff13cb4c63306e43ef
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>