Commit Graph

24723 Commits

Author SHA1 Message Date
Thiago Macieira
28dfc33c3a QNativeSocketEngine: add code to send extra IP header data
Change-Id: Iee8cbc07c4434ce9b560ffff13ca48c053bd88ed
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-08-22 22:26:37 +00:00
Thiago Macieira
abe269bb72 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>
2015-08-22 22:26:33 +00:00
Thiago Macieira
ef05ad0ac5 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>
2015-08-22 22:26:30 +00:00
Thiago Macieira
5b38454714 Autotest: Print errno in case of failure
Change-Id: I7de033f80b0e4431b7f1ffff13fc4a02e1c1a2a5
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-08-22 22:26:27 +00:00
Thiago Macieira
89efa7333d 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>
2015-08-22 22:26:23 +00:00
Friedemann Kleint
53251e23cf 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>
2015-08-22 22:26:19 +00:00
Thiago Macieira
3997321199 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>
2015-08-22 22:26:16 +00:00
Thiago Macieira
39c2b8c5c1 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>
2015-08-22 00:10:39 +00:00
Laszlo Agocs
b409b1a0e4 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>
2015-08-21 21:02:56 +00:00
Laszlo Agocs
19e61ac290 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>
2015-08-21 12:43:41 +00:00
Friedemann Kleint
5549ba4fa5 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>
2015-08-21 10:37:22 +00:00
Samuel Nevala
b349289fa0 winrt: Hide status bar on windows phone.
Task-Id: QTBUG-47789
Change-Id: I9ca5f336ba9ee7524d4a4bbff3bbf4fbbb56fd54
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-08-20 05:41:26 +00:00
Thiago Macieira
5bf5fe964b 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>
2015-08-19 22:13:23 +00:00
Topi Reinio
e525d1f44d 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>
2015-08-19 12:06:05 +00:00
Topi Reinio
2473f4fac3 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>
2015-08-19 12:06:00 +00:00
Topi Reinio
d558100aa7 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>
2015-08-19 11:30:23 +00:00
Friedemann Kleint
53762b102b 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>
2015-08-19 11:19:09 +00:00
Thiago Macieira
dd92002416 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>
2015-08-19 06:13:33 +00:00
Simon Hausmann
b479d5befb 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>
2015-08-19 05:03:26 +00:00
Friedemann Kleint
e50629cc0d 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>
2015-08-18 20:03:35 +00:00
Friedemann Kleint
2f50102f85 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>
2015-08-18 20:03:21 +00:00
Laszlo Agocs
df80753134 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>
2015-08-18 08:07:31 +00:00
Laszlo Agocs
95aad72e84 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>
2015-08-18 08:07:27 +00:00
Laszlo Agocs
1fe890317a 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>
2015-08-18 08:07:21 +00:00
Laszlo Agocs
b652c19f08 Add Intel NUC device makespec
Change-Id: I2ffaadd06f27da8ec8f44d7d698e84e1fe780270
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2015-08-18 08:07:18 +00:00
Oswald Buddenhagen
5a039bf53e Merge dev into 5.6
Change-Id: I061f2513ef58f696e75b11928d89aaaf059659a3
2015-08-17 19:55:41 +02:00
Thiago Macieira
dbcf5730ac 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>
2015-08-16 18:12:54 +00:00
Thiago Macieira
3ae90ed371 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>
2015-08-16 18:12:51 +00:00
Thiago Macieira
4fbc63f03b Fix thread-safety of qnetworkinterface_win.cpp:resolveLibs
Change-Id: Ia4b5103c9c590c24de9a43c5c7097b0c7b83e679
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-08-16 18:12:47 +00:00
Thiago Macieira
c72311440b 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>
2015-08-16 18:12:44 +00:00
Thiago Macieira
8fa44b382f 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>
2015-08-16 18:12:42 +00:00
Thiago Macieira
1bf9cb44e2 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>
2015-08-16 18:12:39 +00:00
Martin Smith
89302b8b88 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>
2015-08-16 14:48:13 +00:00
Martin Smith
330da82cc2 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>
2015-08-16 14:48:06 +00:00
Martin Smith
8c5ce68fcf 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>
2015-08-16 14:47:58 +00:00
Alex Trotsenko
6dde874c32 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>
2015-08-16 14:22:32 +00:00
Olivier Goffart
f029468b8d 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>
2015-08-16 08:23:32 +00:00
Thiago Macieira
3bfba054cb 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>
2015-08-15 04:35:42 +00:00
Thiago Macieira
060b7ffe5b QtTest: Add QHostAddress support for QCOMPARE failures
Change-Id: Iee8cbc07c4434ce9b560ffff13cc6dad04a5a554
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-08-15 04:35:34 +00:00
Thiago Macieira
45e59556ed 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>
2015-08-15 04:35:23 +00:00
Sérgio Martins
385202c27c 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>
2015-08-14 23:34:26 +00:00
Andreas Hartmetz
ea3e2ca6ea OSX FreeType: respect hinting preference
Task-number: QTBUG-42839
Change-Id: I2bccd7bda74ccbbb752181f1caea7ecf4672c01c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-08-14 23:34:22 +00:00
Thiago Macieira
c21113f9ee 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>
2015-08-14 20:17:43 +00:00
Andreas Hartmetz
b71b36fa22 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>
2015-08-14 19:07:11 +00:00
Timur Pocheptsov
fbc3b6f405 Fix a typo
'Do', not 'dot' in the help's text.

Change-Id: Ib0ccdd50ae62085571c5f932650b9209fa966d79
Reviewed-by: Richard J. Moore <rich@kde.org>
2015-08-14 03:22:08 +00:00
Morten Johan Sørvig
7a0222fba3 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>
2015-08-13 18:34:05 +00:00
Morten Johan Sørvig
65cbf263a3 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>
2015-08-13 18:33:39 +00:00
Morten Johan Sørvig
e5d54c8af7 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>
2015-08-13 18:33:03 +00:00
Morten Johan Sørvig
a50db99d15 Add QPlatformWindow::windowFrameGeometry()
Convenience accessor for use by the Wayland
platform plugin.

Change-Id: I420209138cfc285f8396913548b9e158a35ee9c1
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-08-13 18:28:51 +00:00
Morten Johan Sørvig
8f747efcc1 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>
2015-08-13 18:28:28 +00:00