QString::fromLatin1 always allocates memory, but there are
cases where we can avoid/reduce allocations or/and reduce
text size, e.g.:
QStringBuilder expressions
Fix: replace QString::fromLatin1 with QL1S
QString::fromLatin1().arg(String) pattern
Fix: replace with QStringBuilder
Overloaded functions with QL1S arg
Fix: replace QString::fromLatin1 with QL1S
In rare cases if there is no overloaded function
with QL1S and we have deal with string literal,
replace QString::fromLatin1 with QStringLiteral.
Change-Id: Iabe1a3cc0830f40ef78a0548afa4368583c31def
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
... to the new qmake based configuration system.
This removes the old qfeatures.txt (distributed over configure.json
files) and qfeatures.h (distributed over qconfig-<module>.h files).
qfeatures.prf is gone without replacement, as attempts to use it would
lead to followup errors anyway.
Change-Id: I1598de19db937082283a905b9592d3849d2199d0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
"description" suggests something slightly longer.
this may seem like a gratuitous change, but the upcoming replacement of
the old feature system clarifies makes it seem much less so.
Change-Id: Ibe702e01cb146b59127bf1f990b4acaef1c61d55
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Move the different parts of configure.json/.pri into the libraries where
they belong.
Gui is not yet fully modularized, and contains many things related to
the different QPA plugins.
Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Change-Id: I6659bb29354ed1f36b95b8c69e7fce58f642053f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
dc3e7e45eb introduced locales from a
packaging perspective, providing the information available from the
package manifest. However, developers are rather interested in the
available and preferred system languages to update user interfaces.
Task-number: QTBUG-55672
Change-Id: I740d4f9c9ca21a8cbd437d3b232470897c569d34
Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Add an rvalue overload of the QForeachContainer ctor to allow moving
rvalues into the internal container copy.
This does not change the semantics of Q_FOREACH. It is just an
optimization.
Port to NSDMI to minimize code duplication.
Costs ~1.3KiB across all libraries and plugins in a QtBase Linux
build (optimized GCC 6.1 AMD64).
Change-Id: I180e35ecab68aa1d37773b3546787481bb5515a2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The rest of Qt, including the QString constructor, uses UTF-8 to
interpret narrow character literals. The fact that QTextStream uses
Latin 1 should be considered a defect.
We can't fix this in Qt 5, so log it for consideration in Qt 6.
Change-Id: I9e96ecd4f6aa4ff0ae08fffd14710fa61673db57
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Earlier versions of the compiler cannot default
move special member functions, even though we
also define Q_COMPILER_RVALUE_REFS for them.
Fix by retracting the less-often-used of the
two compiler feature defines.
Q_COMPILER_DEFAULT_MEMBERS is not used outside
QtBase in neither 5.6 nor 5.7 (5.8 is not
released at this time, so wasn't considered).
The same is true of the dependent macros
Q_COMPILER_DEFAULT_DELETE_MEMBERS and
Q_DECL_EQ_DEFAULT.
In QtBase, the three uses are:
1. in QAtomic*, where the user also requires
Q_COMPILER_CONSTEXPR, which is not defined
for any MSVC at this time,
2. for QEnableSharedFromThis, which is a class
template with an alternative {} implementa-
tion of the default constructor, and uncon-
ditional user-defined copy special member
functions.
3. The test of the corresponding functionality
in tst_compiler, which this commit amends.
That means that neither of these two only uses
of the macro in Qt libraries are affected by
the change.
The reason we do this change, then, is that in
the future, we want to be able to more easily
restore move special member functions for
classes for which they are suppressed due to
user-defined dtors or copy special member
functions.
Change-Id: I6f88cad66d6b87a758231f16355c3bddae697b86
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
According to https://msdn.microsoft.com/en-us/library/5dae5d43.aspx,
strncpy_s' second argument must not be 0:
> If strDest or strSource is NULL, *or numberOfElements is 0*, the
> invalid parameter handler is invoked.
Move the existing check for len > 0 up to protect the strncpy_s
call, too.
Change-Id: I70d339ea60d4b76f3038b2e4e4756f6590a9bd31
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The sleep time increases exponentially, but we never checked whether the
time to sleep was less than the remaining time. For example, if timeout
was 4000 ms on entry, we'd progressively sleep 100 ms, 200, 400, 800,
1600 ms. At this point, the accummulated sleep time would be 3100 ms and
the next sleep should be no more than 900 ms.
Prior to this change, the tryLock() would then proceed to sleep 3200 ms,
for a total wait time of 6300 ms, or 57.5% above the timeout provided by
the user.
Change-Id: Ifc295639c8cf4ddcaa69fffd146f7586a7ee95e4
Reviewed-by: David Faure <david.faure@kdab.com>
The constructor that sets it is inline already, so there's no point in
hiding this.
Change-Id: I66707fdfe8eb460a9c72fffd146d8dbc35b13056
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
CFURLCreateDataAndPropertiesFromResource and
CFURLWriteDataAndPropertiestoResource have been
deprecated since 10.9. We replace them with simple
QFile access.
Code cleaning and included.
Change-Id: I19c7ceac41c8c511962f1128bd8e210e3adb434c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
cf53aa21bf and 3aaa5d6b32
were reverted because of reconstruction in 5.7.
defineTest(qtConfTest_checkCompiler) in configure.pri is smart
enough to cover the case in a9474d1260.
DirectWrite: Fix advances being scaled to 0
Since 131eee5cd, the stretch of a font can be 0, meaning
"whatever the font provides". In combination with ec7fee96,
this would cause advances in the DirectWrite engine to be scaled to
0, causing the QRawFont test to fail.
Conflicts:
configure
mkspecs/features/uikit/device_destinations.sh
mkspecs/features/uikit/xcodebuild.mk
src/corelib/global/qglobal.cpp
src/corelib/global/qnamespace.qdoc
src/plugins/platforms/cocoa/qcocoamenuitem.h
src/plugins/platforms/windows/qwindowsservices.cpp
src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp
src/widgets/kernel/qapplication.cpp
tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp
tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp
Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
This reverts commit 53f0b43a4b.
{QAbstractAnimation::}{updateCurrentValue()} had been modified to
{QVariantAnimation::}{updateCurrentValue()} in a previous patch.
Change-Id: Ibaccf51de816966f16b8f3109e0c20626d5102a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As noted by Mat Sutcliffe <oktal3700@gmail.com>, there were
no relational operators for Latin1String/QLatin1String and
String/QLatin1String mixed comparisons, leading to implicit
conversions from QL1S to QString in Entry::op==(QL1S).
This patch fixes half of the issue, by providing the operators
for Latin1String/QLatin1String. In doing so, it cleans up their
definition (non-members, non-friends, delegating to existing
QL1S operators where possible, passing both {Q,}Latin1String by
value, as they're both Trivially Copyable and small).
A follow-up patch will deal with String/QLatin1String
comparisons. It will be not quite as straight-forward as
this patch, since we don't, yet, have QStringView, the
UTF-16 equivalent of QL1S, available.
Amends a5159cc50a.
Change-Id: I596358eb3ccf847b7680f171f9992f3fad80132c
Reviewed-by: Mat Sutcliffe <oktal3700@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The endptr from reading the exponent of a 'g' form snprintf result
should not be past the end of the string we're reading from. It has
nothing to do with the 'e' sign.
Task-number: QTBUG-54482
Change-Id: I8bdee917b8d21fdc94c255548ad7e008431a07fa
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Calling QMutableListIterator::remove() in a loop constitutes quadratic
behavior (O(N) function called O(N) times).
Fix by splitting the loop, simplifying it by sharing conditions, and
using std::remove_if(), which is linear.
Removes one more use of mutable Java iterators.
Change-Id: I88bde414777b50996e546bc8cb238619ea4fb645
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
This makes it possible for the application to control which language
is used by QMimeType::comment()
[ChangeLog][QtCore][QMimeType] QMimeType::comment() now uses the default locale
rather than system locale, so that applications can control which language
is being used.
Task-number: QTBUG-50776
Change-Id: I82623b7c488035a4164fadaf37ebcc79a9fd6173
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since Qt 5.6.0, some applications such as Kate (built with clang, libc++
and libcxxrt) on FreeBSD occasionally crash with the following error
message on exit:
QMutex::lock(): sem_wait failure: Invalid argument
[or pthread_cond_wait in the 5.6 branch]
Investigation by Gleb Popov, Thiago Macieira and Olivier Goffart has
shown that this is caused by the fact that QDBusConnectionManager is a
Q_GLOBAL_STATIC (so it will be destroyed with all the other
Q_GLOBAL_STATICs in the reverse order of construction). In the
Q_COMPILER_THREADSAFE_STATICS case, freelist() also returns a
function-level static that is constructed on first use, so it may be
destroyed earlier than the QDBusConnectionManager object, making it
impossible to lock a contended mutex.
We now make freelist() return a global static, so that it is always
destroyed after QDBusConnectionManager and other function-static
variables.
Change-Id: I210fa7c18dbdf2345863da49141b9a85cffdef52
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This fixes a problem that occurs when a task, that is run synchronously,
throws an exception. If that happened, then the exception would not be
re-thrown, because of an early return.
Task-number: QTBUG-54831
Change-Id: Ic70c5b810ec6adce6e62bfd6832ba9f170b13a7f
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
The text direction should *not* be set by the default script, but by the
UI direction.
For example, if the default script is Hebrew, but the UI is in English,
it doesn't make sense to default all the controls to RTL. This should be
done only if the UI is RTL.
This reverts commit a90869861c.
Task-number: QTBUG-53110
Change-Id: I5a6951ac30f24eec86bc0ae2a9fcfe14eb3a8e28
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The platform is not supported since Qt 5.7
Task-number: QTBUG-55331
Change-Id: I98b90d574d9a76c4281852d93818620b5f489117
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
It's not possible to build Qt with gcc 4.7 since
aca0e367be because of the bug
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53473 that doesn't
allow to specialize static members declared both as constexpr
and noexcept. That commit was made after 5.7.0 and it introduced
QAtomicTraits::isLockFree() with these specifiers.
Remove the noexcept specifier to fix building.
Change-Id: Ifc2462c90de1180f1e015fdc0646f246d33e68b0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The platform is not supported since Qt 5.7.
- Removed Windows CE-specific \notes in SQL drivers' documentation
- Marked a couple of Windows CE-specific enum values using
\omitvalue
Task-number: QTBUG-55331
Change-Id: I35b44f9d31fde6f10013c043260db1b852c171e2
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
An implicit conversion from const char* would be quite unfortunate.
Luckily, the code compiles as-is.
Change-Id: I445f983a27cc25bfaf4285c1a6c5811bd5d201b3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Replaces our mix of comments for annotating intended absence of break
in switches with the C++17 attribute [[fallthrough]], or its earlier
a clang extension counterpart.
Change-Id: I4b2d0b9b5e4425819c7f1bf01608093c536b6d14
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Q_NAMESPACE is useful to add Q_ENUM_NS/Q_ENUMS, Q_FLAG_NS/Q_FLAGS and
Q_CLASSINFO to a namespace.
[ChangeLog] Added Q_NAMESPACE which can be used to add Q_ENUM_NS/
Q_ENUMS, Q_FLAG_NS/Q_FLAGS and Q_CLASSINFO to a namespace
Task-number: QTBUG-54981
Change-Id: Ic61b972794063e77134681fb347d6c4acddcdb44
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This replaces the QT_NO_STATEMACHINE_EVENTFILTER define, and
gives it a proper name.
Change-Id: I2b9386458224ff2bd30003daac548daa61961085
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Instead define a proper feature for it and use qtConfig().
Change-Id: I64b1d26b2419a24d3239e9935341b7d535990dfb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The configuration system already takes care of setting QT_NO_ICONV.
Also move the platform conditions for using iconv from the pri file
to the .json.
Change-Id: I91b08bcee6799deddabcbb4a91d0a3f9ed7f0f28
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Use the new qtConfig macro in all pro/pri files.
This required adding some feature entries, and adding
{private,public}Feature to every referenced already existing entry.
Change-Id: I164214dad1154df6ad84e86d99ed14994ef97cf4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Added a qtConfig(feature) function to qmake, and a QT_CONFIG(feature)
macro. These can safely check whether a certain compile time feature of
Qt is enabled or not.
For this to work the feature has to have a publicFeature or
privateFeature output in the configure.json file.
In pro files, please use the qtConfig(feature) test function
instead of checking contains(QT_CONFIG, feature), as the latter
will be unreliable with the upcoming modularization (it requires a
load(qt_module_config) before doing any such checks). Note that
feature names are now lowercase, and identical (except for hyphens
versus underscores currently) in the pro and c++ files.
This makes the logic easier to follow, as we avoid all double negations,
and most importantly, QT_CONFIG and qtConfig are implemented in a
way that you'll get a build error for a mistyped or non-existent
feature. This will also prevent accidental use of a widget feature
in gui in the future.
This gives us complete symmetry between the handling in pro and
c++ files.
Change-Id: I60404f97953724e639ffb6386cce2e8b1e4b735a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Output the version as a define into the private config header as
a define using a hex number. Like that we can easily do version checks
on libraries using the QT_LIBRARY_VERSION(lib) and QT_VERSION_CHECK()
macros.
Change-Id: I6dc4ac6550886ca95c5542b6e75cd933ed079d76
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
instead, the only relevant defines from qconfig.h (QT_VERSION*) are
passed on the command line, like we already did for qmake and
configure.exe.
this enables us to remove the early forwarding header generation from
qtbase.pro, and rely wholly on the regular mechanism from syncqt +
qt_module_headers.prf.
another advantage is that we can be sure that the bootstrapped namespace
is not polluted by the target feature configuration.
Change-Id: If29285cfc697ae56b591e2ff1a2114686d18fb30
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
this switches all instances of LIBS[_PRIVATE] += -lfoo where a config
tests exists for foo.
this removes some code duplication between tests and project files (in
case of conditionals), and ensures that the projects always actually use
the libraries configure has found.
Change-Id: Ia7e80c8db5f329290c7f1a4e03a8bf78882a687e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
this migrates the cases where the build system already made (some) use
of variables (possibly) set by configure.
Change-Id: I43a08caed481d5f887a3a40821e71a4797760e7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Replace substring functions that return QString
with corresponding functions that return QStringRef.
Change-Id: I3c485f89352a1ee66076fba74fd486da9349c354
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Use Q_NULLPTR in all public headers
Task-number: QTBUG-45291
Change-Id: Ib294deb3c210a9a186448cbf9656af7a09fea2c1
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Fix the occurrences where the wrong classes are mentioned.
Change-Id: Ia291af77f0f454a39cab93e7376a110c19a07771
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: I5a6937545561c51add0d48a618b1921cf9201c4b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
They were masked by the pointless user-defined copy special member
functions, which we cannot remove because it would change the way
the iterators are passed by value into functions, on some platforms.
Add a reminder for Qt 6 to fix the issue for good.
Change-Id: I039093894db4a4e5e4bbf94fb346fd90311316c0
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix warning:
QtCore: WARNING: qtbase/src/corelib/kernel/qdeadlinetimer_p.h does not have the "We mean it." warning
Amends change 12eacc3bab
Change-Id: Ibb8fd25cee0249380996ae271200055e131d359b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Explain in terms of CSIDL_ values and update the sample locations.
Task-number: QTBUG-55065
Change-Id: I15ddf32555d43cffae66d98c6ac12d62a98d5e6d
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Due to how invalid model indices are handled in Qt, child() is unsuitable
for general purpose usage. In particular you can never get a top level
item in the model because the root model index by definition hasn't got
a pointer to the model it belongs.
That makes child() useless for anything but tree models (and even there
you'd need to special case your code anyhow).
[ChangeLog][QtCore][QModelIndex] QModelIndex::child has
been deprecated due to its lack of generality.
Use model->index(row, column, index) instead.
[ChangeLog][QtCore][QPersistentModelIndex] QPersistentModelIndex::child has
been deprecated due to its lack of generality.
Use model->index(row, column, index) instead.
Change-Id: Ice73c17133aaf71355fa2af1eacfe64da01bd456
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: David Faure <david.faure@kdab.com>
We require Q_COMPILER_VARIADIC_TEMPLATES since Qt 5.7,
so remove the non-variadic version which anyway has
zero test coverage.
Change-Id: I24dd22a798e11d797238f9209312802d1d84a672
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
We require Q_COMPILER_RVALUE_REFS (implicitly used, but not explicitly
checked for) and Q_COMPILER_VARIADIC_TEMPLATES since Qt 5.7, so remove
the non-variadic version which anyway has zero test coverage.
Change-Id: Ie3658ff6ae71a66df9d35100c3d6df41f2326c80
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
We require Q_COMPILER_RVALUE_REFS and _VARIADIC_TEMPLATES since Qt 5.7,
so remove the non-variadic version which anyway has zero test coverage.
Also drop #include <utility>, as that is included from qglobal.h already,
and drop QSKIP from test.
Change-Id: I1fc7f7068eac80ad6fd85e1d8f6d33c5c7bb67db
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It's like QElapsedTimer, but marks a time in the future instead.
[ChangeLog][QtCore] Added QDeadlineTimer, a counterpart to
QElapsedTimer, used to mark a time point in the future (a deadline) and
determine whether such a deadline has passed.
Change-Id: Ifea6e497f11a461db432ffff144921f7fbc1d1d3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QStandardPaths::LocateOptions was declared with Q_DECLARE_FLAGS(),
but missing Q_DECLARE_OPERATORS_FOR_FLAGS().
Change-Id: Id4ab1b1c86cdc9e79fb324d9b9d4d8deb659f718
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This allows QML StandardPaths to use the same enums without having to
duplicate them.
Change-Id: Ibfc63a97a8ba31e5c4dc11e3e8fee9d753087c54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The compiler-generated ones are just fine.
This is BC because the class is not exported and
QFutureInterfaceBase (needlessly) contains virtual
functions (the dtor), so this class will never be
trivially copyable. It's also not movable, until I
figure out how to add move special member functions
to QFutureInterfaceBase.
Also made the QFutureInterface(State) constructor
explicit, because a State is not a faithful
representation of a QFutureInterface.
Change-Id: Ifa44f87b41c4ee3c5167c282512ec4860075671d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As of version 10.12 (Sierra), the name of Apple's desktop operating
system will be macOS. Change the occurrences where the Mac platform
is discussed to use a macro \macos, which expands to 'macOS'. This
helps with adapting to future renaming.
Update the instructions on mac-specific Q_OS_* macro usage.
Add a \target for the old 'Qt for OS X' topic to keep links working
for other documentation modules that try to link with the old name.
Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
In QStringListModel, the display and the edit roles are synonyms,
so when one is changed, the other changes with it. However, in
setData() we only emitted a vector with just the role that was
passed in by the user.
Fix by always passing both roles, regardless of which one was used
to set the data.
Change-Id: I498e7cb33796fae266901817b01ad85d861d4bb4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This gives a chance for some cleanups at least.
Change-Id: I3a628e32c6fc8c7fa00943769210c517005f2a0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also document the current license the modules are available from,
since this is not consistent anymore across Qt.
Task-number: QTBUG-55139
Change-Id: I117fdb0cda7bd7ff92aa825e29c28f22a8a2f96d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
(Move QT_FORWARD_DECLARE_CG to qglobal.h)
This function converts to CGImage for supported formats. This
is done by creating a CGImageRef that reuses the QImage data.
The CGImage and QImage ref counting systems are bridged, implemented
by using CGDataProvider that holds a copy of the QImage.
Unlike the previous internal implementation this public version
does not implicitly convert unsupported formats to ARGB32_Premultiplied.
See included documentation for the complete description.
Change-Id: Ie3984a7a8331e02a6f1c42943caaf76854e93538
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
I am not convinced toUpper/toLower is a generally sound solution here;
however, QLocale doesn't make the upper/lower case distinction this
parser does and a bug report shows tr() isn't doing an adequate job.
Task-number: QTBUG-47815
Change-Id: Iaf654d1d76d4c38d74fc647e168d50debb924a8f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
ICC supplies a math.h header that defines things like:
#define isnan( __x__ ) __IMFC99MACRO1ARG_ALL( __x__, isnan, __, f, __, , __, l)
So use the already-existing workaround for it.
Since Qt 5.7 requires C++11, we can remove the check for that.
Change-Id: I149e0540c00745fe8119fffd1463cc5caf341337
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Neither clang-cl nor the Intel compiler are able to parse the MSVC code
in a constexpr environment. For Clang, we can just use the __builtin
functions, which it does make available on Windows. For the Intel
compiler, there's no alternative, so we just don't use the _BitScanXxx
functions. It will produce slower code, though.
qalgorithms.h(587,19) : error: variables defined in a constexpr function must be initialized
qalgorithms.h(635,12) : note: non-constexpr function '__popcnt' cannot be used in a constant expression
etc.
Change-Id: I149e0540c00745fe8119fffd14627ded43807000
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since STL support is mandatory in Qt 5, the sentence is a tautology
and can be removed.
Change-Id: I8676368cc917aa00a85b1113ed2a47694427b2ce
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Commit 4a40c717f3 optimized
QString::compare_helper(QChar*, int, char*, int), but got
the case wrong where the rhs is null, but the lhs is empty,
not null (which is the case even with a null QString, as
QString().constData() != nullptr). The correct result in
this case is 0, since in Qt empty and null strings compare
equal.
Fix by checking the length of lhs, not its pointer.
Task-number: QTBUG-55154
Change-Id: I3ec2cd25d9bdca90cf3f5568a875b1e52c779979
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both were mapped to QVariant() before. Instead, use a null pointer
QVariant for a null JSON value.
[ChangeLog][QtCore][QJsonValue] QJsonValue(Null).toVariant() now returns
a QVariant of type QMetaType::Nullptr instead of an invalid QVariant.
Task-number: QTBUG-43077
Change-Id: Ife611f418583dbff542210bc8c5cd65201212a6e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We should create the files with 0666 and let the umask take care of adjusting
to the final permissions in the file system.
[ChangeLog][QtCore][QLockFile] Fixed permissions on lock files on Unix to
allow for adjustments via umask.
Change-Id: Iee6a6ac3920d0ffd4465f54ac6e955f7fe087173
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
8a33077 made QUrl::resolved() follow its documentation ("If relative
is not a relative URL, this function will return relative directly.",
where relative means scheme is empty).
However there is much code out there (e.g. qtdeclarative) which relies
on QUrl::fromLocalFile("fileName.txt") to be treated as relative, so
for now, we still allow this (in Qt 5.6.x). For Qt 5.8, this commit will
be reverted.
[ChangeLog][QtCore][QUrl] [EDITORIAL: replaces 8a33077] QUrl::resolved()
no longer treats a URL with a scheme as a relative URL if it matches
this URL's scheme. For now it still treats "file:name.txt" as relative
for compatibility, but be warned that in Qt 5.8 it will no longer
consider those to be relative. Both isRelative() and RFC 3986 say that
such URLs are not relative, so starting from Qt 5.8, resolved() will
return them as is.
Change-Id: Iff01e5b470319f6c46526086d765187e2259bdf5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Use QStringRef::isNull instead of QStringRef::string()
for validation. Non-NULL str.string() may yet leave us
with a useless str.unicode(), which is the actual problem here;
whereas !str.isNull() does really confirm that str.unicode()
is sensible.
Such test prevents situation like:
const QString a;
QString b;
b.append(a); // b.isNull() == true
b.append(QStringRef(&a)); // b.isNull() == false
Auto test updated: create QStringRef from QString directly, without
any condition.
Change-Id: I082cd58ef656d8a53e3c1223aca01feea82fffb9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Re-use methods of QStringRef.
Change-Id: I0f79ee6767653c694ac6a342263c046a5f5f3baa
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
... by using the recently-added QUtf8::convertToUnicode()
and a QVarLengthArray instead of QString::fromUtf8().
Like elsewhere in QString, use a QVarLengthArray<ushort>
instead of the more natural <QChar> to avoid instantiating
another QVLA.
Assume that length2 is usually set to a non-negative value.
Not because that's necessarily the frequent case, but
because a negative length2 leads to an expensive strlen,
that usually dwarfs the additional branch cost.
Check for data2 == nullptr early to avoid having to check
it later twice.
Change-Id: I04bda44ed857451efdf04c3283b5726480dd8c0d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The code depends on qApp to be visible in the scope
Change-Id: Ibeb54c90f5a65f441e9eb90b848952b955c71f0d
Reviewed-by: Jesus Fernandez <jesus.fernandez@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... so don't use emit on them.
Just confuses readers.
Change-Id: I24365fc533b5b35f8942d6014dbc68387aa23e22
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This simplifies the retrieval of the correct Context object.
Task-number: QTBUG-55102
Change-Id: I303bc5393a7900ceb4bde36e711938f3f49075c1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
As it were, QStringLists were not handled explicitly when comparing
QVariants. If both QStringLists contained only a single entry, they
were treated as QStrings - if both QStringLists were empty, there were
equal (correctly so) - but if one of the QStringLists had more than
one entry, the compare function fell through to returning always 1.
As discussed here: https://stackoverflow.com/a/38492467/3444217
Added rich comparison tests for all non-numerical, non-recursive
QVariants that support them (except QModelIndex and
QPersistentModelIndex)
Task-number: QTBUG-54893
Change-Id: Icc5480d9ba056ee5efe83da566c5829caa1509d7
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
One of the good features of the new connection style is that
implicit conversion is performed for the connection arguments.
However, this is also a bad feature when it comes to the old
C remnants in the C++ language: for instance, doubles implicitly
convert to ints, possibly losing precision (and GCC/Clang do not
even warn about those under -Wall, only MSVC does) or even
triggering undefined behavior.
For this reason, when using braced initialization, C++11
disables narrowing conversions or floating/integral conversions.
Use this feature when checking the arguments of a PMF-style
signal/slot connection. Technically this makes the program
ill-formed, however GCC still accepts it (but at least
warns under -Wall).
Hence, add a way to disable these implicit conversions.
This is a opt-in and guarded by a macro, as it's a source
incompatible change.
[ChangeLog][QtCore][QObject] The
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT macro has been added.
When using the new connection syntax (PMF-based) this macro
makes it illegal to narrow the arguments carried by the signal,
and/or to perform floating point to integral implicit
conversions on them. When the macro is defined,
depending on your compiler a QObject::connect() statement
triggering such conversions will now fail to compile.
Change-Id: Ie17eb3e66ce0cd780138e60d8bb7da815a4ada83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Various transition functions checked on m_tranTimes.size() > 0 inside
a block which was conditioned on this already; simplify the code by
knowing this is true already. Tidied up an initializer at the same
time.
Change-Id: I3e933a69e1b71b94bfd4451e4d761844da669d33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Conflicts:
configure
5.7 now supports clang on android; but dev re-worked configure
src/gui/kernel/qevent.h
One side renamed a parameter of a constructor; the other added an
alternate constructor on the next line. Applied the rename to both
for consistency.
tests/auto/tools/moc/tst_moc.cpp
Each side added a new test at the end.
.qmake.conf
Ignored 5.7's change to MODULE_VERSION.
configure.json
No conflict noticed by git; but changes in 5.7 were needed for the
re-worked configure to accommodate 5.7's stricter handling of C++11.
Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
We can't forward a VerticalSortHint or HorizontalSortHint hint, because we might
be filtering extra items.
The documentation of QAbstractItemModel::LayoutChangeHint states:
Note that VerticalSortHint and HorizontalSortHint carry the meaning that
items are being moved within the same parent, not moved to a different
parent in the model, and not filtered out or in.
And some of the views rely on this assumption (QQmlDelegateModel for example)
What happens in the test is the following:
- 'model' emit the dataChanged signal when its data is changed.
- 'proxi1' QSortFilterProxyModelPrivate::_q_sourceDataChanged does not forward
the dataChanged signal imediatly, it will instead first re-sort the model and
call layoutAboutToBeChanged / layouChanged with the VerticalSortHint
- 'proxy2' would forward the layoutAboutToBeChanged with the hint, but in
QSortFilterProxyModelPrivate::_q_sourceLayoutChanged, it will redo the mapping
which will cause the changed data to be filtered.
So proxy2 can't forward the VerticalSortHint as it removed rows in the process.
Change-Id: I20b6983e9d18bf7509fe6144c74f37d24e4a18c2
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
This makes the API more consistent with the STL, which helps discovering
the API. Much like QVector has push_back etc.
Change-Id: I75f6b77ab94233c15e17f66605f4bf13aa03e61c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the option expects a value the valueName parameter of the
constructor isn't optional; it must be set. This requirement is made
explicit in the documentation.
Task-number: QTBUG-54855
Change-Id: I190884aff2fa8e96bc5c5e82cdfed85be761d6e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
They look relative because the path doesn't start with a '/' but they
have a scheme so they shouldn't be combined as if it was one absolute
and one relative URL.
[ChangeLog][QtCore][QUrl] QUrl::resolved() no longer treats a URL with
a scheme as a relative URL if it matches this URL's scheme. This special
casing was incompatible with RFC 3986 and broke resolving data: URLs,
for instance.
Change-Id: I3758d3a2141cea7c6d13514243eb8dee5d510dd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There was a race condition between QObject::disconnect() and
QMetaObject::activate() which can occur if there are multiple
BlockingQueued connections to one signal from different threads and
they connect/disconnect their connections often.
What can happen in this case is:
T1 is in activate() method and T2 is in disconnect() method
T1 T2
locks sender mutex
selects next connection
unlocks sender mutex
locks sender mutex
sets isSlotObject to false
creates QMetaCallEvent derefs connection
posts event
Two things can happen here:
1. Connection can still be valid, but it will have isSlotObject==false
and callFunction will be used instead of slotObj
2. Connection can already be invalid
To fix it mutex unlock should be moved after QMetaCallEvent creation.
Also there is another case, when we don't disconnect but delete the
receiver object. In this case it can already be invalid during
postEvent, so we need to move mutex unlock after postEvent.
Change-Id: I8103798324140ee11de5b4e10906562ba878ff8b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Same reasoning as commit 3092bd5 (which was for Clang), but for gcc >= 5.1.
Change-Id: I123b17670c1a64876b01fd39fb11648fa4e8b1fd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It crashed when d was equal to Data::unsharableEmpty().
Task-number: QTBUG-51758
Change-Id: If9f2a7d11892507135f4dc0aeef909f59b7478fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
Much like the QObject::setParent() warning, which helps a bit when debugging.
Change-Id: I2abf277a12aa1ce04bd8b5759f46f8bfdcb25383
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Conflicts:
src/corelib/io/qtemporarydir.cpp
One side encapsulated a repeated piece of #if-ery in a local define;
the other added to the #if-ery. Made its addition to the other's.
src/corelib/kernel/qeventdispatcher_unix_p.h
One side moved some members into a struct; this collided with a #undef
check that neither side now has. Discarded the #undef part.
src/gui/opengl/qopengltexturehelper_p.h
5.7 deleted a bunch of methods; not clear why merge got confused.
src/tools/moc/moc.cpp
One added a name to the copyright header; another changed its URL.
Change-Id: I9e9032b819f030d67f1915445acf2793e98713fa
[ChangeLog][QtCore][Important behavior changes] qFatal will now
use std::abort to terminate the application on all operating
systems. Previously, ::abort() or ::exit(1) were called, depending
on the operating system.
Change-Id: I43da912cce1db3c2229568da25000ea80060eed9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Now QBasicMutex is Lockable and QMutex is TimedLockable, which means they can
be used in std::lock_guard, std::unique_lock, std::lock, etc.
[ChangeLog][QtCore][QMutex] QMutex now fully models the TimedLockable
concept by providing the try_lock, try_lock_for and try_lock_until
functions, therefore making it usable in Standard Library lock
management classes and functions.
Change-Id: I7c691481a5781a696701e1ab78186b5cefbd6a87
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Known ICC bug, still present in version 17 beta.
qdatetime.h(126): error #3280: declaration hides member "QDate::jd" (declared at line 136)
Obviously a parameter to static function or to a function in a nested
class can't shadow an NSDM.
Intel issue IDs: 0000698329 / DPD200245740
Change-Id: I149e0540c00745fe8119fffd1463c679a3a9c8c3
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
As a special case, setting the value of chunk size to zero forces
QRingBuffer to produce a separate QByteArray on each call which
appends the data. So, this enables a packet mode where portions of
data are stored independently from each other.
Change-Id: I2d0b331211901a289da7d4533e974f06830b5590
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
The number of bytes to write was converted to a 32bit unsigned value,
causing losses. Change the type to qint64 and adapt the code determining
the block size.
Task-number: QTBUG-54870
Change-Id: I294da5bfe97c7e60f67228399e1244a1aba4c89c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Since Android 5.0 Google introduce a nasty bug[1] which calls
JNI_OnLoad more than once.
Basically every time when a library is loaded JNI_OnLoad is
called if found, but it calls *again* JNI_OnLoad of its .so
dependencies! So, JNI_OnLoad of libQt5Core.so gets called may times,
this is not a problem as long as it's called from Qt's java delegate
class loader. The problem is that the application .so file *must* be
called from default class loader to allow the user to find his custom
Activity/Service stuff.
[1] Workaround https://code.google.com/p/android/issues/detail?id=215069
Change-Id: Ia71209658ef56056b560018597608acf7cb0f9ea
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Instead of reporting the file times in the precision of seconds, our API allows
us to report it up to millisecond precision.
Change-Id: I8bcc6a1fb4116e8c5421d650a68f6fb00482e551
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For platforms not providing mkdtemp(), QTemporaryDir relied on an implementation
of q_mkdtemp() operating on char *, converting back and forth using
QFile::encodeName()/decodeName() when passing the name to QFileSystemEngine.
This caused failures on Windows (which uses "System"/Latin1 encoding)
for names containing characters outside the Latin1 space.
Reimplement q_mkdtemp() to operate on QString, which avoids the conversions
altogether and also enables the use of larger character spaces for the
pattern.
Add tests.
Task-number: QTBUG-54810
Change-Id: Ie4323ad73b5beb8a1b8ab81425f73d03c626d58a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Should be reverted when https://github.com/android-ndk/ndk/issues/34 is fixed
Change-Id: Ic7fe394412afc25082a9689da59d36cba8b3dade
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@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>
The header says they'll stop doing that in the next release. It's been
like that since at least the OS X 10.8 SDK...
Change-Id: Ib57b52598e2f452985e9fffd14585d4838dc8b09
Reviewed-by: Richard J. Moore <rich@kde.org>
C preprocessors augment their standard list of include paths from the
environment: Unix preprocessors use $C_INCLUDE_PATH (for C) and
$CPLUS_INCLUDE_PATH (for C++), plus CPATH for both, whereas MSVC uses
the an environment variable simply called "INCLUDE". Handling this for
MSVC is particularly important because the VCVARSALL.BAT script sets the
necessary #include paths in the environment for important things.
Without that being parsed, moc won't find some #defines, like
WINAPI_DESKTOP_FAMILY.
[ChangeLog][moc] qmake and moc now cooperate to use the Visual Studio
environment variables (set by the VCVARSALL.BAT script) to find system
include files. A possible consequence is that moc parses application
headers slightly differently, depending on #if conditions that depended
on macros that previous versions had not seen #define'd. Implementers of
other buildsystems are advised to pass the --compiler-flavor=msvc option
to moc.
Change-Id: I7e06274214d1939b0124e5b4bf169cceaef9ca46
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
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>
There is now a DARWIN version for all four Apple platforms at once,
a MACOS_IOS version for macOS and iOS (since many of the checks we need
are prior to tvOS or watchOS's existence), and MAC and OSX have been
relegated to synonyms for MACOS_IOS and MACOS, respectively.
Change-Id: I54f587e26c6b46bf4b469c5d3039086c65566651
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Conflicts:
qmake/library/qmakebuiltins.cpp
qmake/library/qmakeevaluator.cpp
qmake/library/qmakeevaluator.h
qmake/project.h
QMakeEvaluator:
* evaluateConditional(): one side changed return type, the other
changed a parameter type.
* split_value_list(): one side changed a parameter adjacent to where ...
* expandVariableReferences(): ... the other killed one overload and
changed the survivor
src/corelib/io/qlockfile_unix.cpp
One side changed a #if condition, the other moved NETBSD's part of
what it controlled.
src/corelib/tools/qdatetime.cpp
One side fixed a reachable Q_UNREACHABLE in toMSecsSinceEpoch(), the
other moved it from the private class to the public one, in the midst
of the "short date-time" optimization, which confused diff entirely.
One side changed a QStringLiteral to QLatin1String, the other rewrote
adjoining code.
src/network/kernel/qauthenticator.cpp
Both rewrote a line, equivalently; kept the dev version.
src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
One side changed #if-ery that the other removed.
tools/configure/configureapp.cpp
One side added a check to -target parsing; the other killed -target.
tests/auto/testlib/selftests/expected_cmptest.lightxml
tests/auto/testlib/selftests/expected_cmptest.teamcity
tests/auto/testlib/selftests/expected_cmptest.txt
tests/auto/testlib/selftests/expected_cmptest.xml
tests/auto/testlib/selftests/expected_cmptest.xunitxml
Regenerated using generate_expected_output.py
I note that quite a few other expected_* come out changed, now.
There was no git-conflict in
src/widgets/kernel/qformlayout.cpp
but it didn't compile; one side removed some unused methods; the other
found uses for one of them. Put FixedColumnMatrix<>::removeRow(int)
back for its new user.
Change-Id: I8cc2a71add48c0a848e13cfc47b5a7754e8ca584
Align ourselves to what std::thread does (and what's sensible to do anyhow,
since we even document that "Deleting a running QThread [...] will probably
result in a program crash").
[ChangeLog][QtCore][QThread] Destroying a QThread which is still running will
now result in immediate and abnormal program termination.
Change-Id: Ib481287915be01a1381df14abf6e0fb68c36b5b5
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Most fields were over-written after setting invalid. The two that
weren't (not used by QUtcTimeZonePrivate) should be (if only for
uniformity with other QTimeZonePrivate variants), so set them to
sensible values.
Change-Id: I824ca0108d5b6bc322f76a0d1683342f789523b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
The XML parser uses fastScanLiteralContent() to read a block of
text. The routine was not checking the range of valid characters as
defined in the XML standard:
https://www.w3.org/TR/2008/REC-xml-20081126/#NT-Char
A check has been added to stop reading the bad character.
Note that the characters are legal in XML 1.1, but QXmlStreamReader
is a well-formed XML 1.0 parser
[ChangeLog][QtCore][QXmlStreamReader]
Fixed a bug in the XML parser that prevented to load XML that
contained invalid characters for XML 1.0.
Change-Id: I10aaf84fbf95ccdaf9f6d683ea7c31925efff36d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.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
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>
The new modular configuration system requires one global
header per module, that is included by all other files in
this module.
That header will later on #include the configuration file
for Qt Widgets. For now it defines the Q_WIDGETS_EXPORT
macro for this library.
Change-Id: I6698989b952b9bac94d086d9f219e03c000f7d53
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The file lives in Qt Gui, but declares a few methods from
Qt Core and Widgets. All of those methods are actually mostly
unused, not documented and pretty trivial.
This patch removes the last few places the methods got used and
removes the declarations. The implementations should get removed
in a future release.
Change-Id: I2b609c29f403d2ed4824ff4346008be08b3fd067
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
The two versions of this function are now documented on the
global variables page.
Change-Id: Iee95e251d616f6c8b1b42458d23cbf64a70a5315
Task-number: QTBUG-50654
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
The hash function is carefully designed to give the same result
as the straight-forward implementation of qHash(unordered_map),
which we'll probably add at some point, namely: std::accumulate
over a container of std::pair.
This is one reason to use std:: and not QPair in the implemen-
tation of qHash(QHash). The other is that qHash(QPair) uses a
bad hash combiner, which may xor out the 'seed' from the result.
We can't fix that until Qt 6, but the qHash(std::pair) overload
uses the well-known boost::hash_combine algorithm (implemented
in Qt as QtPrivate::QHashCombine), so we can use that.
I also trust std::pair to work without problems with reference
template arguments, while QPair only very recently gained a very
basic auto-test for reference parameters.
[ChangeLog][QtCore] Added qHash() overloads for QHash, QMultiHash.
Change-Id: I90879d8a99cf1aadb6e84ecc0c3704f52f3691da
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>
These make the (future) usage in declarative even more convenient.
Change-Id: I12c0fec1ea843d8acd2ee3fdf2a2189939bebd95
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It absence is just an oversight. The patch also adds test for the valid
inputs of the method.
[ChangeLog][QtCore][QJsonDocument] fromVariant can now take a QVariantHash argument.
Task-number: QTBUG-39751
Change-Id: I7e051413f930023db3cbb81452e77c56a7ceffe8
Reviewed-by: Lars Knoll <lars.knoll@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>
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>
In all other forms of disconnecting this is done. We also know the
signal index, so there is no reason not to do this.
Change-Id: Ic8b042cd8f45dbff74b42ee30c384a84bef78b20
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.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>
The default ctor never initializes m_nstz but calls init with
[NSTimeZone systemTimeZone].name. Init (re)sets m_nstz _only_
if this ianaId is in [NSTimeZone knownTimeZoneName], which is not guaranteed
(a good example is "US/Pacific" that can be returned by systemTimeZoneId() -
the similar problem is described in [*]. Set m_nstz to nil in ctor,
so if 'init' fails we still have a valid (nil) pointer.
[*] http://stackoverflow.com/questions/19819268/convert-ios-localtimezone-to-a-knowntimezone.
Task-number: QTBUG-54330
Change-Id: I68917926350aad3158d44a06f06721f25b3fdb74
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The const qualification prevented toUpper() etc from
calling the rvalue overloads of the corresponding QString
functions. Since resolved() always returns a non-shared
object, the rvalue overloads can re-use the object's
capacity for storing their result, saving up to one memory
allocation per QStringBuilderCommon::to*() invocation.
Change-Id: Ica97fcd906cdd949ffe56055654578b93407e2d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use QStringBuilder and QString::asprintf more.
Use += operator to reserve extra capacity for
possible free following append/prepend/+= call.
Change-Id: Ia534bec28cb96b688a68a5051a855cda1eb5db4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Commit fb498a6519 introduced the short
datetime optimization, but it accidentally removed the optimization from
Qt 5.7 that made QDateTime's default constructor not allocate memory.
Instead of bringing back the Q_GLOBAL_STATIC that was used, let's use
the short date time optimization on 32-bit too.
The CanBeSmall constant remains false on 32-bit systems, but judicious
non-use of that constant in a few functions allows 32-bit systems to use
the optimization. We still say that any date/time value is "unsmall", as
there's no sense in calculating whether the date is between 1970-01-01
and July 14 of the same year.
Change-Id: I413d458307aa46469b80fffd145a9db0325c08cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
[ChangeLog][QtCore][QTimer] Added support for std::chrono duration
objects for QTimer methods, like QTimer::singleShot and
QTimer::setInterval.
Change-Id: I87e17314d8b24ae983b1fffd14536e24d5b12424
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Replace it with QL1S in QStringBuilder expressions
and in overloaded functions.
Replace patterns 'QString::number() + QStringLiteral'
and 'QStringLiteral + QString::number()' with
QString::asprintf.
Saves some text size.
Change-Id: Ib39b2332264dfc3df04e77f2c101b47a1030cef4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In case a background task wants to use Qt, winmain is not invoked.
Neither can we create the same objects like winmain do (as in creating a
application view). Instead runOnXamlThread uses the thread pool enabling
the event loop to run successfully.
Task-number: QTBUG-54396
Change-Id: Ia3ba23ed0fd6cd7d2ed8d43675e88073b9aec8b5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Make QProcess::startDetached() behave exactly like QProcess::start() when it
comes to the behavior of whether to create a new console window or not.
Before this patch, QProcess::startDetached() created a new console window
(CREATE_NEW_CONSOLE flag of CreateProcess()) unconditionally. Instead, use the
same rules for deducing whether to show an console window or not as
QProcess::start().
[ChangeLog][QtCore][Platform Specific Changes] QProcess::startDetached()
changed behavior on Windows: it no longer creates a new console window
unconditionally, instead it passes the same creation flags to CreateProcess
as QProcess::start().
Task-number: QTBUG-53833
Change-Id: I0e3d4b161fb5cb94cfbbd21fb4edb8417ab543fd
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Move those to the equivalent {to,set,from}SecsSinceEpoch(), except for
the cases that did QDateTime::currentDateTime{,Utc}().toTime_t. Those
are best implemented with QDateTime::currentSecsSinceEpoch().
Change-Id: Ib57b52598e2f452985e9fffd145a366c92cfda20
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Use the criterion that GNU coreutils' df uses: if the total size of the
filesystem is zero, then it's pseudo. After all, if it contains files in
a zero-sized volume, it has to be pseudo; if it contains nothing, then
it's not very useful anyway.
This would have caught most Linux pseudo-fs anyway, but the mount point
check beforehand allows us to skip quite a few statfs() syscalls.
The new algorithm also solves the following cases which had been
mistakenly interpreted:
* fuse and ZFS (source devices don't usually start with /)
* pseudo-fs that were mounted from a device starting with /
(the source device is usually ignored by the OS)
This change is not testable automatically. Manual testing shows it still
reports the same entries it used to on Linux, plus now shows FUSE
(sshfs) mounts.
Task-number: QTBUG-54235
Change-Id: Ib57b52598e2f452985e9fffd1459f06dcefcc5c6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This reverts commit dc0ae02ebc.
qdoc is a binary built inside the qttools repository, thus it should be added
to the respective ConfigExtras.cmake.in there instead.
Task-number: QTBUG-54446
Change-Id: I182e5889af164a89c68226a91abc4d9962a508ea
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The new modular configuration system requires one global
header per module, that is included by all other files in
this module.
That header will later on #include the configuration file
for Qt Network. For now it defines the Q_NETWORK_EXPORT
macro for this library.
Change-Id: I9c45d425baf881c431ed71fd457c7feb2c123855
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
The new modular configuration system requires one global
header per module, that is included by all other files in
this module.
A similar scheme and naming convention is already being used
for many other modules (e.g. printsupport, qml, quick).
That header will later on #include the configuration file
for Qt Gui. For now it defines the Q_GUI_EXPORT macro for
this library.
In addition, add a private global header, qtguiglobal_p.h,
that can later on include the private config header for
Qt Gui for things we don't want to export to the world.
Change-Id: Id9ce2a4f3d2962c3592c35e3d080574789195f24
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
1) In general it's unsafe to let exceptions propagate through Qt code,
so document that.
2) Add a note that overriding notify() makes sense only in Qt 5, in Qt 6
it's going away.
3) The advice applies also to applications not using QApplication, but
just QCoreApplication.
Change-Id: I4f6e74c53da757faf2eeaa9de226ceba55c52536
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
... and reject invalid ones. There was one error: we accepted schemes
starting with pluses, dashes and dots.
Change-Id: Ie585843cfb684bc3b6e3fffd145cfe12227ec4ad
Reviewed-by: David Faure <david.faure@kdab.com>
A Qt5 program writing a null QTime() using setVersion(QDataStream::Qt_3_3),
and then a Qt3 program reading that, would lead to a weird QTime,
with isNull=false, isValid=false, hour=1193, minute=2, second=47, ms=295.
This commit restores interoperability, by writing out the expected value
(0) for a null QTime rather than the -1 value used by Qt4 and Qt5.
Change-Id: Icde468a8f6fc9434ef7018296725819b44d672af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's really a kernel functionality, as it implements really low-level
functionality and it's used by the event dispatcher. It was in tools/
only because QTime is.
QDeadlineTimer is also coming to kernel/.
Change-Id: Ifea6e497f11a461db432ffff14491c6d9b839eb0
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
... instead of creating a QDateTime object.
Change-Id: Ib57b52598e2f452985e9fffd145a36911de4fa9a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Replace substring functions that return QString with
corresponding functions that return QStringRef where
it's possible.
Create QString from QStringRef only where necessary.
Change-Id: Id9ea11b16947220cd27787c0b529de62d10b6c26
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
As noted in comments, QSortFilterProxyModel and QStandardItemModel
duplicate code to compare QVariant; extract this into a separate method
they can share.
Since there is only one common suitable header for both files,
the method was placed in qabstractitemmodel.cpp
Change-Id: I82bb4a2d6084059b8a70a8d556c16f1a29f4f686
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Serialization of the Qt container classes is accomplished by breaking
up the data into primitive units. On the receiver side, these units
should be read atomically to guarantee integrity of the container.
Deserialization procedures for QHash and QMap were already implemented
in accordance with this strategy and have the following behavior:
- a previously latched error status is saved for the caller. This
overrides possible different errors in the current read. This
is consistent with the treatment of primitive types.
- if an error occurs during the deserialization, the container is
cleared.
To make the API consistent, this patch adjusts the behavior of QList,
QLinkedList, QVector, and QSet deserialization. On the implementation
side we accomplish this with a private StreamStateSaver RAII class that
consolidates the handling of the stream status for all containers.
[ChangeLog][Important Behavior Changes][QtCore][QDataStream] Incomplete
reads of Qt containers are now handled same way as for primitive types,
meaning that previous errors are latched.
Task-number: QTBUG-54022
Change-Id: I5c77257fe2a4637e8a7e6cf3cd43091c8469340e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Be explicit on how to check whether parsing succeeds.
Change-Id: I44f408cb6e5a830826b84dfb3a8af331f03e58cc
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
It could be reached when QT_BOOTSTRAPPED was defined.
Change-Id: I632d6f908a3bcbde81a6ebbadcaf2800dfe1449d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Seems the previous check was a leftover from debugging. Tests still pass
and loop checks properly now.
Change-Id: Ic12cd49881f6d146687e257794b3028f6c8e874c
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
to keep compatibility with and without
using QT_USE_QSTRINGBUILDER.
Change-Id: If8218fe0693cdb7ad1250beb272e0e7c356bbf4a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The rule was:
- if the header included qglobal.h, turn that into qglobal_p.h
- otherwise, insert the #include after the "We mean it" warning
qglobal_p.h currently only includes qglobal.h.
Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This also corrects for some code that was not included in the forward
merge from 5.6 (ea438b2508) due to code
restructuring.
Change-Id: I90a20fbcb60cfd6deb1cca3716a62754af27901f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The compiler didn't complain that they were unused or -Werror / -WX was
not active.
Change-Id: Ib57b52598e2f452985e9fffd145a7b63a32189fd
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
These new functions use a 64-bit integer in the API, instead of the
broken 32-bit unsigned integer that the previous xxxTime_t functions
used. That was a design flaw when the API was introduced back in Qt 4.2,
so I'm deprecating the API and slating it for removal in 6.0.
The changes to qfilesystemmetadata_p.h and quuid.cpp are necessary to
build the bootstrap library. The rest of the adaptation to the new API
will come in the next commit.
[ChangeLog][QtCore][QDateTime] Introduced toSecsSinceEpoch,
fromSecsSinceEpoch and setSecsSinceEpoch functions, which use 64-bit
integers to represent the number of seconds.
[ChangeLog][QtCore][QDateTime] The toTime_t, fromTime_t and setTime_t
functions are deprecated and will be removed in Qt 6.0. For new code,
use the equivalent functions with "SecsSinceEpoch" in the name, or the
equivalent ones with millisecond accurancy that have existed since
Qt 4.7.
Change-Id: Ib57b52598e2f452985e9fffd145a355d0e7ff48d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
A prior commit has already added the resetting of QMAKE_LFLAGS_NOUNDEF
in corelib.pro for FreeBSD due to environ(7) not being part of libc.
OpenBSD has the same issue, so add it to the list of BSD systems
affected for resetting the flags for qtcore.
Change-Id: I50a62271ffa05a9976e802de420d47a1425359c4
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QT_HAS_BUILTIN is already defined in qcompilerdetection.h which is
included in qglobal.h which is included in this header file.
Task-number: QTBUG-54068
Change-Id: I46c2e13d85fc21d3e6c426d0f35a584b21ae792b
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
qdatetime.cpp(2834): warning C4312: 'reinterpret_cast': conversion from 'int' to 'QDateTimePrivate *' of greater size
Change-Id: Ib57b52598e2f452985e9fffd1458fe3ba3fcfb48
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
And blacklisted a few tests in tst_QUdpSocket.
Conflicts:
src/android/jar/src/org/qtproject/qt5/android/QtNative.java
src/corelib/global/qglobal.cpp
src/corelib/global/qsystemdetection.h
src/corelib/io/qfileselector.cpp
src/plugins/platforms/eglfs/deviceintegration/eglfs_kms_egldevice/qeglfskmsegldeviceintegration.cpp
tests/auto/network/socket/qudpsocket/BLACKLIST
Task-number: QTBUG-54205
Change-Id: I11dd1c90186eb1b847d45be87a26041f61d89ef6
This does not seem to be a function that is overloaded.
Change-Id: Icf8942dfb1e78a2ddb38cbd1c49657f745a61989
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt 5.8 no longer supports Windows CE, or versions of Windows where the
marketing version is not an orderable version number.
Change-Id: I8fab7d9b0d466f891e872b6c3fdf9d98ffe6ebc1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The clang based qdoc need to be able to parse properly anything that is
in #ifdef Q_QDOC
The #if for the forward declararion now match the one in which it is used.
Change-Id: Ia6cf84dd07a979b4e7aa8da764d9fb2fce74baa1
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Same as 9224255f13: some Qt types are
polymorphic and are marked as movable, so Clang complains.
qarraydataops.h:608:27: error: destination for this 'memmove' call is a pointer to class containing a dynamic class 'QPixmap'; vtable pointer will be overwritten [-Werror,-Wdynamic-class-memaccess]
qarraydataops.h:608:61: error: source of this 'memmove' call is a pointer to class containing a dynamic class 'QPixmap'; vtable pointer will be moved [-Werror,-Wdynamic-class-memaccess]
Change-Id: Ib57b52598e2f452985e9fffd145861e025b81550
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
It's a problem when building for 64-bit where the two types no longer
match.
Change-Id: I8c31915caf81a60d635c79816a3a2d5d36742ff9
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Otherwise, the code:
ds >> s >> hash;
could set the stream status to ReadPastEnd, while deserialization
of the string is failed with ReadCorruptData status.
Proposed solution is to restore a previously latched error status
unconditionally in accordance with QDataStream::setStatus() docs.
Change-Id: Id3a7dccf709b02e5b018efb48d7647ee48fe5124
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
0 must not be used as a null pointer constant
Change-Id: I082d0e99c105fb02980b9cf390e7f6e4c9ad0869
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
- Adapt to the OS X => macOS rename in Q_OS_ macros/docs, qmake scopes,
file selectors, etc.
- Add new QSysInfo values and MAC_OS_X / __MAC_ / __IPHONE_ values for
macOS 10.12 and iOS 9.1 through 10.0.
- Update prettyProductName with new macOS "Sierra" codename.
Change-Id: Id976530beeafa01b648ebaa16f4a8f0613fcaf75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The fromCGPoint function was left out for QSize, as the foundation type is
using CGFloats internally. Clients should use an explicit QSizeF::toSize()
when potentially throwing away precision.
Change-Id: I12d43ae0881f09ad8d79f2caaa000c3983f4ef30
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
The fromCGPoint function was left out for QPoint, as the foundation type is
using CGFloats internally. Clients should use an explicit QPointF::toPoint()
when potentially throwing away precision.
Change-Id: I12a37e8f81c86b7ada56066cc18ee29709cc21e3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Push conversions from pthread_t to Qt::HANDLE and back into functions.
The casts that were being used didn't work for the unusual 64-bit
pointer/32-bit int combination that QNX is using for 7.0. HANDLE ends
up as a 64-bit pointer and pthread_t ends up as a 32-bit integer. g++
considers the precision loss when converting from the 64-bit pointer
to the 32-bit integer an error. Better to have the casts hidden in
functions so it's easier to adjust them for unusual combinations such
as this.
Change-Id: Ia156b26224a0f7edc1c31e3d1ee8b21191381698
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
GetModuleFileName exists for Windows 10 and upwards, hence use the
generic version from the win32 mkspec. This allows to create a
QCoreApplication object with nullptr argv, as the application filename
is identified via the binary itself and not via arguments. A couple of
auto-tests use this method to create multiple application objects during
runtime.
Unfortunately we cannot apply this for msvc2013, even though MSDN states
the GetModuleFileName exists, it fails to compile for Windows Phone 8.1.
Change-Id: I2b8b988107487ef3785462f8ca40b0a6e0623e32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
In case QEventDispatcherWinRT::runOnXamlThread returns an error the
runtime sets the status of IAsyncInfo to Error. At the point when the
IAsyncInfo destructor is invoked, an unhandled exception is thrown
indicating the error has not been handled, causing any application to
just crash deep inside the Windows platform libraries.
Hence, in case runOnXamlThread returns non-S_OK we have to manually
invoke Close() of the IAsyncInfo to tell the system we have taken care
of everything.
Change-Id: I3ac1e2ec2726f42e44f4f9a92191e454711120dd
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Q_COMPILER_CONSTEXPR can be undefined (or not defined at all) to
indicate that constexpr should not be used regardless of the compiler's
ability to support it. This is done for QNX because some C library
floating point functions used in the Dinkumware C++ library aren't
constexpr functions; i.e., the library doesn't have proper constexpr
support even though the compiler does.
(cherry picked from commit d87242968f)
Change-Id: If0bdeb2180710dd9ccd97d79fa91cf9ff42f7990
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The fromCGRect function was left out for QRect, as the foundation type is
using CGFloats internally. Clients should use an explicit QRectF::toRect()
when potentially throwing away precision.
Change-Id: I0d4c5c5a4e6a45ea3287e3f37a00b69b0bfdefcf
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
The move constructor is slightly more interesting than the copy
constructor because we can reset other to a short data state on 64-bit
systems. The assembly of that function is simply:
mov (%rsi),%rax
mov %rax,(%rdi)
movq $0x1,(%rsi)
retq
The move-assignment operator for QDateTime was already there. There's no
need for one for QDateTime::Data since it's never called.
Change-Id: I06bae9392f534e45b3f1ffff144dffdd7f23b170
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We won't shrink on manipulation when we have memory allocated, but it's
a good idea to create a non-shared copy if we can. It's an unlikely
scenario, though, because it requires the QDateTime object to have been
set to a large state then manipulated back into a small state.
Change-Id: I06bae9392f534e45b3f1ffff144dfee755bafa01
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The file has an organization, so let's follow it. This commit has no
other changes besides moving code around.
Change-Id: I06bae9392f534e45b3f1ffff144e0b1f6dd72622
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Well, maybe not for so long: we may want to revisit it for Qt 6. At the
very least, we should enlarge the size of QDateTime on 32-bit system so
that they too can benefit from the optimization.
With this optimization, on 64-bit systems, the most common uses of
QDateTime now no longer allocate memory at all. The range is slightly
reduced from 584,554,049 years to 2,283,414 years around 1970. The other
drawback is that calling QDateTime::offsetFromUtc() on a localtime now
needs to recalculate the offset, instead of using the cached offset.
(QDateTime::toMSecsSinceEpoch() didn't use the cache).
Change-Id: Id5480807d25e49e78b79ffff144a8b2c9af91814
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit moves QDateTimePrivate functions setTimeSpec, setDateTime,
getDateTime, checkValidDateTime and refreshDateTime outside the
class. Like the previous commit, this is done in preparation for the
"Short QDateTime Optimization" as the "msecs" field will be placed in
the short data, if possible.
By making them file-level static, this also improves code generation, as
the compiler doesn't know whether it has to emit the class members for
out-of-line use or not.
Change-Id: I06bae9392f534e45b3f1ffff144df4d73cbc9184
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit changes most accesses to the d->m_status (including
d->spec() and d->setSpec() uses) to use new static functions. This is
done in preparation to the "Short QDateTime Optimization" as the status
byte will be kept in the short data.
Change-Id: I06bae9392f534e45b3f1ffff144dbd795d03227a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Instead of using a macro for maybe passing an extra parameter, pass the
d pointer and let the function decide what to use and what not to use.
Change-Id: I06bae9392f534e45b3f1ffff144dbeb68a30cb48
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
They're superfluous, since b491fab02a
removed the distinction between null and invalid. Just use the
isValidXxx equivalents.
Change-Id: I06bae9392f534e45b3f1ffff144db9badad010fd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
We're going to have to stop using QSharedDataPointer because of the
upcoming short-datetime-optimization. By dropping the inheritance, I am
also able to rearrange the members and remove the padding hole that
existed.
The second padding hole was removed in the previous commit, which merged
two 32-bit fields into one.
On 64-bit systems, there's no way around a remaining 4-byte hole
somewhere due to the odd number of 32-bit members. I chose to leave it
in the middle of the struct, before the m_timeZone member, instead of
tail padding, so that the layout of the first members structure are the
same in bootstrapped and non-bootstrapped builds. That should help
debugging the bootstrapped tools in Qt Creator. It's also now the same
in 32- and in 64-bit systems.
Change-Id: Id69569111e7d4e619e22ffff144b1fba708885f7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Storing them in a single byte is the first step towards the Short
QDateTime Optimization.
The bump in the "private version" by 10 is to accommodate possible
changes in the Qt 5.7 branch.
Change-Id: Id5480807d25e49e78b79ffff144a59420457bcf0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This makes it easier for users to find out how to get a file's
extension when browsing docs.
Change-Id: I08a1b620dea5432462133324824fae85754b9a09
Task-number: QTBUG-53380
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
On ABIs where quint64 is aligned on 8-byte boundaries (such 32-bit
Windows and all 64-bit systems), there was a padding hole of 4 bytes
between QHostAddressPrivate::a and the anonymous union. If we move the
member to after the union, there is no hole anymore.
That operation causes the tail padding to grow from 3 to 7 bytes. Since
we also don't need full 32 bits for the protocol, we can shrink the
structure by 8 bytes on those architectures and by 4 bytes on 32-bit
Unix systems.
Change-Id: I461e9fc7199748faa187ffff1415d6601a7bd777
Reviewed-by: hjk <hjk@theqtcompany.com>
The first is "exact", not "more": qCalculateBlockSize. It ensures that
there's no overflow in multiplying, adding the header size or when
converting back to an int.
The second is the replacement for qAllocMore: it calculates the block
size like the first, but increases the block size to accommodate future
appends. The number of elements that fit in the block is also returned.
Task-number: QTBUG-41230
Change-Id: I52dd43c12685407bb9a6ffff13f5da09f816e667
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The GCC builtins for clzs and ctzs are enabled when the x86 extension
for LZCNT and TZCNT are enabled. The use of only __BMI__ in commit
f5f47987ce was incorrect.
But GCC needs both BMI and LZCNT enabled to enable this builtin.
Change-Id: I1cc7601489634e96833cfffd145647e9fc9f2f51
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
This works only on Aarch64, because the vaddv instruction is only
available on 64bit ARM. Doing something equivalent on 32bit ARM has the
high chance to run into micro-architecture differences: on an Cortex-a8,
transferring a single vector element from NEON to the regular CPU
registers takes 20 cycles(!).
Change-Id: Iccbfe84da82abb9b10f3f3dc35c8b950df69e251
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
GetTickCount64 is available on Windows Vista and WinRT. Since Windows CE
is no longer supported on dev, we don't need to dynamically resolve the
function anymore.
What's more, QueryCounterFrequency is documented to never fail since
Windows XP, so we haven't needed GetTickCount64 for years (no clue when
we dropped support for Win2k).
Change-Id: I115db302eb114bed8cd1fffd14558a81353d2aed
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The implementation used the QString::compare_helper(QChar*, int, char*, int)
overload, which, however, interprets the rhs as a UTF-8 sequence, not as
Latin-1.
Fix by using the (QChar*, int, QLatin1String) overload.
Extend the test to cover this case, too.
Change-Id: I59b26d63d0caec036b80ef8818c75d0cebe519d2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When using a 8 bit encoding to write a file, a test discovers if the
encoding is really ASCII compatible by examining a letter and one of the
XML reserved characters. EBCDIC, in the current base, was not well
handled.
[ChangeLog][QtCore][QXmlStreamWriter] Fixed a bug that prevented the
generation of valid XML files when using encoding with 8 bit per
character but not ASCII compatible. QXMLStreamWriter generated XML
markup using always ASCII in this case.
Change-Id: I9c86a122dd91b2290d50c358638442f99777d4ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It doesn't like the attribute there. I think it's a compiler bug, but I
can't be sure because the part of the standard dealing with the
placement of attributes and where they apply is very complex. Exercise
left for the reader to determine if ICC is correct or not to reject it
there.
Change-Id: I87e17314d8b24ae983b1fffd1454bde826b7bcf4
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>