This fixes a bug when submenus are shown as simple actions when
a platform system tray icon is used.
To correctly handle submenus, we need to set platform menus on
all submenus, and only then on a parent menu.
Change-Id: If2bfcc703b938dbb14ba4b9aa810039ced07e946
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Dimitrios Glentadakis <dglent@free.fr>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Implemented handling of GID_DirectManipulation for WinCE.
Derive touch information out of gesture event
directmanipulation.
Task-number: QTBUG-31216
Change-Id: I74e90f32d2384fc3550b47af0b72edf0292dea8f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
The note is already in setItemWidget where it makes sense.
This looks like a copy/paste error; this method doesn't change
anything in terms of ownership, it's a getter.
Change-Id: Idc963787b81f53fb37bbe59e9bf35f47d3441b34
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Gets rid of warning that the file is missing, but probably doesn't
have any other effect since the file in question does not require
moc-ing.
Change-Id: I22085a55c212b6285341d61462dfaf548787e11c
Reviewed-by: BogDan Vatra <bogdan@kde.org>
When we supported platforms < android-9, we needed to include
some headers which were introduced in android-9 to compile the
QPA plugin. This is no longer needed, and also creates problems
when you pick e.g. android-21 as your platform, since some
definitions (specifically fd_set) are different in the two sets
of headers, giving us an undefined reference to
QEventDispatcherUNIX::select().
Change-Id: Ifd28479b4bf3be0e9e62200a01fc4cf2cc855215
Reviewed-by: BogDan Vatra <bogdan@kde.org>
Setting the stretch of a QFont did not work correctly on OS X or
iOS.
Two things are needed to make it work: First of all, we need to
properly set the transform when creating the CTFont.
In addition, we need to manually scale the advances, as
CTRunGetPositions() does not do this for us. On OS X 10.6, however,
there was a regression and CTRunGetPositions() would return scaled
positions, so we exclude the step to scale the advances on this
particular version.
This is an adaptation of bc25cfdd65452efa226cbd544c9ae9803eb6748a
in Qt 4.
[ChangeLog][QtGui][OS X/iOS] Fixed a bug when rendering fonts that
were set to be stretched.
Task-number: QTBUG-43801
Change-Id: I4902a9f5e29299761e3c2c5c6d6d80ee1dea1a25
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Only happens with active signal spy callbacks. The Connection object can
be deleted when returning from the slot here, so accessing it for the
method index for the signal end callback will access invalid memory.
Change-Id: I44643a171863c35a94e7a5ffa096fcaac5abd509
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
When creating a temporary directory but failing to set its permissions,
we need to remove the directory we created to avoid leaving 256 empty,
unused directories in the destination folder.
This happens on Android if you try creating a QTemporaryDir in the
download path on the sdcard.
Task-number: QTBUG-43352
Change-Id: Ic88fb7572f1abd65e5c7d8882b59c95f4b22ed72
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
ChildWindowFromPoint does not work properly under
wince, so lets use the plain old WindowFromPoint.
Task-number: QTBUG-44022
Change-Id: I49bae6409f2d11ddc01bea01f4c2f91a02b90892
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
bec1854cc0 introduced a regression:
when sorting a tree model, children items would not follow the sorted
parents any more (they wouldn't be remapped correctly), resulting
in crashes.
So, the fix needs more reasoning; let's revert the fix,
but leave the original test around for any subsequent attempt, and
introduce a new test which looks for the right behavior when
sorting trees.
This commit partially reverts bec1854cc0.
Task-number: QTBUG-43827
Change-Id: Ic83ac53aef639f870f6c36a8b4b2992f5b485b13
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Volker Krause <volker.krause@kdab.com>
(cherry-picked from qtbase/e9ad46ed412987e3e46c5a641e5f30408b97ac90)
The documentation says that QUdpSocket emits readyRead() only for one
datagram and that if you don't read it, the class will not emit again.
That should be implemented by disabling of the socket notifier once we
have the datagram already read, but was broken.
In turn, that breakage caused a live-lock of the event loop: since we
didn't disable the notifier nor read the pending datagram, the event
loop would fire every time for the same datagram.
The re-enabling of the notifier was already working.
Task-number: QTBUG-43857
Change-Id: Ic5d393bfd36e48a193fcffff13bb32ad390b5fe8
Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
The selection update is not implemented on other platforms (if needed at
all).
Task-number: QTBUG-39440
Change-Id: I8eb8c4eb1c23ba2d246bc95f1c77dc9da9e22495
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Left-shifting of negative values is undefined ([expr.shift]/2).
Use multiplication with 64 instead.
There are probably more instances in this class, but this patch
already gets rid of vast amounts of ubsan errors in
tests/auto/gui/text.
Found by UBSan.
Change-Id: I89b8bb61e4decba605fe4fb3efea68b1f1eacf1a
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There's already some code to be able to generate the rcc files from stdin,
only problem being that the input sanity check was not allowing the code
path to proceed being left unreachable.
This patch fixes it by allowing "-" as an acceptable argument and the
process proceeds as expected.
Change-Id: Icd47c7a65373ff1ea3f98d9528736f8a1b21b707
Reviewed-by: Albert Astals Cid <albert.astals@canonical.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Don't recommend a common value for maxlen, because we don't really
know it. Soften a statement about not applying QString::trimmed()
to the result because it may contain surrounding spaces.
Change-Id: Ie90db6f033cfcc0dff0ef6796ba115028bcaaa77
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
We forgot to initialize the tracker if create() was used.
Task-number: QTBUG-43696
Change-Id: Ic5d393bfd36e48a193fcffff13b740931ff2204b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
For windows that do not have WS_EX_TOOLWINDOW set, the WINDOWPLACEMENT
API uses workspace/available aera coordinates. Introduce a helper
function to return the offset and use that.
Task-number: QTBUG-43872
Change-Id: I329c640f180524699b45b855b4583f447c4a0987
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Replace by QCOMPARE where applicable; introduce message to generate
output for failed comparisons with QVERIFY2().
Task-number: QTBUG-43872
Change-Id: I09c8f9fd31ceed224e441f253049f68907ca0d7a
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Since we don't configure HB-NG via its configure script, we have to
define all optional switchers we do care about by our own.
Some of these switchers were missing in harfbuzz-ng.pro, causing
HB-NG to be built with no threading support.
Task-number: QTBUG-43850
Change-Id: I0944a68fe0bfae3306a3e6085e25704f0d0d0efc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
The NSStrings return by QString::toNSString are autoreleased;
manually releasing them is not correct. The test still
works (no leaks or double deletes) since there is no
autorelease pool in place when running it.
We don't want to encourage incorrect usage: remove
the release call an add an autorelease pool.
Change-Id: Ic566fd3a8efd6cbc0eb6db850248a68bfc8fed0b
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
They were added in 233a2f37bf, which is in
5.4, but the \since information was missing.
Change-Id: I346a049cad75647fdcd7b64df80dc169bb4ec70a
Reviewed-by: Richard J. Moore <rich@kde.org>
The fake expose generation for shrunk windows is causing
side effects with desktop GL: it will generate expose events
even when only moving the window. This is bad. So change the
condition to look for shrinking and do nothing if the size is
same as before.
This is reported to cause perf issues with e.g. QOpenGLWindow
or similar where an expose does an immediate repaint (potentially
with block swap).
Task-number: QTBUG-32121
Change-Id: I4687ea8210cee6691d608450c48b1dbef52d6df3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Right now it breaks in qwindowseglcontext due to its ifdefs for
static ANGLE-only builds. The checks for QT_STATIC should be
extended with QT_OPENGL_DYNAMIC so that it continues to resolve
functions dynamically in -opengl dynamic builds even when combined
with -static.
Task-number: QTBUG-43993
Change-Id: Iac6d0353ef16a32a22ab1db0a833fbb0165f328c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
QOpenGLWidget and QQuickWidget was not functional when
WA_TranslucentBackground was set. This is due to the
static "isGL" type of checks that are not suitable since 5.3
due to RasterGLSurface windows which may or may not be
OpenGL windows, depending on their content.
To handle this, we have to do some check on every makeCurrent
and perform the necessary calls (most importantly
SetLayeredWindowAttributes).
Task-number: QTBUG-43854
Change-Id: If19c79482ec4f0a8b795ee710d52ed7e08b52563
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
It was previously not possible to render to a QBackingStore
with the linuxfb platform plugin because of both the use of
a QTimer created on the main thread and there was no lock
on the backing store surface (which would lead to copy content
to screen that being rendered in another thread).
Change-Id: I0ea3600316ce29eb89f6595997847afe7086116f
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Change-Id: Ie6c659f6d8e8b3eeaf2453f0cba6189d56f86581
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
The old harfbuzz code path is included as a fail safe for any
possible use case where the Harfbuzz-NG regresses, but because the
variable was checked statically, it was not actually possible to
build a releasable executable which employed the work-around.
Instead we use the regular global static pattern where the variable
is queried the first time it's needed.
Task-number: QTBUG-43850
Change-Id: I9ade76bf0825bbfefebdbdc4e6ee5571f1a3deec
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Delay initialization/GL detection until a surface is requested.
Remove member variable from window and access static context
from QWindowsIntegration only.
Task-number: QTBUG-43832
Change-Id: I4b9a324b58af4399df5c314bfb2b952455b1e080
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
The code makes usage of _fileno without including the appropriate
header, which is stdio.h according to Microsoft:
http://msdn.microsoft.com/en-us/library/zs6wbdhx%28v=vs.120%29.aspx
Task-number: QTBUG-43900
Change-Id: Ic9d407c66243d64823353a1c7e79cf0825c735db
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
The text edit that shows which flags we have set should be updated in
PreviewWindow::setWindowFlags() and PreviewWidget::setWindowFlags()
but QWidget::setWindowFlags() isn't virtual so only the base class
one was called.
Change-Id: I5c9d47d003d5701dde1ab63df0d349f641d66f44
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
We have the same check for null already for PE_IndicatorHeaderArrow
which actually uses the same pixmap. If the file is not found the
pixmap will be null and the code dividing by its width or height will
thrown an arithmetic exception.
Task-number: QTBUG-43067
Change-Id: I13a5ee9f21f4189b7bbcfd57a6f5b52113de834d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Since the former is monotonic and we need a monotonic timer here.
Change-Id: I34325da4fe0317e12f64629a6eef6a80990c3e1a
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This function is private.
Task-number: QTBUG-35907
Change-Id: I370c0bfd8fda11c68ee76ee42967f117a81b381c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
The layout for an invalid block is very likely to be null, it
shouldn't be accessed without checking the block's validity first.
We can make the check a bit more conservative and simply check that
the block isn't empty.
Change-Id: Ic1459a6168b1b8ce36e9c6d019dc28653676efbe
Task-number: QTBUG-43562
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
When the hotspot is set to be QPoint(0,0) then QPoint will see this as
being a null QPoint. However, it is a valid position as far as the hot
spot for the cursor is concerned, so we default to QPoint(-1,-1) instead
and check for that.
Task-number: QTBUG-43787
Change-Id: Ibf6253033016c4b556b8a2a79c89819a4d5825cb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
When determining the size of the QPushButton's label then the device
pixel ratio of the pixmap used to represent the icon needs to be taken
into consideration so it is rendered correctly.
Change-Id: If32760b120d7a749a51e2c30592d621c0e63dace
Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Since going from FullScreen to Maximized is taken care of inside the
FullScreen block then we don't want to call ShowWindow() again in the
Maximized block. Therefore the Maximized block is moved so it is only
invoked if it is not coming or going to fullscreen.
As the minimized case is not accounted for in FullScreen that is left as
is in its own if block.
Task-number: QTBUG-43849
Change-Id: I3141347e072c50b2a4475098d7b8ee0b207578a7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Signed integer overflow is undefined behavior ([expr]/4),
but unsigned arithmetic doesn't overflow, so isn't
([basic.fundamental]/4, footnote there).
So, use unsigned arithmetic for the loop-around serial
number generation in incrementserial(). While we're at
it, also use it for the masking operation in the same
function.
Found by UBSan.
Change-Id: I500fae9d80fd3f6e39d06e79a53d271b82ea8df8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Left-shifting of negative values is undefined ([expr.shift]/2).
Since hashValue is a uint already, rectify by casting it->key to
uint prior to shifting.
Found by UBSan.
Change-Id: I94a5311f5a4492f514f595b8fb79726df1e7d0de
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The REHASH macro is used in qFindByteArray() with a char argument.
Applying the shift operator promotes (a) to int. The check in
REHASH, however, checks for the shift being permissible for
_unsigned_ ints.
Since hashHaystack is a uint, too, rectify by casting (a) to
uint prior to shifting.
Found by UBSan:
src/corelib/tools/qbytearraymatcher.cpp:314:72: runtime error: left shift of 34 by 30 places cannot be represented in type 'int'
Change-Id: Id09c037d570ca70b49f87ad22bed31bbb7dcc7fb
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>