Add a test for embedding Qt windows into foreign windows.
Complements the existing "foreignwindows" test (which embeds
foreign windows into Qt).
The test has a simple UI based on QRasterWindow allowing
for checking events and geometries.
Task-number: QTBUG-41186
Change-Id: Ie62a3e250ca666e2fa5c2e3ef37ef0654829397c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
setContext is needed by modules that don't need an Activity object to run (e.g. QtMultimeida, QtSensors, etc.)
Task-number: QTBUG-54506
Change-Id: Ief9daff52ddefdb27092040c89dfce9e466eac5c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
harfbuzz-ng doesn't link to Qt libraries, but uses the Qt headers for
some types. With CONFIG -= qt, we don't get QT_NAMESPACE set, which
leads to linker errors later. Instead of setting QT_NAMESPACE, ask
qversiontagging.h not to tag the headers.
Change-Id: Ie585843cfb684bc3b6e3fffd145e7e438ae7c6bd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
it positively makes no sense to have a configure test which will be
never reached due to the configure/qmake bootstrap failing with a
slew of totally unhelpful error messages.
pre-standardization partial c++11 implementations are now rejected,
except for VS2013, which is still sufficient despite not announcing full
compatibility.
Change-Id: I58af10e03960af06b80cedac105cf8433f7a1745
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Whenever someone installs Clang or the Intel compiler on Windows, it's
very likely that the compiler will be much newer than the MS headers
that came with the installed Visual Studio version. So let's make sure
we disable the C++11 features that the MS headers don't support
properly.
For example, MS's <limits> header supplied with VS 2013 doesn't mark the
max() function as constexpr, resulting compiler errors in uses of that
function in Qt code declared with Q_DECL_CONSTEXPR:
qdeadlinetimer.h(62,13) : note: non-constexpr function 'max' cannot be used in a constant expression
: s(std::numeric_limits<qint64>::max()), ns(0), type(type_) {}
^
Change-Id: I149e0540c00745fe8119fffd146286ffe480d216
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Sometimes clang-cl.exe is on PATH and would get picked up by the
build. That is often by mistake, but it will inreasingly happen
as clang-cl becomes more popular. Unfortunately, configure.bat is
too early to detect which MSVC version it's set to compile
against, so the -fms-compatibility-version option will often be
wrong. One such case is when trying to build for MSVC
2013. Microsoft headers for VS2013 are unsuitable for our use in
Qt with clang-cl.
Instead, use cl.exe. It's a much better-known quantity and is
always on PATH if trying to build with clang-cl, as the latter
needs the former to fall back to if necessary.
This does not affect the build of Qt libraries and tools.
Task-number: QTBUG-51534
Change-Id: I149e0540c00745fe8119fffd146287662436c4b9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
While connecting, the socket goes through the HostLookupState. In
this state, the socket engine is not yet created, unless the socket
had previously been bound. When it has been bound, we should keep
the socket engine even if the user initiates a delayed close by
using the write()+close() sequence.
Change-Id: Iefebcb33cd72cb49617acbac8e02af9d8209c869
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If an error occurs during the transaction, we should prevent the
containers from being successfully read. So, check the status of the
stream before reading the container, because the deserialization
procedure temporarily resets it on entry.
Task-number: QTBUG-54022
Change-Id: Ie955c2fa3e449374f0f8403f00e487efa2bfdaf3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We were printing 'loaded library "xxx"' even when ret == false, which
was misleading. So instead print the error string.
Change-Id: Ib57b52598e2f452985e9fffd1459ea860ed2dfcf
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Associates the scalableBitmapFactor with the freetype QFontEngine
so that it is preserved when caching the engine
Task-number: QTBUG-53652
Change-Id: I010f9d235ccf30679b112e0c05e01bc247a3693f
Reviewed-by: jian liang <jianliang79@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
We can expect C++11 now, and using an initializer list
is much shorter.
Change-Id: I6424d24ce7660b342a629e836b94d62c8868a44d
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Conflicts:
qmake/library/qmakeevaluator.cpp
One side changed the iterator to use ranged-for, the other changed its
body; they only conflicted because the latter had to add braces around
the body, intruding on the for-line. Trivial resolution.
Change-Id: Ib487bc3bd6e3c5225db15f94b9a8f6caaa33456b
The (example) code used a real to hold 360 / 7, which is of course 51,
discarding the 3/7 that was most likely meant to be kept. Noticed by
Coverity (CID 22364). Use 360.0 instead of 360 to get more accurate
results.
Change-Id: Ifdfbb932589d8ea728710e8b656af651c9f8a7d2
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Do not attempt to switch from translucent GL windows (emulated by DWM blur
behind) to translucent raster windows (using layered windows) as
this produces warnings from UpdateLayeredWindowIndirect() failing.
Task-number: QTBUG-54734
Change-Id: Ie05126c5cb091a00f17b88a74b287c90aa2dfebd
Reviewed-by: Joni Poikelin <joni.poikelin@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Do not increment 'data' past the buffer in case of invalid token.
Remove the left over qDebug so we can make a test.
Task-number: QTBUG-54609
Change-Id: I8f0dd3381fbdea3f07d3c05c9a44a16d92538117
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Emit a warning when the function is called before show()
as it does not have any effect in that case.
Amends change 69839e55c1.
Task-number: QTBUG-41309
Change-Id: I7c2bb21735d8e41d525c5e00213b0e278ae5c774
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Previously, QWindowsTheme had a hardcoded list of of available file icon sizes.
As the sizes depend on the Windows display scale factor, this can lead to
undesired scaling of icons.
Maintain an array of the standard sizes against which the sizes are
matched; refresh in display change.
Task-number: QTBUG-54561
Change-Id: If36de2f30c8a230cc7bd8eeb4dfc9f201aeda5e4
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Use QStringBuilder more.
Use QL1S directly, without QString construction.
Change-Id: Iad844391367681fc1013b9725403d009e7c346e6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When one tries to lock without a timeout, there is no need to allocate
a QReadWriteLockPrivate as we will not wait on it.
Change-Id: I37c96a7fbc0c66fbdffe372f6089708cb2466fe3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A number of devices are indicating that there is a problem with using
bgra so instead of blacklisting all of them individually it is best to
blacklist them all on the iOS platform. This ensures
QQuickItem::grabToImage() will work then.
Task-number: QTBUG-45902
Change-Id: I900857cfa996924469aaaeeee8037dc84a4fd575
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
styleHint for SH_FocusFrame_Mask calls drawControl with a painter created
for pixmap. We only test pixmapSize.isValid(), but the size (0,0) is also 'isValid',
and we end up with a QPainter with an invalid paintEngine (null) crashing in
drawControl.
Task-number: QTBUG-54630
Change-Id: I84d1785f04ffb3e608812076a6d1bc36ffb92adc
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
We cannot really remove the function, since it's called from
inline code (QCharRef::op=(QChar)), but we can schedule it for
removal in Qt 6, and inline it into existing in-tree callers.
Change-Id: I3499f101dcb5ae908726b3673bf3526a04408db6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When I introduced this code in Qt 5.0, I made INT and POINTER be
SOMETIMES_NATIVE, but then later I made the specific sizes be
ALWAYS_NATIVE. That doesn't make sense.
Instead, use the macros from the C++11 <atomic> header.
Note that the member isXxxxNative() functions should not have been
constexpr. That's a defect I introduced in Qt 5.0.
Task-number: QTBUG-51315
Change-Id: I0c94a5c2846b48c8aea7ffff1436013e8686c153
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Another one of Cocoa's capricious behaviors. Evidence shows that
the menu item's submenu property needs to be set before we can
set the item's hidden property. We ensure this is the case by
getting the NSMenuItem through QCocoaMenu::attachedItem() instead
of QCocoaMenuBar::nativeItemForMenu() in QCocoaMenuBar::syncMenu().
Change-Id: Id50356dae5f556fa3d745ba9a5982e5a72bf0ac2
Task-number: QTBUG-54637
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Jason Haslam <jason@scitools.com>
This was missed in ab599a3931 when
QMAKE_STRIP was set as a side effect of adding support for separate
debug info.
Task-number: QTBUG-54212
Change-Id: I86dd040dbefec4c58879c7d029ed89dd8bad3daf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
exclusive_builds_post.prf (via default_post.prf) processes
debug_and_release into BUILDS, so .prfs which can rely on being
executed later (because they are loaded via CONFIG) can rely on BUILDS
and related variables.
Change-Id: I5677079ad5145bf493af17b4b60347208572fd21
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
the whole point of the check is ensuring that the message is printed
only once for each sub-project, so !build_pass alone is fully adequate.
Change-Id: Ib8f821ead6709efc9bfa935e1d05f8caba02a814
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
when the file name is empty, the path will be returned verbatim. this
must be considered when constructing the return value.
Task-number: QTBUG-54550
Change-Id: Ie108ed52275e66a154ef63bd6f7193f55b3e0454
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
that can make sense if a function which determines the availability of
a dependency fails to do so for unexpected reasons.
Change-Id: If6cd113df25aee66830c120a2fab067c822a4543
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
if() would simply "downgrade" a fatal error to a false condition, which
is certainly not expected.
Change-Id: Ie9c54f2bddf588856498bf795007b341b7c9363a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This patch adds a warning that will be shown when link_pkgconfig is used
in a project but Qt's configuration has it disabled. This can happen
when Qt is built before pkg-config has been installed or if it's not
detected.
This will avoid user losing time trying to make pkg-config work while Qt
just ignores it.
Change-Id: Ieeff8dd6784b9430cfebef355855ec1be91bc96e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
When setting a QFileSystemModel as model, the completion role
is set to QFileSystemModel::FileNameRole. This needs to be reset
to the default Qt::EditRole when setting another model.
Task-number: QTBUG-54642
Change-Id: Ie78d5d417e008ad05a2f995bdbc218b3ad1bc49c
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The previous patch works for FreeBSD 10 but however not for 9 and 11
due to the order of includes. Move <sys/user.h> down to fix those compile
issues due to unknown types when user.h is included first.
Change-Id: Ica3d3ddf335a543c4a473e8b80d1667cb81667cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As OpenBSD ships its own X11, linker errors occur when not explicitly
adding the X11R6/lib dir to rpath dirs.
Change-Id: I75991e9d7de115d2d212a017d9c8f9aa93cecc27
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
When the insertion position is not beyond end(), call
resize() instead of expand(), which fills the new size
with spaces, which, however would just be overwritten
by the following memmove().
Add some Q_UNLIKELY to indicate that we strongly
expect the resize() case to be the more common.
Change-Id: Iaf3215dd53c2cbd18f2fd8a5f80af8f6844944da
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Anton Kudryavtsev <a.kudryavtsev@netris.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The option was removed in dev but should have been removed in 5.7. In
order not to complicate merges most of the code that was removed in dev
has been kept as is and only the "bare minimum" was removed.
Task-number: QTBUG-54674
Change-Id: I5118fe344de014bdcf008cccfe9eca112896d23a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
When replacing each copy of one text with a copy of another, we do so
in batches of 1024; if we get more than one batch, we need to keep a
copy of the sought text and replacement if they're part of the string
we're modifying, for use in later batches.
Also do the replacements in full batches of 1024, not 1023 (which left
the last entry in an array unused); marked some related tests as
(un)likely; and move some repeated code out into a pair of little
local functions to save duplcation.
Those new functions can also serve replace_helper(); and it can shed a
const_cast and some conditioning of free() by using them the same way
replace() now does. (There was also one place it still used the raw
after, rather than the replacement copy; which could have produced
errors if memcpy were to exercise its right to assume no overlap in
arrays. This error is what prompted me to notice all of the above.)
Added tests. The last error proved untestable as my memcpy is in fact
as fussy as memmove. The first two tests added were attempts to get a
failure out of it. The third did get a failure, but also tripped over
the problem in replace() itself. Added to an existing test function
and renamed it to generally cover extra tests for replace.
Change-Id: I9ba6928c84ece266dbbe52b91e333ea54ab6d95e
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Also skip doing a += 0 when we had to test whether the relevant rhs
was zero anyway (because we want to ++ there instead of +=ing).
Change-Id: Ibd5f21eb9aaf410b09c9db8450b2d61618e628fc
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
qwidget.cpp:498: warning: Can't link to 'Qt Examples'
Change-Id: I5eed4ac4fd5514a1e1ff7130997df8449d5c5e7f
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
if the environment variable is set, but the buglist file cannot be found,
we should fall back to the built-in buglist instead of not using any.
Change-Id: I370a1f21238efd155b46f0e7071734f5d3c6c343
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>