Commit Graph

27210 Commits

Author SHA1 Message Date
Eskil Abrahamsen Blomfeldt
342c909b34 Qt Quick: Fix selection when mixing line breaks and line wraps
The enabler for finding selection ranges in Qt Quick had two bugs
which caused some selected text to disappear. Specifically, this
was the case for selected text where a line contained both an
explicit break and a break due to line wrapping.

First of all, the glyphsEnd that is passed into glyphRunsWithInfo()
is expected to be inclusive, since we are actually searching for
its index in the log cluster array. We would in certain cases
not find the glyph at all in the log clusters, thus the glyph
run would be set to overlap with any glyph run coming after it
in the same item.

Second of all, we need to start searching at the correct position
in the log clusters when searching for the correct rangeStart,
since rangeStart is initialized with textPosition. Otherwise, we
would in some cases never reach the start of the range, and
rangeStart would be set to textPosition + textLength, which is the
end of the range.

Task-number: QTBUG-49596
Change-Id: I436ba3f1c7414d4f5044d9b70aa04c60b01755e4
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-19 10:47:57 +00:00
Eskil Abrahamsen Blomfeldt
fef629cd91 Disable unneeded ligatures when letter spacing is set
For writing systems where glyph substitutions are purely
cosmetic, we should disable them when letter spacing is set,
otherwise we get ligatures where the spacing is not applied.

To avoid changing Harfbuzz-NG upstream, we detect this
case when fetching the GSUB table and return an empty
blob instead.

Task-number: QTBUG-44393
Change-Id: Ie5f6b2d795d7fecbba0ece3941fb70ba7f04c395
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-19 10:47:54 +00:00
Paolo Angelelli
67ced1d9c4 OpenGL: Fix for incorrect GL enum in getter
QOpenGLShaderProgram::defaultInnerTessellationLevels() uses the wrong
GL enum. This patch fixes it.

Change-Id: I2d7ebfad27f7b36d3047d80bfacba65c43c68165
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2016-02-19 10:37:20 +00:00
Friedemann Kleint
11cd0902e6 Re-enable tst_QTreeView::setSortingEnabled on Windows.
The test was made insignificant for Windows in change
f3939d943e. As the failure is not
reproduceable locally, re-enable it. Also split apart the test.

Task-number: QTBUG-51149
Change-Id: I6a06bdf2369bc3bdbc73dfe4fa416e9d644f8b01
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-02-18 22:54:19 +00:00
Friedemann Kleint
8917cdf13b Windows QPA/font code: Fix warnings as shown by Qt Creator's Clang based code model.
Introduce C++ casts and add some conversions. Where possible, increase
const-correctness.

Task-number: QTBUG-50804
Change-Id: Idd73730ae83b837c065c8c80f500d5336570f228
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-02-18 22:54:02 +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
Friedemann Kleint
bb8f01c601 QRasterPaintEngine::penChanged(): Assert on painter state.
Task-number: QTBUG-48823
Task-number: QTCREATORBUG-14888
Change-Id: I043a777da6b4e3dfdc58770fb136240a57707cb7
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-02-18 22:53:37 +00:00
Friedemann Kleint
5d2068b912 Prospective fix to stabilize tst_QMdiArea::subWindowActivated2()/xcb.
Ensure that the window is active (as otherwise
QMdiArea::activeSubWindow() returns 0) and add a QTRY_COMPARE.

Change-Id: I7edb01d43fd2635864266614ef9a0e844f76edbf
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
2016-02-18 22:53:22 +00:00
Błażej Szczygieł
78ad8f208d xcb: Fix drag and drop between xcb screens
Set the proper screen before creating a shaped pixmap window in
QBasicDrag::startDrag(). Grab mouse again when D&D window is
recreated.

Task-number: QTBUG-51215
Change-Id: I5cb47d3b11672b56d17b32072d84a722bdcdcd9a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
2016-02-18 20:08:07 +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
Andreas Hartmetz
719623a11d Fix builds without session management.
My previous change broke it.

Change-Id: I3c3a9a65775032a95eebf3526c1bbf2c50773230
Reviewed-by: Samuli Piippo <samuli.piippo@theqtcompany.com>
2016-02-18 07:24:38 +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