This is an opt-in feature to control whether font and palette should
be propagated, and there is no reason this should be removed in Qt 6.
This has been introduced in commit
7293200ace .
Change-Id: I666c09d716bf7033953e98108da3f7711f3bc321
Reviewed-by: Samuel Nevala <samuel.nevala@intopalo.com>
Reviewed-by: Martin Koller <kollix@aon.at>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The flakiness was reported for macOS 10.8 a long time ago and I
am not able to reproduce it, so lets remove the workaround for
it.
Task-number: QTBUG-32690
Change-Id: I92e64065c7480b8f4c5d1d1e6cb5fdd218a70313
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
QWidgetTextControl is a base class for controls of text widgets
and widget-specific code should be used in derived classes, so
override loadResource() in QTextEditControl.
Change-Id: I6d829ead0837419530094d19e0ca53a964413e92
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Two cases with no code between them don't need a fall-through marker.
The only code in the first case is subject to #if-ery; it either
returns, without falling through, or has no code there. Putting in an
overt Q_FALLTHROUGH() confused a rather dumb compiler ...
Change-Id: Icc034be08859cc1656401af1c62367aec302668b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This reverts commit 4bdd8d4eca.
It contains an error.
Change-Id: I51052029f001b9e82c2a53de15b4ba354aafdbae
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
These functions have not been used by the font selection algorithm
in Qt 5. Calling lastResortFamily() always gave you "helvetica"
and lastResortFont() would actually crash.
Since we cannot remove them before Qt 6, we deprecate them for now
and update the documentation to give a more accurate description
of how the font matching works in Qt 5.
Note that in the non-native QFontDialog, it tries to implement its
own font matching algorithm and therefore was calling
lastResortFamily(). Since fixing QFontDialog is not within the
scope of this patch, I have just replaced the call by "helvetica"
directly, so that it will continue to behave the same.
[ChangeLog][QtGui][Text] Deprecated QFont::lastResortFamily()
and QFont::lastResortFont() which are not in use in Qt 5 and
did not provide any useful information.
Task-number: QTBUG-60813
Change-Id: Id8fe7bfdd427292ef86bc8405de03cb466b9b62a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Adding standard behavior for text selection, when user want to select text
and there isn't any previous line then selection will end on start
[ChangeLog][QtWidgets][QWidgetTextControlPrivate] Move cursor selection to start
Task-number: QTBUG-69735
Change-Id: If222d37747772f60774f671ffdd273d63cdaf571
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
QList, QVector and QVarLengthArray check the validity of iterators
passed to member functions using isValidIterator(), which checks that
the underlying pointers are in the range [begin, end]. This check is
well-defined when the outcome is positive, ie. when the iterator is
valid. But if the iterator is not valid, and does not happen to point
into [end, begin + capacity], the comparison, which uses normal
operator<, invokes UB.
Fix by using std::less<T*>, which defines a total ordering.
Change-Id: I1e5757789b4b9779f5e3e298e7f2b2dd0b27576c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The version we're using is at least seven years old.
Let's try staying up to date ...
Change-Id: I450a2fc37c22740fe554a81b471bf0fad340498e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use a template on the size of the char[], as suggested by Ville
Voutilainen. This resolves ambiguity about whether such look-ups
should be done via QString or QCborValue (not that it would have made
any difference).
When we come to add mutating indexing of QCborValue, chained
dereferences like map[i][j][k] need to stay in operator[] const
throughout, to avoid detaching intermediates to create references into
them due to using the mutating operator[] on the earlier dereference's
return. So const-qualify the QCborValue operator[] const variants at
the same time, to match those of QCborValue itself.
Change-Id: Ib1652ae9440fe3767a653afa2856b74040210e07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Likewise have mutating operator[] insert an invalid entry at its
target index, if beyond the end of the array. This makes it possible
to fill an array from high index to low, for example.
Change-Id: If71699c20e2623142214ce2c11c4d6e4a120c989
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch adds the missing overload for QRegularExpression to match the
QRegExp one for QPlainTextEdit.
[ChangeLog][QtWidgets][QPlainTextEdit] Added QRegularExpression find()
method overload.
Change-Id: Id156971d3fa0372712bfa8b72a55550942a767e0
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
This patch adds the missing overload for QRegularExpression to match the
QRegExp one for QTextEdit.
[ChangeLog][QtWidgets][QTextEdit] Added QRegularExpression find() method
overload.
Change-Id: Ic7be224dcc59fc8d832daddd1999a713b7f04253
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: David Faure <david.faure@kdab.com>
Theoretically, it could improve the speed. Some of the modified lines
also make the style homogeneous.
Change-Id: Iaed7b16fa75e485be0f825220c366903525448ce
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Applications with target SDK version lower then 28 running on a device
with version greater or equal to 28 will cause compatibility warnings,
so default to none when the extract_android_style value is set to
default.
Note that the new value "default" was introduced to allow this kind
of changes in the future, i.e., selecting the best solution based on
some simple heuristics. Adding a new value also keep compatibility and
allows the user to explicitly set a value when needed.
Task-number: QTBUG-69810
Change-Id: I68301716767870ce6de40e45742d9c5fc263ee25
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
For winrt we cannot rely on the fact, that QThread::current will be called
from the correct thread for the first time. The application's main entry
point creates a suspended thread and starts it right afterwards. At that
moment, other functionality (QLoggingRegistry for example) might have
called QThread::current, which set the wrong thread as the main thread. In
order to avoid this situation, the main thread is explicitly set in
QCoreApplication's constructor.
Task-number: QTBUG-66418
Change-Id: I8b6347357a80eb395ae758bd3d420adef0826751
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The height of a line edit depends on the height of its font,
which in turn depends on DPI. So use the DPI-scaled icon size
from a style instead of hard-coded values.
Task-number: QTBUG-65627
Change-Id: Ic1f5af61b0d6346cfbc828817c4a3a39296a41ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
There is no need to apply QMAKE_LFLAGS_NOUNDEF in a .pro file that loads
qt_module.prf or qt_plugin.prf, both of which do the same.
Change-Id: I1ec86cddb4d0991becc136f8bd50d6652c885a6b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Make the code consistent with the DomProperty::write() method.
Task-number: QTBUG-70613
Change-Id: I622b4a019a4473823584de97304f8324f2cf0c6b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Check on the application state before requesting activation.
Fixes: QTBUG-70810
Change-Id: I550137dc00209b17f4b3c033287ceef1b871ff50
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The only use is for ::tr so use QCoreApplication::translate
Automatic is not used in dialog/ anyway so there's no translation to
reuse
Change-Id: I0c993e87f46384a0f09d83c9b5e96de5366f1eb9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Normally, when deleting a widget, setVisible(false) calls -orderOut:
and then ~QCocoaWindow will call -release, as a result the window
will disappear from the screen and will be deallocated. But -orderOut:
has no effect on minimized/iconified window. As a result, a 'zombie'
window still can be seen on screen, while all Qt-thingies already
deleted/dead. The similar behavior can be reproduced with a native
NSWindow where we do not call -orderOut:/-close and only call -release.
To fix this - we call -close.
Task-number: QTBUG-70794
Change-Id: Iee8e1fc98018885f1f6e9628d966843d21ac7d38
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
qabstractitemmodeltester.cpp:223:31: internal compiler error: in expand_expr_real_1, at expr.c:9170
Change-Id: I098c1bdf706512c91c649205f4675de0ca374227
Reviewed-by: David Faure <david.faure@kdab.com>
In order to ship our own version of wayland.xml protocol code we need
to get rid of all includes of system versions of
wayland-client-protocol.h and wayland-server-portocol.h.
These were unfortunately included by wayland-client.h and
wayland-server.h and now can't be removed because of compatibility
issues. To solve this, wayland-client-core.h and wayland-server-core.h
can be included instead, which don't include any generated protocol
code. Again, due to compatibility concerns, wayland-scanner does not use
these versions unless invoked with --include-core-only, which is what
this patch fixes.
Task-number: QTBUG-70553
Change-Id: Icf7c870bd4d5bf891628cbddce2a9de3dda50164
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
This change applies to darwin. It adds each include path in the
QMAKE_DEFAULT_INCDIRS variable to the qdoc command line with the -I
flag for both the prepare and the generate phase. These include paths
provide access to the standard c++ and c headers, which clang needs
to see. This change should work on all platforms, but it increased
the qdoc warning count on the linuxsystem where it was tested, so
now it only applies to darwin.
Change-Id: I16e2e0d744e2cf68743dc12d39155dda2ece1536
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The documentation for key bindings was a little bit unclear for key
asterisk. Also sync the names of the left and right key was not
consistent (Left/RightArrow - Left/Right)
Change-Id: Icee0821880fcc3ebc2ade939cf80127ebf0976ad
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
In iOS, the system certificates cannot be accessed, so this function
will return an empty list for the default configuration.
Task-number: QTBUG-60407
Change-Id: I0d691a0dd5e6367594e71c7ebccfbdc866d4a3f0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
52f1692b84 introduced a possible fix for
this flaky test. Therefore unblacklist them to see if the change really
fixed the issue.
Task-number: QTBUG-64639
Change-Id: I759d66aac7641505487e88254d16750e87c97350
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QTable/QTreeView did not follow the documentation and returned
their needed size with scrollbars within viewportSizeHint().
Then sizeHint() also took the size of the scrollbars into account
when the policy was set to ScrollBarAlwaysOn.
This lead to different results when the widget was shown/hidden and/or
the scrollbar was visible or not.
Fix it by only adding the additional size when the scrollbars are
really visible. Also use header->isHidden() instead of isVisible() in
QTreeView the same way it is done in QTableView.
[ChangeLog][QtWidgets][QAbstractScrollArea] QTableView/QTreeView are
now reporting their viewportSizeHint() correctly taking into account
its scroll bars visibility and visibilityPolicy.
Task-number: QTBUG-69120
Change-Id: If50959a9f7429275e3e33122644c978fb64972ba
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Perform a @Nx image file lookup when loading pixmaps.
Make drawBackgroundImage() handle high-dpi pixmaps,
here the layout calculations needs to be in device-
independent pixels
Fixes: QTBUG-36825
Change-Id: I61e6f53c59f61f3bd88c34a036349e51e8c8ad92
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
When switching between different input sources, we have to update layouts.
Task-number: QTBUG-50865
Change-Id: I0c23c19b79a2102dcc533822b0f861c387582c6c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Previously some of the members would have random initial values. Also,
on updateKeyboard() if we don't find usable uchrData, we should just
reset keyboard_layout_format and keyboard_mode, rather than keep the
previous values.
Task-number: QTBUG-50865
Change-Id: I1297fa55bb1593dd549d0bc122713d5d98f7b1fc
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Usually we focus in when we receive a click or equivalent.
QGraphicsScene by default also transfers the focus when you start a
touch on a trackpad or similar. Most of the time this also generates a
synthetic mouse click, so people don't necessary notice. However, at
least on macOS you can configure this behavior. With focusOnTouch
switched off, QGraphicsScene behaves as one would expect on macOS.
Fixes: QTBUG-59442
Change-Id: Ib87112640eef6b77892ad2490d80eedd055e6dce
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Commit 710ff392d9 introduced this fallback code for the case where the
extension was empty. Let's make it happen only in that case, so that the
much more common case of "foo.png" doesn't go through
iconEngineFromSuffix twice, nor through QMimeDatabase (which has to load
and parse an XML file in order to determine preferredSuffix(),
unfortunately).
Found using heaptrack.
Change-Id: Iab6b71e1fa23916029c9e2ba25447a12d70f88a5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
A font property specified in the css was used while drawing the QMenu
action text but not within sizeFromContents() which results in a wrong
size of the menu rect used for drawing.
Fix it by mimic the rect calculation from
QMenuPrivate::updateActionRects().
Fixes: QTBUG-70648
Change-Id: I5cf4f8b679c69197437393965c0bc6326f1c6c3a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This patch enabled json1 support for sqlite3 by defining
SQLITE_ENABLE_JSON1
[ChangeLog][QtSql][SQLite] Enable the json1-extension for
the SQLite3 plugin
Task-number: QTBUG-63498
Change-Id: Iaf1069ff1396c573125a5a3f490c0df5df560468
Reviewed-by: Andy Shaw <andy.shaw@qt.io>