Commit Graph

18811 Commits

Author SHA1 Message Date
Morten Johan Sørvig
45bb9c29e8 Fix QHighDPiScaling initialization issues
Call QHighDpiScaling::updateHighDpiScaling() in init_plaform(),
after the platform integration has been created and most platforms
have populated the screen list. Keep the existing udpate call for
the platforms that don't, but guard against calling it twice.

Task-number: QTBUG-47947
Change-Id: Ib73bea7c4ab42e7acf6532f3a3100e1fc29acc2c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-10-26 09:25:38 +00:00
Marc Mutz
a681b90418 QNetworkAccessCache: convert QDateTime::currentDateTime() to currentDateTimeUtc()
The latter is much faster as it doesn't have to deal with
time zones.

This change is safe, because the timestamp member is only
ever handled inside, and the calculation of the time difference
does not depend on any particular time zone.

Credits to Milian Wolff, from whose QtWS15 talk this advice is
taken.

Change-Id: I6c9190a4253ce5972871ab1f12870f8ae9891966
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-26 09:00:26 +00:00
Eskil Abrahamsen Blomfeldt
4f4da7462b Support overlapping contours in glyph rasterizer fallback
Truetype fonts should be rasterized with a winding fill
as documented in e.g. Microsoft's specs.

Failing to do this caused a bug when doing native
rendering in Qt Quick for fonts that were large enough
that the fallback path was taken when drawing the glyphs
into the cache. If the glyph had overlapping contours,
they would be subtracted from the shape.

[ChangeLog][Text] Fixed an uncommon rendering error with
fonts containing overlapping contours.

Task-number: QTBUG-41197
Change-Id: I0e4a4432ba3f902bc3ea59d8f4dbd12a295630b2
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2015-10-26 08:07:55 +00:00
Maks Naumov
1721c83c27 QPathSegments::Intersection: reduce struct size 24 -> 16 bytes
Only for systems where qreal is double(8 bytes).

Change-Id: I3fd6b5d4279c41102ead24eef287bb37847398c1
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-10-26 08:23:45 +00:00
Shawn Rutledge
51dac9890d xcb: better error reporting when shmget() fails
Change-Id: I160ebc07f25fd08b86ca5494cb149c5fc7c70086
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-10-26 07:34:13 +00:00
Samuel Nevala
a8455ac5fa ANGLE: Fix winrt backing store to support feature level 9_3 devices.
Partially revert c7abf81786. Instead of using the ES3 entry point,
use ES2 for framebuffer blitting. This means that a small change is
required to ANGLE for the blit behave the same as ES3 (applied only for
Windows Store apps).

Task-Id: QTBUG-48266
Change-Id: Idc51f00a659c91f740876be071eb71bff69e0e38
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-24 09:41:03 +00:00
Liang Qi
7df107f026 Cocoa: Implement QPlatformInputContext::locale().
Listen to NSTextInputContextKeyboardSelectionDidChangeNotification.

Task-number: QTBUG-48772
Change-Id: Icea4ef61fd184edbe65a7f195318832a22c312ab
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2015-10-24 05:51:20 +00:00
Frederik Gladhorn
129d268246 Fix alignment in qConvertARGB64PMToA2RGB30PM_sse2
_mm_load_si128 requires 16 byte alignment. This crashes on 32 bit Windows
builds.

Change-Id: Ib6c30eba726747bbab56467eada820521981a80c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-10-23 21:11:43 +00:00
Alex Trotsenko
ccca3ffdc2 QNativeSocketEngine: declare PacketHeaderOption enum as a bit field
It should be possible to use these constants simultaneously and to
handle them separately from each other.

Change-Id: I0c48a3c25456b487c9d6139b05105ada20f34be6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-23 18:21:07 +00:00
Alex Trotsenko
192606a9fd QIpPacketHeader: correct the type of hopLimit member
In other places, it's referenced as int.

Change-Id: Ic66f33a34d45208686ad0e229644d3ef33c55a62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-23 18:20:49 +00:00
Thiago Macieira
f3e4769d05 Compile the 64-bit version of some code on all 64-bit processors
This is true for ILP32 on x86-64, IA-64 and AArch64.

Change-Id: I1d0f78915b5942aab07cffff140f9d4c277bb5d4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-10-23 18:10:27 +00:00
Marc Mutz
2cdafb0999 Convert some QDateTime::currentDateTime() to currentDateTimeUtc() (I)
The latter is much faster as it doesn't have to deal with
time zones.

This change handles the trivial ones: Either the call to
currentDateTime() is immediately followed by a call to toUTC()
or toTime_t(). The latter is much faster on UTC QDateTimes, too.

Credits to Milian Wolff, from whose QtWS15 talk this advice is
taken.

Change-Id: I872f5bbb26cbecedc1e5c0dbee4d5ac2c6eb67ee
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2015-10-23 18:09:18 +00:00
Alexander Volkov
8a8a5813a9 QMenu: Fix a typo EventShouldBePropogated -> EventShouldBePropagated
Change-Id: Id9439bd749576d1f7dfcb1653905f5de47b825b4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-10-23 14:03:15 +00:00
Gabriel de Dietrich
b50ee28eb5 QWidgetAction: Don't deactivate the current window on Mac
We check the name of the window class the widget's QNSView
changes window and set a flag when the that window is a native
Cocoa menu window. Later, only those views not inside a native
menu can become first responder, ensuring Qt won't deactivate
the main window.

We're allowed to reject becoming the first responder mainly
because Cocoa itself doesn't support sending key event to menu
views and, therefore, it doesn't change what's already possible.

This patch also sets the widget action visible, which needs to
be done right after reparenting it to the container widget.
Besides that, it also contains a few small code cleaning changes
related to Cocoa's support of QWidgetAction.

Change-Id: Ia2170bdc5e1f40bfa2f1091c05e9e99397c47187
Task-number: QTBUG-44015
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-10-23 11:28:49 +00:00
Erik Verbruggen
07475c662e OSX: replace use of deprecated API.
dragImage:at:offset:event:pasteboard:source:slideBack: on NSView is
deprecated since 10.7. Use the one on NSWindow instead.

Change-Id: Ia1c2ea367ae2ca5194b52ea57ab261461bf8b529
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-10-23 07:51:34 +00:00
Marc Mutz
8515aa1871 QTextStream: optimize streaming of QLatin1String and const char*
Instead of converting the QLatin1String to a QString at the first
opportunity, keep it around until it is appended to one of the
internal QStrings in write().

Avoids a memory allocation per QLatin1String / const char* streamed.

Change-Id: Id973a9b743e5a6696defbc4ef4ed2db1ef54e9cc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-23 05:51:00 +00:00
Thiago Macieira
be926e412c Prevent the pixmap cache from crashing if it's been destroyed
In case the static destructor has already been run, make sure we don't
crash. This shouldn't happen, but could happen if the QApplication
destructor is run in a weird order (after the static destructors have
begun running).

That's not usually a case we'd fix (unsupported), but since this change
improves the code and also avoids creating the pixmap cache if it hadn't
been used up until this point, the change is a net benefit.

Task-number: QTBUG-48709
Change-Id: Ia505aece07bf4e13a1faffff140f3e119cfc773e
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-10-23 00:16:01 +00:00
Lars Knoll
cefc393059 Respect QPen::dashOffset when generating PDF
Change-Id: I26de1cd4a14d1b8978be6d0377cb2cba573fc82a
Task-number: QTBUG-47164
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-10-22 20:18:39 +00:00
Lars Knoll
661bcb79c8 Fix warning message to match the function signature
Change-Id: Ie21d63e29351dae9a52998e3d1068500e502ec5a
Task-number: QTBUG-46693
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-10-22 20:18:27 +00:00
Frederik Gladhorn
8ea61d6d2a Fix alignment issues on 32 bit in qConvertA2RGB30PMToARGB64PM_sse2 and qConvertARGB32PMToARGB64PM_sse2
On 32 bit platforms the pointers may end up being 4 byte aligned.
Happens with MSVC on 32 bit Windows. _mm_store_si128 is documented to
require 16 byte alignment.

Change-Id: I80737fedf9e7f436a51a83924117cc0bc63017cc
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
2015-10-22 19:40:19 +00:00
Oswald Buddenhagen
f343989852 qdoc is moving back to qttools
Change-Id: Icb5abd32a1cbc3e8d876341c877e8d2a963c0e25
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-10-22 19:40:09 +00:00
Marc Mutz
a903ddd8dc QTextStream: Extract Method padding() from putString()
This is in preparation of adding a putString(QLatin1String) overload.

To keep the change simple, I kept the construction of the padChar
chain per putString() call. It probably makes sense to have a
QString::resize(int, QChar) to perform the padding operation in-place.

Let's leave that for another changeset.

Change-Id: I9ef66b8df38117e1669fd2bece6ee180a2ce3369
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-22 18:41:56 +00:00
Olivier Goffart
d206d04b7c moc: fix Q_PROPERTY with parentheses in their MEMBER clause
This was never a documented feature, but happended to work before Qt 5.5.
It broke because the peoperty access went into the static function and are
now prefixed with '_t->'

So restore the behavior as it was by not including the parentheses in the
member name.

Task-number: QTBUG-47695
Change-Id: Ic3509ddea7ac9abc871e71f5bfbe81d04d08e9bc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
2015-10-22 16:48:26 +00:00
Samuel Nevala
f57afda69f winrt: Fix sending of back key event.
Windows Runtime side callback is run from XAML thread and receiver
is at UI thread thus sendEvent asserts. Use synchronous system
interface key event handler to deliver the event.

Task-Id: QTBUG-48105
Change-Id: I91a8ef6fd29c277edfb699b688b9e7895dadda8f
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-22 13:28:51 +00:00
Samuel Nevala
0d5bf2eb59 Remove superfluous newline
Change-Id: I556ac48f586633faa6b7048e03a33a0f018973e6
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-22 10:21:47 +00:00
Laszlo Agocs
d0cbd1e0b8 eglfs: Avoid sending enter-leave events with an invalid leave ptr
Task-number: QTBUG-48890
Change-Id: Iad82f285a0c982a5fafd276459b8177086d43d1b
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2015-10-22 09:21:54 +00:00
Samuel Nevala
ceec35a6de winrt: Connect callbacks after after integration class constructed.
It was possible for Windows Runtime callback to run while integration
class was constructed. That caused an assert when handling
application state change. Fix this by connecting callbacks after
integration class fully constructed.

Change-Id: I029c2e1f932e8edc3665443cc17dbf11eaae1bf6
Task-Id: QTBUG-48109
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-22 08:58:23 +00:00
Friedemann Kleint
9388bbe4bd Windows: Implement QPlatformInputContext::locale().
Initialize locale from current keyboard value and listen
to WM_INPUTLANGCHANGE.

Task-number: QTBUG-48772
Change-Id: I53b6ef4e2cf538bb81b41ea497ed0cb66991b104
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-10-22 08:45:16 +00:00
Samuel Nevala
e137676354 winrt: Add missing Q_DECL_OVERRIDEs
Change-Id: Ifbf2995baa2eedc726e814b04b51bde6e91a7c40
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-22 06:11:07 +00:00
Alex Trotsenko
e1d4c16aef QNativeSocketEngine: allocate more space for the ancillary data
As a corner case on BSD systems, we use IP_RECVIF control message to
retrieve an interface index of the received datagram. Take care about
sockaddr_dl structure, while calculating a size of the ancillary
data buffer.

Change-Id: I1c113d390a4929489c4c5858847b6262f1baa204
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-21 19:18:45 +00:00
Laszlo Agocs
2a1d3f330d Add support for TEXTURE_EXTERNAL_OES in the internal texture blitter
Assuming that the target is always GL_TEXTURE_2D is not going to be sufficient
when working with EGLStreams for example where GL_TEXTURE_EXTERNAL_OES is a
must. The blitter is now changed to support multiple programs so other targets
can easily be added as well in the future, if necessary.

Change-Id: I247d30600222fb5af6305ed5d9740baa5e43e83e
Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com>
2015-10-21 13:32:42 +00:00
Edward Welbourne
3dff3fdefb Several cases of s/decelerating from/decelerating to/.
The relevant easing curves all start out fast and end stationery; so
it's at the *end* that they attain zero "velocity", so they're
decelerating *to* zero, not from it.

Change-Id: I69874c46c8d42f185ff815295c4470a195cc43ae
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-10-21 13:19:55 +00:00
Maurice Kalinowski
fb049254c8 WinRT: Fix InputPanel on Windows 10
Check for MSVC2015 to enable usage of IInputPane(2). Move object
construction to the XAML Thread, otherwise instantiation will fail when
running on desktop.

Task-number: QTBUG-44494
Change-Id: I816230cc5b0def796e86e6c6bb05a552a4e59d1b
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-21 12:59:37 +00:00
Topi Reinio
70b229d996 qdoc: Minor optimizations
Remove unnecessary type casts in qdocindexfiles.cpp, and reduce the
amount of duplicate string literals used for generating QML
documentation.

Change-Id: Ia6d68a44fad14bd7414c0106e8752999830c93e8
Reviewed-by: Martin Smith <martin.smith@digia.com>
2015-10-21 09:52:29 +00:00
Topi Reinio
d159fe199f Doc: Update examplesinstallpath to include the repository name
The examplesinstallpath variable in .qdocconf files defines the path
under QT_INSTALL_EXAMPLES where examples are found.

To match the way examples are packaged in Qt 5.6, prefix each
install path with the repository name.

Task-number: QTBUG-48736
Change-Id: I6a35c94fdacaad21cd044411aba02027b9019300
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2015-10-21 09:50:16 +00:00
Thiago Macieira
bf92993829 Add an automatic use of the ELF-versioned QtCore symbol
See the comment in the header for an explanation of what it does.

This trick is enabled for every single .o that is compiled, unless
QT_NO_VERSION_TAGGING is defined. The assembly expands to a COMDAT
section, which is mergeable by the linker, so only one copy of the
output is present in the ELF module.

This is enabled only for Linux and x86 / x86-64 / x32 due to the
requirement of writing assembly and relocations, so it needs to be
tested on each platform, which I have not done. It might work on
Solaris/x86, but again it requires testing. Support for other
architectures requires different assembly output and relocations and can
be added as needed, but they are not as important since this trick is
has most value on desktop systems.

Change-Id: I049a653beeb5454c9539ffff13e3ff5782a8cb86
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Rex Dieter <rdieter@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-20 16:21:03 +00:00
Thiago Macieira
629ceec208 Update qversiontagging.cpp not to use too much assembler magic
The only reason I had used them in the first place was because C
preprocessor macros cannot call themselves recursively. But the magic
was too magic and caused issues with some builds, so let's choose the
safer option.

Anyway, this solution now works for all ELF architectures, independent
of the processor, whereas previously it was restricted to x86 and Linux/
FreeBSD. However, this does not apply to the assembly in
qversiontagging.h.

Change-Id: I42e7ef1a481840699a8dffff1404f032fc5cacb8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2015-10-20 16:20:34 +00:00
Andrew Knight
e19bedc846 winrt: use correct winapi family defines in mkspecs and system detection
WINAPI_FAMILY_APP is deprecated, so use WINAPI_FAMILY_PC_APP instead. Also,
open up the phone partition for use on MSVC2015.

Change-Id: I7476d71c31395b2914f5a1439e8088341976bf2f
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-10-20 14:29:16 +00:00
Marc Mutz
4388c6a669 QLatin1String: add some nothrow
Change-Id: I488fe7c4122febf46caa6487d92f61391edd41a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-20 14:11:06 +00:00
Marc Mutz
5a2d0cf5fe [docs] QLatin1String: add some guidance as to when to use it
Change-Id: I391be8bda3a5cb4873b89b437d2b76b1cd88261f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2015-10-20 14:09:00 +00:00
Laszlo Agocs
101a6bda45 Fix GL_VERSION parsing when using WGL
Unlike other platforms and the EGL path, this one tries to parse
GL_VERSION on its own. Unfortunately it breaks for certain version
strings: we cannot assume more than major.minor in the beginning
and so looking for a second dot is wrong.

For example, "2.1 Mesa 7.11-devel" is parsed as major "2", minor
"1 Mesa 7" (result in 0), leading to a version of 2.0 instead of 2.1.

To overcome this, use the common helper function in
QPlatformOpenGLContext.

Change-Id: I460f4276a3a06659b542e0c076ddc1ada3122907
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-10-20 13:11:11 +00:00
BogDan Vatra
f35797991e Android: Make sure we deliver all queued actions when we resume.
When the activity is paused, all runOnUi actions are dropped :(, this
patch ensures that no action is lost no matter what.

Task-number: QTBUG-45526
Change-Id: I61db4f73b0d2da47bf71a1324dc40b90dab01e81
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-20 13:08:37 +00:00
BogDan Vatra
31ef0d0dd6 Android: Warnings--
Change-Id: I79bef1e5e73fedf2bae61d6cfc9634a14958ba0e
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-20 13:08:29 +00:00
Maks Naumov
9b54f4c81c QFileSystemModel: cleanup sortChildren()
Second value of QPair is not used.
And add reserve for "indexNode->visibleChildren" list before pushing.

Change-Id: Ia002130c929f71e0802f73f4c0694fd2887b4c91
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-10-20 09:46:05 +00:00
Erik Verbruggen
6df48eb668 Fix compilation on OSX when building in a namespace.
Change-Id: I377d9ffe95b72e098a91e6da564b59a56b34cf4e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-10-20 09:30:28 +00:00
Marc Mutz
dd8351b654 QLatin1String: add default ctor
A pending change in uic depends on this.

[ChangeLog][QtCore][QLatin1String] Added default constructor.

Change-Id: Ie6f5dfc7b38683a488b0ff7f31404800ef5ee188
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2015-10-20 09:27:21 +00:00
Laszlo Agocs
5c3cd4a6a1 Move EGLDevice/Output/Stream resolvers into eglconvenience
Needed by Qt Wayland as well.

Change-Id: Ic349f0a79831e9121cbe9885246897efea2701d5
Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
2015-10-20 08:54:04 +00:00
Lars Knoll
f4bfdc8610 Add the proper NOTIFY signal to the primaryScreen property
Change-Id: I1c1fa6c93d9c0284b5a9b790c9066a0c8c722d70
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-10-20 06:54:11 +00:00
Maks Naumov
d2648d5f3f QFileSystemModelPrivate::name(): avoid the double-lookup
Change-Id: I67507248220fbbddc67ab60ecb1933e1fbacf5fd
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-10-20 06:45:57 +00:00
Maks Naumov
bfb6a8cd44 QFileSystemModel: avoid detaching
Change-Id: If7e9f11e5514b2f8975e7f83c56b606e67f5952f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-10-19 17:58:24 +00:00