Commit Graph

27058 Commits

Author SHA1 Message Date
Dmitry Shachnev
b6a824d0a3 Add native support for D-Bus global menu
The protocol was originally developed by Canonical, currently supported
by Unity and Plasma.

Adjust some tests to use the non-native menu bar when they require it.

[ChangeLog][XCB / X11] QMenuBar uses the unified D-Bus AppMenu menubar
when the desktop environment supports it.

Change-Id: Iea74b40522573bcc4f70168fe7fa2a49b4f3fc21
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-23 20:56:07 +00:00
Eirik Aavitsland
950bb7185c Autotests: if cross-compiling, ignore dbus status on compilation host
The auto.pro file would bail out or skip based on the availability of
the session bus at qmake time. That does not make sense for cross
compilation: the session bus may be available on the target even if it
is not on the compilation host.

Change-Id: I459a518f3411acb39e8dcdad9d32ded1f9b57029
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-23 12:19:31 +00:00
Friedemann Kleint
fc6d5ed18d QFileDialogOptions: Expose default name filter setting.
Move the bool QFileDialogPrivate::defaultFileTypes to QFileDialogOptions
as defaultNameFilters and add a static function returning the
translated default filter string. Let QFileDialogOptions::nameFilters()
return the default filter until a value has been set.

This removes the need for special handling for empty filter lists
in the QPA plugins. As a side effect, Qt Quick Controls's FileDialog
will then also default to "All files" if no filters have been set.

Task-number: QTBUG-50644
Change-Id: I9ba271a472d4fa03767b540ef6f1399f5ca4408e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
2016-02-22 09:13:04 +00:00
Samuel Gaist
6129aade00 QListWidget: setup connections when changing selection model.
QListWidget uses a set of slots for its selection model that are
connected only at creation time. This patch adds the missing
connections cleanup and setup when a user changes the selection
model.

Task-number: QTBUG-50891
Change-Id: I942bae6c471ea1ae22637d09b96d6fbd422f653f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-21 20:50:18 +00:00
Andre Somers
923be3f78c Fix small textual error in documentation for QFlags::setFlag
Change-Id: I075932cfb9fdd38fb8d54da19e7d72b8cdec49f3
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-02-21 09:09:33 +00:00
Anton Kudryavtsev
7ce90fe6fa QFileSystemModelPrivate: remove unused code
Change-Id: I83df0d0bbac66957dc06e2805acf2c47d172fed8
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-20 18:53:29 +00:00
Marc Mutz
a425b5f19c QWindowsGLContext: replace homebrew Array with std::vector
std::vector is all that the Array original author dreamed about,
and more: never shrinks capacity, non CoWed, ...

Appart from append(), the Array API was modeled after std::vector
(size_t size_type, etc) already, so the port to std::vector is
minimal. The only change besides append() -> push_back() was not
assuming const_iterator being const T*.

Remove now-unused Array.

Change-Id: I02bc71441d01e554e320746d82dbc00f74c5466d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-20 13:36:19 +00:00
Liang Qi
611942f2d7 Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7 2016-02-19 21:18:19 +00:00
Friedemann Kleint
9b49b375e3 Windows QPA: Fix warnings as shown by Qt Creator's Clang based code model.
Fix warnings in file qwindowswindow.cpp. Remaining part of a refactoring
done in the 5.6 branch.

Task-number: QTBUG-50804
Change-Id: I4d7b423e0802ac39109c30c0de615664d3ee9216
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-02-18 22:53:49 +00:00
Liang Qi
4fe2fbcf82 Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 018e670a26.

The change was introduced in 5.6. After the refactoring, 14960f52,
in 5.7 branch and a merge, it is not needed any more.

Conflicts:
	.qmake.conf
	src/corelib/io/qstandardpaths_mac.mm
	src/corelib/tools/qsharedpointer_impl.h
	tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp

Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
2016-02-18 20:50:35 +01:00
Lars Knoll
4889269ff0 Fix quadratic behavior when converting from QVariant
The old code called insert for each item, leading to constant
reallocation of the data structure. Instead rely on the fact
that a QVariantMap (as well as the variant list) is sorted, so
we can convert to the QJson data structure in one go without
lots of reallocations.

Task-number: QTBUG-44737
Change-Id: Id2d38d278fb9afa5e062c7353b4d4215bdfb993c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-18 07:38:37 +00:00
Lars Knoll
03f1a69e9c Avoid size overflows when inserting into very large JSON objects
QJson has a size limitation for arrays and objects. Make sure we
don't go over that size limit and create corrupt objects when
inserting data.

Change-Id: I45be3caefc282d8041f38acd120b985ed4389b8c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-18 07:38:28 +00:00
Oswald Buddenhagen
6342fb2c3e Bump version
Change-Id: I62b55dde4a21a46470cafcc0e0b46bc70c097052
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-02-18 07:38:22 +00:00
Jake Petroules
cf47e2e181 Fix build when QMacStyle is disabled.
Change-Id: Ica66ab2b48266590b14d16a323b572f63168a580
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-18 07:38:17 +00:00
Jake Petroules
de82352d28 Wrap legacy APIs in a QT_MAC_DEPLOYMENT_TARGET_BELOW macro.
If the deployment target is OS X >= 10.10 or iOS >= 8.0, we always have
the NSProcessInfo API available and do not need to compile-in this code
at all.

Change-Id: I8470a5be475a82e7b88d62f4558925f62527b6f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-18 07:38:06 +00:00
Jake Petroules
c1da6347e8 xcodeSDKInfo: return the correct path based on the specified SDK.
This fixes a regression introduced in
9daeb6fe9d.

Change-Id: I3100b307bb65c90bdc023be4993afaea666e409d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-18 04:34:05 +00:00
Vyacheslav Grigoryev
34472e946a QSqlDriver: use table prefix in WHERE clauses
If the WHERE clause is used in a query involving multiple tables,
such as generated by QSqlRelationalTableModel, the table prefix
may be necessary to disambiguate column references. It is harmless
if not needed.

Task-number: QTBUG-43320
Change-Id: I39e1ab7359bf748afa8bcd8578220e3abb3ee24a
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-02-17 23:13:58 +00:00
Peter Kümmel
d562c7761e Fix typos in qOverload documentation
Change-Id: I92f99623f659543934c52961307b0b53c8520948
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-17 22:41:32 +00:00
Marc Mutz
aae362e2fe QDirModel: replace an inefficient QList with QVector
SavedPersistent is larger than a void*, so holding it in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by marking it movable and holding it in a QVector instead.

Take advantage of rvalue-enabled QVector::push_back(); optimize
element construction by using aggregate initialization.

Change-Id: I4fd88879aa13e6536d59d164b3c33fbc2fead77f
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-17 19:45:02 +00:00
Oswald Buddenhagen
86c5a337e3 Merge "Merge dev into 5.7" into refs/staging/5.7 2016-02-17 19:57:54 +00:00
Friedemann Kleint
ed4ef55ec5 QtNetwork: Silence Clang on Windows.
Remove dead code and fix override.

Task-number: QTBUG-50804
Change-Id: I9cc28507e549d56a1f15fcc54bb6f7465beef644
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-17 18:58:18 +00:00
Oswald Buddenhagen
6620045fca Merge dev into 5.7
Change-Id: I5c60b4d9fd8355ddd49a01e21861f36afbbf889b
2016-02-17 18:26:22 +01:00
Marc Mutz
47ca3f7813 bearer plugins: fix uses of inefficient QLists
These types are larger than a void*, so holding them in QLists
is needlessly inefficient. Worse, the code could come to depend
on the fragile property of (inefficient) QLists that references
to elements therein never are invalidated.

Fix by marking them movable, and holding in a QVector instead.

Change-Id: I78774fc78d787241aaadc4f819b6d229e6200f46
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-17 16:52:15 +00:00
Marc Mutz
24a96e2a3e QtPrintSupport: convert some index-based into C++11 range-for loops
Also reserve a QList in QPrinter::supportedPaperSources().

Change-Id: I94d24b81d7adcad2b28d36efdbef5a8726412f1a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-17 16:18:08 +00:00
Marc Mutz
7ca90e985c QSslSocket (OpenSSL): replace QList<QPair> by QVector<Struct>
A QList<QPair<int,int>> is one of the most dangerous ones, because
it fundamentally changes memory layout, and therefore performance
and invariants, when going from 32-bit platforms (array list) to
64-bit (vector-like).

Port to QVector instead, which has a consistent design across all
platforms.

Also port from QPair to a simple struct { code, depth }, because
member names such as 'first' and 'second' have no semantic value
and make code using them very hard to understand.

Change-Id: I86c95d78dbb2e82ec222d6eae8ba11568e3ff0af
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-17 16:17:58 +00:00
Marc Mutz
8049e9b3b9 QSslSocket (OpenSSL): use QMutexLocker
... instead of naked QMutex::(un)lock().

Change-Id: I9927e60286231bfc254d99cc88c39301b31df336
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-17 16:17:53 +00:00
Marc Mutz
6f7a5b0ecf QtSql: eradicate remaining Q_FOREACH loops
Change-Id: I86afe7104d506b840130517ae8066588fab2d745
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-02-17 16:17:50 +00:00
Marc Mutz
88e043a8bd QOCIDriver: optimize string handling in tables()
- Instead of a QStringList, use a const char 2D array
  to hold the system user names. Don't remove the
  current user from that list, skip it duing processing.
- Extract Method make_where_clause, optimize it and
  cache its result. Instead of creating a QStringList
  and join()ing it at the end (sometimes twice), append
  to the result QString directly. Reserve the max size
  of the result string, which is statically known.
- Keep the query select statements in QLatin1String.
  They are only used in QStringBuilder expressions.

Change-Id: I0593d2812da671a541d49a6136f3ff3d784c63d5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-17 16:17:46 +00:00
Marc Mutz
de8229f370 mimetypes: Declare some types as shared
It's private API, so we can.

As a consequence, had to add nothrow member-swap and, in
QMimeGlobPattern, remove the user-defined empty destructor
to un-inhibit the (nothrow) move special member functions.

Change-Id: If5bb72db3c823c7b0e372f9bec99c7242d11839b
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-17 16:17:43 +00:00
Marc Mutz
773458ad63 Remove QMimeMagicRule's pimpl
It didn't make the class implicitly shared, but required an
additional heap allocation on construction and copy, as it
used 'only' QScopedPointer. As it's private API the pimpl
is also not needed for BC reasons.

So inline the data members, and some trivial accessors.

As a by-product of removing the copy special member functions,
we gain nothrow move special member functions.

Interestingly, the memory layout of a QList<QMimeMagicRule>
(replacing which is the topic of a future patch) doesn't
change due to this change, because the type that formerly
fit QList very well now is too large. But copying the type
outside QList now no longer allocates memory.

Saves more than 2.5KiB in text size on optimized GCC 5.3
Linux AMD64 builds.

Change-Id: Ie3588cb5693227da6f1bfa196db924e075a750b3
Reviewed-by: David Faure <david.faure@kdab.com>
2016-02-17 16:17:37 +00:00
Marc Mutz
30b0c346ec QShortcutMap: re-use an existing bool variable
... instead of re-evaluating its expression. More readable.

Change-Id: I18c6ab3bbc4c5a14328f9910fab991f6cad5549d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-17 16:17:32 +00:00
Marc Mutz
4262f31330 QDaemonThread: replace a function pointer with a lambda
Saves around 0.5KiB in text size on optimized GCC 5.3
Linux AMD 64 builds.

Change-Id: Iaf2664e670a96136031bac67e4012d4f7324eb47
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-17 16:17:29 +00:00
Marc Mutz
66e2643072 QDialogButtonBox: replace a QList copy + pop_front() with mid(1)
Simplifies the code and is also more efficient, because
it copies less data.

Change-Id: I9ad0c372fb4fa6f5818d9d6cb7b7cf35935f8565
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-17 16:17:25 +00:00
BogDan Vatra
efcf1dec49 Say hello to Android Services
This changeset enables running a QCoreApplication from within an Android
Service. The Android Application running can now have a QtActivity or a
QtService, but having both in the same process is not supported.

This patch was based on Cory Slep's patch

[ChangeLog][Android] Qt can now be used to easily create Android Services.

Task-number: QTBUG-37221
Change-Id: I0fd693daaa85b991940ffe9cc41c483022677199
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-02-17 14:29:58 +00:00
Tor Arne Vestbø
4a7ccf74ff Disable XCTest support in QtTestLib
In recent Xcode versions it doesn't work as expected, and caused build
failures in downstream modules, so we disable it until the cause can
be investigated further.

Change-Id: Ie54c7256a10d73610ec7e481b9d665b75e396365
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-17 13:12:56 +00:00
Tor Arne Vestbø
d6c8073a34 Revert "Fix shared library framework builds of Qt with a platform suffix."
This reverts commit c4ecb81d6d.

Hard-coding the library suffix into the linker flags was wrong. The
library suffix is handled at runtime with DYLD_IMAGE_SUFFIX, set
as part of the Xcode scheme or during debugging in .lldbinit.

Change-Id: I11907b2755f7f187fb6fa18202813fde9ada4354
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-17 13:06:45 +00:00
Stephen Kelly
bfeb2fdd79 QStandardItemModel: Reset the flags on clear()
Pass modeltest after clear().  Otherwise it fails because more flags
than Qt::ItemIsDropEnabled get returned for the QModelIndex().

Change-Id: I8f11515cc7dc9383f528f785312ffb77b3c2699d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-17 11:39:13 +00:00
Anton Kudryavtsev
a44d7862c8 QDate: mark getDate() as const.
This method does not modify the object.
Can't change the API, so overload and mark the old function
for removal in Qt 6.

Change-Id: I4aee2bc19209646adc21388375aedd20a09129d0
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-17 11:19:52 +00:00
Friedemann Kleint
56ad625f78 Add attribute Qt::AA_DontUseNativeDialogs.
The attribute can be set to suppress native dialogs for example
for testing purposes.

Task-number: QTBUG-51074
Change-Id: I35611e07e00b7a060f22b49d6ab6f3b8627f8aca
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-02-17 10:20:28 +00:00
Ariel Molina
42b39f9827 Add source device information to qDebug output of QTouchEvent
This is a simplistic patch to make it easier to debug touch input when
using multiple physical or virtual devices.

Change-Id: I996237cdce5e0ff0c4a0660dabb0d190679ab585
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-02-17 05:07:14 +00:00
Gabriel de Dietrich
049fad42a2 QWindow: Make screen warning more informative
Change-Id: Icd7933422e272434370ae6080348de6159d2e725
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-17 04:57:53 +00:00
Gabriel de Dietrich
9212727813 QOpenGLExtensionMatcher: Fix possible use of unintialized memory
Some drivers don't support GL_NUM_EXTENSIONS, so we may be reading
random bits from numExtensions.

Change-Id: Ibe61fa6d7c379f3f1428458edd3e0ddba0eb04d7
Task-number: QTBUG-48943
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-02-17 04:57:21 +00:00
Anton Kudryavtsev
a3b8e355fc QListView: fix skipping indexes in selectedIndexes().
Remove spurious increment of i.

Task-number: QTBUG-51086
Change-Id: I4307a6728de1e7f25c8afa31fe2066f92373f3fc
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-17 04:53:16 +00:00
Maurice Kalinowski
5b727576b1 winrt: add logging to platform plugin
Task-number: QTBUG-38114
Change-Id: I24c96bb2e29e1bbfe93dfe45aa764451aa9ddde8
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:52:41 +00:00
Maurice Kalinowski
e7a06c9843 winrt: Fix clipboard
Native implementation was missing and so far it only used the Qt
internal fallback mode.

Unfortunately this does not apply to Windows Phone 8.1.

Task-number: QTBUG-49766
Change-Id: I8cbbb0c843d077d7df1396d673fedeab2799b5a6
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:51:46 +00:00
Maurice Kalinowski
ad16703fa8 Update testdata
Some entries were not updated and tests failed to succeed on platforms
which need to deploy content/testdata.

Change-Id: Ieb2b44c375b04cbaaecc1fb2303cc2478b86a100
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:50:50 +00:00
Maurice Kalinowski
8b0dc80294 winrt: Fix usage of testdata
testdata needs to be deployed to temp and current directory
needs to be set to that directory for the test to succeed.

Change-Id: I2dd023af9073d90afbb4ad60fcfb50bb1af4e159
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:50:14 +00:00
Anton Kudryavtsev
9baf824e4d QDateTimeParser: de-duplicate calls and cache results
Change-Id: I2e95456146b6ce646e244e962082f2967bcaed42
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-16 21:38:05 +00:00
Eric Lemanissier
21d19f760c Improve sql allocated cache reuse
This change avoids unnecessary allocation of QSqlCachedResult cache.

Change-Id: Ief592ab05b50f5e328490c504af088ec74d1938f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-02-16 21:22:19 +00:00
J-P Nurmi
273114582a Add QStyleHints::setTabFocusBehavior() for testing purposes
So far we've been dependent on the focus behavior setting in OS X
system preferences. This change allows us to start testing both
behaviors on any platform.

Change-Id: I9ce004f8b9479f8e722a387b795de16edb166a07
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2016-02-16 21:12:49 +00:00