So invert the list and let "msvc-2017" be the latest, at least until we
know about a different version.
Change-Id: I39332e0a867442d58082fffd1504c316e27f51d0
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QTreeViewPrivate::itemAtCoordinate() did not calculate the correct item when
non-uniformRowHeights is enabled and vertical scroll mode is ScrollPerPixel.
This results e.g. in an activation of the item above when the click happens
on the very first pixel line of an item. Another, more problematic effect was
that once a drop happened on the very first line of an item,
QAbstractItemViewPrivate::dropOn() calculated the root as the drop index
because the visualRect of the calculated item is compared with the drop
position which did not match.
Task-number: QTBUG-57538
Change-Id: If89571bf0fb76fc01d60ba7139f1d985b49d70db
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Add an env variable QT_MAC_TABLET_IGNORE_BUTTON_MAPPING which, if set,
reverts to the old behavior.
The issues that it fixes are:
1) With a Genius tablet, it's not possible to generate a middle-click
at all, regardless of preferences, unless you set this variable
2) With a Wacom mouse (passive mouse used with an Intuos 3), the
side-buttons (normally mapped to forward and back buttons) do not
work unless you set this variable
[ChangeLog][macOS][Tablet support] If you have changed
the button mapping of your Wacom tablet in System Preferences,
it will be respected in Qt applications. To revert to the
old behavior, set the environment variable
QT_MAC_TABLET_IGNORE_BUTTON_MAPPING
Task-number: QTBUG-57487
Task-number: QTBUG-54160
Change-Id: I0a1c9c6550e4dfe6ee2daa2d993f22691430826c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Due to the integration of clang in qdoc, several qdoc warnings
appeared for class QRandomGenerator. This update corrects all
the remaining qdoc warnings.
Change-Id: I92fe9f7d9cb193e145ee8ad0e7198625b9a5bf7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unconditionally apply window cursors restoreOverrideCursor() also for
platforms with override cursor capability in case
a cursor was changed while the override cursor was active.
Amends b05d1c2ebf.
Task-number: QTBUG-65001
Change-Id: I7fd38a27dcf045f2fb48a16abb484342feaab5df
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
QTreeView makes columns movable except for the first one
(since Qt 5.0, see commit e0fc088c0c). This is indeed best
for actual trees, but not when using QTreeView as a flat
multi-column list (with no "root decoration"). Then it should
be possible to move the first column.
[ChangeLog][QtWidgets][QHeaderView] Flat treeviews can now allow
the user to move the first column (like in Qt 4.x) using the new
method QHeaderView::setFirstSectionMovable().
Change-Id: I6b5025e40850bf5c4c373124ee81f657f3f09d29
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Since DB2 can potentially have more than one error code, we need to join
these together using ';' as a separator.
Task-number: QTBUG-142
Change-Id: Idd376df84a8e3ae4c05b4722b4d0020fa4f3edad
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QSqlDatabase objects can only be used in the thread that the connection
was opened for. So if the driver was created already then we check if
the thread is correct. If it is not then we output a warning and return
an invalid QSqlDatabase.
[ChangeLog][QtSql][QSqlDatabase] QSqlDatabase::database() will return
an invalid QSqlDatabase if the calling thread does not own the requested
QSqlDatabase.
Task-number: QTBUG-216
Change-Id: Ib5a25aa62129e3925f9819109af05961e5178bc5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If the values vector is empty then we know already that the paramCount
will still be invalid, so we should just accept that and not check the
reused named placeholders.
Task-number: QTBUG-64923
Change-Id: Ifaa755540c4574f1f76d3f9f129bf0f66b837b70
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This patch updates the code from QSharedMemory to remove the use
of the deprecated QRegExp class. It also updates the unique key
test to avoid change of behavior going undetected.
Change-Id: I649e615027507898800bb5454a62a6cf8bbb2e18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch updates the Cocoa QPA backend code to use QRegularExpression
in place of the deprecated QRegExp.
Change-Id: I6de2774975e63f8dbff6dad0a842f35c3c4b4f83
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This is the first version that supports Unicode 10.0.0, which
we now require for Qt.
Change-Id: Iff3cb757eb7d97dace5649262c337a4ed1145199
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is the latest released version, fixing a large amount
of bugs and adding Unicode 10 support.
[ChangeLog] Bundled HarfBuzz-NG copy updated to 1.7.4
Change-Id: Idc8092dfc4e593d64fff2fd51ff9e1b3d84049a7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Since its initial implementation, QRingBuffer had the following
fragilities in the architecture:
- it does not guarantee validity of the pointers, if new data will
be appended. As an example, passing an address of the QRingBuffer
chunk as a parameter to the WriteFileEx() function on Windows
requires the stability of the pointer. So, we can't add new data
to the QRingBuffer until the overlapped operation completed
(related issues were fixed for QWindowsPipeWriter and QSerialPort
in 5.6 branch by introducing an intermediate byte array);
- inefficient reallocations in reserve(), if a shared chunk was
inserted in the queue (we can get a reallocation in the place
where we don't expect it:
char *writePtr = buffers.last().data() + tail; <- line #133
).
Proposed solution is to avoid reallocation by allocating a new
block instead. That was accomplished by introducing a QRingChunk
class which operates on a fixed byte array and implements head/tail
pointers strategy for each individual buffer in the queue. So,
QRingBuffer is no longer dependent on QByteArray's internal
shrink/growth algorithms.
Change-Id: I05abab0ad78e22e4815a196037dfc6eff85325d1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
That causes compilation error in developer build or when '-Werror'
command line argument is forced:
kernel/qnetworkinterface_unix.cpp:142:12: error: 'int getMtu(int, ifreq*)' defined but not used [-Werror=unused-function]
static int getMtu(int socket, struct ifreq *req)
^
cc1plus: all warnings being treated as errors
So, mark 'getMtu()' as unused in the appropriate branches.
Change-Id: Ib4d74845835962bb12f56baf8e13834c032a0404
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Some apps (e.g. Chromium) explicitly append a \0 to the text they
transmit through the clipboard. Remove that one, when we retrieve the
text, so it doesn't become part of the text we're pasting.
This was e.g. visible when pasting from chromium to the textedit example.
Change-Id: I9445319e6e5ef304a364e14f794b16557a3cc919
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Binding without an interface and expecting the OS to select something is
not supported in all OSes. On FreeBSD, I keep getting EADDRNOTAVAIL. So
modify our test to only join, leave and send to multicast groups with an
interface selection.
With this, all tests either pass or are skipped for me on Linux,
FreeBSD, and macOS. On Windows, this revealed an inconsistency in
behavior, which this commit adds a workaround for.
Change-Id: Ifb5969bf206e4cd7b14efffd14fb6815456494d2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Putting parentheses around the call to (std::numeric_limits<T>::min)()
works, but the trick cannot apply to the min() function declaration on
the same line. So we really need to #undef.
I hope no one after the 1990s still needs these macros.
Task-number: QTBUG-65414
Change-Id: I39332e0a867442d58082fffd15024f8edb293311
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The C standard library functions cannot handle UTF-8 filenames. Instead,
we need to use the wide-character versions which accept UTF-16 input.
Task-number: QTBUG-65492
Change-Id: If4b3b4eeeec4f3bbb428b8f6b0311a65d01463b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Like in commit 75cdf654bc, we use the
pointer value of the QMap header (which is of type QMapNodeBase) as a
sentinel. It's never dereferenced. In that commit, the issue was calling
end() directly; in here, it happens when iterating forward from any
element, which means nextNode() can reach back to the header.
However, using static_cast is wrong, so we use reinterpret_cast.
Change-Id: I39332e0a867442d58082fffd15040317704a87ce
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Move the selected and selDescription members to a subclass of QOptionTreeItem
since it's only ever used for Option type nodes of the tree
Change-Id: Ic99841c4e04a3afcff0950f72abf12977850f6d3
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Renato Araujo Oliveira Filho <renato.araujo@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This involves QCocoaApplicationDelegate and QCocoaMenuLoader.
The former has been modernized to use blocks. The latter was
not being deleted previously.
Change-Id: Ic4cbfed2d9598fa04130675b3330d985b9489a21
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This removes at least one special-case we had to have, in Android's lack
of /etc/mnttab. Bionic's _PATH_MOUNTED is already /proc/mounts.
Change-Id: I9407dcf22de6407c83b5fffd14fedc638586d0f9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This fixes only those that look fixable. There are a number of errors in
the online documentation that look like qdoc tool bugs, like missing
functions (operator==) and documentation text that does not exist in the
source code. This fixes:
- QRandomGenerator(System) constructor showing up
- Links for C++ reference documentation not showing up as links
Change-Id: I9e2892cb6c374e93bcb7fffd14fe21db5a6969d9
Reviewed-by: Martin Smith <martin.smith@qt.io>
QHeaderViewPrivate reimplemented _q_layoutChanged() to handle changes
of rows/columns via layoutChanged/layoutAboutToBeChanged. This worked
fine for Qt4 but since Qt5 only the special signals rowsAboutToBeMoved/
rowsMoved are used for this (8021e2d5e7).
With this change, QAbstractItemViewPrivate::_q_rows/columnsMoved() is
calling the virtual function _q_layoutChanged(). This resulted in a
wrong call of QHP::_q_layoutChanged() for a horizontal header when
a row changed and for a vertical header during a column change. In the
end this can lead to an unhide of hidden sections.
Task-number: QTBUG-54610
Change-Id: Ide4bfc5b24a97746fd1e5af82d3ba08257149157
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Commit 77942a1bdf introduced the QScopedValueRollback, but without
assigning it to a local temporary, so the value was rolled back
immediately, resulting in always sending touch events async.
Change-Id: Ic7f65c3d38c46813ff06694e883dae3df138b9d4
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
The QTextFormat::FontLetterSpacingType property was added outside
the span of the FirstFontProperty and LastFontProperty, so
the fontDirty flag would not be set when it was changed. There is
no binary compatible way to fix this before Qt 6, so for now, we
add a special case for it.
[ChangeLog][QtGui][Text] Fixed an issue where changing the letter
spacing type of a QTextCharFormat would not cause its font to
update.
Task-number: QTBUG-65345
Change-Id: I5ab53d7f82d529b57edceacfc3fa688c6741cd17
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: C. Boemann <cbo@boemann.dk>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Instead of allocating the full backing store size for
the transparency layer, we make sure we only allocate
exactly as much as needed by the scrollbar.
Change-Id: I55c3172fe3dd2a1f3fd46828463497f9f35cb1ae
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This one fell off the truck while we were removing
HITheme calls. We add it back by simply rendering a
BLACK RIGHT-POINTING TRIANGLE character.
We also fix smaller issues, such as not displaying
any shortcut related to a submenu action — this is
simply not a thing. The spacing between the menu
item's text and the submenu indicator has also been
slightly improved.
Change-Id: I6c768a5506a5eb9528b0dd76acd52b561266d67b
Task-number: QTBUG-64405
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
The thing we are looking for in qstandardpaths_unix.cpp is
regularexpression, not QT_BOOTSTRAPPED.
Change-Id: I37eb0cdd8a52b0adfd69f592b84659e8807e35ad
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The vnc and tuiotouch plugins depend on network support. The tuiotouch
plugin furthermore depends on a specific feature from network.
Change-Id: I3bc1f7b1dcf3437c6ed0d41cc9e282114a95a39c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
By not actually making them intrinsic, leading to linker errors:
/home/qt/work/qt/qtbase/src/corelib/global/qfloat16_f16c.c:61: undefined reference to `_mm256_cvtps_ph'
/home/qt/work/qt/qtbase/src/corelib/global/qfloat16_f16c.c:76: undefined reference to `_mm256_cvtph_ps'
I had the workaround applied, but only for "intel_icl", the qmake config
for the Intel compiler compatible with MS cl.exe options. The one for
compatibility with Unix cc (intel_icc) was missing.
Task-number: QTBUG-65367
Change-Id: I39332e0a867442d58082fffd15020e4838b6a01d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
In file included from ..\..\include\QtWidgets/qdesktopwidget.h:1:0,
from kernel\qt_widgets_pch.h:71:
..\..\include\QtWidgets/../../src/widgets/kernel/qdesktopwidget.h:71:65: note: declared here
QT_DEPRECATED_X("Use QGuiApplication::primaryScreen()") int primaryScreen() const;
Use QScreen directly and remove the then unused function realDpi().
Change-Id: I526adb09ba35ed0699338d6a8d044c2ff9a03a1e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It breaks a build if warnings are treated as errors.
Task-number: QTBUG-65357
Change-Id: I42d5cbdbd90f831662a6decaebecebef5005e735
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
On Windows, QFileInfo.isWritable() was returning true in situations
where the file would only be writable with elevated privileges. Using
AccessCheck instead of GetEffectiveRightsFromAcl to get the correct
results.
Done-with: Friedemann Kleint <Friedemann.Kleint@qt.io>
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Task-number: QTBUG-30148
Change-Id: I7a3468ac069bf782ca312078e3a84107b6cd468c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Code examples make it much easier to learn how an API behaves.
One area that the patch tries to address is the distinction
between a relative URL and a relative path.
Change-Id: Ife52172816b89afb6cd810b07d3573480e2cd747
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Task-number: QTBUG-65354
Change-Id: If628c73b05854c13086708c193995062c8b9f9e4
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Fixes the fallback painting used with complex transforms to be able to
handle color bitmap fonts which can't be converted to a path.
Change-Id: Id2851607f673b8fc1aea63f92043d0cdebc0fb9d
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
old style connects have protection against null sender and null receiver,
but new style only had against null sender.
Change-Id: Ie555ac078412918e60c3b60830fe1f3abfb7f5af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
By using NSEvent.characters instead of NSEvent.charactersIgnoringModifiers,
we may miss sending ShortcutOverride events.
For example, when the user presses Cmd-Opt-o, characters will be "ø"
(on a US keyboard layout) and therefore we'll be looking for the wrong
key-equivalent among the menu items. We only fall back on the modified
string when the search on the unmodified string fails.
As and addendum, we also skip any submenu when doing the key search.
This is not necessary since each menu delegate will get called eventually.
Change-Id: Id793315293a02c99e99d793ad812cff7b4a47821
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Out of the box, this saves one delegate instance per NSMenu. It
also weak-couples the NSMenu instance with its owning QCocoaMenu,
making it safer to inspect from the menu delegate.
In the future, this will be helpful for debugging by just overriding
any NSMenu method.
Change-Id: I7eb801009b97f6a8ee2003306c0e152621bbce54
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Change the condition to strong equal, as 'bytes' was checked against
wrong value on the start of the function.
Change-Id: Iebd785665ac7bd0941ba4ffd3f315b12efc6ce0b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The current implementation is poorly documented and hides the mapping
between keysyms and modifier bits.
This changeset adds documentation about the inner workings and makes
the keysym/modifier bit mapping reusable. (The latter will be needed for
xkb keymap synthesis if the XKEYBOARD extension is unavailable.)
Change-Id: I70c6d204b2357365db4dafeda680132ab6823ca3
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Make sure to use the printer original name as 'cupsPrintFile' function
argument
Testing:
- Create a instance of your print with lpoptions
- Try print a document using the new instance of the printer
- Check if the instance properties was respected
Change-Id: I884b641d1871fe04c7b119c82d4edb4aa41db2f5
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Change from config to feature in the json and pro files.
Change-Id: I58ddac3c4ad739253bae010f1d5023fc1d481047
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The old code used select with all-zero parameters and a timeval struct
configured to wait for 50ms. This can be drastically simplified by just
calling QThread::msleep which makes the intention much more clear.
Change-Id: I115b56ae67ae2c2cd03354e16a7bfdf56f8c15b8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
... and make sure we can compile without it. In particular,
Qt Concurrent depends on QFuture, so we specify it as a condition,
and QtConcurrentException should not depend on future but on
concurrent.
Change-Id: I65b158021cecb19f227554cc8b5df7a139fbfe78
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
FileChooser portal expects filter property in a(sa(us)) format but by
default, using enum, we will end up with a(sa(is)), thus we have to
specify format for the enum.
Change-Id: I7de971197a0c77d6dca092edda7d428d90394574
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Used 'ppdLocalize' to translate cups options
Change-Id: I7fea7c26194fd6c6ee62a17d3e35d7c2c5be6d3c
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This means that actually the paper size set on system settings (or lpoptions) is used instead of A4
Change-Id: I2dd86fd9ba210a335773430328b0ba2d3343395f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This also reads the job-hold-until from lpoptions if set there for the particular printer
Change-Id: Ic60fef675ab9f4760cd99ee9ac417b0478459681
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This also reads the job-billing from lpoptions if set there for the particular printer
Change-Id: Ia4a6961de504005b8dcd9209da0624e9ae9ef7e4
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This also reads the job-sheets from lpoptions if set there for the particular printer
Change-Id: I35aff103261ef58492779071d866e8a15ac78607
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
This also reads the job-priority from lpoptions if set there for the particular printer
Change-Id: I75d983c377d2135a0b0d3e028829a7384a5e1897
Reviewed-by: Laurent Montel <laurent.montel@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Comparing pointers with op< that do not point into the same array is
UB. Fix, in the usual way, by using std::less.
Change-Id: Id2c957557719887b2016632d683dbab8af07b34c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If a top level, parentless widget has Qt::WA_WindowPropagation
set, Qt will crash when trying to resolve the widgets locale.
The reason is that we try to access the QLocale of the
non-existing parent.
This patch will add a check if a parent exists before trying
to access it.
Task-number: QTBUG-61213
Change-Id: I09a6351a12dc1fffab3069b70e3d7b3932317c85
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When one scrollbar is added, this may cause the other to be
needed as well. This change does a second calculation
immediately instead of relying on a signal through a
QueuedConnection.
Task-number: QTBUG-62818
Task-number: QTBUG-56280
Change-Id: Iee9a083e3a6cd3765e6bb9206687a8a6e7f99cff
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This is actually two fixes.
* We need to call cupsMarkOptions
* CUPS differentiates between the "" and the nullptr instance, so we need
to change the call to cupsGetNamedDest accordingly
Change-Id: If2692e405b6b71f8ee91362e6e72eabd9202d704
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
The number of active scrollers is probably very low, so O(N) vs. O(1)
search can be neglected, compared to the higher cost of allocating and
iterating a QSet. The tipping point is that the public API uses QList,
and the QSet needs to be converted toList() on each (external) access.
Just use a QList.
Change-Id: I5f0b37761923dc94d6dbbbf92973da73f5335e4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
dialogs/qprintdialog_unix.cpp:1104:21: error: incomplete type 'QTextCodec' used in nested name specifier
Amends b4330bc391.
Task-number: QTBUG-54464
Change-Id: I555431d11a5c3f247d4f055d94255d2708c92374
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
QHeaderViewPrivate::_q_layoutChanged() was not called when used in a
QTreeView because it was explicitly disconnected in setModel().
The disconnect was added sometime prio to Qt 4.3, but there the signal
was connected to the doItemsLayout() slot. This was correct since
QTreeView::doItemsLayout() is calling header->doItemsLayout().
In Qt 4.3.0 _q_layoutChanged() was introduced and the disconnect was
adjusted. But since _q_layoutChanged() is doing much more than
doItemsLayout() (e.g. restoring hidden sections), functionality was
lost. The problem was already observed for Qt 4.6 (QTBUG-18196) but
only partially fixed.
Task-number: QTBUG-41124
Task-number: QTBUG-54610
Change-Id: Id13a9930d0163812e12a0287016bab9c3aa02068
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Makes sure the ARGB32PM that is painted on always have a defined alpha.
Task-number: QTBUG-55645
Change-Id: Ifcf5fcc2127d255518eca4763845a197da6c7914
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Adds support for FileChooser Flatpak portal. To support them we just do
specific DBus calls, which are then caught and forwarded by xdg-desktop-
portal daemon/service. This is needed for Qt applications running in
sandbox.
[ChangeLog][Platform Specific Changes][Linux] Added support for flatpak
portals. Flatpak is a software utility for software deployment and
package management. It provides a sandbox environment in which users
can run applications in isolation from the rest of the system. To
communicate with the system flatpak uses portals, which are designed to
be a bridge between sandboxed applications and desktop/system running on
user's computer. Flatpak runs this service (called xdg-desktop-portal)
automatically. It exports the portals via DBus and they are visible by
default to all applications running under Flatpak.
Change-Id: I4de1402434ba7cbcc805eab51c30f84f8ba0c5c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is especially useful on macOS where the default
ignore cursor is the pointer cursor.
Change-Id: I5e14814abd2d59a7f4c4cd1029829ebbed5b3017
Task-number: QTBUG-26724
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This is one of the most frequent problems users ask for help with, and they
don't even know if the plugin was found but not loaded or simply not found.
Qt knows what happened, so communicate it to the user.
Change-Id: I6003ed4ab3d147a5d159b2002004e53c251cb512
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fixes 5d4089299a commit,
which was causing a build break if qnx pps is enabled.
Change-Id: I8c29f48bde0187a9db02d6325e8a9a0fae760bcb
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
This is mostly a revert of 69de617761 adapted to the new code.
The commit that removed this code said:
a) there's duplicate settings in the advanced tabs and in the rest of the ui: this easily
solved with a blacklist
b) you can set these options in the system settings: probably true, but it is very cumbersome
to go to the printer settings every time i print to select from which tray the
paper should be used
Task Number: QTBUG-54464
Change-Id: I7b1cacf51006dadb10aa6e00fe6dd2ff748fe576
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Scanning for WiFi networks is causing network disruptions
in the form of higher latency, sometimes globally
for all running applications.
In practice, the default configuration selection algorithm
in QNetworkConfigurationManager prefers configurations
from the generic bearer plugin, due to the way the
plugins are ordered. Removing the platform WiFi bearers
should have no effect on default network configuration
selection.
Task-number: QTBUG-40332
Change-Id: I778281c41a1aaec1949c220a9266677bd788a57a
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This code is unused/not functional.
Use sRGB everywhere instead. This is not a change
of effective color profile: the backing store has
had the sRGB profile assigned since commit ac899f6d
changed it as a side effect.
Change-Id: Ib45cec3acad90db2a0873b052d6bc4a61c894b18
Task-number: QTBUG-47660
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
getCursorCapsMode() now matches the Java implementation in
QtActivityDelegate.showSoftwareKeyboard() which is given to the Android
keyboard on InputConnection creation.
The reason we only saw this bug with some Android keyboards was that many
keyboards never call getCursorCapsMode and just rely on the initial hints.
Task-number: QTBUG-51865
Change-Id: I2aae024d9c77ea14e087e3f51a413d15a684179c
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
Qt requests full resolution OpenGL surfaces by default.
However, when running as a VMware guest it looks like
the OS silently creates low-resolution surfaces.
This is not possible to detect using the standard NSWindow
APIs for converting to backing coordinates or for
reading the backing scale factor. The result of this
is that Qt will incorrectly display one quarter of
the window content only.
Fall back to detecting if the OpenGL renderer is the
Apple software renderer, which it will be on VMware.
Cancel the high-resolution surface request if this
is the case. This needs to be done while we have a
valid OpenGL context.
Task-number: QTBUG-62357
Change-Id: I33bf12b3bb0408249e6d66e0a8ca86b044bea781
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This is going to be the most common scenario for GCC: all recent
versions allow compiling F16C code in the same source, thus generating
better code.
MSVC is excluded unless AVX is already turned on by the user in the
mkspec file, because it fails to use the VEX-prefixed instructions for
everything else, printing a warning that it knows it should have done
so.
ICC is excluded because it's known to generate invalid code when using
the F16C intrinsics unless F16C is turned explicitly on.
Clang is excluded because it runs into an internal error compiling this
code unless F16C is turned explicitly on.
Change-Id: I57a1bd6e0c194530b732fffd14f58de6a46f0de1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
QFileSystemModel had a #ifdefed out experimental code path for watching
single files to track changes in size, which got outdated over time.
Replace the #ifdef 0 by a check for the environment variable
QT_FILESYSTEMMODEL_WATCH_FILES, fix it up and apply some fixes to
related code to make it work:
- Split file names signaled by QFileSystemWatcher on '/' always.
- Do not instantiate QDirIterator on "", which means "current directory"
and results in mixed-up directories.
- Check on lastModified() in QExtendedInformation::operator==() so
that changes trigger an update in _q_fileSystemChanged().
- Fix the #ifdefed out part to compile and not to add directories
to the watcher.
[ChangeLog][QtWidgets][QFileSystemModel] It is now possible to enable
per-file watching by setting the environment variable
QT_FILESYSTEMMODEL_WATCH_FILES, allowing to track for example
changes in file size.
Task-number: QTBUG-46684
Change-Id: Ia5da9170866416c9529251f889814b23d7a7d069
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Check that the inserted/removed range is indeed valid.
Change-Id: Ifccbe13f0753252ee1450c8668df782dc699f05b
Reviewed-by: David Faure <david.faure@kdab.com>
- adjusted to new configure system realities
- centralized 'make install' instructions
- fixed 'make' command for mingw
- externalized the license compatibility question
- removed dated information about postgresql client libs
- removed dated claim that freetds is not stable yet
- updated official sybase client link to point to sap support
- removed apparently bogus "demo" include path from oci instructions,
based on the archive content description
- removed troubleshooting item about static builds - one can use static
"plugins" with a static build just fine. and building dynamic plugins
for a static build is plain impossible to start with.
- removed troubleshooting item about build key mismatch, as build keys
have been removed in qt5
- removed "general info" sub-section titles, as that's bad style
- misc language and minor content fixes
Task-number: QTBUG-62479
Change-Id: Ic4efa9e20a5966b6fc646062aec6d1a8d4ff4158
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
W3C Namespaces Standard states that "The attribute value in a default
namespace declaration MAY be empty" (secion 6.2). Analysis and fix
thanks to Eugenio Rustico.
Task-number: QTBUG-63538
Change-Id: Icd8d4df639b9737d8e0d215bf2bea56fe1e161ac
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If a signal is emitted more than once in a multithreaded application the
QSignalEventGenerator::execute function asserts in the check for a valid
signal index. It happens after abandoning the state and all the
connections are disconnected. If we have pending signal to be
processed the QObject::sender() won't be able to resolve the sender
object.
Task-number: QTBUG-61463
Change-Id: I9d4b7266c6dddc9ff2e7453b05a6989876ccb332
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The update adds the moduleheader variable to the qdocconf
file for qttestlib.qdocconf and qmake.qdocconf. The problem with
qmake is that it doesn't have a module header file, but it does
have qmake_pch.h, which is used here. This update also corrects
several \fn commands in the qttestlib docs.
Change-Id: I2202b9db96390bac1ee491ca8a99ca9010057ce3
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
QPlaformPrintDevice uses QVector to store, but QList in the getters to
retrieve these data. Port API from QList to QVector to avoid
conversion between the two containers on every access.
Saves almost 4KiB in text size (another 0.9% of QtPrintSupport).
Change-Id: If33df141b87753803c45d9f4dae501a68abe49af
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit pains me, because we want Qt to migrate away from QList,
but the QtPrint API stack (all the way to public API, for QPageSize,
and int) is formulated in terms of QList, not QVector, so it makes
zero sense to store data in QVectors just to convert to QList on every
opportunity.
Store QMimeType in QList, too, since that's what QtCore uses.
Saves 3KiB in text size (0.7% of QtPrintSupport).
Change-Id: I71249f60be517cc06973b38d9ccad7a31f348be3
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QWidgetBackingStore::markDirty has an optimization for QRect, so we don't
want to unify these two functions by calling update/repaint(QRegion(rect)).
Change-Id: Id2a42f478f71863da45697041e0ab0130c74b9d2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
If QCoreApplication is recreated, it is possible the previous argv[0]
pointer has become invalid, so we should not rely on it. So to prevent
that, we copy the original argv[0] to a static QByteArray.
Task-number: QTBUG-58919
Change-Id: Idadd4cb78e4281830165fb681ea7925109f316ff
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
In order to support the generated EUDC.TTE font for
End-User Defined Characters on Windows, we need to allow
fallback fonts which are not part of the default font
collection. This is the same as change
21c7421d4e, but adapted to
the fallback font code path.
Without this change, the EUDC file would still be loaded,
but it would be loaded through the GDI fallback, and we
would display an error message on the console.
Task-number: QTBUG-44594
Change-Id: Id2404228c7fd345523e4e5c99f31862e256930e3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
We set anchors from QSslConfiguration::caCertificates. On macOS these
anchors are by default copied from the system store, so I expected
setting 'trust those anchors only' should not break anything.
Somehow, on 10.11 SecTrustEvaluate fails to evaluate a valid
certificate chain (apparently because it has an intermediate
certificate, it's just a guess, since their API/docs are too poor
to explain well what was the real cause) as I can see connecting,
for example, to google.com - we have a chain with a valid root,
say it's GetTrust CA and we have it also in our list of anchors we set
on trust, but evaluation fails with: kSecTrustResultRecoverableTrustFailure:
"This means that you should not trust the chain as-is, but that
the chain could be trusted with some minor change to the evaluation
context, such as ignoring expired certificates or adding an
additional anchor to the set of trusted anchors."
Since none of certs is expired, and the required anchor already set,
this must be some bug in SecureTransport. For macOS (deployment
target) < 10.12 we fallback to the original version of the code
(the one that unfortunately does not allow us to limit the set
of trusted anchors by what client code wants to trust).
Change-Id: Ie42fd77c3eb6ef7469812aa0d7efff88a003c0b8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
... from 1.7.4 to 1.7.5 (released Sep, 2015).
Some more locking issues were fixed after 1.7.4. Testing
for a prolonged period of time has showed that 1.7.5 does
not cause a system lock-up.
[ChangeLog][Platform Specific Changes][X11 / XCB] Minimal libXi
version requirement has been updated from 1.7.4 to 1.7.5. This
is because XIAllowTouchEvents is known to deadlock with libXi 1.7.4
and earlier. When touch events are never received, this is not
an issue. Plain mouse / keyboard systems are not affected.
Task-number: QTBUG-62224
Change-Id: Ie70264b9af0390df33c417f660350d4bce48c6d3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The safe area margins of a window represent the area that is safe to
place content within, without intersecting areas of the screen where
system UI is placed, or where a screen bezel may cover the content.
QWidget will incorporate the safe area margins into its contents margins,
so that they are are never smaller than the safe area margins. This can be
disabled by unsetting the Qt::WA_ContentsMarginsRespectsSafeArea widget
attribute, which is set by default.
QLayouts will automatically use the contents area of a widget for their
layout, unless the Qt::WA_LayoutOnEntireRect attribute has been set. This
can be used, along with a contents margin of 0 on the actual layout,
to allow e.g. a background image to underlay the status bar and other
system areas on an iOS device, while still allowing child widgets of
that background to be inset based on the safe area.
[ChangeLog][iOS/tvOS] Qt will now take the safe area margins of the
device into account when computing layouts for QtWidgets.
Change-Id: Ife3827ab663f0625c1451e75b14fb8eeffb00754
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The code that was supposed to initialize the joining property of
characters to the correct defaults was actually applied after reading
in the data from the Unicode file, and was in a couple of cases
overwriting explicitly specified data in ArabicShaping.txt
Task-number: QTBUG-63191
Change-Id: Ie35261039b2211a827322ca11afacd9555ccefc7
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
EUDC, or "End-User Defined Characters", is a concept in Windows,
where the end-user can create a local fallback font of default
glyphs for the PUA (Private Use Area, a range of Unicode
not reserved to any writing system), and these glyphs will be
used when displaying the character using a font which does not
itself support the code point.
To support this in Qt we look up the default EUDC font in the registry
and add it to the fallback fonts if it is available. We use the
font for code page 1252. This has been tested on a couple of systems,
and appears to always be present. The font is added to the front of
all fallback lists, so that it will override other fallbacks,
such as Segoe UI Symbol, which happens to assign glyphs to the PUA.
If there is no end-user defined fallback, then Segoe UI Symbol will still
be used as before.
Note that this required a small change in the code to get canonical
font names. The EUDC font that Windows generates will only have a
name set for the current locale, and we expected all fonts to have
an English name. Instead, the code has now been changed to prefer
the English name if one is present, but accept any other name if
there is nothing in English.
[ChangeLog][Windows][Text] Added support for End-User Defined Characters
in Qt.
Task-number: QTBUG-44594
Change-Id: I83ae68b6d16e9b50e990dfb3ac3d294b7b2a5113
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use the correct height/width values when calculating
the vector for resizing the window content and the
new size as viewport size.
Task-number: QTBUG-62475
Change-Id: I33a8dc1379a908e991b04bc31dfc6254a6d005c9
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(or lack thereof).
* `QString::utf16()` reallocates if `*this` has been constructed using
`fromRawData()`.
* `QString::data()` ensures a writable string, so will detach from raw
data.
* `QString::unicode()`, `constData()`, and `data() const` do not. They
just return `QStringData::data()`, which may point to raw,
non-NUL-terminated data.
These functions can therefore not possibly have the same behavior, but
were documented the same.
Fix.
Also drop the discussion of operator[](size()), as that, too, was not
correct, and anyone who indexes with op[] beyond size() - 1 should not
rely on proper behavior.
[ChangeLog][QtCore][QString] QString::unicode(), constData() and
`data() const` do not return a NUL-terminated string. This was true
before, but the documentation claimed the opposite.
Change-Id: I1437f57cd02bdf80264e8559608b46aa749c23a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For multi text-item texts we should render the text decoration at the
same position as the text-item part is, and not always from the
beginning of the line.
Task-number: QTBUG-60422
Change-Id: I9aa58fc164122ad1fae9716b8b18bdfbbbd778a9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Change the include header to sys/slog2.h, which is available
in both QNX 6.6.0 and 7.
Task-number: QTBUG-64033
Change-Id: I26d8c5451376bab33e11f4784ca772f84cd6fc28
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Autotest is taken from the previously reverted
8b1377fde1.
Task-number: QTBUG-60231
Change-Id: I44dd79cba22b6baefdd6d95c176790bef0b7eafe
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
In QWindowPrivate::applyCursor(), do not apply override cursors
when the platform supports QPlatformCursor::OverrideCursor.
Complements b05d1c2ebf.
Task-number: QTBUG-65001
Change-Id: Ie84cc30ad99b22e037aae829a2ce847ec4bf900f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Override cursors were not restored when nested or in a dual
monitor setups.
The default cursor stored in QWindowsCursor::m_overriddenCursor
was clobbered by subsequent calls to QWindowsCursor::setOverrideCursor().
This caused for example the wait cursor to remain active when
switching to Help Mode in Qt Creator. Add a check preventing that.
Make the variable static so that it is shared between the cursors
of multiple screens.
Amends b05d1c2ebf.
Task-number: QTBUG-65001
Change-Id: Iead5804d317f73dedd78d22c1c85c62b5349ab83
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This change allows services using QAndroidService to function properly.
A service using a plain QCoreApplication is still affected.
The original code uses postfix decrement, causing an off-by-one error in
reference counting, which, in turn, fails to properly release a semaphore.
Fix by using deref() instead, which is also more readable, and consistent
with the use of ref() elsewhere in the code.
Task-number: QTBUG-64728
Change-Id: I99b59307638d619506c594f86de6d7d202d755f2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
The user can set QT_QPA_NO_TEXT_HANDLES to 1 to disable the text handles.
Change-Id: I974af4d79c86259288035fe20b6a9d0c6d047af8
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
The hash from QOpenGLContext* to cursor texture/shader data can
accumulate dangling pointers if the program uses multiple contexts on
the same screen. This is fixed by moving the cursor data into the
platform context. The code for deleting the texture and shader program
is omitted as it is tied to the life time of the context and the GL
context deletes its resources automatically upon destruction.
Task-number: QTBUG-65119
Change-Id: Ic3b8e5669d14949af811bdf047e7d47000216180
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QHeaderViewPrivate::setupSectionIndicator() did not honor the font
set for the QHeaderView which results in a wrong font in the indicator
pixmap. Fix it by using the correct font for the dragged section as
it is done in paintEvent()
Task-number: QTBUG-65017
Change-Id: I5393c6861073de22f30ffa13e12c5e2cf8aa7776
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
In rtl mode, the headers were not painted correctly. The style option
selectedPosition was not filled correctly and the paint rect needed
to be adjusted by one pixel to fit the table grid.
Task-number: QTBUG-56520
Change-Id: Ib92d5ab6ff730bba67eca35c83cd638e613f58b9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The file size column was not properly horizontally aligned. The model
only returned Qt::AlignRight with no horizontal alignment. This lead
to a top alignment within QStyle::alignedRect().
Task-number: QTBUG-64098
Change-Id: Iaef30200a63bd0975c88a67d0af2eb1d5254f588
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Change 28666d167a simplified
QProcess::start{Process,Detached} by using findExecutable() instead of
using execvp, but this introduced an unintended side effect when the
PATH environment variable isn't set. It turns out that most libc have a
default fallback in that situation, which we didn't apply.
This commit applies the default directly to findExecutable(), which
seems sensible.
[ChangeLog][QtCore][QProcess] Fixed a regression that made QProcess be
unable to find executables when the PATH environment variable on some
Unix systems wasn't set. This behavior should not be relied upon since
many systems do not have sensible fallback values for PATH.
[ChangeLog][QtCore][QStandardPaths] findExecutable() will now apply the
default value for the PATH environment variable (as returned by the
POSIX confstr(3) function or found in <paths.h>) if the variable
isn't set in the environment.
Task-number: QTBUG-65076
Change-Id: I9407dcf22de6407c83b5fffd14feda6c1f509210
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Check for QWindowPrivate::blockedByModalWindow in
QGuiApplicationPrivate::processDrag().
Task-number: QTBUG-46287
Change-Id: I8f43de8389f34458f9e10b37b94806b47a50d40a
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
If the cursor is at the top of the screen, it may end up with a cursor
rect that extends beyond the screen after we pad it. We need to make
sure it's constrained by the screen geometry before checking if it's
within the available geometry.
Task-number: QTBUG-65041
Change-Id: I115f49d359b3c2e10219a6b8aa5ad051f44256a7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When the mode is center we are typically moving the dock widget,
but we should however not stop if the mode is Center.
Though the regression
(in commit e662b4ed721ee36f0a17cc413494b7d09395d52e)
is not easy to reproduce it is clear
that the code later may call "mouseMoveEvent(e)" and the
mode is also checked for being Center and in that case
the eventfilter (function) returns true (not false).
Change-Id: I3936ec56833d613f78920d9ccf8ddb66e19e9802
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This is mostly relevant for Apple platforms, where we can use the new
unguarded availability warnings to guarantee that proper version checks
are present when using APIs that are not necessarily available on the
deployment target.
Change-Id: Ie408704b2924e1220491a9ea30f0141dfa4867d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from 70422449ef)
MetaKeyKeyListener augments the meta state of the keyboard, we need
to also check the KeyEvent.getMetaState().
Task-number: QTBUG-61369
Change-Id: I07a5d7b1b741a958bc94e1f1677dc1f2256220b6
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Changed some uses of Q_QDOC to Q_CLANG_QDOC;
eliminated some uses of Q_QDOC; correct some
function signatures used for qdoc; added docs
for swap() functions.
Change-Id: I0d3c62d462bd3b10fd35d411bdfb93d952e6423d
Reviewed-by: Martin Smith <martin.smith@qt.io>
QT_NO_OPENGL must not be defined when running clangqdoc
because there are opengl elements that must be documented.
That means clang will see uses of GLxxx, which might not
be included on some platforms. For example, clang must
parse the declaration for class QOpenGLFramebufferObject,
which uses GLuint, GLenum, and GLbitfield, because there
is documentation to be published for that class in
qopenglframebufferobject.cpp.
This change uses Q_CLANG_QDOC to first undef the needed
GLxxx types and then provide suitable typedefs for them.
This technique is also used in qglshader.h.
This works for macOS, but is it the right way to solve the
problem?
This change also removes some \overload commands, because
they shouldn't be used on constructors. And some \fn commands
that are made unnecessary by upgrading to clang.
Change-Id: I4ac658e951b3f2011698005f0238d4dea85fc403
Reviewed-by: Martin Smith <martin.smith@qt.io>
QColorDialog does not save custom colors after application
relaunching, if those colors were changed with drag'n'drop
Task-number: QTBUG-64500
Change-Id: I8ba6e1ef4e078f7b93463e7b20c9e21659d4777e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QFontMetrics(F)::width() has been deprecated and is replaced by
horizontalAdvance(). This updates all usage of it in tests and
documentation.
It is worth noting that many or most of the usages of
QFontMetrics::width() probably intended to use boundingRect().width(),
but since it currently works, I have not looked into that, just
replaced the function name mechanically.
Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use being()/end() instead.
The region of whose rects() we iterate here is modified in the loop
body, so take a copy of the rectangles. Since QVector is still
missing a range constructor, use std::vector. This does not cause
extra copies, since the QVector inside QRegion would detach anyway,
when the QRegion is modified inside the loop.
Change-Id: Ib973e825b55d9c9568936cb80180858163d87379
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
These errors resulted from the improved parsing provided
by clang, which required rethinking which elements of the
QtConcurrent API should be visible to clangqdoc. The basic
problem is that clang must see declarations for all types
used by a type, or else it either gets lost and fails to
parse a type correctly, or it simply refuses to include
the type in its AST.
Change-Id: Iaa699c287e67d1288fcb2d83a9dbbaf07521d0cc
Reviewed-by: Martin Smith <martin.smith@qt.io>
This change updates the \fn commands in the QtConcurrent
module, which makes extensive use of templates. Some of the
update \fn commands are very long as a result.
A few cases of the tag trick were used to fix qdoc errors
for some complicated template function signatures that were
marked \internal anyway.
Change-Id: I8546b89030c51bb9dddf38fa10bc0248d901aa51
Reviewed-by: Martin Smith <martin.smith@qt.io>
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.
Change-Id: If45465880933174f1481a8be292474be191cfd45
Reviewed-by: Martin Smith <martin.smith@qt.io>
This update corrects many qdoc warnings in qglobal.cpp caused by
incomplete \fn commands. It also corrects many undocumented parameter
errors caused by clang's requirement that the formal parameter names
be the same in both the declaration in the include file and the \fn
command.
Some formal parameter names were changed in the declarations in the
header file.
Change-Id: I4cd38f30461c585b97ec11923cdbc81a41fe00b8
Reviewed-by: Martin Smith <martin.smith@qt.io>
There were four dummy declarations for struct QMetaObject that were
needed by old qdoc to allow documentation of some very complicated
function signatures that old qdoc could not parse. clangqdoc can now
parse these signatures, but, unfortunately, old qdoc is still used to
parse \fn commands in .cpp and .qdoc files, so the dummy declarations
are still needed in struct QMetaObject. However, clangqdoc now
sees that two of the four dummy declarations are actually duplicates
of the other two, and then old qdoc complains when it can't find all
four of the function nodes, when it parses the four \fn commands.
This update removes the duplicate dummy declarations and the two
redundant \fn comments. The remaining two \fn comments are
updated accordingly.
This change also moves a couple of qdoc comments so they are located
with the function definitions that they are documenting.
Change-Id: I85e2492ba0380b01c3700b3dc7db0913d6429701
Reviewed-by: Martin Smith <martin.smith@qt.io>
All of QLocalePrivate::codeToLanguage()'s legacy codes were
two-letter, so duplicated a "third letter is 0" check; pulling it out
in front of them all will get any three-letter code more promptly to
the final fall-back, while saving the two-letter codes repetition of
the check.
Change-Id: I8ee81a526adaa7b24c11c1de7a1750d87deb5fb3
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
The documentation claims that function objects just work with
map-reduce. They work for the map function, but not for the reduce
function. Making them work for the reduce function was deemed
too complex for questionable benefit, so this patch explains
the situation and provides a work-around.
Task-number: QTBUG-22710
Change-Id: I7f706468e36031bc261234310d331001b96e5137
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
- There was a typo
- It has not been limited to the 4D mouse for some time now
- The Apple Pencil now supports rotation too
Change-Id: I96e20a56491fbcb80e19dc39d0b48b543217aa24
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
It was superseded by begin()/end() in Qt 5.8.
The eventual removal of rects() will allow greater flexibility
in the implementation's choice of data structure (std::vector,
e.g., or QVarLengthArray).
Remove all traces of rects() from the documentation. This means
we need to copy information previously contained in the rects()
docs to functions which previously just referred to rects(), in
particular the begin()/end() familiy of functions.
Change-Id: I90809809783252f7c552f24b4841f1e965580284
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Not doing so might break the connection. We have had similar
issues before, e.g. QTBUG-45312.
Change-Id: I95f15d24773fc92b052578bd72d1ba264d0a5f63
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Uli Schlachter <psychon@znc.in>
Add the command line switch added in change
184c5470f534119b27c1a4caec29d699aba9c234 on qtdeclarative to the
help output of the qmltestrunner application.
Change-Id: I9f42719500e0039afa6a5b0f1f365611855229b3
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
To fix QTBUG-52493 we tied the exposed state of a window to the
application being in the foreground. This has the result of a
visible flash of black between hiding the launch screen and showing
the first frame of the application, as the application is still
waiting for UIApplicationStateActive to begin rendering, which
happens after iOS hides the launch screen.
According to the iOS OpenGL ES Programming Guide, it should be safe
to render GL in UIApplicationStateInactive as well, and even in
UIApplicationStateBackground, as long as the rendering finishes
before the UIApplicationDidEnterBackgroundNotification returns.
To ensure that we catch any bugs in this area, checks have been
added that verify that no rendering happens while in the background
state.
Task-number: QTBUG-63229
Task-number: QTBUG-52493
Task-number: QTBUG-55205
Change-Id: Ib42bedbeddd7479ab0fb5e5b7de9f5805658e111
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
I don't know when it ceased to be needed, but QRegion no longer
does anything fancy with QVector.
Change-Id: I1bdfefc84724c379fab76dada35575666144df12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Despite the OpenGL ES Programming Guide telling us to avoid all
use of OpenGL while in the background, iOS will perform its view
snapshotting for the app switcher after the application has been
backgrounded; once for each orientation. Presumably the expectation
is that no rendering needs to be done to provide an alternate
orientation snapshot, just relayouting of views. But in our case,
or any non-stretchable content case such as a OpenGL based game,
this is not true.
Instead of continuing layout, which will send potentially expensive
geometry changes (with isExposed false, since we're in the background),
we short-circuit the snapshotting.
iOS will still use the latest rendered frame to create the application
switcher thumbnail, but it will be based on the last active orientation
of the application.
To ensure that we pick up the right geometry when rotating the device
while the app is in the background, we treat applicationWillEnterForeground
as Qt::ApplicationInactive, which matches the recommendations of the
OpenGL ES Programming Guide to "re-create any objects and restart your
animation timers".
Change-Id: Ia9c27f85f996ecf30284c825b43447aa7099224e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Make sure we catch application state changes as early as possible,
and deal properly with any changes delivered before we have an app
to send them to.
Change-Id: I6d0ea0398f9fab88fc182342769b075cb144227f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Use begin()/end() instead.
The old code extracted the rects from the region, then checked for a 'complex'
region (by comparing the number of rectangles against 10), and replacing the
region with the bounding rect if it was too complex. It then went on to adjust
the rectangle list it had gotten from the original region to match the new.
Simply delay getting the rectangles until after we have modified the region.
Since there are many member function calls in-between, take a copy of the
region to iterate over later, rather than relying on the region to be left
untouched by all the code in-between.
Change-Id: I49ddf4d545520ab435ab6b89eec3d24cf371823e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use begin()/end() instead.
In QXcbShmImage::flushPixmap(), instead of gettings different rects(),
depending on a bool parameter, just call yourself again with the
modified QRegion, which we can then just iterate over.
Change-Id: I6d4f7c6e4e5d2a24520716847ca9331bf39337c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
... between QXcbWindow and QxcbShmImage.
Replaces one QRegion::rects() call (to be deprecated), fixes potential overflows
that QXcbShmImage did not handle, but QXcbWindow did, and saves ~1KiB of text size.
Change-Id: I55d37021164feefe0cb3e60bd6d22b1976a6467b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use begin()/end()/rectCount() instead, which don't require QRegionPrivate
::vectorize() calls.
In QPaintEngineEx::clip(), the rectCount() == 1 case called clip(QRect), but
forgot to return, causing another clip(QVectorPath) call with the same
arguments. Fixed.
Change-Id: Ife33112fc8006ed4bdff6409e2b8465ce7acb9d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Wrap std::free() in a function object, to avoid having to carry around
state (the function pointer) inside unique_ptr objects. This shrinks
unique_ptrs back to sizeof(void*).
Change-Id: I32a711192c5485dc04e3b36a1ddabf02d1e9d4f9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
A UIGestureRecognizer may have its delaysTouchesBegan or delaysTouchesEnded
properties set, which causes iOS to not deliver touch events to the view
until the recognizer has failed recognition of its gesture.
In that case, the touch event is not delivered via [UIWindow sendEvent:]
as usual, but via _UIGestureEnvironmentSortAndSendDelayedTouches. The
latter function is apparently not reentrant, as opening a native alert
dialog in response to the touch delivery will result in the dialogs's
buttons to stop working, probably because they themselves use gestures.
Unfortunately iOS maintains two internal gesture recognizers on iPad,
of type _UISystemGestureGateGestureRecognizer, probably related to the
swipe-from-bottom gesture used for multitasking. Without any workaround,
these two recognizers will result in any tap on the bottom part of the
screen to be delivered delayed, which may introduce stuck alert dialogs
as described above.
UITouch has a gestureRecognizers property, but unfortunately this property
does not give us any information in the cases where we need it, so we
have to use an heuristic involving a UIWindow subclass to detect the
case where event delivery is delayed. As there is no way to prevent
the user from recursing into an event loop when delivering the event,
our only hope is to deliver the event asynchronously.
Task-number: QTBUG-64577
Change-Id: I11d9caa8c4542dc80426a9e58ea555914bed433e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Since 5.10, QIODevice resets the error string on opening. So, we should
set the error code to UnknownSocketError accordingly.
Change-Id: I0dd314788ffc182d6837f9d06b51e41d6de59d7e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This update corrects many qdoc warnings in qsharedpointer.cpp and
qshareddata.cpp caused by incomplete \fn commands. Template stuff
was added to the \fn commands.
Change-Id: Ic10bcf04477d5f3d5380aeb1e58050a88f03005a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This update corrects several uses of #ifdef macros
that needed updating because qdoc now uses clang to
parse header files.
Change-Id: I285efa4629a1a5d5bcbfaf701eeafbd0e9f1e43e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
It is only ever called after the constructor, so merge the code
Change-Id: I5c75a2cd367af401b41920f51754a64dc6c6eb40
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
It is only ever called after the constructor so merge the code
Change-Id: I381165ad90c85342e5db3c16327d729388b71fb2
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
It's only ever called after the constructor so merge its code to the constructor
Change-Id: Icca88764f725b9aeaa08ee7387da8885be247fba
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
And move it's code to the only place it is called, the QUnixPrintWidget constructor,
that means we can remove the if that checks if propertiesDialog is not null since
at that stage we know it is null
Change-Id: I81cdaa0505fa6fe64a45c7d1f5c3e277400cbbf7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
In Qt 5.4 these envvars were replaced with categorized logging
59ba84d31c. This is not a public
API, the log output is useful mostly for developers and it can
still be used via QT_LOGGING_RULES, so there is no good reason
to keep the old envvars around. By using QT_LOGGING_RULES, we
can access even more xinput2 logs than is available via
QT_XCB_DEBUG_XINPUT*.
Change-Id: I2b12b8696043bc8bf8310f49f0cdc2ba1b8708ba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This change supplies several missing class qualifiers for
parameter types and function return types.
Change-Id: I569026e4da0948902fcc13557003d3748b85dd82
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This update corrects about 200 qdoc warnings caused by incomplete
\fn commands for member functions of template classes. It can be
used as an example of how to fix \fn commands that suddenly cause
qdoc warnings now that qdoc uses clang to parse the \fn commands.
For example, with the old qdoc, we had this \fn command, which the
old qdoc handled correctly:
\fn QAtomicInteger::operator T() const
For the new clang-based qdoc, this \fn command must be written this way:
\fn template <typename T> QAtomicInteger<T>::operator T() const
However, the documentation generated by the clang-based qdoc looks the
same as it did in the old qdoc.
Change-Id: I7803b3b7ec7c6b8b3cc1be789bc36921438f527e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Use begin()/end() instead.
Drop the special handling of rectCount() == 1, since with begin()/end(),
we no longer take the hit of creating a QVector just to be able to return
it from rects().
Change-Id: I19ebc38267951c80bc71aa9d2b5df7403d710064
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
When the QVarLengthArray was initialized with a size then append would
add to the end of that. Therefore we need to use reserve to get the
desired effect.
Task-number: QTBUG-64905
Change-Id: Ia1ebeb26cd31bc5e92bd7f81079506a266b845bf
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Android Marshmellow intentionally forbids use of hard links. See
https://code.google.com/archive/p/android-developer-preview/issues/3150
However, instead of using EPERM or another error code that indicates the
hard linking operation itself has a problem but there are no other
problems, Android developers stupidly chose to use EACCES, an errno code
that only indicates permission problems.
In any case, since the call will never succeed, we shouldn't even try.
Task-number: QTBUG-64103
Change-Id: I9e2892cb6c374e93bcb7fffd14fc5d1082bd60a3
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
A few parameter types in \fn commands were not
qualified with their class name. They had to be
qualified because they were in a base class of
the class being documented.
Change-Id: Ic0b43be689d17a0a539ee977c0db6e20eb05d5fe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This prevents an out of range assert when monitoring directory
with activity (for example, temp).
Task-number: QTBUG-62841
Change-Id: Id3aa4098e9bbd665c7b17a667516885fa7c7f473
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Martin Rotter <rotter.martinos@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When building Qt 5.6.2 with gcc 4.1.2 on Fedora 8, a compilation error
happened when compiling the code below
QColor::name()
{
...
case HexArgb:
return QLatin1Char('#') + QString::number(rgba() | 0x100000000, 16).rightRef(8);
...
}
qtbase/src/gui/painting/qcolor.cpp:527: error: integer constant is too large for ‘long’ type
gcc 4.1.2 was unable to handle 0x100000000. The patch is to use Q_INT64_C to
append "LL" to 0x100000000 to avoid the compilation error.
Change-Id: I000e65a5c897ef2d78fcfe4e212d832eb488a762
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Prioritize CoreText over Fontconfig since the former is the
native one on macOS, and any other native font DB on its
respective platform. We introduce a new 'fontconfig' option
to allow using Fontconfig instead. This works similarly to
'freetype' overriding the default font engine on Windows. A
propos of which, 'freetype' now does the same on macOS.
Change-Id: Ic8168820d1d01fddc2f26e046abb65b8ab765f89
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
These errors resulted from clang parsing function
declarations for functions that were not meant to
be documented. Here they are hidden from clang
with #ifndef Q_CLANG_QDOC
Change-Id: I256b49830b63188bf0a685cb393d469f2f2ca315
Reviewed-by: Martin Smith <martin.smith@qt.io>
src/corelib/global/qrandom.cpp:915: warning: Cannot find 'bounded(...)' in '\fn' qreal QRandomGenerator::bounded(qreal highest)
src/corelib/tools/qstring.cpp:774: warning: Command '\snippet (//! [qCompareStrings-QSV-QSV])' failed at end of file 'qstring/main.cpp'
src/corelib/tools/qstring.cpp:5281: warning: Cannot find 'qTrimmed(...)' in '\fn' QStringView qTrimmed(QStringView s)
src/corelib/tools/qstring.cpp:5281: warning: Cannot find 'qTrimmed(...)' in '\fn' QLatin1String qTrimmed(QLatin1String s)
src/corelib/global/qrandom.h:171: warning: No documentation for 'QRandomGenerator::System'
src/corelib/global/qrandom.h:105: warning: No documentation for 'QRandomGenerator::bounded(double highest)'
src/corelib/global/qrandom.h:84: warning: No documentation for 'QRandomGenerator::generate64()'
src/corelib/global/qrandom.h:77: warning: No documentation for 'QRandomGenerator::generate()'
src/corelib/global/qrandom.cpp:799: warning: No such parameter 'sseq' in QRandomGenerator::seed()
src/corelib/global/qrandom.cpp:1096: warning: Can't link to 'operator()()'
src/corelib/tools/qstring.cpp:8982: warning: Can't link to 'qStartsWith()'
src/corelib/tools/qstring.cpp:9203: warning: Can't link to 'qTrimmed()'
src/corelib/tools/qstring.cpp:4798: warning: Can't link to 'qConvertToLatin1()'
src/corelib/tools/qstring.cpp:4825: warning: Can't link to 'qConvertToLocal8Bit()'
src/corelib/tools/qstring.cpp:4928: warning: Can't link to 'qConvertToUcs4()'
src/corelib/tools/qstring.cpp:4884: warning: Can't link to 'qConvertToUtf8()'
Change-Id: I5c7c89b230d3d1de8a679c10833319a470a44e80
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Wacom stylus proximity detection had stopped working: it was not
detecting which type of tool is in use, so all stylus types
acted as a generic drawing stylus.
Selecting XI_PropertyEvent on a root window fixes the problem.
There is nothing in the XI2 specification that says that this
property would not be supported on non-root windows. Possibly
it is bug in the X server. Anyways, selecting XI_PropertyEvent
on a root window in this case actually is better. Property event
contains a global state information, there is nothing window
specific in it, so there is no need to select it for every native
sub-window.
It is worth noting that XI_HierarchyChanged also seems to work
only when selected on the root window (according to my testing
results). And on XI2 author's blog post about XI_HierarchyChanged
it says [1]:
"These events are sent to all windows, so it doesn't really
matter where you register. The traditional approach is to
register on the root window."
This kind of further confirms that it might be bug in X Server's
implementation.
[1] http://who-t.blogspot.no/2009/06/xi2-recipies-part-2.html
Task-number: QTBUG-64911
Change-Id: I8582675bf835239932e23f4596966dc167495e30
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Follow native behavior and disable ⌘H and the “Hide”
menu item if there are any open popup windows.
Task-number: QTBUG-58727
Change-Id: Iad38cc5cce29e0081613417c53b154ae0f05857e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
There are two fake classes in qendian.h that exist only documenting
a lot of operator functions, but now that clang is being used to parse
all C++ code, when a class is a template class, clangqdoc must see its
template stuff to recognize template type T, for example. Hence, this
update adds template<typename T> to some fake class declarations used
only for documentation purposes. ie, inside #ifdef Q_CLANG_QDOC.
Change-Id: I1988b77cd7f3bb97067e7107dd00de34770e9fed
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
1. Make the checkbox's box size hidpi scale-able. Making the size
not only anchored to icon size, but also the menuItem's rect height
in empty or too small icon cases.
2. Make the checkmark's pen width in propotion to the box's size
to keep consistent visual effects among different dpi settings
3. Also make the radio button hidpi scale-able.
Task-number: QTBUG-63576
Change-Id: I4369aaa18ee68908a26a118cf04292ee4c3e9847
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This change updates the \fn commands in the endian
functions, which are template-based. clangqdoc now
parses these \fn commands and expects to see all the
template stuff in the signatures.
Change-Id: I94c1aba8d710c97b8d41184d64b5341c88ece297
Reviewed-by: Martin Smith <martin.smith@qt.io>
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.
Change-Id: I920d9cc4bef710f276267a34b6b9d49f7412adb0
Reviewed-by: Martin Smith <martin.smith@qt.io>
For ibus-hangul, it needs ForwardKeyEvent signal to fix
the commit issue.
[ChangeLog][plugins][ibus] Support ForwardKeyEvent signal
Change-Id: If41e75bed9ec4e3126db05c8ece4a51d2bc3c3fd
Reviewed-by: Takao Fujiwara <takao.fujiwara1@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The macros Q_GLOBAL_STATIC(Type, VariableName) and
Q_GLOBAL_STATIC_WITH_ARGS(Type, VariableName, Arguments)
were documented in qglobal.cpp, but both qdoc comments
were marked \internal. More recent documentation for the
macros also exists in qglobalstatic.qdoc, and the qdoc
comments there are not marked \internal. clang-qdoc
reports errors indicating that both macros havew been
documented in two places. This update removes the older
comments that are marked \internal.
Change-Id: I1c319b831d705d86eb4142b9963dbf56edc72772
Reviewed-by: Martin Smith <martin.smith@qt.io>
This change updates the \fn commands in QGenericMatrix
clangqdoc now parses these \fn commands and expects to see
all the template stuff in the signatures.
Change-Id: Icf815606f98271aae1959adc633e918e7f241aa0
Reviewed-by: Martin Smith <martin.smith@qt.io>
_q_canWrite() unconditionally disabled the write notifier before the
writing, and might have enabled it again afterwards. This caused
unnecessary processing in the event dispatcher and could result in
extra system calls.
Actually setting the state at the moment when the write buffer size
is determined is enough.
Change-Id: I81f9ec27d95a5a9bdb83cc6a842b6ae95f002b96
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Clang needs to see declarations for GLclampf, GLSizei,
and GLboolean.
Change-Id: Id1c1310e4877b32bb8fc2e6d4f743999842b3f06
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
When Q_CLANG_QDOC is defined, ensure that the following openGL
types are defined:
typedef int GLint;
typedef int GLsizei;
typedef unsigned int GLuint;
typedef unsigned int GLenum;
typedef unsigned int GLbitfield;
typedef float GLfloat;
typedef float GLclampf;
typedef bool GLboolean;
typedef void GLvoid;
typedef char GLchar;
Running clangqdoc with these on macOS fixed over 500 qdoc errors!
There were also some functions that declared the parameter list as void.
It was also shown as void in the \fn command for each function in the
.cpp file, which is wrong. When the function is declared in the header
as int func(void), it should just be \fn int classname::func() in the
.cpp file.
Change-Id: I6489d499f0830e5ba97c085ed5dadfad5affecb7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Two of the three functions were for functions that
should not be documented. The third was a function
protected by #ifndef Q_OS_DARWIN, which required a
test of Q_CLANG_QDOC in the header and cpp files.
Change-Id: Id2ab3e4f2ea896dc628a622de2e80a19c18eb9fe
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Some member functions of QImage were upgraded to use ref qualifiers,
but the documentation wasn't updated correctly to account for this.
This change update the documentation for those member functions to
show the ref qualifiers in the documentation.
Change-Id: I0ff4011e9d0251062d5616d69e9dda6bdbc1c136
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This update surrounds some #defines with #ifndef Q_CLANG_QDOC
because they define some names that conflict with formal parameter
names. Otherwise, clang starts replacing formal parameter names
with $27 etc, when qdoc runs, and that causes trouble for qdoc.
The change also replaces one use of Q_QDOC with Q_CLANG_QDOC.
Change-Id: I6e93bf1e0d30d7590280b6f18f0e694556050685
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
A use of Q_QDOC is changed to Q_CLANG_QDOC.
A misspelled std type name is corrected.
A few extraneous ';' are removed.
Change-Id: Ic49f64a3b97f645268a8ecbbca5f0eef0456bb33
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The code checked on QFileInfo::size() whether the file had any content.
The check failed for NTFS symbolic links since QFileInfo::size() returns 0
for them. Workaround by using QFile::size() instead.
Task-number: QTBUG-64121
Change-Id: I303414b5a560d1ed8fbc53d969e53f9e2899ae5c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This update corrects many qdoc warnings in qpointer.cpp caused by
incomplete \fn commands. Template stuff was added to the \fn commands.
Change-Id: I39bcd5db1cb4257d574918155dc49414a8b00c3d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This update corrects many qdoc warnings in qdebug.cpp caused by
incomplete \fn commands. It also corrects many undocumented parameter
errors caused by clang's requirement that the formal parameter names
be the same in both the declaration in the include file and the \fn
command. The name changes don't seem to be objectionable in this file.
Change-Id: I0630a0e05e651b58608b2f2116df70dcf0e83a45
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This update corrects many qdoc warnings in the documentation
for the QFuture classes caused by incomplete \fn commands.
Template text and parameters was added.
Change-Id: I360c9db191230b19a9b174a43468d3de1eb24549
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This change updates the \fn commands in qalgorithms.qdoc.
clangqdoc now parses these \fn commands and expects to see
all the template stuff in the signatures.
Change-Id: Id9492bf80eca494eb2b5b8d7364b8485ed1a047e
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.
Change-Id: I49302d0792c8a4c5a36c671142796a48d384b548
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters.
Removes about 150 qdoc warnings.
Change-Id: I63c6cae5613f0bb23527607230b6edf7fac33740
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters. This
change eliminates about 150 qdoc warnings.
Change-Id: I23632e739b529cd56a6cae1a29df2e7131a05292
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This reverts commit 958a4c9087.
QApplicationPrivate::usesNativeStyle() introduced by that commit
was never used. We have an untested method that is furthermore
may return wrong results because it relies on the comparison
'app_style->objectName() != QApplicationPrivate::desktopStyleKey()',
but not all styles set their object names.
Conflicts:
src/widgets/kernel/qapplication.cpp
src/widgets/kernel/qapplication_p.h
Change-Id: I48d221f9387381db9ed51a7a068bfd0a0c2ed58d
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Non-const arrays are not literals, so their encoding may be
not defined at compile-time and they should be converted
explicitly.
Change-Id: I2a65e095224f48efafeaa97fd85134697a1e5bf0
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Drop the #ifdef Q_COMPILER_RVALUE_REFS - we require that since Qt 5.7.
Change-Id: Ib4c6f559b014915f43875ec6791bfda3f24a109b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the response from res_nquery is too big for the buffer used to receive it
(of size PACKETSZ, a mere 512 bytes), the returned responseLength is the
size of the data that would have been delivered, had there been enough space.
Trying to process all of the data, including what wasn't delivered, leads to
reading past the end of the buffer, which either causes a crash or leads to
rubbish (from the stack) in the resulting QDnsRecords. Easy to reproduce
using many long TXT records.
Replace the array with a QVarLengthArray; when the response is big, resize()
and retry, so as to actually get all of the data, so that we can process
it all. A follow-up patch will fix the case when even the second call/resize
buffer is not enough and we have to use TCP.
Task-number: QTBUG-64742
Change-Id: I173beb531e11a3828fd9c97f437afc192766035e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
As the numercialPrecisionPolicy can be set and subsequently retrieved
from the QSqlDatabase's driver, then when copying the QSqlDatabase, we
need to set that appropriately too.
Task-number: QTBUG-10452
Change-Id: I2c63748365ab4e9fbc29d8d460d80d2e2a0ee385
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We haven't had support for anything older than 7.3 for a long time, so
this removes the code to save having to maintain it any further.
Task-number: QTBUG-644
Change-Id: If0635f3bef5138a00a0e77011a70f23d0bffda32
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The \fn commands were not recognized by clang-qdoc because
the template stuff was missing from the \fn commands. This
update adds the correct template text and parameters. It
eliminates nearly 2000 qdoc warnings.
Change-Id: Ibe047424396a8f99f8bd64efea1b0d8cc7c7527d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
... to make user code buildable with gcc [-Werror=zero-as-null-pointer-constant].
Change-Id: I309953acd7154511660302aa9826410276cfe41b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Although the items were enabled for a dialog's menubar they were not
appearing as such because Cocoa will query the menu item's target to see
if it has a worksWhenModal selector. Therefore to ensure that the menu
item will be enabled, we need to add this selector to our delegate and
return YES from it when the window for the menubar is the dialog.
Task-number: QTBUG-44584
Change-Id: Ic62dc027d563069d2f5c2b7bf9810184bd76de39
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Change-Id: I5bed1fd690daa72492e7ec5f24e80198a2592986
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
There seems to be an issue in CoreText which may cause an existing
font descriptor to give unreliable results if it refers to one of
the system theme fonts. Since we do not know all function calls
or events that may trigger this bug, the safe route is to always
create fresh font descriptors when creating fonts for these
descriptors. The impact on performance should be small, as Qt has
its own internal caches.
[ChangeLog][macOS/iOS][Text] Fixed an issue where text using
one of the system theme fonts would under certain circumstances
display random glyphs.
Task-number: QTBUG-63476
Change-Id: I9e9b253018c63976345eec1439a6b78de2cab869
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Enable xcb QPA plugin when XQuartz is available. This is done
in a single build, alongside the Cocoa version.
We delegate part of the configuration stage to pkg-config, so
this becomes a requirement. Ensure that
PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig:/opt/X11/share/pkgconfig
is in your environment, or pkg-config is properly set up.
Tested with the following configure options:
configure \
-pkg-config \
-fontconfig -system-freetype \
-system-xcb -xkb -no-opengl \
-qt-xkbcommon -qt-xkbcommon-x11
Change-Id: I2eb5a0491172368afc4c629c540cbef08580348d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The condition for the 'services' sub-project in platformsupport.pro
was identical to the one guarding genericunix.pri in services.pro.
We can't remove the condition in platformsupport.pro because that
would result on an empty static library, which is not supported on
some platforms, like macOS.
Change-Id: I5c80737d9527bdd75dde44e33e5063f3d7aeecb7
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
qwindowsxpstyle.cpp(289,35): warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized]
qwindowsxpstyle.cpp(292,35): warning: Signature is not normalized. Use void* instead of void * [-Wclazy-connect-not-normalized]
Change-Id: I773530452c0837c5066f9174c25ae37e57086e76
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
... and not only when the source explicitly specifies build variants.
Change-Id: Iac6c8fda8f431d5fb50fada8338d1b660ab040d7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
flex emits code using isatty(), but fails to include the required
unistd.h. we can work around it by including the header ourselves.
Task-number: QTBUG-64771
Change-Id: I05313eeb79f7a0e25365dee5f05a0142f87209ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QAbstractItemDelegatePrivate::textForRole() was formatting date and
time separately, then gluing the parts back together with space.
QLocale can do that just fine itself (it has a toString() overload
that handles a QDateTime) and might even (some day) do it better. To
my mild surprise, this proved sufficient to fix a problem with
date-time display in tool-tips, when the date-time includes a zone.
Extracted the date-time part of an existing selftest into a test of
its own and extended it to test times of each spec-type; verified that
the non-local spec cases of this all failed before this fix.
Task-number: QTBUG-61069
Change-Id: I6d6be0c27be9a557d8afc3ced200a10b2aaff816
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
It's decoding a SYSTEMTIME in the slightly quirky manner of MS's
timezone APIs (year 0 means annual, with wDay as 1 through 4 for the
first through fourth, or 5 for the last, of a specified week-day
within a month) and the calculations to go with it were a little
opaque. So clean it up, document what it's doing (and why) and assert
some things that should be true. Also, only copy one int, instead of
a whole structure, to change from their day-numbering to ours.
Expand on a related TODO comment in its caller, at the same time.
Change-Id: Iffd95c094c37fc1081b73b2a267cfdcd29aeb4ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The implementation of QWinTimeZonePrivate used many static functions
and at least one struct; to which I've added. Put these all into an
anonymous namespace (thereby keeping the struct types out of the
linker's sight): make them local the C++ way, rather than the C way.
Change-Id: Ibdce0865234b5d4ebbdc90628cc4d9e790ed6321
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QTimeZonePrivate::dataForLocalTime() needs a transition before the
time it starts at; MS's time-zone data tends to omit old zones (before
2007, in the case of Win7 for Casablanca - which had interesting
transitions before that), so all we can do is extrapolate backwards
from there; but a first rule is indeed apt to be a no-transition rule,
describing the zone's status up to the first known transition. So
fake a "start of time" transition to return for this case, that
describes this prefix of history.
Change-Id: Iaf178cbebc3b1e599cbde3437a0af75d9f6ca432
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A transition time may represent the beginning of time; as such,
arithmetic on it might underflow, e.g. on adding a negative zone
offset to compare with a given time. So move the arithmetic to the
other side of the comparison in such cases.
Change-Id: I1697a03ebf74679ff86059664dd2b173b9c4c367
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When a year contains a real change of standard time without any DST,
MS's APIs still claim to have both a DST start and a DST end; one of
them is bogus and positioned on the start (or end) of the year,
producing no change in offset from the end of the previous (or into
the start of the next) year. So code round that.
Task-number: QTBUG-42021
Change-Id: Ieb6161cfb77db8a57dc181097f117316f9d1c13c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Iterate rules (now that there's fewer of them than years) with only a
secondary iteration on years (when needed - in which case it should
never need more than two iterations). In particular, avoid iterating
years to the MIN_YEAR and MAX_YEAR extremes on failure; fail faster !
Change-Id: I354af8e0cb1e484c8abda279991e6e1824f9f7d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The MS API documents that the two TIME_ZONE_INFORMATION date fields
either both have wMonth clear (when there is no DST) or both have it
set (for each part of a DST pair). This rule is followed even when
there's a standard time change without DST, with perverse results I'll
deal with in a later commit. Add code in init() to verify the rule is
followed and qWarning() if not.
A year with no transitions doesn't imply no earlier or later year has
transitions, so don't give up on searches for transitions because of
it. Also fix a potential uninitialized variable bug, related to
data() breaking out of a loop on such a year.
Change-Id: I1ad86c07e54b2eb835a2e02d18dc64022f52a0d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Note that the relevant cases are all numeric, eliminate a redundant
variable (the min of two others, one of which was provably <= the
other), invert and rename a boolean (that was always used negated),
eliminate a case that couldn't arise (and assert this).
Change-Id: I9ef9cedbeb608c7cd56ddc618ddfb921966edfbf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Previously, a 1, 2 or 3 for "dd" would be rejected because 10, 20 or
30 would fit in the field and be valid; but 4 or more was accepted,
even though it was too short for the field, because no suffix could
make it valid within the field-width.
[ChangeLog][QtCore][QDateTime] When parsing dates and times from
strings, fixed-width date-time fields, such as a "dd" for day,
QDateTime now rejects all values that should be padded, rather
than only doing so when the value is a prefix of some value that
would fill the field-width. Use a single letter for the field,
e.g. "d" for day, if you want to accept short
values. (QDateTimeEdit is not affected.)
Task-number: QTBUG-63072
Change-Id: I22d223c50057c3edab4ef7f01d9ed0f58e9139c1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Test-case taken from bug-report; fits in as an easy row in an existing
data-driven test. Add similar tests for date-time and time; and an
isValid test on the end of year 9999. The date-time parser was using
the end of year 7999 as maximum value for dates and date-times; extend
this to year 9999, as I can see no reason not to.
[ChangeLog][QtCore][QDateTime] Years up to 9999 can now be parsed
without error (previously 8000 and beyond were treated as invalid) in
all formats (not only in ISO format). Widgets handling dates now
support dates to 9999, likewise.
Task-number: QTBUG-64401
Change-Id: I518cfa6c2cb4ecc5a85b896dc9e56b4fdd8a8bb1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For want of this, nothing that used QLocale::system(), inter alia,
could be thread-safe or re-entrant.
Task-number: QTBUG-49473
Change-Id: I3e017aa7d59c4c39828bb5cdc7ff0780ea66bafe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
To signal a thread to cancel, nothing more than a std::atomic_flag is
needed, but the implementation actually used mutexes, and weird
run-state introspection, so we can't just swap it out for a
std::atomic_flag.
Instead, we retain the principal logic, however weird it is, and just
optimize the common case where isInterruptionRequested() is called
from the secondary thread, repeatedly. We add a fast-path that just
checks that d->interruptionRequested is not set. That requires nothing
more than a relaxed atomic load, because there's no new value read
that could be used as a signal to the secondary thread that some
condition changed.
"What signal?", you may ask. Well, one can think of users doing this:
void cancel() {
m_why = tr("&Canceled");
requestIterruption();
}
void run() override {
while (!isInterruptionRequested()) {
doWork();
}
emit progress(100, 100, m_why);
}
We need to keep this code working, at least until Qt 6.
But the code can already now only rely on synchronization if
isInterruptionRequested() returns true. If it returns false, then
requestInterruption() has not been called, yet, and any modifications
done prior to the requestInterruption() call are not visible in the
secondary thead.
So we still lock the mutex, and in general don't change the semantics
of the functions, except that we don't lock the mutex in the case
where the flag wasn't set in the first place.
This makes calling isInterruptionRequested() as cheap as it can get,
assuming a lock-free implementation, of course.
I opted to use a std::atomic<bool> instead of QAtomicInt, as the
latter does not have loadRelaxed()/storeRelaxed(), and because it
future-proofs the code.
Change-Id: I67faf36b8de73d2723f9cdd66c416010d0873d98
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
When a new source model was set to QSortFilterProxyModel, the model
tried to remap the persistent indexes to the new model which was wrong.
The correct solution is to clear the persistent indexes with
_q_sourceModelDestroyed() since the old source model went away.
Task-number: QTBUG-44962
Change-Id: Id39e9ac83324250e8bfa434aae467a9206d2590e
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
QItemSelectionRange::intersects() needs to check if the parent of both
QItemSelectionRanges is the same. This is a very expensive operation
which should be done last. Same goes for isValid() which itself calls
parent() for two indexes.
This rearrangement speeds up some worst-case usecases by at least 30%
as shown in the bug report.
Task-number: QTBUG-60940
Change-Id: If6111a73cb8b97a8a0d0640527b34448d21f3143
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
When switching on/off multiple time the wifi (mainly, but not only) on
ios/macos the QNAM may wrongly stay on a NotAccessible state while the
configuration is Active.
This change make sure the QNAM::networkAccessible() is correctly
reporting the accessibility.
Task-number: QTBUG-49751
Task-number: QTBUG-58275
Task-number: QTBUG-60366
Change-Id: I238ab32030fbaa8072cce341db8da6bcfc346035
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In addition to the (deprecated) applicationFrame property, we
base the available geometry on the root view's safe area, which
also takes into account system-reserved areas on iPhone X, and
the screen's bezel in the case of tvOS.
Change-Id: I252d960a0e486dd0c7e30843f88c0bf5684feb24
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Instead of trying to adapt to whatever the C library may have and using
QThreadLocalStorage, let's use a simple linear congruential generator
engine from <random>. We can't use a single instance because qsrand()
is documented to work per thread.
I thought of using QRandomEngine, but had to make the choice between
growing the QtCore code size and growing the per-thread data size. Code
is sharable and is actually smaller than the sizeof(QRandomEngine),
which is over 2500 bytes. sizeof(std::minstd_rand) is just
sizeof(uint_fast32_t).
Change-Id: I0a103569c81b4711a649fffd14ec8e641d02bf20
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This logic initially was copied from QTest::mouse* widget overload
(by d130382776) which uses QCursor::setPos()
to generate mouse move events via the windowing system. The QCursor API was
later removed by 1762bf3394, but now the redundant
qWait logic remained. Later this stray qWait was incorrectly moved to apply
for all mouse event types (by 268f41ec70), when
originally it was needed (arguably) only for mouse move events due to usage
of QCursor.
This patch also removes the waitForEvents() function as it is not a documented
qtestlib API (in qtestlib only the documented functions should be considered
public API, no matter what you can find in the header files). Removal does not
affect binary compatibility as this is not an exported symbol. And if somebody
has used this non public API, updating code is trivial.
Change-Id: Id1dec10f5cf276cee1ac0e8c8f8ba2edc493b667
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The standard calculateUnixPriority provides values that are almost
invariably inappropriate with even LowestPriority mapping to
something higher than the priority of any other thread on the
system.
[ChangeLog][QtCore][QThread] Changed how Qt thread priorities are
mapped to QNX system thread priorities.
Task-number: QTBUG-53357
Change-Id: I205035c4ca7dcafabda7a9a9b06cc52c67c6d2b2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
qprintengine_win.cpp:1502: warning: Missing reference in range-for with non trivial type (QPrint::InputSlot) [-Wclazy-range-loop]
Change-Id: If6e55c1748e05e32aaa32a16063ba491fe242952
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
ApplicationInfo.dataDir holds "/data/user/0" (Blackberry PRIV running
Android 6.0.1), which is in fact a soft link to "/data/data". This
directory is used as a prefix for various Qt environment variables,
including QML2_IMPORT_PATH, which in turn is used for resolving QML
type URIs, looking up Qt Quick Controls 2 styles, and so on. The QML
engine is not happy with "/data/data" and "/data/user/0" being wildly
mixed for QML types in the same module. Use the canonical path instead
to avoid such conflicts.
Change-Id: I1fd45736728ee662942d7ef48c3fbc553981c59b
Task-number: QTBUG-64868
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Add Q_DECL_COLD_FUNCTION (__attribute__((cold))) to tell the compiler
that the following functions are not usually executed in normal programs:
- qWarning/qCritical/qFatal
- qTerminate
- assertion failure
- qBadAlloc
The effect of the attribute is that
1. These functions get put into their own section, .text.unlikely,
and will be optimized for size, not speed.
2. Conditions that lead to one of these functions are automatically
marked as unlikely (something we have done manually in the past)
3. (anecdotal) the compiler is less likely to inline these functions
Text size effect of this change over all of QtBase: ~27KiB text size
saved, of which 11KiB in QtCore alone.
Change-Id: If308d4a4b9ff8f7934316c54b161a78ebe3f4205
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We do not touch anything mutex-protected in the path towards the qWarning(), so
the mutex lock is not needed. It may actually be harmful, since a message handler
may check isInterruptionRequested(), which would then deadlock.
Otherwise, we're just decreasing the size of the critical section — always a
worthwhile goal.
Change-Id: I26aa7e3dc087ff7efaccff1d4dc788ba00ba183f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
clangqdoc now accepts an unnamed enum type, calls it "anonymous"
and allows it to be documented as a named enum type. In this
update, several instances appear in subclasses of QGraphicsItem.
This update documents them correctly.
Change-Id: Ide8026801269154a37e7677a1ce62e0cb392efea
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Martin Smith <martin.smith@qt.io>
When setting a header item (that is, the item that provides the
QTreeWidget's column) the widget needs to manipulate the underlying
tree model and add or remove columns. This requires calling
the right QAbstractItemModel APIs for structural model changes.
The calculations done resulted in a off-by-one error:
* if the model had N columns and needs to grow to M(>N), then
one needs to begin insertion from N to M-1 (and not M);
* if the model had N columns and needs to shrink to L(<N), then
one needs to begin removal from L to N-1 (and not N).
Add the -1s needed.
Change-Id: Ic669788825a1c480376a08df0d7c9c10f91552ef
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
QTreeWidgetItem::insertChildren should behave like a more-optimized
QTreeWidgetItem::insertChild. Unlike the latter, the former lacks
out-of-bounds checks, resulting in successful insertions even
when using an invalid index (say, bigger than the row/column count).
Reintroduce some sanity checks instead. This allows to fix a "fixme"
left in the autotest.
[ChangeLog][QtWidgets][QTreeWidgetItem] QTreeWidgetItem::insertChildren
now ignores insertions happening at invalid indices, for
consistency with QTreeWidgetItem::insertChild.
Change-Id: I1532597768cc6aff96a6e8f356bc6075b582801d
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The penultimate entry in mimeRuleTypes_strings is "byte", which, incl. the
terminating NUL character, has length five. But 65-59 == 6, so the last index
in magicRuleType_indices was off by one. No harm done, since there's one more
NUL (three in total...), but fix for the next reader of the code.
Change-Id: Ibdf855014a313a0486d013c9d06d55cea96435fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The previous commit didn't handle correctly the case where an entire
mime directory is deleted. The unittest wasn't testing that case,
now it is. We need to move providers into a new list, and then
delete those left over (i.e. now unused).
Change-Id: I04fd8b39b511a2331d706864f695ce5074acf916
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Previously, we would use mime.cache in all mime directories if at
least one of them had such a file (other than the most-local one),
otherwise the "source" XML would be used in all directories.
Now it's possible to use mime.cache in those directories which
have one, and XML in those directories that don't.
Not only is this more correct, it will allow in a subsequent
commit to bundle the binary cache in QtCore's qrc rather than
the very big XML file.
The design change to allow this is that now every provider
only deals with a single directory, and QMimeDatabasePrivate
takes care of creating multiple providers, one for each dir.
This required to move most of the loops from the binary provider
up to QMimeDatabasePrivate itself.
Change-Id: Iac82d5f5836b80d45076e586b903d16fa2525b34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is actually simpler (two calls to ensureLoaded are enough,
rather than one in every implementation method) and is necessary
for further refactoring steps (which will instanciate more provider
instances).
Change-Id: I9fb8acf3556515babecb88ba88e25af43937af5a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This wasn't the case when called from QMimeType, or some
QMimeDatabase methods. Now fixed.
Change-Id: Ifd515c1520482e4a23c399f1f773269659c92359
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If the text of a QAction in a menu item contained a sequence of multiple
ampersand characters, only one of them would be removed, which is
inconsistent with the way this situation is handled on Windows, where
every other ampersand is removed, which is also the way other widgets
such as tabs, buttons, etc. are handled on macOS and other platforms.
Task-number: QTBUG-63361
Change-Id: Ibd9a520afa37b3387f3b951a94a3c275742e7ad3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Makes the code smaller and neater. Take this opportunity to mark some of
them constexpr.
Change-Id: Idaa189413f404cffb1eafffd14cef1df599c9ab7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This has two main benefits:
1) introduces a qmake CONFIG we can use in .pro/.pri/.prf files
2) removes the need to keep an up-to-date list of which compilers
support the feature
The test is implemented as trying to compile every single SIMD test we
currently have, but without passing the -mXXX option. The reason for
trying all of them is that some people may have modified their mkspecs
to add -mXXX options or -march=XXX, which could enable the particular
feature we tried, resulting in a false positive outcome.
Change-Id: I938b024e38bf4aac9154fffd14f7784dc8d1f020
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This allows us to get "subvolumes" on all filesystem types. We do that
by detecting the subdirectory that was bind-mounted.
/proc/self/mountinfo has been in the kernel since 2.6.26. Since btrfs
was only added on 2.6.29, there is no loss of functionality for btrfs
users.
I've tested this with subvolume or mountpoint names containing spaces,
tabs and newlines.
Change-Id: I57a1bd6e0c194530b732fffd14f4fa418255d839
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The MinGW version we support supports IsWindows8OrGreater so that we can
check the windows version properly. As the OpenGL detection falls back
to WARP in case of RDP it was possible, that shared handles were wrongly
stated as supported, which caused crashes in users' code.
Task-number: QTBUG-64657
Change-Id: Iaca2bd169f2764cf6ec68a1d36112a735246b29a
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The NoClip version of the drawTriangle code had the vertices swapped.
Task-number: QTBUG-50845
Change-Id: I731dafee6cc140ea017b3b7d1051a27ad3081aa7
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
We actually test for this already in tst_QString::split().
Change-Id: I35fe8f90900ea9c8e6251facdb3326b9226348d0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We were missing some recent iPads, and the iPhone 8 Plus and X.
Change-Id: Ib65644a277a1cbd75ccb360b79b9ac8af935c741
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Change-Id: I9a2f18263a8bc0a0de8978792dbb1f285acc0ccd
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We always need to set the QMenu screen explicit also when
it is about to be shown on the primary screen.
The reason is QWidget::metric (called from style/sizeHint)
may use qApp->devicePixelRatioF() when it does not
know about the topLevelWindow. That may not be the same
value as DPR on primary screen. It can be argued that
it likely is a bug in QWidget::metric, but fixing that
looks to be a somewhat dangerous behavior change.
Task-number: QTBUG-59794
Change-Id: I6ed0e808aa31bee5b77c0e19ce61a77548fdbb38
Reviewed-by: Morten Kristensen <msk@nullpointer.dk>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
It will fill the view in some cases, obscuring what Qt draws.
Change-Id: I9ca00dddd829a28fb2cb3b009bfd3223f85ef7cb
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
... just like -xcb does implicitly. Otherwise, failure to detect
system-xcb would silently fall back to -no-xcb despite obviously
contradicting the user's request (-qt-xcb always worked anyway,
as there is no test that can fail).
Change-Id: I6f3145fac0881e7847c4a70547fce206e797a9bb
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
The former is more idiomatic in Qt, and doesn't require
as much boilerplate to set up.
Change-Id: Idf03af4018611c8eb3b31af90da72f9d85617b2c
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This is a follow-up commit to 97eec16e.
Blackberry tries sending touchpad events first, and if not consumed,
it sends synthetic mouse wheel events as a fallback. This makes touch
keyboard scrolling work in native Android ListViews and other views
that do not handle SOURCE_TOUCHPAD motion events. Qt apps, however,
blindly accepted all generic motion events, so synthesized mouse wheel
events were never sent. => Make QtSurface & QtNative accept only those
motions events that are actually handled.
Task-number: QTBUG-51165
Change-Id: Iefbbf1e3e1cc3da86afc4c87c19671cc6c5fa145
Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Since removeAll() takes its argument by cref, if passing a reference
to an element of the container to removeAll(), the element may be
deleted (overwritten) by anyother value, leading to UB.
Add a test that actually happens to fail for me without the patch,
even though that might not be guaranteed (we may invoke UB).
Change-Id: If8c795113aeb515f4a9bdf1e072395b932295667
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On iOS we want all delivery of events from the system to be handled
synchronously, as that's what the system expects.
We don't need to add a delivery template argument to each function
in QWindowSystemInterface that we want to delivery synchronously;
that's only needed for functions that a platform normally sends
asynch, but in some cases want to delivery synchronously.
For always delivering events synchronously we just need to change
the default delivery method.
The only events affected by this are the screen changes, and
window state change, which were not synchronous before, but
should be. All other events were already synchronous, though
either explicit delivery, of a flush.
Change-Id: Ib20ca342d1c076be0fbcf018c83735a416769cfe
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
During the container BoF session at the Qt Contributor Summit 2017 the
name of the signed size type became a subject of discussion in the
context of readability of code using this type and the intention of
using it for all length, size and count properties throughout the entire
framework in future versions of Qt.
This change proposes qsizetype as new name for qssize_t to emphasize the
readability of code over POSIX compatibility, the former being
potentially more relevant than the latter to the majority of users of
Qt.
Change-Id: Idb99cb4a8782703c054fa463a9e5af23a918e7f3
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: David Faure <david.faure@kdab.com>
Using "struct statx" as argument type is forward declaration which
then will expect the namespace where it was first encountered.
Change-Id: I2d4ba930bd5b4e264228f2549bd6ef75e5cf3a67
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
WSARecvMsg does not return the sender in WSAMSG::name if WSAMSG::Control
isn't set. This makes no sense, so I'm assuming it's an API quirk we
need to work around.
[ChangeLog][QtNetwork][QUdpSocket] Fixed a regression from Qt 5.9.3
caused by an apparent Win32 API quirk we triggered when using
readDatagram(), resulting in an invalid QHostAddress sender address.
receiveDatagram() was not affected.
Task-number: QTBUG-64718
Change-Id: I71488efd29b645f7b228fffd14f9d84cc205c4b3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Factor out translation from the matrix applied on bitmap glyphs,
as that gets applied as position when painted.
Task-number: QTBUG-64313
Change-Id: Iab8d995c00ee02eda0896242903312d837b6d790
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Allows categorized logging before QCoreApplication has been created,
which otherwise would silently fail to output anything because the
category would never be enabled, despite QT_LOGGING_RULES being set.
Change-Id: I1861e5366ea980dff2ffa753b137276c77278eee
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Often requested feature in QtWebKit is reporting what kind of resource
corresponds to particular QNetworkRequest, similarly to
QWebEngineUrlRequestInfo::resourceType(). This information can be used
to modify or block certain request types in user's implementation of
QNAM::createRequest().
The only clean way to pass this data is via attributes of QNetworkRequest,
so enum value needs to be reserved. It's unlikely to be used anywhere
outside of QtWebKit, however this is already the case for
SynchronousRequestAttribute.
Change-Id: I51a258e5e4b78e6e823c30c48d0c644356de6b17
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Unary ~ is not defined for enum classes, so we need a cast.
Change-Id: I79d495ebcc24ab960da8dae3be08eb307a9de448
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When processing host lookup error if-statement only checks the connection
type SPDY, which is not right - it could also be HTTP/2. As a bonus:
QT_NO_SSL conditional inclusion is not needed - HTTP2 can be 'clear text'
and SPDY enumerator is defined even in no-tls build (and is just a
noop here). Also, improve our somewhat cryptic message in 'Should not happen'
else branch - 'cannot dequeu' says nothing about HostNotFoundError.
Task-number: QTBUG-64721
Change-Id: Ib0346b8717c2dbddaffab690298f3cae01e338ea
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Some cursor themes may not contain cursors with common names,
then fallback names should be used. The fallbacks in this
change were taken from the wayland plugin.
Change-Id: I7fcc47a71cafe41c88a21a7168acd3a274b71693
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Also we can't use constructors for multiple reasons now that it is C.
Change-Id: I27f3e011cc1f67f5aa134eaf3ab934456cead902
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
An over-correction snuck in at some point.
Change-Id: Ib67c4f6ecf8e6e244a0598c025a7cb7c15401070
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's a trick used by some C libraries to keep compatibility with BSD
extensions while supporting POSIX.1-2008 API. st_atimensec is defined as
st_atim.tv_nsec, so the code would expand to invalid C++
In substitution of 'template<class T> typename std::enable_if<((&T::st_atim.tv_nsec), true), long long int>::type{anonymous}::GetFileTimes::atime(const T&, int) [with T = stat]':
error: invalid use of non-static data member 'stat::st_atim'
Change-Id: I38341f8155354cc4a776fffd14e20f4fc0f6d5bb
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Prevent image scrolling on client-side whenever possible - do it on
server-side. When using shared memory use server-side pixmap for
scrolled contents.
Put new image which will be scrolled to the server-side pixmap and do
scroll on it. Then do a server-side copy of a scrolled area from pixmap
to he window. Also put non-scrolled image directly to the window.
When not using shared memory also don't do redundand client-side image
scrolling.
When using OpenGL compositing first copy scrolled image area from/to
server-side pixmap.
Task-number: QTBUG-64414
Change-Id: Ibf5f8cfb40cd4fb3e4a75a1b92eecb625f4fd74f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The assertion in isUnnamedFile() we had was incorrect after the file was
removed, since we cleared the name and possibly reset back to the
template. Since ~QTemporaryFile() calls remove(), this was easy to
trigger if you attempted to remove the temp file and leave
QTemporaryFile like that.
Take this opportunity to add to the docs of setAutoRemove() explaining
the possibility of unnamed files.
#7 0x00007f69bcc2b50e in qt_assert (
assertion=assertion@entry=0x7f69bcf194a0 "unnamedFile == d_func()->fileEntry.isEmpty()",
file=file@entry=0x7f69bcf19458 "io/qtemporaryfile.cpp",
line=line@entry=514) at global/qglobal.cpp:3123
#8 0x00007f69bcd672cf in QTemporaryFileEngine::isUnnamedFile (this=this@entry=0x55cd60644df0)
at io/qtemporaryfile.cpp:514
#9 0x00007f69bcd683f7 in QTemporaryFileEngine::remove (this=0x55cd60644df0)
at io/qtemporaryfile.cpp:396
#10 0x00007f69bcd48654 in QFile::remove (this=this@entry=0x7fffb393f7e0)
at io/qfile.cpp:513
#11 0x00007f69bcd6653b in QTemporaryFile::~QTemporaryFile (this=0x7fffb393f7e0, __in_chrg=<optimized out>)
at io/qtemporaryfile.cpp:719
Change-Id: I57a1bd6e0c194530b732fffd14f4ed28ca8185b2
Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
One of our CI machines has WatchOS SDK 3.2 which is missing
net/if_types.h. This block integrations and until SDK is updated
in VM, we provide the missing macros from if_types.h. To be
removed ASAP.
Task-number: QTBUG-64447
Change-Id: I202d3313b9a6a6d7bd29670f0bffc182d4660f81
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
On modern distros (e.g. those using systemd), /etc/localtime is always a
symlink. As that file is actually used by libraries (see tzset(3)),
prefer it over /etc/timezone (which is no longer needed since
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803144).
This fixes a wrongly reported local timezone when a stale /etc/timezone
file exists. While at it, improve sanity check for localtime symlink.
Change-Id: I8557a58acf21afaeca0d585066304c79a92b5ddb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Calling QCoreApplication::applicationDirPath() requires an app instance,
but on Windows the implementation just relies on qAppFileName(), which
does not require any instance. As resolving the standard paths could
be needed before QCoreApplication instantiation, e.g. for categorized
logging, we use qAppFileName() directly.
Change-Id: Id882cebd528bcb8e945e73a83f1dc3d599b74d1d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
When an app is in split-view mode, the app can't use the full bounds of
the screen, but should limit its area to that of its UIWindow.
Task-number: QTBUG-48225
Change-Id: Ia66ad6bba24d9d73a8263ad3f65b9dee9b8a1b37
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
A layoutChange indicates that anything can have moved to anywhere else,
including as a result purely of new items being added. It can also
indicate that items are removed.
The old code here incorrectly assumed that the section count remained
constant over this operation by setting the size of the oldSectionHidden
QBitArray - whose size is the size before the layoutChange operation -
and then calling setBit with model rows numbered after the layoutChange
operation. As the two are not necessarily the same dimensions, this can
result in asserts from the setBit call.
Simplify the handling of layoutChanged entirely by clearing section
information, and using the QPersistentIndexes which indicate hidden
state to restore that state after re-population.
Task-number: QTBUG-53221
Change-Id: I3cda13e86b51b3029b37b647a48748fb604db252
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Fusion style did not honor direction option when drawing the child
indicator. This lead to a wrong rendering of QTreeView in right-to-left
mode.
Task-number: QTBUG-63396
Change-Id: I2d5de03d7c831e3caabcc9269617eecb9338f163
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
If -mavx2 is used, __AVX2__ is defined, which enables the F16C code
after commit 280e321e52, but that was
wrong since we aren't allowed to use the F16C intrinsics with either
Clang or GCC (we can only do that with GCC 4.9 and Clang 4.8, and only
with an __attribute__ decoration).
With ICC and MSVC, we are allowed to use the intrinsics, but the
#include was missing.
[ChangeLog][QtCore] Fixed a compilation issue with qfloat16 if AVX2
support is enabled in the compiler. Since all processors that support
AVX2 also support F16C, for GCC and Clang it is recommended to either
add -mf16c to your build or to use the corresponding -march= switch.
Task-number: QTBUG-64529
Change-Id: I84e363d735b443cb9beefffd14b8ac1fd4baa978
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Make sure we don't run into warnings for CMake 3.10
Task-number: QTBUG-63442
Change-Id: Ida004705646f0c32fb4bf6006036d80b1f279fd7
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Sebastian Holtermann <sebholt@xwmw.org>
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Since the first item in a treeview might be hidden, start from the
first visible item in the view when starting or wrapping round
during a keyboard search.
Task-number: QTBUG-63869
Change-Id: I202bea567c6d4484c3ffaf8a5f9af8ea2e13708d
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
The private class already store a QNetworkConfigurationManager
and networkSessionRequired so it's not need to compute them again
nor to instantiate temporary classes.
Change-Id: I1bbd9439afa70c950ed6ec3e4fc63ddae4a5b259
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Failure to do so will result in displaying the layer
contents on a quarter of the window when moving the
window from a 2x screen to a 1x screen.
Task-number: QTBUG-64494
Change-Id: I57ce98025e841549f62d132d4985e727898e6207
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Update the list of highlighted examples for modules in qtbase, based on
which examples have been updated to use C++11 features, the new
signal/slot connection syntax, and documentation improvements.
Not all the modules have highlighted examples yet as some of the
work is still ongoing.
Task-number: QTBUG-60641
Change-Id: If28d59c10ca1a30e5db408970f20159434ac94f8
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
655687d84d shuffled things around, moving the logic to connect
to the window's destroyed signal from backingFramebufferObjectFor into
makeCurrent. Unfortunately backingFramebufferObjectFor was the one taking
care of recursing into the root context (when shared contexts were in
play), so the end result was that the root context were keeping track
of the FBO, but the leaf context was trying to clean up the FBO.
Task-number: QTBUG-56653
Change-Id: I80ed71a3dedeb7611b2aa7548d94b9fbe0e20763
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Detecting that a Qt window has been reparented into a native window and
setting isEmbedded automatically. While there is no specific message for
the change in the parent window, a WM_WINDOWPOSCHANGING message
indicating a change in the Z order is sent. We can recognize an
embedding condition by detecting that our QWindow does not have another
QWindow as a parent, but the HWND associated with it has another HWND as
a parent, which is not the desktop window.
This change should cover the use case where a Qt-based plugin must
return a HWND to a host application, where the host application will
then reparent the HWND as it sees fit, outside of Qt control.
Task-number: QTBUG-64116
Change-Id: Iec417c0dd55ad68eff1ea75bb6f5b5495489c31e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Both ARM and x86 can convert fp16 much faster in bulk than one at a
time. This also enables hardware accelerated conversion on x86, when
F16C isn't unconditionally available at compile time.
This code is implemented in C to ensure that there's no leakage of
inline symbols from the .obj file that was compiled by Visual Studio
with AVX support. Unfortunately, simd.prf uses $(CXX) instead of $(CC)
for all its sources, which means the file gets interpreted as C++ by
g++, clang++ and icpc. Those compilers at least don't leak any symbols.
Done-with: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: I9d26d99e83392861fb09564e0e8e8d76cd8483b3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Tested with Clang, GCC 4.5 & up, ICC 17 and MSVC 2017. No current
version of MSVC supports C11 and GCC implemented the features slightly
later in C than in C++.
Change-Id: I57a1bd6e0c194530b732fffd14f45c5074c9a052
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Commit 8e70241dcc removed the need for having a global sharecontext
to be able to composit GL and raster content in the backingstore, but
forgot to remove this part of the iOS platform.
Change-Id: I46ffd766729369aff2f8c54799bd033905c9f3dc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Using QWindowSystemInterface::SynchronousDelivery reduces the chance
that we are flushing other events before delivering the application
state change. Those other events may conclude that the application
is still active, while in reality it is not, and do bad things.
Change-Id: I738c162fac22d2cd18de1e080bcd2cda78ec3f77
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When qt_lstatx() succeeds and the target is not a link, we'd erroneously
mark the file as non-existent during the pass to check qt_statx(). All
flags besides the file's modes were cleared.
This is unit-tested, but only happens on Linux kernels 4.12 or later. It
didn't happen to me because I already had this fix applied as part of a
later change relating to QSystemResult.
Task-number: QTBUG-64514
Change-Id: I938b024e38bf4aac9154fffd14f893506a1ef55b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
std::mt19937 is defined as operating on uint_fast32_t, which is usually
just a 32-bit integer. That's not the case on 64-bit Linux, where it is
actually 64-bit wide, meaning sizeof(std::mt19937) jumps from 2504 to
5000 bytes, with exactly 50% of it filled with zeroes. The seed()
function also needs a large zero-extending loop.
Change-Id: Icaa86fc7b54d4b368c0efffd14efa911e2a40b44
Reviewed-by: Lars Knoll <lars.knoll@qt.io>