... printed by QPainter when it gets a pixmap with one or both of
dimensions equal to 0 (and a nullptr as a paintEngine).
Task-number: QTBUG-71806
Change-Id: I978f56c843daab307042e34390fc33f338ce8cf5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's a leftover from when the Cocoa plugin used QFontEngineMulti
exclusively. Nowadays QFontEngineMulti will strip out the highByte
before calling into the real engine. Left an assert just in case..
Change-Id: I6cb26d20a908d7c3aaf096297fca160805fdb85b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Commit 17b73b0d2b regressed performance by grabbing
the entire screen and then copying the grab region.
Move back to grabbing a minimal rectangle instead.
Also handle multi-screen grabs at different device
pixel ratios.
Multi-screen grabbing is handled by grabbing each screen
individually, and then stitching together the result.
The returned pixmap is created using the highest DPR
available, upscaling lower resolution parts as needed.
Change-Id: I9d45c5f7ec7b342360b745f49ef2939dc588f40b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add a dialog where the user can enter a line of text, which is then
displayed in several encodings with special characters converted
suitable for C++/Python string literals.
Task-number: QTBUG-60635
Change-Id: Ibd436f9f76e128c93cbb581235c730d636641d8a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The only reason why we bundled this library ~6 years ago was because
it was not available on distributions that we supported at the time,
but library was a hard dependency for XCB plugin. See:
2122e731ab
Later more and more projects started to depend on it (compose input
context plugin, libinput, mir, wayland). The configuration had become
too complex, because some projects used bundled and some used the
version from the system.
Having libxkbcommon in 3rdparty sources is not necessary anymore, after
RHEL 6.6 was removed from the list of supported platforms for Qt 5.12.
Ubuntu 16.04 - 0.5.0
Ubuntu 18.04 - 0.8.0
openSUSE 42.3 - 0.6.1
RHEL-7.4 - 0.7.1
This will also simplify further development, e.g. QTBUG-42181
Bumped the minimal required version 0.4.1 -> 0.5.0.
The patch also contains a code marked with "TRANSITION HACK", which
is temporary needed so we can update the dependent wayland module.
[ChangeLog][Third-Party Code] Removed xkbcommon from bundled sources.
This library is present on all supported platforms. The minimal required
version now is 0.5.0.
Task-number: QTBUG-65503
Change-Id: Iec50829bb6f8fbb19f3c4e4ad62e332beb837de5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The code was previously assuming font-smoothing was only used with
A32 font antialiasing, so the corresponding gamma-correction was not
performed.
Task-number: QTBUG-71075
Task-number: QTBUG-71946
Change-Id: I68d8304cf18638239d8bfac32c67333f16ccc7bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Also, add a note that explains that autoRepeat does not affect
QToolButton's autoRepeat property.
Change-Id: I9e95cef9e9d1b5ee6cb1114d0b9a9fad562db601
Fixes: QTBUG-48204
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
How to test:
* Have two printers
* Use lpoptions -d to set the default printer to be one and then the
other
* Use lpstat -d to check setting the default printer worked
* Use this simple test program and check the resulting values make
sense
qDebug() << "DefaultPrinter" << QPrinterInfo::defaultPrinter().printerName();
const QList<QPrinterInfo> list = QPrinterInfo::availablePrinters();
for(const QPrinterInfo &pi : list) {
qDebug() << pi.printerName() << pi.isDefault();
}
Fixes: QTBUG-70317
Change-Id: I535d11451c568630a374f5c37d8cac32cbb6d3ab
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Instead of tying the linear-conversion to a specific function, we move it
to imageForGlyph and base it on the premise for needing it.
Change-Id: Ib8fc79ad419ef703abcb82785ac15d4c75fb98e6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The font smoothing helper in particular now takes into account whether
or not we're dealing with color glyphs, in which case we shouldn't (or
don't need to) smooth, and also makes sure the QFont::NoSubpixelAntialias
style strategy doesn't affect font smoothing when we're dealing with
non-subpixel-antialiased font smoothing, as on macOS 10.14.
Change-Id: Ibd477158629402c55cafec31576b6d9901d184cf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The setting is not relevant for modern macOS applications, and none of
the applications shipped with macOS today are affected by it.
The only code path in macOS that picks it up is +[NSFont initialize] in
the UIFoundation framework, storing it for later so that -[NSFont screenFont]
and -[NSFont screenFontWithRenderingMode:] can use it, but these APIs are
deprecated and we don't use them in Qt.
Other NSFont code paths will not hit these APIs unless screen font
substitution is enabled, something it hasn't been since OSX 10.7.
https://preview.tinyurl.com/yctpfnqp
Removing handling of this setting allows us to simplify the reasoning
for whether or not antialiasing and font smoothing is enabled for a given
engine.
Change-Id: Ie2809052a1a0815d9bddedd4a6236eb6c898f993
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
No need to return top level window if it was not created.
It means no platform resources have been allocated.
Events might not be delivered if the wrong window is returned.
Fixes: QTBUG-70544
Change-Id: I43462974f70871470f7b7490dc2b3c08846f77b1
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
It will avoid a creation of temporary object and avoid copying.
Change-Id: Ifae5f6f9e36bcb07f4bacc31f151f8adcfa621a3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
The 'aa' argument doesn't unconditionally enabled antialiasing, it just overrides
the check that the pointSize is larger than the antialiasing threshold. If the
styleStrategy has QFont::NoAntialias we still end up without antialiasing.
Change-Id: I7130e7c68d883c2443756242e96790264f583b0f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Makes for clearer code than looking at the glyph format.
Change-Id: Id6dd2a7851aac2a42cc27d9e2fb408ce9a5345d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The way macOS does font smoothing has changed in Mojave, and we need to
take both this new algorithm into account, as well as support users who
set legacy preferences to revert back to subpixel font smoothing.
As a followup to this patch we will tweak some of the existing logic
to take the new font smoothing algorithm into account, so this is
just a first step.
Change-Id: If37014c18515f406b8bb8194c9df7a75c2eb10fc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Turns out that also Debian patches OpenSSL 1.0, changing its soname to "1.0.2".
Therefore, try also to load that one.
Amends 2708c6c11d.
Task-number: QTBUG-68156
Change-Id: I37cc060e90422779a6c29a324ab900f0fb99cfa7
Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The read from a QHash needs to be protected too if other threads are
writing.
sync-up with qtc, no actual effect on qmake itself.
Fixes: QTCREATORBUG-21416
Change-Id: I75e5634e11b10056d6dbb6fdceef482ca2222ca1
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from qtcreator/5f79b5d2e5e33321cdcd00362f0d6d9442a73ec2)
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Removes assumptions about QImage format in a few places.
Change-Id: I515701be53190429a48956c31986fa0804806406
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The operator T() function of QAppleRefCounted should be const so
that the underlying type can be accessed from const member functions
just like the naked underlying type could.
Change-Id: I0819c5795d28442a6ff4db2732e211b183574f9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The function doesn't need the flags argument, nor does it need the
ctfont or fontdef arguments if it's a normal const member function.
It can also be used from QCoreTextFontEngine::stringToCMap(), instead
of duplicating the code. This was originally the case before b4aa5d97
which improved surrogate pair handling, but for some reason the change
introduced the duplicate code instead of just changing the arguments
in the function call slightly.
The use of 0xff000000 to skip certain glyphs looks dubious, and is
probably related to QFontEngineMulti's use of the high byte to
indicate which engine the glyph came from, but the multi engine
strips this away before calling out to the concrete engine so
it could potentially be removed in a later patch.
Change-Id: I6c693595616da1b69fdbe3d7a31e392a8443369d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
It's only used in a single function (twice), so let's keep it
closer to the call site.
Change-Id: I7f8ceadc380171237eef3fa6b03ccd6bc89e99af
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The leak has been there since the beginnings of Qt 5.0.
Change-Id: I238181dcc63cb4cf8a60b5c565b184d8278d0315
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Keeping the fake parent window around in a created state means we're
wasting system resources such as native platform views/windows, and
makes it harder to debug the lifetime of these resources.
The fake window will be re-created if re-parented into at a later
point.
Change-Id: Ib82560e7e565af19d58afe121fd087669a6ffb95
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Instead of relying on the return value of malloc having the correct
alignment, use proper non-throwing new[] operators.
Change-Id: I06c6c619e21c848f3d184bdb7cef8c5589c1c7ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
First of all, we were using the wrong size variable: instead of the size
of the section, found in the section header, we were using the size of
each section entry in the section table. Since that's usually smaller,
we weren't hitting a problem.
Second, if the string table is the last thing in the file and there's
nothing else after it, not even padding, then offset + section_size can
be equal to the file size. In fact, the .shstrtab section is usually the
last one, as it contains the section names themselves, so it stands to
reason that it's the second to last thing written.
For generic linkers, the last data in the file is the section table
itself, so usually the file is larger by at least a kilobyte, which is
why we haven't hit this bug. It could only manifest as deciding that
certain specially-crafted but valid ELF files were invalid. I can't
think of a way to trick it into thinking an invalid ELF is valid.
That's another reason why this code needs to be rewritten with more
modern coding styles and actually using <elf.h>
Fixes: QTBUG-71443
Change-Id: I1bd327aeaf73421a8ec5fffd156162f2df5557b8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Originally QAtomicPointer didn't have the three-operand version,
resulting in code like:
if (!atomic.testAndSetXxx(expected, newvalue))
expected = atomic.load();
The three-operand version gives us the current value of the atomic in
case the test failed and it's free in all architectures, unlike the
extra load.
I have to use testAndSetOrdered here because I need the failing load to
use the Acquire memory order, even though that has an extra Acquire for
the successful case we don't need. QAtomicPointer does not have
testAndSetReleaseAcquire.
Change-Id: I1bd327aeaf73421a8ec5fffd1560fe30d3bfd9b8
Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Remove the option from msvc-desktop.conf, which duplicates
the /nologo option in idcidl.prf.
Fixes: QTBUG-72046
Change-Id: I906097e0611f4578c307616b3f9ebecdfc4d8812
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If a focus frame is set around a widget that exist inside a
QAbstractItemView, both the focus frame and the widget will
be scrolled when the table is scrolled (since the focus frame
is a child of the view). The result is that after the widget
has been scrolled (which will move the focus frame to the
correct position as well), the focus frame will be scrolled
next, and therefore away from the widget.
This patch will catch this case by always adjusting the
focus frame position when someone tries to move it. Trying
to move the focus frame away from the widget it tracks
will anyway be flaky.
Fixes: QTBUG-63877
Change-Id: Ic2aacc4fafc219280e32092c258a7539d0db9cd0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
QOpenGLWidget uses an FBO internally, that is glCleared whenever
recreated. But for the clear to be visible across shared contexts
we must also issue a glFlush.
QOpenGLWidget defers this flush until the compositing step, in
QOpenGLWidgetPrivate::beginCompose(), based on a flushPending
variable.
This variable is set either after invoking the user's paintGL()
function, or when opening a QPainter on the QOpenGLWidget, via
QOpenGLWidgetPaintDevice::ensureActiveTarget().
Unfortunately, if QOpenGLWidget::paintEvent() is overridden or
intercepted (meaning we will not end up calling paintGL()), but
the overridden paint event does not open a QPainter, we end up
never setting flushPending to true, and end up composing an
uninitialized FBO.
This can lead to rendering issues, or even kernel panics with
some unfortunate GL drivers.
The fix is to ensure the glClear is always flushed before
composing, by forcing a pending flush whenever the FBO is
recreated.
Fixes: QTBUG-70921
Change-Id: I72b596c09dcf54bd0f37668062daaad2d6f7f4bd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
It would crash if there is no screen at 0,0.
Change-Id: Ic84d75b3d8b917fe3696530cbe843e82923ba676
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
If the time the widget is set to use falls in the gap skipped by a
spring-forward, setting the date to the day of the spring-forward
turned a valid date into an invalid date-time. So use the usual trick
to map the "draft" date-time to a valid one.
Fixes: QTBUG-64485
Fixes: QTBUG-58947
Change-Id: Ib8f0f092cd5d6dce3da31eb52cd42150ca0d1fcb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This makes it clearer that const-ref needs to be specified in
the template arguments of qOverload() and related.
Change-Id: I527c8ca853be159af8665e9759d9549df10573b3
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
SSL_CTX_set_ciphers is new in 1.1.1.
Task-number: QTBUG-71983
Change-Id: If0ae9f95dcc867c62ed0d3a6a60c22c7f5e1cc9f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 36f3eeaf3e)
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The failure mode of this behavior is worse than the surprises that the
non-explicit library dependency chain has, so it should be opt-in.
This reverts back to the behavior in Qt 5.11, but lets our tests
opt in to the feature.
Fixes: QTBUG-71724
Change-Id: Iede11f02d978b637324ddf71d29e7c99fe3ee99f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Do not reset the isSubWindowsTiled flag if the hide/show event is an
external (spontaneous) system window event, i.e. we should instead
reset this flag when the subwindow itself is directly hidden or
shown. This change ensures that tiling will be performed during the
resizeEvent after an application window minimize (hide) and then
restore (show).
Change-Id: Ib37f52f1162b493be3413fc59951be2f30701439
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The previous implementation leads to infinite chain of showing/hidden
line edit under circumstances described in QTBUG-54676. We basically got
the situation when size hint were calculated differently depending on
the line edit visibility state. In this case toolbar layout have to
show/hide extension button and line edit a lot of times and can never
leave this "loop" (please note, that the chain is much more complicated
in reality):
Resize toolbar -> Set layout geometry -> Size is OK to display line edit
-> Set layout geometry -> Hide extension button -> Set layout geometry
(wrong size is calculated here, so "run out of space") -> Hide line edit
-> Set layout geometry -> Show extension button -> Set layout geometry -
> Size is OK to display line edit ... And we're in the "loop"
Clear button is hidden if there is no text in a line edit.
In the previous implementation, the button was always visible, only
opacity was changing in order to "hide" the button. It resulted to
incorrect size hints (regular and minimum).
In the current implementation the button is really hidden/shown, and
size hints calculated correctly.
Also updated unit test for line edit.
Remove code duplication in functions for calculation text margin
Fixes: QTBUG-54676
Change-Id: I4549c9ea98e10b750ba855a07037f6392276358b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>