Vibrates the device or plays an alert sound on devices
that do not support vibration.
The other implementations of beep() have been moved to
QPlatformIntegration as a proper API instead of having
them as invokables in QPlatformNativeInterface.
Change-Id: Ic597dbef04b46d49862b070e78ddfc0d763829a2
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Use the new reverse_iterator support in QList to
avoid building a QList with prepend()ing, using
append() instead.
Change-Id: Ia1f6d0ecc08a824f11d93a6fd4077b11b1b0f786
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Use the new reverse_iterator support in QList to
avoid building a QList with prepend()ing, using
append() instead.
Change-Id: I6b9d9b1a9941cf2e6cc39ad2d9097fdc629c24bc
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
There's no point in checking isEmpty() to prevent a for loop from
executing, esp. if the checking involves copying the container
and calling an out-of-line function to get said copy.
Just fall through the for loop.
Change-Id: If6c689ff4bcd685bc645b4fb3f2c15ce5d5945af
Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
- Do not save geometry when going from maximized->fullscreen
- Use SW_SHOWNA instead SW_SHOWNOACTIVATE as otherwise the
maximized geometry is restored.
- Add a test for Windows.
Task-number: QTBUG-49709
Change-Id: Ic81e7398ee90d499a50b02192a45cb09276a2105
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
When keys are pressed and the application becomes inactive before
they are released, the stored state becomes inconsistent.
Task-number: QTBUG-49930
Change-Id: Ide86b1d9052df060f30f7c02b81a4f2ae15d28e7
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Windows automatically disables DWM for opengl windows that have the
exact dimensions of the primary screen. This causes numerous issues,
such as menus and popups not showing up, and alt+tab misbehavior.
Adding a one pixel border via WS_BORDER solves all of these issues.
This is done by a QWindowsWindowFunctions to make it opt-in as turning
it on can cause an unwanted change in the look of the window so it is
up to the user to decide if they want this.
[ChangeLog][Platform Specific Changes][Windows] Add a function to
QWindowsWindowFunctions to enable working around a limitation with
showing other top level windows when showing a fullscreen OpenGL based
window.
Task-number: QTBUG-41309
Task-number: QTBUG-41883
Task-number: QTBUG-42410
Change-Id: I8c5c785f5024737cd034b2b703671632a8102700
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Use the macro we have that does exactly what we want without the boiler
plate code.
Change-Id: I25c67a71f83f91f50128c8a54033ee53ad28e88a
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
In certain cases we were still showing a cursor in a TextInput even
though the keyboard was hidden programmatically.
Change-Id: I48ebb6b8bc0382236b1ea5835e68eae48ece2b4f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
If the focus object changed programmatically for example to the next
input field in a window, we want to keep the keyboard open. This
strangely only worked if the inputs had different IM hints because this
made the keyboard appear again.
Change-Id: I52e66bb7d2ff97ae7084173769d9b5c2d0c549b5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
The edit menu will also close if the user taps outside it, not only
when selecting a menu item. But we never caught this case, which left
QMenu to belive that it was still open.
Change-Id: Iae071b4fc5fdc44d7d05b4dd767042907e337957
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
[UITextInput textInRange] is sparsely documented, but it turns out that
unconfirmed marked text should be seen as a part of the text document. This
is different from Qt IM (ImSurroundingText), which handles marked text on
the side. The reason we can assume this is that the range we are given
as argument to textInRange exceeds the documents length when having
marked text appended to the end, suggesting that it tries to read / verify
the current marked text. In addition, keyboards like Japanese-Kana will not
update and function correctly unless marked text is included.
Note that the docs seems to imply that you cannot have marked text and text
selection at the same time, unless the selection is contained within the
marked text (using the dedicated selectedRange argument to setMarkedText).
If this turns out to be incorrect, we might need to adjust the methods
dealing with selection to also include marked text as well.
Task-number: QTBUG-49946
Change-Id: Ifedd792ec66db435806f57fca157e1abbbf121a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Delay the exit call until Java part finishes the execution.
We must be sure all the threads are stopped (hanged), when we
call exit, otherwise java thread will try to use static vars
that are freed by the qt thread.
We also need to call exit from Qt thread, otherwise Qt will complain
about it.
Change-Id: Ia1e7a4d7d56c39d38313f040aab618ec5a68dfb6
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Implement the reading of the QT_QPA_EGLFS_PHYSICAL_WIDTH and
QT_QPA_EGLFS_PHYSICAL_HEIGHT as documented.
Change-Id: I862a03e9d05dcd15fb6a245c93ebd3e028de0c47
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Adds NEON version of interpolate_4_pixels used by smooth upscaling, and
bilinear sampling.
The SSE2 version is reordered to match the NEON version so they have
the same order of operations and a faster version that loads directly
into vector registers.
Testing is extended so we have a test of smoothness that can catch more
possible mistakes.
Change-Id: I0de4aecf5cb79468e7c8f19f421aa24b2955547c
Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
Now that more of the raster operations are NEON-optimized this should
be acceptable. The switch enables antialiased drawing, and makes iOS
in line with other platforms in having QBackingStore backed by a QImage.
The use of QImage also allows us to remove code from the backingstore
implementation that was only needed to support the composeAndFlush
code path.
The common parts of a raster backingstore implementation have been
factored out into QRasterBackingStore in platformsupport, which can
be shared with more platforms in the future.
[ChangeLog][iOS] QBackingStore now uses the raster paint engine
instead of the OpenGL paint engine, enabling improved antialiased
drawing. In case of performance regressions, the old code path
can be enabled by setting the window's surface type to
QSurface::OpenGLSurface.
Task-number: QTBUG-35271
Change-Id: Ia300b9a5edf8dc0b4bfb99d84ed3c23a8523c267
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Quite obviously faster (doesn't need to populate a QList first,
just to iterate over it).
Also saves 1.5KiB text on optimized GCC 4.9 Linux AMD64 builds.
Change-Id: If4c7af80165a6027d39359bac22df30e7ca09815
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Saves ~0.5KiB in text size on optimized Linux AMD64 GCC 4.9 builds.
Change-Id: Iba2c02eed44f1ee3521bc49fe7afae9c2e916fdc
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Depending on the number of popped arguments, repeated
pop_front()s could turn quadratic even with QList.
Change-Id: I1f29af4a61f0f8e13253807d2f208c7911e71378
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This needs to be handled a bit carefully, because Qt containers
will detach upon being iteratoed over using range-for.
In the cases of this patch, that cannot happen, because all
containers are marked as const (either by this patch or before).
Separate patches will deal with other situations.
Apart from being more readable, range-for loops are also the
most efficient for loop.
This patch shaves almost 2K of text size off an optimized Linux
AMD64 GCC 4.9 build.
Change-Id: I53810c7b25420b4fd449d20c90c07503c5e76a66
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This needs to be handled a bit carefully, because Qt containers
will detach upon being iterated over using range-for.
In the cases of this patch, that cannot happen, because all
containers are marked as const (either by this patch or before).
Separate patches will deal with other situations.
Range-for loops are much more efficient than foreach loops.
This patch shaves almost 3K of text size off an optimized Linux
AMD64 GCC 4.9 build.
Change-Id: I7b1d41db4d9b5db8b515cb75686dc5135177da68
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
the variable is later re-used by qtPrepareTool(), so the tools used to
build the tool would get excess variables passed.
Change-Id: Ib1bdd2211b4a8615e2be9ba0310822f373f5efb0
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Strings do not have to be overly specific to test parser function.
Change-Id: I345dfec7fb4b8004661f6757cfd53b428ad87b6b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
When cleartype rendering was turned off, transforms would be
badly broken with the DirectWrite engine because we did not
implement the appropriate code path there. In Qt 5.6, this
would become especially visible, since DirectWrite is always
used when high-dpi scaling is enabled.
[ChangeLog][Windows][DirectWrite] Added transformation
support to DirectWrite engine when using grayscale antialiasing.
Task-number: QTBUG-49562
Change-Id: Ic5f7dd5b020a85ed1b6473c511a67cdb5ed5cedb
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
The code is using the same rasterizer for A8 and A32 glyphs,
in the former case it's just converting to grayscale afterwards.
Therefore, we need to pad the glyph cache with the same number of
pixels for both cases.
[ChangeLog][Windows][DirectWrite] Fixed clipping bug when rendering
unhinted text with grayscale antialiasing.
Task-number: QTBUG-49562
Change-Id: If85ff768451116278f6d2ccd1e77b5ce0664087d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
1. Keep 'separator' a QLatin1String.
- saves at least two memory allocations
- necessitates carrying the \n previously prepended to it
around explicitly
2. Start adding to 'textToCopy' with op+=
- saves one allocation, costs one -> ±0
- preallocates more capacity than if we started with
assignment
3. Collapse three unconditional op+= into one
- more efficient usage of QStringBuilder
4. Don't collect button texts in a separate variable, but
append to 'textToCopy' directly.
- saves at least one memory allocation, probably more
since the growth increments of 'textToCopy' should
be larger (due to more content) than those of a new
variable.
Also replace index-based iteration over the buttons with
C++11 range-for over a const QList. Avoids the detach that
happened previously, due to use of op[] instead of at(),
but frankly, I was just too lazy to separate this change.
Change-Id: I27a46a6a163c16d773124f140e085325b17ce5d1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Both specify 87 (invalid parameter) as error code for non existing
shared memory.
Change-Id: I02b02da106e9e4e574a21359c25bc2a03e385a7c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
As for the #include-parser, the moc-detector's minimal C preprocessor
could be confused by a raw string into ignoring large chunks of code.
Change-Id: Id688e9a1f04628ce75a51a7d15269078c734288e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
If a / wasn't part of a comment-start, it and the character after it
were none the less stepped over. If the character after started an
enclosure, this would duly be missed, leading to mis-parsing of the
subsequent text. As for similar bug recently fixed in findDeps().
Change-Id: Ie5329ec633c23a554b42a6351723c980e27fb9a9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
qtPrepareTool() does it anyway, so this saves repeated manipulations.
for now, this is just nicer, but soon it will be a requirement.
Change-Id: I5184e0e4597c6d5a4d7dd4cc4d81e7f742a79fc8
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Change the QWindowsInputContext::composition if it is called
with lParam has flags GCS_RESULTSTR and GCS_DELTASTART,
it doesn't call endContextComposition.
Task-number: QTBUG-49955
Change-Id: I2035c4b3c1e947c5757d7532150798963fc39012
Reviewed-by: Tasuku Suzuki <stasuku@gmail.com>
Reviewed-by: Takumi ASAKI <takumi.asaki@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
In tests with many data sets and init()/cleanup() functions, a significant
time is spent looking up the methods "init"/"cleanup"and the test methods
in qInvokeTestMethodDataEntry().
Introduce a class TestMethods that aggregates the optional methods and the
test methods as a std::vector<QMetaMethod>. Its method list can be populated
either by inspecting the QMetaObject or from the command line.
The class is instantiated on the stack.
Previously, 2 data structures existed for storing the methods to execute
obtained from the command line (array of class TestFunction and an exported
StringList testFunctions for QML).
Remove the custom TestFunction and use only the (QML) testFunctions list
for populating the new class.
Speeds up tst_QChar::normalization() from 340ms to 300ms on an average
Linux machine.
Task-number: QTBUG-38890
Change-Id: I80b488e7249ce031b6d6c8442e53aa87bd2edd42
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
This extends the test suite introduced in 497f0af1f7 for
a known-to-be-good case also for 32 bit systems.
Change-Id: Ia231bcb9b0102c28483d932be18767662b7a6afd
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
instead of an empty list.
Even if QBasicFontDatabase::fallbacksForFamily() returns an empty list ;)
Change-Id: Ib4a63e7898d2708737dd694f0629bdb68b2eb3a1
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Do not assume QBasicFontDatabase doesn't reimplement fallbacksForFamily()
and use the proper chaining instead.
Change-Id: I822d1902843a3a13517b7025761b88439fd75ced
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Previously, the geometry stored for floating dock widgets
in QPlaceHolderItem::topLevelRect and QDockAreaLayoutInfo::saveState()
included the window frame (frame position/content area size).
This does not work in the case where a floating dock widget is deleted
since the geometry is determined after reparenting the widget when the
frame geometry is no longer available. Change the behavior to store
the geometry excluding frame to avoid such problems and adapt
QDockWidgetPrivate::setWindowState() accordingly.
Task-number: QTBUG-49832
Task-number: QTBUG-45780
Change-Id: I84b5c80df6e1c9e738bbb1407b9047cc84719ce0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
when QCocoaWindow::setCocoaGeometry is called on windows embedded into a
native cocoa gui, QPlatformWindow::setGeometry does not apply the geometry.
we therefore need to set the frame on the embedded view manually.
related tasks:
Task-number: QTBUG-47632
Task-number: QTBUG-45269
Change-Id: I976e4606d36bb4afc74b0834105bceab8a6f8cbd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>