Commit Graph

32029 Commits

Author SHA1 Message Date
Marc Mutz
5e93361888 Add a test for consistency of hash values between QString{,Ref,View}
Change-Id: I64a169fd6c8e2444bfe67e3ecd5375ea7b6a81ee
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-07 08:30:17 +00:00
David Faure
e5a2c87dc7 xcb_egl: fix clang error due to m_connection now being unused
Change-Id: I00846d26013d31856f049659069852d749d54b8e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2017-04-07 07:27:21 +00:00
Thiago Macieira
97d7d80e73 Disable MSVC warning 4577 in headersclean
This warning is added in MSVC 2015 and is printed when we use noexcept
in modules we turned exceptions off.

Task-number: QTBUG-59645
Change-Id: Id92f4a61915b49ddaee6fffd14ae3b943ccd2bce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-07 01:51:44 +00:00
Marc Mutz
f672bd6316 Extend the check for null and empty QString hashing to QString{Ref,View}
Change-Id: I5c41287991f6dd2eeb3d54699da0f653bfac59be
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-06 22:19:41 +00:00
Samuel Gaist
c608ffc56a Improve pair-like class handling in tests
Currently when doing comparison with pair-like classes the fallback
toString method is called which returns a Q_NULLPTR thus not allowing
proper diagnostic of the values that triggered an error. This patch
adds support for QPair and std::pair to improve the tests output
readability.

[ChangeLog][QtTest][QCOMPARE] Now outputs contents of QPair and
std::pair on failure.

Change-Id: Ib0b4aad7640590d56275b6f1306fb9fb39fa81bc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-06 21:46:32 +00:00
Marc Mutz
6f41600422 Port internal class QXmlUtils to QStringView
... and adapt callers.

In one case, port a use of QString::toLatin1() to QStringRef::
toLatin1() so together with this change and the addition of
QString::arg(QStringView) we can drop one more QStringRef::toString().

Change-Id: Iba898af8cc2a9e1a811e271789359395f595ad32
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-06 12:06:26 +00:00
Marc Mutz
e1e6506c8d QString: add QStringView/QLatin1String overload of (non-multi) arg()
Use the new overload directly in QXmlStream*.

Saves 129B in QtCore text size on optimized GCC 6.1 Linux AMD64
builds, even though we added two more functions.

[ChangeLog][QtCore][QString] Added arg(QStringView),
arg(QLatin1String) overloads.

Change-Id: Idf7236dcab763824593f34182e4e0b16b5ed4321
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-06 12:06:18 +00:00
Marc Mutz
0a5b610679 QText{En,De}coder: mark ctors explicit
C++11 allows these to be called implicitly.

Change-Id: Ife62ce4df4c294623e84fb0c0751ae9b4f6d1020
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-06 12:05:56 +00:00
Marc Mutz
c928d08267 QTextCodec: add QStringView overloads
[ChangeLog][QtCore][QTextCodec] Added fromUnicode()
and canEncode() overloads taking QStringView.
[ChangeLog][QtCore][QTextEncoder] Added fromUnicode()
overload taking QStringView.

Change-Id: I2599f25570480d967921ccd4414e092bfc90d821
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-06 12:05:33 +00:00
Marc Mutz
edb29be8ba QStringView: fix ambiguity between f(QString)/f(QStringView) with QString::null args
... by removing the QStringView(QString::Null) ctor.

This means that QStringView(QString::null) will now fail to compile.
That's ok, since we've deprecated QString::null in the last Qt version.

This will also help pulling up the QStringView definition to before
the QString one in qstring.h, something that we'll require for properly
adding QStringView-append/prepend/insert to QString.

Change-Id: I3c836732be1e185111b13950be9d8dcd935734ff
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-06 12:05:26 +00:00
Robin Burchell
727da2965c qmltestcase: Allow a QML-only testcase to not require a C++ harness
[ChangeLog][qmake] If you use CONFIG+=qmltestcase with no SOURCES, 'make check'
will now run qmltestrunner for you.

Change-Id: Ie9dfaef75494c9b38f6c9a6239754858535d8657
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-06 08:40:17 +00:00
Marc Mutz
be49235266 QStringView: use qssize_t as size_type
Nothing changes, we've just given 'QIntegerForSizeof<size_t>::Signed'
a better name in qglobal.h and now use it in QStringView API and
users.

Change-Id: Ibea1ae26e95b3a96708400fd4b0cd120459d57b6
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-04-06 02:38:25 +00:00
Gabriel de Dietrich
7d5e516e67 Remove unused function qt_mac_secure_keyboard
This function was also relying on Carbon APIs.

Change-Id: I87bc942800f5f3dc4ab69cad80f3cbf06d1ad4e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-04-05 17:25:17 +00:00
Benjamin Terrier
ea4c4691f7 Remove superfluous handle assignment in QLocalSocket::connectToServer()
The handle is already assigned by QLocalSocket::setSocketDescriptor().

Change-Id: I695cfa31f3d14a3a9eef2fb79d23e9651616e8a8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2017-04-05 16:54:44 +00:00
David Faure
411398aab4 QTextLayout optimization: avoid calling [] when at() will do
The 'lines' and 'items' containers are both declared mutable, so
[] detaches even in const functions.

Change-Id: I29ac74302af2fab390b3cf3f9d05ea2cace6840b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-05 12:48:51 +00:00
Martin Smith
4a67066f14 doc: Prevent overwrite of qbytearray.html
A use of Q_GLOBAL_STATIC() tricked clangqdoc into
thinking it created something called QByteArray that
should be documented, so the html generator tried to
overwrite qbytearray.html which had already been
created for the real QByteArray. This probably means
there is a bug in the clang visitor class, but I can't
see it, and this change eliminates 4 qdoc errors.

Change-Id: Iee333217212ce60727cd9424a19b8e96a20547b4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-05 12:14:47 +00:00
Richard Moe Gustavsen
b99ec4b4ec Docs: add platform notes to QSystemTrayIcon
On macOS, DoubleClick will work if there is no context menu set.
Otherwise, the context menu will open on the first mouse
press, and then steal focus (which is native behavior).
This means that we never get a callback from the OS for
the second click.

Since it sounds strange to attach a context menu, and at the
same time, listen for double click, we choose here to follow
native behavior and open the menu straight away.

Task-number: QTBUG-5770
Change-Id: I14e08bb8ccd330eecc98e332d54ce4e551cd78fb
Reviewed-by: Jeremy Whiting <jpwhiting@kde.org>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2017-04-05 11:59:58 +00:00
Marc Mutz
84b114e4f3 QVulkan{Layer,Extension}: various fixes
- don't export simple structs
- make op== non-member
- add op!= (required by EqualityComparable)
- add qHash() (should be defined by Qt for every EqualityComparable class)
- add Q_DECLARE_TYPEINFO

Change-Id: Ia14ac3fea48a6a0ad1d8993c9408afe77bbe6c1a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-05 11:49:20 +00:00
Friedemann Kleint
fdd32329ab Documentation: Add Vulkan section to Qt Gui overview
Add section, external references and link examples.

Task-number: QTBUG-55981
Change-Id: I705f8bacc9d21aff8446ac40b7a172604a18ef85
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-05 11:06:20 +00:00
Marc Mutz
f5e77d3d54 Fix some issues with the QStringView docs
Change-Id: Ibb6fed18c6b7aa23ffc259dc66d22d4ff0372ca0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-04-05 09:17:34 +00:00
Marc Mutz
a8c046a2a3 Use (new) QStringIterator(QStringView) to avoid casts
This is the only one in QtBase that casts to be able to use QStringIterator.

Amends d40dcee642.

Change-Id: I709e0285717e8d17feab9ab0020c8d0aed0dbe36
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-04-05 09:10:33 +00:00
Andy Nichols
8a6b20eb0e Vulkan: Fix shadow builds
Change-Id: I6529c76109e2d668355524b9b0d65048a6d3df2e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-05 09:03:18 +00:00
Giuseppe D'Angelo
5c2d177552 Mark some more functions with Q_DECL_CONST_FUNCTION
Saves a mere 300byte of text.

Change-Id: Ibc87a395af83757e855477a57e48e1e190504757
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-05 08:00:04 +00:00
Giuseppe D'Angelo
49c4c061e0 QStaticText: mark constructor as explicit
A QStaticText object is supposed to be created and *kept* by the user,
and then used repeatedly for drawing, saving the expensive
layouting/rasterization process which would otherwise be done for each
drawText-like call.

Allowing an implicit conversion from QString is therefore surely
unwanted.

[ChangeLog][Potentially Source-Incompatible Changes][QStaticText] The
QStaticText(const QString &) constructor is now explicit.

Change-Id: Ib939a5f46638cb9a54d1cc30ff50e3a9d20be5e4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-05 07:58:08 +00:00
Marc Mutz
89302436cb QStringBuilder: add support for (non-const) char*
There's support for const char[] and char[], so it seems this was
simply forgotten.

[ChangeLog][QtCore][QStringBuilder] Added support for (non-const) char*.

Change-Id: I4b5d9039632da7721256579b7741816027321a7e
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-04 22:12:25 +00:00
Gabriel de Dietrich
a433614bec QCocoaEventDispatcher: Remove Carbon dependency
QCoreApplication::hasPendingEvents() is deprecated, and so is
the event dispatchers' eponymous function. (A subsequent patch
will remove all of the event dispatchers' function, and add a
warning in QCoreApplication.)

The replacing logic is based upon QEventDispatcherCoreFoundation.

Change-Id: If2c1920148dc6d910e77c1dc8ac5b4459c149e2b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2017-04-04 18:06:42 +00:00
Liang Qi
aeb3f9d168 Merge "Merge remote-tracking branch 'origin/5.9' into dev" into refs/staging/dev 2017-04-04 16:15:55 +00:00
Liang Qi
9419dfe8ee Merge remote-tracking branch 'origin/5.9' into dev
Conflicts:
	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase_p.h
	src/plugins/platforms/xcb/qxcbwindow.cpp

Change-Id: Ic747c3c50e68c005b425e7a1ec2a90965527c8bd
2017-04-04 18:09:33 +02:00
Giuseppe D'Angelo
5eb74ad4f5 QRegularExpressionMatch: add QStringView-related functions
Change-Id: Ia81ba131cc2c7f56acb3312fbc7d62ffe5e18da4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2017-04-04 15:35:22 +00:00
Jan Arve Saether
e011c9c3b8 Pass along keyboard modifiers to touch events
Change-Id: I0d90425166c035dfa81823e3487d6262980ae16b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2017-04-04 12:15:42 +00:00
Samuel Gaist
9076046a10 SQLite: enable support for named placeholders
SQLite has been supporting named placeholders for some time now and the
code of the module is also written in that sense. The only thing that
currently fails is the parameter count check. If the named placeholder
is used several times then the parameter count will not match the
value count. This patch adds a second check in that case. This use
case is already tested by tst_qsqlquery.

[ChangeLog][QtSql][SQLite] Named placeholder can now be used.
If compiling Qt by hand and using system libraries, this feature
requires at least SQLite 3.3.11.

Change-Id: I1f6fa93f72bd809136894eafce0a2ae5cf6a62db
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-04-04 12:02:10 +00:00
Laszlo Agocs
8f93d6632a Fix some capitalization issues in QVulkan docs
...and remove see-alsoing wrappers that do not get a doc page.

Change-Id: Ia26aeef3c142b15a47e650dfc7f64ad7339cc80d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-04-04 12:01:31 +00:00
Marc Mutz
8b5aa7b6c4 QStringView: add an array ctor
With sufficient enable_if magic, the array ctor can overload the
pointer ctor and statically determine the size of the array passed.
Consequently, remove the sizeof in QStringViewLiteral again.

Change-Id: I486baa3cafefde60ccc5f2b47eb94ee53cefe63c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-04 11:33:08 +00:00
Marc Mutz
d40dcee642 QStringIterator: port to QStringView
Pretty straightforward, as the implementation already used only
an iterator range internally.

Change-Id: I6e6b809329e2e2548bba6db414a3d107d09637d1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-03 15:41:09 +00:00
Thiago Macieira
b8c61c6bb3 x86: Report the AES and SHA New Instruction detection
Commit 0f1b6acab7 added the detection, but
not the reporting in configure's output. This change makes them be
reported alongside F16C.

Change-Id: I27b55fdf514247549455fffd14b1711ca47b1d9a
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-02 17:40:48 +00:00
Benjamin Terrier
d2388f15e7 Add QMetaObject::invokeMethod() overloads for function pointers
The new overloads do not accept parameters for the invoked function, this
use case is handled by using lambda.
Overloads for non member function pointers and functors are separated as
the return type is not retrieved in the same way.
Move QSlotObjectBase, QSlotObject and QFunctorSlotObject from
qobject_impl.h to qobjectdefs_impl.h in order to make them available in
qobjectdefs.h.
Update autotests of previous overloads because of a soft break in source
compatibility: passing null literals (0, NULL, nullptr, etc.) for the
second parameter of invokeMethod() is not supported anymore.

[ChangeLog][QtCore] Added QMetaObject::invokeMethod() overloads for function
pointers.

Task-number: QTBUG-37253
Change-Id: I6fb67e086d315ae393ce32743c4eb1abd6cc9139
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-02 08:00:27 +00:00
Jake Petroules
0c4eb097ed Fix up QAppleRefCounted API
- Add proper move semantics.
- Use better variable names.

Change-Id: I9d13e4474414593a451d3ccf34c034cb7ab7f60d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-01 15:19:11 +00:00
Jake Petroules
384f6ca96a Add QAppleRefCounted template as the base of QCFType
This helps to reduce code duplication as it will be used as the basis
of other reference-counted RAII template classes in the future.

Change-Id: I6e7e32373ec738f68d960afc759213610232b9bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-01 15:19:02 +00:00
Joerg Bornemann
d436e0e6f5 QProcess::startDetached: support nativeArguments on Windows
The non-static method QProcess::startDetached now supports nativeArguments.

[ChangeLog][QtCore][QProcess] Added the ability to specify native
arguments for detached processes on Windows.

Task-number: QTBUG-52405
Change-Id: Ic97c55caac7c1156e1412322000c1e40d80bdbbb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-01 06:08:19 +00:00
Jake Petroules
2810f39658 Remove bad compile-time check for QMacStyle
QMacStyle already sets SH_Workspace_FillSpaceOnMaximize, so this will
have the same behavior when QMacStyle is in use.

Change-Id: Ibe9f93b2ca94d84b0ce2d3a3078b7db6d5906042
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
2017-04-01 00:14:31 +00:00
Thiago Macieira
580156e555 Simplify QFSFileEngine code: QFile does not require buffering
We still support buffering via stdio.h (FILE*), but QFSFileEngine itself
is not responsible for the buffering. Opening by file name (not FILE*
and not file descriptor) already added the Unbuffered flag.

Change-Id: I2bc52f3c7a574209b213fffd1498d4e3f78fe1bf
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-31 21:08:54 +00:00
Joerg Bornemann
6ba8708a2f QProcess::startDetached: support custom process environment
Starting a detached process with a custom process environment can now be
achieved by:

    QProcess p;
    p.setProgram("foo");
    p.setProcessEnvironment(myEnv);
    p.startDetached();

[ChangeLog][QtCore][QProcess] Added the ability to set a custom process
environment for detached processes.

Task-number: QTBUG-2284
Change-Id: I49406dffb64fa2aed41ea05cb271bd42eeabb729
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-31 17:37:30 +00:00
Joerg Bornemann
28666d167a Simplify Unix implementation of QProcess::start{Process|Detached}
Use QStandardPaths::findExecutable instead of duplicated
implementations.

Change-Id: Ia944f1d343d8c215fc2b6e78dae6b2bfffbba688
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-03-31 17:37:18 +00:00
Joerg Bornemann
31e782cc96 Add non-static QProcess::startDetached
The three static QProcess::startDetached overloads support a limited number of
features: program, arguments and working directory. To support more features of
QProcess (without adding a plethora of overloads) we add a non-static method
startDetached that can be used as follows:

QProcess p;
p.setProgram("cat");
p.setArguments("meow");
p.setWorkingDirectory("/tmp");
if (!p.startDetached())
    qWarning("Cannot start process.");

We plan to add support for nativeArguments, processEnvironment,
standard{Output|Error}File and maybe more in subsequent commits.

[ChangeLog][QtCore][QProcess] Added non-static QProcess::startDetached
to support more features for detached processes.

Task-number: QTBUG-2058
Task-number: QTBUG-2284
Task-number: QTBUG-37656
Task-number: QTBUG-52405
Task-number: QTBUG-57687
Change-Id: If6fdd57ecb28cd13aa5fff566216a4177f81d339
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2017-03-31 12:40:07 +00:00
Martin Smith
6505062f58 doc: Fix several qdoc warnings in new software
This change fixes several common qdoc warnings in this new software.
However, because vulkan/vulkan.h is not always available, a few typedefs
were also added to define some standard vulkan types for clang to see
when vulkan.h is not available.

Change-Id: Id3db8c0a59b0c415829c1873a868aba0e84fe21c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-03-31 11:29:44 +00:00
Martin Smith
28d286dc96 doc: Ensure that clangqdoc sees QVulkanInstance decl
clangqdoc must see the declaration in vulkan
regardless of whether Qt is configured with vulkan.

Change-Id: I91fcaa4c39121b70e10c4fc3e854e49d959a6c02
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-03-31 11:29:36 +00:00
Martin Smith
98ef6c4afa doc: Remove qdoc marker from a few comments
This update removes the ! charaqcter from a few qdoc comment
markers for functions that should not have been documented.
Doing so eliminates 4 qdoc warnings.

Note that this update deliberately ignores a clangqdoc bug that
might eventually require teaching clangqdoc to store template
information with classes and functions so that qdoc can match
function specializations correctly and document many different
specializations when there is only one declaration. Currently,
it can't handle function specializations.

Change-Id: I5c1db98dabc802cce18f2fc3e64b82e15165ad4d
Reviewed-by: Martin Smith <martin.smith@qt.io>
2017-03-31 11:29:29 +00:00
Marc Mutz
0b9fb15b1a QStringView: add mid(), left(), right()
Change-Id: If1d2cf175d51b3c02881e21937b0a2d33b78aadd
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-03-31 11:23:59 +00:00
Marc Mutz
54dd87ca0f QStringView: add tests for relational operators
Remove most of the std::equal() tests that were used to determine
equality in pre-relational-operator-times again.

Amends a1421e4787.

Change-Id: Iff64808f5ac60861caee899d594b512b58046636
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2017-03-31 11:23:11 +00:00
Friedemann Kleint
1c919da99a Windows QPA: Simplify session manager checking code
Introduce convenience function sessionManagerInteractionBlocked()
that is also present when session manager is disabled and
reduce #ifdef-ery accordingly.

Change-Id: Ifa211a3bf19901db669743a16acde6e6dc455f75
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-03-31 11:21:31 +00:00