It's interesting that the HMODULE/HINSTANCE pointer points to something
in the actual module that got loaded, so we can use its value as
"address of something in the module" for GetModuleHandleEx. The "PIN"
flag tells the Windows DLL loader to never unload.
Change-Id: Ifea6e497f11a461db432ffff1449a2169eb6293e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Since I'm changing QDateTime's privates, it's easier to know what may be
depending on it or not.
Change-Id: Id5480807d25e49e78b79ffff144a53018d057e19
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Incidentally, this corrects two small errors in the values of the
Medium and Heavy font weights.
Change-Id: I17d4410890f1f3bd1ed72e94f5ca0d43c21484e1
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The C and C++ standards say it's undefined whether the preprocessor
supports macros that expand to defined() will operate as an ifdef.
Clang 3.9 started complaining about that fact.
One solution was to change QT_SUPPORTS to check for zero or one, which
means we need to change the #defines QT_NO_xxx to #define QT_NO_xxx 1.
The C standard says we don't need to #define to 0, as an unknown token
is interpreted as zero. However, that might produce a warning (GCC with
-Wundef), so changing the macro this way is not recommended.
Instead, we deprecate the macro and replace the uses with #ifdef/ndef.
Change-Id: Id75834dab9ed466e94c7ffff1444874d5680b96a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The window is required to be able to determine the correct
scale factor for the screen when High DPI scaling is active.
Change-Id: I8f776684396d055754093f62e0d33bd7e23cb52b
Task-number: QTBUG-52943
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Query the native parent widget if the widget does not have a window handle.
The window is required to be able to determine the correct
scale factor for the screen when High DPI scaling is active.
Change-Id: Ibaf5e8e7b07327ea635d2f726acea76c2c95bda3
Task-number: QTBUG-52943
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
Not all classes inheriting QAccessibleInterface implement
QAccessibleInterface::window(), so, go up the hierarchy to find
one that does.
The window is required to be able to determine the correct
scale factor for the screen when High DPI scaling is active.
Fixes multimonitor issues for QtWidgets.
Amends change d7a3b61459.
Task-number: QTBUG-52943
Change-Id: I81733765faee4d296bd6ea046bc2cecb018eb28d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
This patch extends 5b54c352ed
by abstracting the watcher pattern. The class is specialized
for QCocoaWindow since it's aware of the QObject sentinel there.
We update the usage in QNSWindowHelper and extend it to the
forward window (this one is used for mouse coordinate conversion
when docking windows).
Change-Id: I628415527593daec835bbad1b6e83d13fe7b6703
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
If the geometry is being changed at some point while showing
the widget after reparenting, we set the Cocoa frame on the
QNSView. This results in Cocoa invalidating the view and
calling drawRect: before we get a chance to flush the backing
store.
This may be an issue if the previous parent toplevel window
has been deleted. In that case, the backing store pointer is
a dangling one, resulting in a crash.
Change-Id: I18b5dd7794a3bde8815daf3f84e4113a37aaea90
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Or, "Give Cocoa a Chance to do its Magic"
Some menubar items, like the "Edit" menu, get extra items added
at some point by Cocoa. Evidence points out to those extra items
being added right after the NSMenu holding the menubar is set as
the current menubar. At that point, both the child NSMenu and its
NSMenuItem (the entry in the menubar) must have their title set.
Therefore, we must set the menubar native item's title before
QCocoaMenuBar::updateMenuBarImmediately() sets the main menu.
Task-number: QTBUG-53085
Change-Id: Idd775cf0e3485739f38363a84cfed8d2db9cb662
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Marko Kangas <marko.kangas@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Change-Id: If78f6afeeeda5ea46a2ed17c6938fa25be9802fe
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
BLACKLIST should make it, recent regression in QUdpSocket went unnoticed
(first) because of 'insignificant'. We'd like to avoid such regressions
in future (again, using BLACKLIST if needed and fixig the real problem then).
NB: BLACKLIST in this patch was extended to deal with previously unnoticed failures on
Windows and OS X. 'multicast' and related family of of functions on OS X
will probably stay like this (seems to be a Darwin's quirk), datagram
size related tests - fixed in dev or 5.7 (change is in nativesocket engine,
'bytesAvailable').
Task-number: QTBUG-52714
Change-Id: I039b05935a02983ce1648de449907dfa765f7db7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This patch QSKIPs all tests that:
- take to much time sitting in some QTRY_VERIFY or similar before failing
- result in 'not in fullscreen mode' warning (with PASS) - thus completely flaky.
- Where previously determined to not apply to OS X using QT_OS_MAC
The intent is to make the test run-time more reasonable,
both when running the test locally and on the CI system.
Reduce the BLACKLIST - to avoid a 'double elimination' the tests that are skipped now,
should not be BLACKLISTed so that we fix them for good.
Task-number: QTBUG-52974
Change-Id: I34dc2010d0debc6b5b99f2375a6da902b7a17b29
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
While we on Linux will do a compile test to check for a
system zlib, the test on a Windows host was less accurate, causing
us to compile in the zlib from 3rdparty/ here. This caused compilation
errors after updating the freetype font engine to support color fonts,
since the zlib in 3rdparty/ was included implicitly in the freetype
library, and since it depends on Qt headers, the compilation failed
in this context.
The hotfix is to force system zlib on Android for Windows hosts, since
we know it is available in the NDK. Doing a proper build check is not
worth it right now, due to future plans for changing configure. We
will still break for an explicit -qt-zlib compilation, so the plan is
to fix this in an upcoming commit by separating libpng into
a library.
Change-Id: I7854c3c762fa37f7ee4b5f1112dbae8b5973ea86
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This fixes a problem that caused the QFont::Thin and QFont::ExtraLight
conditions to be unreachable.
Change-Id: I62a701c53222edffbddbf868311111374ae5bea8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Right now there are no iMX7 SOCs available with OpenGL capable GPUs
so the mkspec is very basic.
Change-Id: Ia5c83eea72c4d436c774b2955ccd71f2256bfd6b
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Have configure add a "CONFIG -= precompile_header" to qmodule.pri when
-no-pch is specified. Ensures that Qt is built without precompiled
headers (as requested) even if allowing precompiled header use is the
default for the toolchain.
Parallels changes to Windows configure.
Task-number: QTBUG-11545
Change-Id: Iab4021e74c4e9978770e917dff97b976c449dd8b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This patch allows handling of special block devices in random-access
mode that restores a Qt4 behavior.
Can not be tested because requires root privileges in the system.
Task-number: QTBUG-51666
Change-Id: Iaa56355f1be343c0d05b292e3c7d2e1c88724529
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Andrius Štikonas <andrius@stikonas.eu>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Some Windows kernels return a v4-mapped QHostAddress::AnyIPv4 as a
local address of the socket which bound on both IPv4 and IPv6
interfaces. This address does not match to any special address and
should not be used to send the data.
To allow handling of the local addresses properly, replace it with
QHostAddress::Any.
Already tested by tst_qudpsocket.
Task-number: QTBUG-52714
Change-Id: Icb7cb75f48cd7ec9b0a9dfaf861ffe0d3093e20d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... instead of using erase() in a loop, with quadratic complexity.
Change-Id: I277ff2527e0a22b3d754b1d14296b9882f164c23
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This patch will add touch based text selection support
to Qt from the iOS plugin.
QIOSTextInputOverlay will listen to changes to the
focus object, and if IM enabled, create three different
gesture recognizers that tracks what the user is doing.
The first recogniser detects if the user does a press
and hold on the text when there is no selection. If
triggered, it will show a loupe that follows the touch
around together with the cursor.
The second recogniser will instead be active when text
is selected, and takes care of drawing a set of handles
on each side of the selection. If the user drags on any
of the handles, a loupe will show that follows the
touch/text line together with the handle.
The third recogniser detects if the user does a tap, and
depending on if there's a selection, or if the cursor didn't
move, it will show or hide the edit menu.
The handles and loupe are implemented as overlays using
Core Animation layers.
Change-Id: Idff6e40e12307a458c9c399b0487bb976fce29c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
From testing on iOS, StartDragTime should be adjusted
slightly, from 500 (default in qplatformtheme.cpp) down
to 300. This will also affect how long the user needs
to press before the text selection magnifier shows
up for doing text selections.
Change-Id: I42ebfec6f0dc809b5d392412cf8f70d128ee6246
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
The test used to output random character sequences which contained
terminal control characters. Change it to output plain ASCII and
Unicode syntax for non-ASCII characters.
Change-Id: Ifaa72f50242bd27416a8698a1f5152bc8b902898
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Q_OS_DARWIN is the general replacement for Q_OS_MAC,
but most/all of the MAC sections in this test are
OS X specific.
Change-Id: Ic54af9d3dce1e1952a57e15b74acdedf2af60c79
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
In function QWindow::destroy() the platformWindow is destroyed
(QEglFSWindow in this case), but after that the QSurface destructor
is called (qsurface.cpp:127), where access to the opengl context is
performed (QOpenGLContext::currentContext()->doneCurrent()). Therefore
the surface pointer is deleted earlier (gbm_surface_destroy) than the
working with it (eglMakeCurrent) is finished. But the event
QPlatformSurfaceEvent, that is sent before deleting platformWindow,
isn't processed (qwindow.cpp:1665), though we can perform doneCurrent()
in the handler of QPlatformSurfaceEvent. The full description with
valgrind stacks on bugreports.
Task-number: QTBUG-52399
Change-Id: I69035dfd8ba5b5eeec243bc0edd3f571dc9525f9
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
If mesa-10.2.7 is installed, gbm_bo_create returns NULL
(QEglFSKmsCursor ctor, qeglfskmscursor.cpp:80), but after
that the pointer m_bo is used in function QEGlFSKmsCursor::changeCursor
without verification.
Task-number: QTBUG-52404
Change-Id: I5b1b15d751e46a5200248e7a8642f7917dedd220
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
The documentation wrongfully recommended deleting QTextFrames
directly. This would cause a crash, since the destructor didn't
update the document's layout at all. The correct way is the same
as when removing other aspects of the document.
Task-number: QTBUG-53082
Change-Id: I64f0ad08f1d063626456fa51d03611871ce6aa45
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Fix a warning about a missing case statement.
Change-Id: Ic89646704d62668cf83c463dbf6e9b549a4b5200
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
The test should not depend on qWait explicitly
Change-Id: I13c01c47c9f7bae8b0c30afa2ac8550dc0fbf028
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
This includes:
- have nothrow member-swap
- have ADL non-member swap
- not specialize qSwap or std::swap
Also prevent QScopedPointer <-> QScopedArrayPointer swaps by overloading
swap (both member and non-member) on QScopedArrayPointer. It's not 100%
safe, but it's what we're doing elsewhere (QMulti(Map,Hash), say).
That's technically a SiC change if users expected (qualified) std::swap
to invoke QScopedPointer::swap(), but those users were doing it wrong to
begin with, and they now get a compile-error instead of silent pessimization,
because generic std::swap() doesn't work on QScopedPointer, due to lack
of copy (and thus move) semantics.
Change-Id: I3ab5c1668722a2c8ccafc16f57310ce8d4bffbd6
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... by replacing them with C++11 range-for loops.
This is the simplest of the patch series: Q_FOREACH took a
copy, so we do, too. Except we don't, since we're just
catching the return value that comes out of the function
(RVO). We can't feed the rvalues into range-for, because
they are non-const and would thus detach.
Change-Id: I42c9c44d948ab1512a69d42890187bc3cf2d7e58
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
7edd10e6c added this compression feature, but it's not a good idea for
drawing-tablet applications, because smooth drawing depends on receiving
every movement of the stylus.
Also show the device ID in qt.qpa.input.devices category logging.
[ChangeLog][X11] The new X event compression feature that was added in
5.6.0 no longer applies to motion events from drawing tablets.
Task-number: QTBUG-44964
Change-Id: Icd2ca8ca77d8f80c2f39160c74208db10e382501
Reviewed-by: Gatis Paeglis <gatis.paeglis@theqtcompany.com>
This patch mainly do two things:
1) Support color bitmap font for freetype fontengine. This partially
based on Corentin Jabot's patch
2) Support ARGB opengl glyph cache when workaround_brokenFBOReadBack is
true (It is always true under Android). Some code refactor has been
done in QOpenGLTextureGlyphCache.
This patch also bump the minimal required freetype version to 2.2
[ChangeLog][General][Freetype] Support color font rendering
Task-number: QTBUG-35156
Change-Id: I35aae5f98ba9a27b70a48db3f2647fc070c39c33
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This can be enabled with QT_MAC_DONT_OVERRIDE_CTRL_LMB=1
environment variable. The goal is to provide consistent
cross-platform input when it's more desirable than full
platform comformance.
Change-Id: I3b96733077bd1c0367edeef21a98a44b15425807
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
In 5.7 the Gbm prefix was added but the .pro file was not updated.
This breaks static builds.
Task-number: QTBUG-53136
Change-Id: I37af46ff768bf8c1dc9269892db25d61b76c0376
Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com>
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
EGL headers including X headers has traditionally been problematic due
to getting macros for Status, None, etc.
In most cases this is not an issue anymore because on embedded one will
almost always use a driver targeting the framebuffer or DRM/KMS and
therefore the EGL headers do not pull in X dependencies.
Furthermore, Mesa supports MESA_EGL_NO_X11_HEADERS which we set, avoiding
the problem altogether with Mesa regardless of targeting X11 or KMS.
However, other drivers do not have this option. On i.MX6 for instance,
targeting X11 is problematic due to not having EGL_API_FB defined, which
in turn means the EGL headers pulls in X headers in order to be able to
define the native display and window types as Display and Window.
Try to play nice with this use case by reshuffling the includes and
undefining the problematic names.
Task-number: QTBUG-52928
Change-Id: I059f26b340b6e442e7296055915d18f5a1ce7a7f
Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
Prompted by Coverity CID 11720 (allegedly recently new in dev but
long-standing in 5.6). Even assuming the class is used correctly -
test initialize() and only use if that succeeded - the destructor
would have passed uninitialized arguments to munmap() and ioctl().
Noticed a double close along the way: it's been fixed on dev but
should have been fixed in 5.6, too. Documented why ioctl() failure in
switchToGraphicsMode() should at least do no harm.
Change-Id: Ie26a9eefa435b5ff5b1a02e03e29469b8db72d3c
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>