A window can resize while dragging, this happens on Windows when dragging
across screens, to a screen with a bigger scale factor. When that occurs
it might lead to the press pos being outside of the window.
Change-Id: Ic61ec7088c8fa81395d43ce665952dbd2eecba39
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
RunLoopModeTracker as one of Qt Cocoa classes was not wrapped
in namespace which limited its use in Objective-C single symbol space.
Change-Id: Ida2c62c6f543a3bf5107f28c78d27435bcb3470d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This is still not a great place for it, but this way we can
Q_REQUIRE_CONFIG(library) in qlibrary_p.h and qfactoryloader_p.h is the
only private header that doesn't require library support in plugin.pri.
Change-Id: Ia6c1ac8799822eca1e0cbeca98d1c1b8de74beae
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Make it iterate the addresses available looking for an IPv4 address,
when that's what it needs, instead of just assuming the first entry in
the list (when non-empty) is IPv4.
Based on a suggestion by Dmitry Pankratov.
Task-number: QTBUG-27641
Change-Id: I1920f68ade44a996ea5c2ed691a87ff3e686f35a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of the incomprehensible "names" .first and .second, the code
can now use .content and .type.
Change-Id: I7fe320ded33a07fb8ff77ac96c17fc5ee1079da3
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The cancel() function added in 5b11e43e for Qt 5.5 suffers from a
number of problems:
First, if runnable->autoDelete() is true, then the function suffers
from the ABA problem (see documentation written for trytake()).
Second, if runnable->autoDelete() is false, due to cancel() throwing
away crucial information instead of returning it, the caller cannot
know whether the runnable was canceled (and thus has to be deleted),
wasn't found or is currently executing (and thus mustn't be deleted),
or has finished executing (and can be used to extract the result).
Deprecate this dangerous API and replace it with the much more useful
Private::stealRunnable(), promoted to public API and renamed to
tryTake() for consistency with the rest of Qt.
Described the various caveats in the function's documentation.
[ChangeLog][QtCore][QThreadPool] The cancel() function suffers from
several subtle issues and has been replaced with a new tryTake()
function.
Change-Id: I93125935614087efa24b3e3969dd6718aeabaa4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We define QT_STATICPLUGIN for the plugins in this case, so that they
define the factory functions needed to link them directly into the
test.
Change-Id: I0f2de7bf6bec5a6d53ec9ad92536817c1221b7d5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Since this table was restructured in 7c401397a4 and changed to
being indexed bitwidth and not format, NEON-enabled builds have
been writing to an undefined place after the table.
Discovered by compiler warnings on CI.
Change-Id: I109cd19a8dd703bdafdf13afd3f96ebeaa0e6de5
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
We fully specialize QTypeInfo for most C++ built-in types,
but enums and extended integral types (like GCC's int128_t)
were not covered.
Now that we depend on <type_traits>, we can stop pessimizing
enums and extended integral types in QVector and QVLA by
defaulting QTypeInfo::isComplex to true for such types.
Fix a test that checked that enums were complex types. This should
have been a XFAIL test. Enums are not complex types.
Change-Id: Ibb0fb38cc83e980a428b5573d1db5666593418ae
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
... except in QList.
When dafa3618 introduced isRelocatable and QTypeInfoQuery, the
intention was to decouple the memory layout of QList from the
reallocation optimizations in QVector. This never happened, as
QVector (and QVarLengthArray) continue to use isStatic to this
day.
Fix by porting both QVector and QVLA to QTypeInfoQuery and
isRelocatable.
Change-Id: I6951f2cf21f0cbb24e2dbd38f80f1bd82007d394
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... but default-initialization instead.
This bug may have rendered the diverse Qt::Uninitialized ctors
we have in Qt containers ineffective.
Change-Id: I5a369fa8527f19b6f8cc1a9f36512f6a0058839a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Instead of setting the mask in toggleFullScreen(), which is only hit
when going to fullscreen via our own API, we do it in the window
notification callbacks, which also includes going to full screen via
the native macOS title bar buttons. This allows making customized
windows without Qt::WindowMaximizeButtonHint full screen with the
full geometry of the screen.
Change-Id: I63c3e4582ea7c4fe8c0008265793c5f656b830b2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
... as a replacement for QPair<QString, int>, and move some
repsonsibilities into it.
This avoids the repeated use of the magic number INT_MIN to indicate
absence of an offset and does away with the confusing .first and
.second, replacing them instead with proper names, .name and .offset.
Change-Id: I0f6906467b8efa16bed2bf5677f2bbbd534da1ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The platform plugins reading this out of the QWindow was a layering
violation, and propagates the notion that a window can shape shift
into representing a new native handle, while none of the platform
plugins support this.
A foreign QWindow is created via the factory function fromWinId(),
at which point we can pass the WId all the way to the platform
plugin as function arguments, where the platform will create a
corresponding platform-window.
The platform window can then answer the question of whether or
not it's representing a foreign window, which determines a few
behavioral changes here and there, as well as supplying the
native window handle back for QWindow::winId();
[ChangeLog][QtGui][QWindow] The "_q_foreignWinId" dynamic property
is no longer set nor read.
[ChangeLog][QtGui][QPA] The function createForeignWindow() has been
added to QPlatormIntegration and is now responsible for creating
foreign windows. The function isForeignWindow() in QPlatformWindow
has been added, and platforms should implement this to return true
for windows created by createForeignWindow().
Task-number: QTBUG-58383
Change-Id: If84142f95172f62b9377eb5d2a4d792cad36010b
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Pass classname 'exefile' to ShellExecuteEx() for UAC prompt.
This allows running executable files that do not have a .exe extension.
Task-number: QTBUG-59008
Change-Id: I88d669481e893db50edccd7b30259e5366477556
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
now that it works nicely, make use of it for the zlib deps, which are
not transitive when the detected library is built statically.
Change-Id: Iaed87a37b36f714f0b919244cd84809650102ba9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
these statements are assumed to provide dependencies for the currently
detected library. this implies that their resolved content must be
passed to the linker after the to be detected static library.
Change-Id: Ifaaee2ac71bf176e8a0033765fb979fe119deaba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
this went unnoticed, because the only cross-module 'use' so far is that
of egl, for which the code path provided for modular builds happens to
(mostly) work due to the specs already providing the library definition.
amends cc842ca4.
Change-Id: I58c638d896eabd26f27d5cd90e3a7f8eeece9bc0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
we derive the keys from the last fragment of the parent directory, which
is potentially not globally unique.
Change-Id: I57cf13394984e6e3d902c0f1bb495bd3920bfc75
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
if a library uses another library which happens to be absent, then the
former must also fail.
amends cc842ca4.
Change-Id: I91f157a6d1ed40b66e196340a282ebe493fcf40e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
the outdated ones remain for backwards compatibility; some remain
unchanged.
Task-number: QTBUG-30083
Change-Id: Ia596b854d26b00fcb4f48df0da7ad893650ac1c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
currently mostly for debugging purposes (especially with -verbose).
Change-Id: I8af32c61df0b19861aa79bc4bbdd3f6095dbe9b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
also actually deletes qfeatures.txt, which was already claimed by
a668c6a6, but not actually done.
Task-number: QTBUG-58411
Change-Id: I686760632fee7c10b01bd2e83f2481b01bc2b774
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
don't attempt to hand-craft a library export any more. instead, use the
configure system's built-in mechanism, and refer to it via QMAKE_USE.
this also allows us to rely on transitive dependencies in the autotest.
as a side effect, this makes the openssl-linked feature imply the
openssl one.
Change-Id: I5dd209b63bc8fbbc62852f6ffc472d4452ea2e68
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
a header-only library in a default location would produce no variables
at all, making it appear undefined. fix this by forcing the writeout of
the QMAKE_LIBS_* variable, and use its definedness (rather than
non-emptiness) as a signifier.
this works for both QMAKE_USE and configure tests'/libraries' 'use'
entries.
Change-Id: Id7a1e23725caba1a91ea4db448b4aeb7fe632393
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
if multiple library entries provide the same export (as openssl is going
to), it makes sense to make them recognize the same input variables, as
it would be rather counterproductive to require different configure
arguments for each.
Change-Id: Ia32842e95294296d50220297f85689bc92de2d05
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
pass the library name instead of a library source object.
improves overall legibility at a marginal runtime cost.
Change-Id: I248ee9622af2b2c37daa2dbc0cc0bca5701d7925
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QObject::connect will extract the QArgumentType for first the signal,
then the slot. The QArgumentType with a string constructor will query
the metatype system to get the meta type id. But it might happen that
between the extraction of the signal's argument and the slot's argument,
qRegisterMetaType was called in another thread. For this reason, it's
possible that one QArgumentType has a type id while the other does not.
For this reason, we should fall back to compare the string if any of
the argument's type is 0.
Task-number: QTBUG-50901
Change-Id: I260ca662ff00a773ae519f78bb633e05fde0ea81
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is straight-forward, since, unlike with transposed(), we can
assume that every compiler that supports C++14 constexpr also supports
C++11 uniform initialization. For Clang and GCC, this is clear. For
MSVC, we might need to reconsider this, as, according to
qcompilerdetection.h, 2015 still does not support uniform
initialization (but not C++14 constexpr, either), and we don't know
what 2017 will support.
Change-Id: Idac7aa929d275645478a926896dca0dff166e114
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
These days, QTypeInfoQuery and isRelocatable should be used.
Change-Id: Ieac2d7fcef6b1d5466b14bbd1066901d6e751a55
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The this pointer cannot be null, so we can't do d->staticFunction while
d is a null pointer. This was caught by Clang 3.8's ubsan.
Change-Id: I3c0d39b88cca83d827a69ed1544a4412b18ac907
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
icc defaults to -O2, so this was causing debug code to be built like
that, making debugging very hard. This change also hardcodes -O2 for
release builds, just in case.
Change-Id: Ibc5c715fda334a75bd2efffd14a478ce539a3a3f
Reviewed-by: Robert Pancoast <RobertPancoast77@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
They are the default with icc.
Change-Id: Ibc5c715fda334a75bd2efffd14a478c20b527d7c
Reviewed-by: Robert Pancoast <RobertPancoast77@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reduces duplication of logic and allows other primitives to be
built on top.
Change-Id: Ia100014cfb0c09ac2f47c3a156d0c76f0fddafa8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The problem was caused by commit 0feeb6f6d2
which fixed QTBUG-58036. It reparented widget that used to be skiped.
In particular, floating widgets are skiped. But seting the parent of a
floating widget docks it. And so as a result it would not be skiped anymore.
This has two side effect: This breaks the animation (as the widget is
docked too early; and cause crash when QDockWidgetGroupWindow get
reparented as this breaks invariant that these are always floating.
So restore the skip from before commit 0feeb6f6d2,
and explicitly set the parent in all cases when the animation finishes.
Change-Id: I0e3e29ad22d6ffe4d62242d48a18dadb916fc14f
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
The perils of adding a default: case to a switch over an enum type:
the compiler no longer warns when the enum is extended.
Provide strings for QtCriticalMsg and QtInfoMsg, too.
[ChangeLog][QtWidgets][QErrorMessage] No longer displays critical
(QtCriticalMsg) and informational (QtInfoMsg) messages as if they were
debug (QtDebugMsg) ones.
Change-Id: Id6776081be736ad92423ec016988dcd92a963cc7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Regression after 89842b97d7, where the retain was part of setView.
We release m_view in the destructor, regardless of how the view was
acquired, and the non-foreign window retains by being the one creating
the view.
Task-number: QTBUG-59001
Change-Id: I6d9621a63ea6ec2cee008986b0ab72ff61110ad7
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Port the last two remaining Q_FOREACH users in QtGui
to C++11 range-for and mark the library as Q_FOREACH
-free, using QT_NO_FOREACH.
Change-Id: Ie6c5eea0af4227af6ef3dc0b4da2cf62e09d8b52
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The screen may change the dpi so the font dpi is also changed.
We must tell QWidget that the font has changed by sending the
FontChanged event to all sub widgets so they can update their
geometry.
Task-number: QTBUG-48242
Change-Id: Ibcdcc0c96429b8cd16311928298294f47a23e816
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Some format and parse tests for time and date-time depended on locale
but had test data for the C locale (so fail if the test-environment
has, e.g., LANG=de_DE@utf8). So impose the C locale (until Qt 6).
The date-time test did *some* attempts at fixing for locale, but
failed to handle am/pm; and we do have "### Qt 6" comments in
Q(Date|Time)+::fromString indicating that we intend to switch these
methods to use the C locale by default (which shall fix this once and
for all). So rip out the incomplete localization now and test we work
properly at least when the locale used *is* C. Add a comment to the
matching QDate test to rip out its (presently adequate) matching code
once we do get to Qt 6 and make fromString() use the C locale.
QDateTimeParser uses systemLocale(), which is initialized the first
time it gets accessed; so we need to frob the locale *early*; doing so
in the test-class constructor is about as early as we conveniently
can; and seems to work (while doing it in individual tests does not).
(There is no point rolling back at the end; the QSystemLocale global
has been set up by then, so the roll-back would merely leave the
global out of sync with setlocale() and the environment.)
Task-number: QTBUG-58728
Change-Id: Ifa6778a80276050a099387a6dab15a1096be7561
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The "accessibility" feature was defined globally for qtbase, but also
in src/gui. The definitions could end up with different values.
Change-Id: I1a932c3c04a5fc26b9f67eb4f5ff02e524f380e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The 'rules' vector is made up of all the individual {env,config,...}Rules
vectors under mutex protection whenever init() is called (only from the
QCoreApplication ctor) or, at any time, by a call to QLoggingCategory::
setFilterRules().
Yet, the writes to the individual *Rules vectors were never protected by
registryMutex, racing against the reads of the same vectors in the
updateRules() function.
Fix by protecting all access of all member variables with registryMutex.
Add some strategic comments to make analysis easier for the next guy.
Change-Id: If68d15a553ec7038693574a34f10a39f4cd480e8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>