Commit Graph

42578 Commits

Author SHA1 Message Date
Alexander Akulich
291b3cebb9 QAbstractSocket: Use constructor delegation
Change-Id: Ib749ff46dd3c9d44c1a3c6273eadd78fdf0f837e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-22 17:20:35 +03:00
Qt Forward Merge Bot
aa3226bab3 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-22 01:00:18 +01:00
Qt Forward Merge Bot
65cafea797 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iace12004afdfe765a3068dfcf6f1320c1123c539
2020-02-22 01:00:07 +01:00
Christian Ehrlicher
1559c328d5 QTableWidget: avoid complete redrawing when an item is removed
When an item gets removed from QTableWidget, the dataChanged() signal
is sent out with an invalid index. This triggers a complete repaint
which is not needed since only one cell is changed.
Fix it by retrieving the model index *before* the internal structure is
cleaned for the given item since otherwise index() will no longer find
the item and return an invalid index.

Change-Id: Ia0d82edb6b44118e8a1546904250ca29d9c45140
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-21 20:04:21 +01:00
Volker Hilsheimer
3c20b9b973 QGraphicsProxyWidgets: document that using OpenGL comes with limitations
The documentation already states that high-performance scenarios are not
a usecase that mixes well with QGraphicsProxyWidget. However, we can
generally not test or support all combinations of widgets and styles
with an OpenGL viewport.

That Qt's basic framework code has to be graphicsview aware is already
unfortunate enough; adding more special checks all over the place
hurts maintainability, makes the general usecase slower, and poorly
serves use-cases that are beyond of what QGraphicsProxyWidget was
designed for.

Change-Id: Iff43ead292240f7b068dcf9206bb3bee3031b1dc
Fixes: QTBUG-63687
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-21 20:03:45 +01:00
Topi Reinio
6248bfd9e5 Doc: Remove \pagekeywords command
The command does nothing, it was not implemented by QDoc.

Change-Id: Id1e5fcc02101723e9089df55d9f8949e50c89b3f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-21 19:45:10 +01:00
Morten Johan Sørvig
4e1c41a26e QStyle: Use primary screen DPI as default DPI
Change d603ee68 made the default DPI be 96, for cases
where a style option is not provided.

This causes inconsistencies, since there are in fact
several cases where QStyle API is called without a
style option.

Restore historical Qt behavior of using the primary
screen DPI. Single-screen systems should now be consistent,
as before.

Task-number: QTBUG-82356
Change-Id: I849934ca2e5604b9fb2f045ed4f6058f3e0426ff
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-21 10:38:58 +01:00
Laszlo Agocs
2940c375e4 rhi: Allow querying the native buffer objects behind a QRhiBuffer
Modeled after QRhiTexture's NativeTexture query.

This becomes valuable in advanced cases of integrating external native
rendering code with Qt Quick(3D), because it allows using (typically
vertex and index) buffers created by Quick(3D) in the custom renderer as
well, without having to duplicate the content by manually creating native
buffers with the same vertex and index data.

Change-Id: I659193345fa1dfe6221b898043f0b75ba649d296
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-02-21 09:15:18 +01:00
Laszlo Agocs
79b605d285 rhi: Fix building hellominimalcrossgfxtriangle on macOS
Change-Id: I55fa7d4d122750ca7ab90559026f4f4fcdf11663
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-02-21 09:15:10 +01:00
Laszlo Agocs
efba2530f9 rhi: Do not rely on unspecified relation between readbacks and FramesInFlight
Add a new queriable resource limit value MaxAsyncReadbackFrames. Change
the autotest to rely on this instead of relying on the unspecified,
works-by-accident relation between readbacks and FramesInFlight. This
way even if the behavior diverges in some backend in the future, clients
(well written ones, that is), will continue to function correctly.

Also clarify the docs for FramesInFlight, and change d3d and gl to return
the correct value (which is 1 from QRhi perspective; the expanded docs now
explain a bit what this really means and what it does not).

Change-Id: I0486715570a9e6fc5d3dc431694d1712875dfe01
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-02-21 09:15:05 +01:00
Mårten Nordheim
fb6acf08bb Replace usage of std::result_of with decltype
It's slated for removal in c++20

Fixes: QTBUG-82240
Change-Id: I7b35c151413b131ca49b2c09b6382efc3fc8ccb6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-21 01:31:52 +01:00
Edward Welbourne
336fe172b1 Back out of calendar support in Qt::DateFormat methods
We're deprecating the locale-specific date-formats, which are the only
ones that use the calendar. The QDateTime::toString() variant was new
in 5.15, so we can simply remove it again.  The QDate one was present
in 5.14, so we need to keep it; deprecated it at 5.15 for removal at
Qt 6.

[ChangeLog][QtCore][QDate] QDate::toString(Qt::DateFormat, QCalendar)
no longer takes calendar into account for Qt::TextDate. There was no
matching support in QDateTime and the locale-independent formats are
intended to be standard, rather than customized to the user.

Fixes: QTBUG-82178
Change-Id: I09db8a82ec5a4eab22f197790264fa3a3724e383
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-20 14:44:29 +01:00
Shawn Rutledge
aeff4b70c5 Make xcb plugin compile with -no-feature-tabletevent
fixed1616ToReal() is used for touch and scroll events too, not just
tablet.

Task-number: QTBUG-82168
Change-Id: Idcdd6365b5619824b41c1278e5dc5ffb81c400f8
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-20 12:36:58 +01:00
Volker Hilsheimer
f79efbc867 Un-blacklist QFileSystemModel::dirsBeforeFiles
After 4e796e0b0d we only have blacklisted
passes in the database, and no flaky failures on macOS.

Exception is WinRT, which stays blacklisted.

Change-Id: Ie1c492d20c76d4ba12b3f513ac038f023b864cb1
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-20 11:23:44 +01:00
Oliver Wolff
5893f10390 QMultiMap: Work around compiler problem in MSVC 2017
In more complex projects (like MuseScore) it is possible, that MSVC 2017
chokes on the usage of "using typename ...". Just fully specify the
iterators when they are used.

Fixes: QTBUG-82166
Change-Id: I5e7882a0963445fc8529cfcb59d2aae606a2777e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-02-20 10:58:34 +01:00
Friedemann Kleint
e0225d8bee Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-20 08:36:03 +01:00
Friedemann Kleint
41ecb6abbf Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ide8768d0d95aaeec943658aea27a03737d7dbf3f
2020-02-20 08:34:46 +01:00
Volker Hilsheimer
1821f5163d Fix font and palette propagation for themed children created at runtime
Widgets have a default palette and font that is influenced by several
factors: theme, style, QApplication-wide overrides, and the parent's.
If an application sets a font or palette on a parent, then widgets
inherit those settings, no matter when they are added to the parent.

The bug is that this is not true for widgets that have an application-
wide override defined by the platform theme. For those, we need to merge
parent palette and font attributes with the theme, and this is currently
not done correctly, as the respective masks are not merged and inherited.

This change fixes this for fonts and palettes. Children are inheriting
their parent's inheritance masks, combined with the mask for the
attributes set explicitly on the parent. This makes the font and palette
resolving code correctly adopt those attributes that are set explicily,
while leaving everything else as per the theme override.

The test verifies that this works for children and grand children added
to a widget that has a palette or font set, both when themed and
unthemed. Children with own entries don't inherit from parent.

The QFont::resetFont test had to be changed, as it was testing the
wrong behavior. If the child would be added to the parent before the
font property was set, then the test would have failed. Since this
change makes sure that children inherit fonts in the same way, no
matter on when they are added to their parent, the test is now
modified to cover both cases, and ensures that they return identical
results.

[ChangeLog][QtWidgets][QWidget] Fonts and palette settings are inherited
by children from their parents even if the children have application-
wide platform theme overrides.

Change-Id: I179a652b735e85bba3fafc30098d08d61684f488
Fixes: QTBUG-82125
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-02-20 08:04:47 +01:00
Nicolas Guichard
f9086ebd01 QShaderGenerator: Allow more expressions in input nodes
Currently QShaderGenerator will crash when encountering some expressions
in input nodes.

For example, this node prototype would make it crash:
"VERTEX_COLOR": {
  "outputs": ["color", "alpha"],
  "rules": [
    "headerSnippets": ["in vec4 vertexColor;"],
    "substitution": "vec3 $color = vertexColor.rgb;
                     float $alpha = vertexColor.a;"
  ]
}

Change-Id: I37abb8099d376843a4cb13228140467dc1b8f60c
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-20 08:00:20 +01:00
Nicolas Guichard
39994e0705 QShaderGenerator: Don't crash when a node has multiple outputs
It was already possible to declare a node prototype with multiple
outputs, but trying to assign to all those outputs was not possible and
instead resulted in a crash.

It is now possible to declare nodes like this without crashing:
"SEPERATE_XYZ": {
  "inputs": ["vector"],
  "outputs": ["x", "y", "z"],
  "rules": [
    {
        "substitution": "float $x = $vector.x;
                         float $y = $vector.y;
                         float $z = $vector.z;"
    }
  ]
}

Change-Id: I748e77e84c9120dc688c573eee33dc13c6bfbace
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-20 08:00:14 +01:00
Andre Hartmann
8cf4ce0fea QString: Add missing number() crosslinks to setNum()
Change-Id: I22a4c86034b399782115bb078c298b211095476a
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-20 06:59:55 +01:00
Paul Wicking
d1186f9299 Doc: Update description of QTextDocument::characterCount
A QTextDocument always contains a QChar::ParagraphSeparator, so
characterCount() will always return actual count + 1.
The tests confirm this behavior, make it explicit in the docs.

Fixes: QTBUG-80597
Change-Id: I91040fb6eb2c4fae5235458c695110f8f15bdfea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-02-20 06:00:42 +01:00
Lorn Potter
d928beb024 wasm: do not try to resume main thread if mainloop has not started yet
Fixes: QTBUG-81520
Change-Id: Ibd891629d1d023e47d196dd60821cc5c583a178d
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-02-20 08:32:53 +10:00
Tor Arne Vestbø
8c3cc07bf5 widgets: Translate QWindow move events into widget relative position
If a widget backed by a QWindow is moved we need to translate the window
geometry into a position relative to the parent widget. In most cases this
was incidentally working due to widgets backed by QWindows always having
QWindow parents too, so the QWindow position was applicable to the widget
as well. But when Qt::WA_DontCreateNativeAncestors is used this is no
longer the case, and we would end up with a widget geometry that included
the parent positions all the way up to the next native widget.

The updatePos() function has been squashed into handleMoveEvent(), since
we need to ensure the position in the move event sent to the widget is
correct as well.

Change-Id: I55894ad7ab42a6d4d65e446a332ecdd7dcdcc263
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-02-19 20:04:19 +00:00
Nicolas Guichard
7981dbfaf3 QShaderGraph: don't generate statements with undefined inputs
This fixes the shader generation for graphs like this one:

                 Function0 ------> Output0
            (with unbound input)

   Input ------> Function1 ------> Output1

With those graphs, createStatements will not return any statement for
nodes Function0 and Output0.

Change-Id: Iec32aa51623e176b03ae23e580f06d14df80a194
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-19 17:39:51 +01:00
André Klitzing
fc3226e790 Fix broken -no-feature-dom
44a26a0a79 did a clean up
and moved the new private header outside of QT_NO_DOM.

Fixes: QTBUG-82175
Change-Id: Iafe9c53b78037bdac8420911f6847d29672c68de
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-02-19 15:21:40 +01:00
Shawn Rutledge
b1b37a36cb Test QImageReader::setScaledClipRect() more realistically
Ensure that each image plugin really clips within the scaled coordinate
system, as documented. Always clipping from 0,0 wasn't interesting.

Task-number: QTBUG-81044
Change-Id: Ic06fe52f92f719e1ff9c0348f667215e53b60fb0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-19 13:28:01 +01:00
Mårten Nordheim
3dc69d651b QNAM Doc: Remove mention of bearer
🐻er management is going away

Change-Id: I86067d593ece0d35a33f23130260ccb7c4b64881
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-19 13:28:01 +01:00
Mårten Nordheim
3742c67041 Remove bearer management from remaining network examples
Because bearer management is going away

Change-Id: I60439c1714e0350b0f2bbef6afc8d2015886135f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-19 13:28:00 +01:00
Mårten Nordheim
22c585f0f9 Remove the bearermonitor example
Because bearer management is going away

Change-Id: I64311895c347b3e63df75d10db1673bcfe54f52d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-19 13:28:00 +01:00
Mårten Nordheim
57a6c60fb9 Remove usage of bearer management from lightmaps example
Because bearer management is going away

Change-Id: I82f2e67a052fdcdf0dde337f9f69b414681511c4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-02-19 13:28:00 +01:00
Assam Boudjelthia
1576f81baa Android: QFileDialog check isLocalFile() with static functions
The functions below try to return the selected QUrl string
with toLocalFile(), however in case of Android "content" Uri
isLocalFile() is false, thus we end up with empty path.
This checks is QUrl isLocalFile() otherwise return QUrl::toString().

* QString QFileDialog::getSaveFileName()
* QString QFileDialog::getOpenFileName()
* QStringList QFileDialog::getOpenFileNames()
* QString QFileDialog::getExistingDirectory()

Change-Id: If7eefb3a067d4bd09849807e60554e0ded507f19
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-02-19 14:28:00 +02:00
Nicolas Guichard
49dbe760e4 Fix QShaderGenerator crashing when a node port name prefixed another one
QShaderGenerator didn't handle substitutions like
`vec4 $color = mix($color1, $color2, $fac);`

Note that `$color` is a prefix to `$color1` and `$color2`. For the
substitution `QByteArray::replace` was used so if `$color` was handled
first and replaced by `v1`, `$color1` and `$color2` were never correctly
replaced and instead became `v11` and `v12` which caused a crash later
on.

Change-Id: Idaf800fdac468f33c323eb722701da5f8eb918d6
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-19 08:47:58 +01:00
Christian Ehrlicher
3dd5caaaec QtSql: cleanup QSqlDriverPrivate and QSqlResultPrivate
Cleanup QSqlDriverPrivate/QSqlResultPrivate and their derived classes
in ODBC, MySql, PostgreSQL and SQLite.

Change-Id: I52e69c00cf981b81dde7c3a0370f86f06ef756bb
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-02-19 06:50:21 +01:00
Friedemann Kleint
045a143c2c Fix RollEffect misplacements in High DPI setups
Pass the correct screen as parent of the roll effect widget.

Fixes: QTBUG-82011
Change-Id: I25c163cb2e4c038e60ceced702a1ea6c18aa5424
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2020-02-18 22:27:25 +01:00
Liang Qi
fd49b4a2b9 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-02-18 22:13:18 +01:00
Andy Shaw
9029c55864 Send the LanguageChange event to all top level windows, not just widgets
By sending it to all top level windows it will make it possible for
non widget based controls to listen for this event if it cares about it
so it can handle translation updates as appropriate.

Task-number: QTBUG-78141
Task-number: QTBUG-82020
Change-Id: I8f35cdcccd81a199ff780c3f4f3d2c663480d638
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-02-18 22:11:30 +01:00
Dmitry Shachnev
57af7f2166 Make libmd4c a private dependency of Qt GUI
Otherwise, when Qt is built with system libmd4c, all applications using
Qt GUI have to link with it, even if they do not use it.

Change-Id: I662dfd4caf29bb692b62c20cef0e99148a87a99a
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-02-18 22:29:16 +03:00
Timur Pocheptsov
379895798e QMacStyle - fix tab buttons
not to have arrows under some conditions. NSPopUpButton had a needed
color, except it also has arrow(s). Which looks quite confusing on an
inactive window on a tab button.

Fixes: QTBUG-82122
Change-Id: I40c57abe9ccae48fa906d592169c412f5f89f712
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0e643bf783)
2020-02-18 18:05:50 +00:00
Alexander Akulich
ee73ec0c77 Fix a typo in QLocalSocket doc
Change-Id: I3047cb24051c7f25d77d5b2b86ff145a52695107
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-18 20:34:50 +03:00
Kai Koehne
d803534954 Add 5.14.0 changelog entry about MinGW
It's too late for 5.14.0 release, but still good to have it
documented.

Change-Id: I76f323d80bb878c779caec2622d5917f868f9fc0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-02-18 18:34:50 +01:00
Kai Koehne
7232c852a6 qmake: Fix handling of QM_FILES_INSTALL_PATH
Do not expect the .qm files to be there at qmake time; they will only be
generated at build time.

Fixes: QTBUG-77398
Change-Id: If73fdb51d40138e52f62eaee0491a5d73d9fe161
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-02-18 18:34:50 +01:00
Edward Welbourne
274b6f3c13 Silence deprecation warnings on implementation of deprecated formats
Change-Id: I3abb36e27e96033b4eb44802c28e0a6ba8250ce5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-18 16:28:24 +01:00
Liang Qi
b9585277e7 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/tools/qlinkedlist.h
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/wasm/qwasmscreen.cpp

Change-Id: Iefca7f9f4966bdc20e7052aca736874861055738
2020-02-18 09:26:53 +01:00
Friedemann Kleint
c308a796d9 Windows QPA: Fix disabled color of menu items in dark mode
Replace green by the standard light color.

Fixes: QTBUG-82197
Change-Id: I12477a055788cc7b6c829e315d5ae9f1577770bf
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-02-18 08:55:17 +01:00
Friedemann Kleint
e2e596c0c5 Windows style: Turn off SH_EtchDisabledText in dark mode
It does not look good in dark mode.

Task-number: QTBUG-82197
Change-Id: I043c7d66d962e4c82581f37e52f279d4f4ed8c7e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-02-18 08:55:09 +01:00
Lorn Potter
d7b6c4288f wasm: add platform qsettings
Since the backend is async, the settings will not be ready to read/write
instantly as on other platforms, but only be ready after the
filesystem has been synced to the sandbox. This takes at least 250 to
500 ms. The QSettings status() or isWritable() can be used to discern when the
settings are ready for use.

This also fixes a crash in threaded wasm

Task-number: QTBUG-70002
Change-Id: I080bdb940aa8e9a126d7358b524f32477db151b6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-02-18 12:40:24 +10:00
Lorn Potter
1538395e3f wasm: futureproof EmscriptenMouseEvent
Future versions of emscripten will remove the timestamp, so we need to
replace this with the current timestamp

See a7f058a1e6 (diff-9a5d68085dc7db2938b37a2b7b05c1f5)

Change-Id: I8379d1adee1df1084461fddb1dd2e71684de9657
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-02-18 12:40:21 +10:00
Lorn Potter
51cc564c50 wasm: guard nonthreaded builds from using threading.h
Change-Id: Ib5cd8afc4822cc89371d184ee5645ed8f496c8b0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-02-18 12:40:19 +10:00
Yuhang Zhao
b84704e208 Fix typo in QGuiApplication's documentation
Change-Id: Ie6a05c8d71b81777ae79a5ff3db380b284d56313
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-02-18 08:53:02 +08:00