Commit Graph

88 Commits

Author SHA1 Message Date
Qt Forward Merge Bot
75c0ffaf6d Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	examples/network/bearermonitor/CMakeLists.txt
	examples/network/CMakeLists.txt
	src/corelib/tools/qlinkedlist.h
	src/sql/kernel/qsqldriver_p.h
	src/sql/kernel/qsqlresult_p.h
	src/widgets/kernel/qwidget.cpp
	src/widgets/kernel/qwidget_p.h
	tests/auto/network/socket/platformsocketengine/tst_platformsocketengine.cpp
	tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json

Change-Id: I21a3c34570ae79ea9d30107fae71759d7eac17d9
2020-02-26 18:39:21 +01:00
Olivier Goffart
a68e4f3b96 Use the new QMetaType API in QVariant
Change-Id: I5495ee1159864ebd64083fadbfac7e07177ed406
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-02-25 15:43:15 +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
Friedemann Kleint
41ecb6abbf Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ide8768d0d95aaeec943658aea27a03737d7dbf3f
2020-02-20 08:34:46 +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
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
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
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
Nicolas Guichard
27d35a3ed0 QShaderGraph: Fix statement creation for graphs with dangling branches
For graphs like this one:

Input ----> Function1 ----> Output
      \
       ---> Function2
         (unbound output)

We would have generated only 2 statements, for Function1 and Output.

This change fixes this by treating Function2 like an output.
Therefore it generates 4 statements: Input, Function1, Output and
Function2.

Change-Id: Iaada40b9b949d771806dd47efad4f7ef2a775b48
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2020-02-17 14:35:56 +01:00
Alexandru Croitor
0d177053b9 Regenerate projects one last time before merge
Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-12 17:30:49 +00:00
Leander Beernaert
502d3d6744 Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
2020-01-24 13:17:33 +01:00
Fabian Kosmale
3359b29c99 QDoubleValidator: Fix thousand separator handling
QDoubleValidator would accept "1,23" as valid in a locale which has ','
as a thousand separator. However, it should have been Intermediate
instead, as there is still one digit missing.

Fixes: QTBUG-75110
Change-Id: I6de90f0b6f1eae95dc8dfc8e5f9658e482e46db3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-12-05 11:30:24 +01:00
Alexandru Croitor
bfbf3e0b3a Regenerate rest of tests/auto/gui
Change-Id: Iaaea50790161715517f7a4085116d5c893fa286b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:05:37 +00:00
Leander Beernaert
56115dba42 Convert remaining gui utils tests
Fixes:QTBUG-78229

Change-Id: I3bff1b562e1c146f291e5692c90d2c38f162d395
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-04 13:36:46 +00:00
Alexandru Croitor
c7ec7cd2a1 Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
2019-08-15 16:53:19 +02:00
Sona Kurazyan
2f33e030b8 Remove usages of deprecated APIs of qtbase/gui
- Replaced the usages of deprecated APIs by corresponding
  alternatives in the library code and documentation.

- Modified the tests to make them build when deprecated APIs disabled:
    * Made the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods are
      enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, added tests for the replacement.

Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-13 10:43:15 +02:00
Alexandru Croitor
e4079eca49 Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.

Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
2019-06-03 15:14:42 +02:00
Tobias Hunger
6630937e63 Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
2019-04-16 16:32:08 +02:00
Eirik Aavitsland
42b42602c4 QTextureFileReader: add support for astc format files
The standard astc encoder has its own file format.

Change-Id: I9a2f7b1fa20ba344b79637bafb50ff2bd0596747
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-02-27 13:00:56 +00:00
Liang Qi
b5c2535eb0 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/3rdparty/pcre2/qt_attribution.json

Change-Id: Ibae941cb12662f27bd6962ee02bc235971c59a15
2019-05-03 10:44:24 +02:00
Paul Lemire
389dec3e7c Only generate temporaries when it makes sense
- Never for global inputs
- Otherwise only if the temporary is referenced more than once
  -> meaning it's actually caching the result of some operation

Tests updated accordingly.

Change-Id: Ic76615370d23dee3965ca6350d5257a8be5a3e22
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2019-05-02 12:47:05 +00:00
Liang Qi
9d67bf6e96 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/tools/qlocale.qdoc
	tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp

Done-with: Edward Welbourne <edward.welbourne@qt.io>
Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I88e0757b2d020f0a244714c87844631df4b3fd13
2019-04-16 09:34:50 +02:00
Paul Lemire
a552864c3b QShaderGenerator: don't generate temporary variables for global inputs
Up until now, the QShaderGenerator would create temporary variables
for uniform, attributes, const. This change makes it use the global
inputs directly rather than relying on the intermediate properties.

Change-Id: Ia9497367d61e536969fe87536606f309c286dbb2
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2019-04-10 09:52:53 +00:00
Paul Lemire
60181f13a3 QShaderGenerator: fix substitution for attributes on GL2/ES2
GL2/ES2 expect it to be attribute and not in like later versions of OpenGL.

Task-number: QTBUG-74829
Change-Id: Iddd22386ed315d6e6843d8225e49a4b73b6ad9ba
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2019-04-10 09:52:50 +00:00
Simon Hausmann
e9c45bbddd Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io>
Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-by: Kevin Funk <kevin.funk@kdab.com>
Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Done-by: Simon Hausmann <simon.hausmann@qt.io>
Done-by: Tobias Hunger <tobias.hunger@qt.io>
Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-by: Volker Krause <volker.krause@kdab.com>
Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2018-11-01 11:48:46 +00:00
Eirik Aavitsland
9d1c881f49 Texture file support: add mipmap reading to ktx handler
Change-Id: Ic2c10b3e64d63d2272a8a3922d2b3f99dfd45bdb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-09-12 08:41:38 +00:00
Eirik Aavitsland
731538fdd4 Add API for reading and decoding graphical texture files
Add a framework for reading and decoding stored graphical texture file
formats. Includes decoders for the PKM and KTX formats.

This is basically the same texture file reading that was added to
qtdeclarative for 5.11, but has been refactored to be independent of
the scenegraph and opengl.

Task-number: QTBUG-67026
Change-Id: I87d8117550d8a2112f4f58c03e9ac6b3249cbc5a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2018-07-24 16:46:05 +00:00
Tuomas Heimonen
4b5afc788f QIntValidator: Intermediate for number if digits equal or less than max
Input value which is over the highest acceptable value, but consisting
of a number of digits equal to or less than the max value should be
considered intermediate.

[ChangeLog][QtGui][QIntValidator] Input value with over the highest
acceptable value, but with equal or less amount of digits than the maximum
value is now considered intermediate.

Task-number: QTBUG-59650
Change-Id: I71a77c9c266f0f3b62c71ac6cb995019385c1cf5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2018-06-29 09:17:05 +00:00
Andy Shaw
0b70f5ada9 QDoubleValidator: Allow intermediate values as close as possible to one considered invalid
The documentation states that if you have a range of
0.00-2.00 with the number of decimals set to 2 then
any number up to 9.99 would be considered intermediate.
This is because the number of digits still matches both before
and after the decimal point. If it is 10.0 or 9.999 then
it is still considered invalid.

In the case of 9.999 being invalid in this case, the documentation
is corrected as this was incorrectly indicated as Intermediate,
as the code indicates it as Invalid.

Change-Id: I07b433e856f355916a1240deafdf4ef58e680639
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2018-04-17 15:36:34 +00:00
Juan Jose Casafranca
95c8f24b71 Enable BuiltIn input in the shader graph builder
BuiltIn inputs shouldnt be translated into a code input. We comment the
input line for this variables

Change-Id: I3b7d2fd06afc6a122d90a999fc5a5246fc93234e
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2018-04-10 23:49:37 +00:00
Kevin Ottens
b6c3f55b93 GLSL 1.00 ES must be selected using "#version 100"
I was mistaken before, the "es" part for that version isn't optional, it
*must* be omitted.

Change-Id: I9e83d2317523fb0a905e40b95a56033cf693b93b
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
2017-08-04 11:19:30 +00:00
Kevin Ottens
4bfff6a98b Implement graph layers support in QShaderGenerator
Change-Id: I823f7866bc5e1f3b262f1aacf4c341dabda7305d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 17:34:56 +00:00
Kevin Ottens
236284357f Add support for layers in QShaderGraphLoader format
Change-Id: I5038600e73523ac7eb37a88ddff1f942af18f18e
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 17:34:52 +00:00
Kevin Ottens
f3c70ab9f3 Implement graph layers support in QShaderGraph
When creating the statements, it is now possible to pass a list of
enabled layer names. Every node or edge which is not in the list of
enabled layers will be pruned from the graph prior to traversal. Note
that an empty layer list for a node or an edge means it is on all
layers.

Change-Id: I61a4df7d395b4beb42ee55ce08fef8ebe04263c9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 17:34:48 +00:00
Kevin Ottens
32281653bf Add the layer concept to QShaderNode and QShaderGraph::Edge
This will be used in further commits

Change-Id: I49977f1ea482b97dc0a159f69a0d2eda3865ec44
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 17:34:44 +00:00
Kevin Ottens
3d5c4ce01e Add support for QShaderLanguage enums in QShaderGenerator
Change-Id: I93306d783309cda09fedae3713afde851df3e9a3
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 17:34:40 +00:00
Kevin Ottens
dd04551504 Extend the parameter support in QShaderGraphLoader for richer types
In particular, go through QMetaType/QMetaEnum to deal with enums.

Change-Id: I2e847ba328eb46609b86b3dfd6c4dbf532d78b7d
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 17:34:35 +00:00
Kevin Ottens
50775424be Extend the parameter support in QShaderNodeLoader for richer types
In particular, go through QMetaType/QMetaEnum to deal with enums.

Change-Id: Idbe16c913c1d471a4a91d219f77876e498c192d9
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-08-02 17:34:30 +00:00
Kevin Ottens
0d196b4268 Add support for parameters in QShaderGenerator
Change-Id: Iff8fec51ddbf9b018cb5ec3aff357125134013eb
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:23 +00:00
Kevin Ottens
13ecd686b9 Add support for node parameters in QShaderGraphLoader
Now the parameters from the prototypes are used as default values and
the graph file can overload them.

Change-Id: I9a8a73963c7e578bd0a34e96f76f147a12224f4f
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:19 +00:00
Kevin Ottens
5667c870fb Add support for node parameters in QShaderNodesLoader
This will allow to make the prototypes more extensible when referred to
from a graph file while providing some sane defaults.

Change-Id: I1ae10182427d8a7d29c51a64e19e99139494ea92
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:16 +00:00
Kevin Ottens
f7fefed2ea Add parameters to QShaderNode
This will allow to create nodes having an entry point for tuning, still
need to be exploited by the loaders and the shader generator. Coming in
further commits.

Change-Id: I8384b0f528c9919e9f8d35102adde2b307f08b80
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:13 +00:00
Kevin Ottens
74e9a11386 Complete the QShaderGraphLoader tests to introspect nodes
We forgot to check that the node content was correct and complete when
loading the graph.

Change-Id: Id4ee6aaba6ca268b0785e7fa3fb51a19817e7c9c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-07-08 09:05:10 +00:00
Kevin Ottens
7e7cd1c294 Sort the keys before comparing them in the test
The return order of the keys is random, so let's sort both first, then
we can compare the lists. Should get rid of the test flakiness.

Change-Id: I2e89d3cc603da6a4667b3677350baa4d40d59b45
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-06-22 11:57:33 +00:00
Kevin Ottens
4d70e03002 [Shader Graph Gen.] Introduce QShaderNodesLoader
This class allows to node definitions from a JSON representation. This
will come in handy to ship preset prototypes for use with
QShaderGraphLoader.

Change-Id: I3f3b5d7852e17d484069b4814ee6e5910997c613
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:51 +00:00
Kevin Ottens
093752faf3 [Shader Graph Gen.] Introduce QShaderGraphLoader
This class allows to load a shader graph from its JSON representation.
To avoid duplicating the shader snippets inside of the JSON which would
be a maintenance nightmare, we instead allow to register a set of node
prototypes by their name and only refer to said names inside the JSON.

Change-Id: I3e7b39e8b3c25f51f331a0a59dda883ac8e2bc57
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:46 +00:00
Kevin Ottens
ad2faa3c63 [Shader Graph Gen.] Introduce QShaderGenerator
This class is meant to generate code from shader graphs

Change-Id: I1cf22352387f3f9f55e7589aa77a296689836911
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:40 +00:00
Kevin Ottens
4212451884 [Shader Graph Gen.] Introduce QShaderGraph::Statement
This is our "byte code" representing a flattened graph. It will be used
as input for the code generation.

Change-Id: Ie02a60d07c035f3d16872e79931eb7cde168a8d1
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:36 +00:00
Kevin Ottens
29a748511a [Shader Graph Gen.] Introduce QShaderGraph
This allows to connect our nodes together via ports. This way user code
can assemble a shader from simpler blocks.

Change-Id: I168dcf4af6aa11ad47b68d91e5a55e96ca922678
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
2017-06-20 21:35:30 +00:00