Commit Graph

24953 Commits

Author SHA1 Message Date
Joerg Bornemann
507625d984 fix assertion in QProcess/Win
Do not call bytesAvailableInChannel if the source pipe end is
invalid. This is the case when redirecting channels on Windows.
The assertions in bytesAvailableInChannel were triggered whenever
an output process or output file was set and waitForBytesWritten
was called.

Task-number: QTBUG-45548
Change-Id: I225dfea2c5e27e122f75008a3a06d425554e00fe
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-08-17 08:25:19 +00:00
Oliver Wolff
ec4426fada WinRT: Skip unsupported multicast UDP socket tests
Change-Id: I69f756ad829569060ae9931748b940842d23a6ea
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-08-17 08:07:49 +00:00
Oliver Wolff
265cda469f tst_qudpsocket: Do not crash if no testserver address could be found
Change-Id: Ica61974b20b848997c8ab101abde4b536814ba83
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-08-17 08:07:46 +00: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
David Faure
4ccf5c6f4a QMimeDatabase: adapt to changes in shared-mime-info 1.3
The generated xml file is now lowercase.
This was changed in shared-mime-info 3805d0bcf2.
It led to runtime warnings "No file found for ...", which helped notice the bug.

Change-Id: I31f0fc7f0fe8a098c3f79c0bcbeeb1909d2cc05a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-08-16 13:33:21 +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
1ff66a7962 QProcess: Ensure that the stdin buffer is cleared on start()
The buffer may have been left dirty if we were unable to write all the
data to the child process in the previous run. So ensure we clear it
before starting a new one. We already did that for stdout and stderr,
for some reason.

Task-number: QTBUG-44517
Change-Id: I1a800c709d3543699131ffff13c419da3bbffacf
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-08-15 21:59:26 +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
Samuel Gaist
40a4105fae Fix QChar char constructors documentation
Reverts the wrongly added \internal and adds a warning for users that
the constructors will not be available if QT_NO_CAST_FROM_ASCII is
defined

Task-number: QTBUG-39862
Change-Id: I038eea3f4eef0b914b470309a2f515741eec35a9
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2015-08-13 21:04:27 +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
Morten Johan Sørvig
ce651b961d 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>
2015-08-13 18:27:28 +00:00
Ulf Hermann
c65b8381bb 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>
2015-08-13 17:09:43 +00:00
Alex Trotsenko
6fca88607b 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>
2015-08-13 17:08:28 +00:00
Milian Wolff
194403a348 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>
2015-08-13 16:53:45 +00:00
Thiago Macieira
1183fb3ea9 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>
2015-08-13 16:35:23 +00:00
Thiago Macieira
6d8c7a61f5 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>
2015-08-13 16:35:14 +00:00
Thiago Macieira
01d0b1d6e3 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>
2015-08-13 16:34:51 +00:00
Andrew Knight
807ec8ea48 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>
2015-08-13 16:12:37 +00:00
Andrew Knight
ebc2b963aa 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>
2015-08-13 16:12:18 +00:00
Andrew Knight
130083a7fc 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>
2015-08-13 16:12:10 +00:00
Andrew Knight
cea03fa3e3 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>
2015-08-13 16:12:02 +00:00
David Faure
6c09b9e553 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>
2015-08-13 15:23:01 +00:00
Ulf Hermann
efa379b9d5 Don't try to dynamically resolve dbus symbols if QT_NO_LIBRARY
Change-Id: I9e307653229c04746d66d3a9f3b3e46ea9a42381
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-08-13 15:02:55 +00:00
Oswald Buddenhagen
e26a20fef9 fix up license references
Change-Id: Ie034902729bb3af498a69d077e50de360c54c051
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-08-13 11:13:09 +00:00
Andrew Knight
68c915f3df ANGLE: call flex/bison by their standard names
qt5.git now contains the winflexbison tools as flex/bison.

Task-number: QTBUG-46852
Change-Id: I8b86cd4211ae8fb120f955be1f423f94b10b318e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-08-13 10:24:53 +00:00
David Faure
109cdeda30 qprintdialog_unix.cpp: fix out-of-bounds when cwd is empty.
This happens when the cwd got deleted meanwhile; this warning is printed out:
QFileSystemEngine::currentPath: getcwd() failed
and currentPath() is empty. Not a problem in itself, but qprintdialog
should not assume it's not empty, then.

Change-Id: I5c89992b36ca58b6325ced399cff33aca9efb7ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-08-13 08:54:47 +00:00
Olivier Goffart
314c83c0c2 Do not use Q_GLOBAL_STATIC in the implementation of QMutex
Since Q_GLOBAL_STATIC might use QMutex and cause a stack overflow.

Task-number: QTBUG-47554
Change-Id: I4853c5e9b9168d4a417200e2a45a1bf9cb103a30
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-08-13 07:03:23 +00:00
Michael Klein
e3d7cf7c96 Cocoa: fix integer multiplication overflow in qt_gettime()
Task-number: QTBUG-24031
Change-Id: Iae00b10b6a7423508669ef173a80a03b3dd388c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-08-13 01:16:17 +00:00
Milian Wolff
af3152adee QMimeProvider: Do not crash when globPatterns is empty.
Change-Id: I351a533a1f03ac2e7bdec876b657a80fac60b2ed
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2015-08-12 13:20:20 +00:00
Oswald Buddenhagen
a47cd2cc82 Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5 2015-08-12 09:53:52 +00:00