Skip to content

Commit

Permalink
qt5 and qt6 compability issues - fixed
Browse files Browse the repository at this point in the history
initialize Material parameters to avoid warning logs
  • Loading branch information
mlowczynski committed Nov 29, 2023
1 parent 9e5c74d commit 5383ccd
Show file tree
Hide file tree
Showing 20 changed files with 91 additions and 59 deletions.
12 changes: 9 additions & 3 deletions qmlui/qml/FunctionDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,15 @@ Rectangle

drag.target: dragItem

onPressed: funcDelegate.mouseEvent(App.Pressed, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
onClicked: funcDelegate.mouseEvent(App.Clicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
onDoubleClicked: funcDelegate.mouseEvent(App.DoubleClicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
onPressed: function(mouse) {
funcDelegate.mouseEvent(App.Pressed, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
}
onClicked: function(mouse) {
funcDelegate.mouseEvent(App.Clicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
}
onDoubleClicked: function(mouse) {
funcDelegate.mouseEvent(App.DoubleClicked, cRef.id, cRef.type, funcDelegate, mouse.modifiers)
}
}

DropArea
Expand Down
16 changes: 9 additions & 7 deletions qmlui/qml/fixturesfunctions/3DView/3DView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@
limitations under the License.
*/

import QtQuick
import QtQuick 2.15

import QtQuick.Scene3D
import Qt3D.Core
import Qt3D.Render
import Qt3D.Input
import Qt3D.Extras
import QtQuick.Scene3D 2.15
import Qt3D.Core 2.15
import Qt3D.Render 2.15
import Qt3D.Input 2.15
import Qt3D.Extras 2.15

import "."

Rectangle
{
Expand Down Expand Up @@ -452,7 +454,7 @@ Rectangle
if (!mouse.modifiers || (mouse.modifiers & Qt.ShiftModifier && direction == Qt.Horizontal))
viewCamera.panAboutViewCenter(-xDelta, Qt.vector3d(0, 1, 0))
if (!mouse.modifiers || (mouse.modifiers & Qt.ShiftModifier && direction == Qt.Vertical))
viewCamera.tiltAboutViewCenter(yDelta, Qt.vector3d(1, 0, 0))
viewCamera.tiltAboutViewCenter(yDelta)
}
else if (mouse.buttons === Qt.MiddleButton) // camera translation
{
Expand Down
6 changes: 3 additions & 3 deletions qmlui/qml/fixturesfunctions/3DView/DownsampleFilter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
limitations under the License.
*/

import Qt3D.Core
import Qt3D.Render
import QtQuick
import Qt3D.Core 2.15
import Qt3D.Render 2.15
import QtQuick 2.15

TechniqueFilter
{
Expand Down
12 changes: 5 additions & 7 deletions qmlui/qml/fixturesfunctions/3DView/Fixture3DItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@
limitations under the License.
*/

import QtQuick
import QtQuick 2.15

import Qt3D.Core
import Qt3D.Render
import Qt3D.Extras
import Qt3D.Core 2.15
import Qt3D.Render 2.15
import Qt3D.Extras 2.15

import org.qlcplus.classes 1.0
import "Math3DView.js" as Math3D
import "."

Entity
{
Expand Down Expand Up @@ -340,8 +339,7 @@ Entity

property var lastPos

onClicked:
{
onClicked: function (pick) {
console.log("3D item clicked")
isSelected = !isSelected
contextManager.setItemSelection(itemID, isSelected, pick.modifiers)
Expand Down
3 changes: 1 addition & 2 deletions qmlui/qml/fixturesfunctions/3DView/Generic3DItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ Entity
id: eObjectPicker
dragEnabled: true

onClicked:
{
onClicked: function (pick) {
console.log("3D item clicked")
isSelected = !isSelected
View3D.setItemSelection(itemID, isSelected, pick.modifiers)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ Entity
{
id: quadMaterial
effect: quadEffect
parameters: [
Parameter { name: "tex"; value: Texture2D { format: Texture.RGBA32F } },
Parameter { name: "colorTex"; value: Texture2D { format: Texture.RGBA32F } },
Parameter { name: "albedoTex"; value: Texture2D { format: Texture.RGBA32F } },
Parameter { name: "normalTex"; value: Texture2D { format: Texture.RGBA32F } }
]
}

components: [
Expand Down
7 changes: 3 additions & 4 deletions qmlui/qml/fixturesfunctions/3DView/MultiBeams3DItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ Entity
effect: sceneEffect

parameters: [
Parameter { name: "diffuse"; value: Qt.color("gray") },
Parameter { name: "specular"; value: Qt.color("black") },
Parameter { name: "diffuse"; value: Qt.rgba(211, 211, 211, 1) },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 0 }
]
Expand Down Expand Up @@ -274,8 +274,7 @@ Entity

property var lastPos

onClicked:
{
onClicked: function (pick) {
console.log("3D item clicked")
isSelected = !isSelected
contextManager.setItemSelection(itemID, isSelected, pick.modifiers)
Expand Down
12 changes: 5 additions & 7 deletions qmlui/qml/fixturesfunctions/3DView/PixelBar3DItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ Entity
effect: sceneEffect

parameters: [
Parameter { name: "diffuse"; value: Qt.color("gray") },
Parameter { name: "specular"; value: Qt.color("black") },
Parameter { name: "diffuse"; value: Qt.rgba(211, 211, 211, 1) },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 0 }
]
Expand All @@ -101,8 +101,7 @@ Entity
id: headsRepeater
//model: fixtureEntity.headsNumber

onObjectAdded:
{
onObjectAdded: function (index, object) {
console.log("Head " + index + " added ----------------")
if (index == fixtureEntity.headsNumber - 1)
View3D.initializeFixture(itemID, fixtureEntity, null)
Expand Down Expand Up @@ -144,7 +143,7 @@ Entity
name: "diffuse"
value: Qt.rgba(lightColor.r * lightIntensity, lightColor.g * lightIntensity, lightColor.b * lightIntensity, 1)
},
Parameter { name: "specular"; value: "black" },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 1 }
]
Expand All @@ -167,8 +166,7 @@ Entity

property var lastPos

onClicked:
{
onClicked: function (pick) {
console.log("3D item clicked")
isSelected = !isSelected
contextManager.setItemSelection(itemID, isSelected, pick.modifiers)
Expand Down
6 changes: 6 additions & 0 deletions qmlui/qml/fixturesfunctions/3DView/ScreenQuadEntity.qml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ Entity
{
Component.onCompleted: View3D.quadReady()
effect: LightPassEffect { }
parameters: [
Parameter { name: "albedoTex"; value: Texture2D { format: Texture.RGBA32F } },
Parameter { name: "depthTex"; value: Texture2D { format: Texture.D32F } },
Parameter { name: "normalTex"; value: Texture2D { format: Texture.RGBA32F } },
Parameter { name: "specularTex"; value: Texture2D { format: Texture.RGBA32F } }
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ Entity
Material
{
effect: GammaCorrectEffect { }
parameters: [
Parameter { name: "hdrTex"; value: Texture2D { format: Texture.RGBA32F } },
Parameter { name: "bloomTex"; value: Texture2D { format: Texture.RGBA32F } }
]
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion qmlui/qml/fixturesfunctions/3DView/SelectionEntity.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Entity

parameters: [
Parameter { name: "diffuse"; value: color },
Parameter { name: "specular"; value: Qt.color("black") },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 0 }
]
Expand Down
6 changes: 3 additions & 3 deletions qmlui/qml/fixturesfunctions/3DView/SelectionGeometry.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
limitations under the License.
*/

import Qt3D.Core
import Qt3D.Render
import Qt3D.Extras
import Qt3D.Core 2.15
import Qt3D.Render 2.15
import Qt3D.Extras 2.15

GeometryRenderer
{
Expand Down
4 changes: 2 additions & 2 deletions qmlui/qml/fixturesfunctions/3DView/SpotlightConeEntity.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Entity
property Entity fxItem: null

parameters: [
Parameter { name: "diffuse"; value: Qt.color("blue") },
Parameter { name: "specular"; value: Qt.color("black") },
Parameter { name: "diffuse"; value: Qt.rgba(0, 0, 1, 1) },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 0 },

Expand Down
20 changes: 14 additions & 6 deletions qmlui/qml/fixturesfunctions/3DView/StageBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ Entity
effect: stage.effect

parameters: [
Parameter { name: "diffuse"; value: Qt.color("lightgray") },
Parameter { name: "specular"; value: Qt.color("black") },
Parameter { name: "diffuse"; value: Qt.rgba(211, 211, 211, 1) },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 0 }
]
Expand Down Expand Up @@ -76,7 +76,9 @@ Entity
ObjectPicker
{
id: groundPicker
onClicked: contextManager.setPositionPickPoint(pick.worldIntersection)
onClicked: function(pick) {
contextManager.setPositionPickPoint(pick.worldIntersection)
}
}

components: [
Expand All @@ -98,7 +100,9 @@ Entity
ObjectPicker
{
id: leftPicker
onClicked: contextManager.setPositionPickPoint(pick.worldIntersection)
onClicked: function (pick) {
contextManager.setPositionPickPoint(pick.worldIntersection)
}
}

components: [
Expand All @@ -119,7 +123,9 @@ Entity
ObjectPicker
{
id: rightPicker
onClicked: contextManager.setPositionPickPoint(pick.worldIntersection)
onClicked: function (pick) {
contextManager.setPositionPickPoint(pick.worldIntersection)
}
}

components: [
Expand All @@ -140,7 +146,9 @@ Entity
ObjectPicker
{
id: backPicker
onClicked: contextManager.setPositionPickPoint(pick.worldIntersection)
onClicked: function (pick) {
contextManager.setPositionPickPoint(pick.worldIntersection)
}
}

components: [
Expand Down
8 changes: 5 additions & 3 deletions qmlui/qml/fixturesfunctions/3DView/StageRock.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ Entity
effect: stage.effect

parameters: [
Parameter { name: "diffuse"; value: Qt.color("lightgray") },
Parameter { name: "specular"; value: Qt.color("black") },
Parameter { name: "diffuse"; value: Qt.rgba(211, 211, 211, 1) },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 0 }
]
Expand Down Expand Up @@ -203,7 +203,9 @@ Entity
ObjectPicker
{
id: stagePicker
onClicked: contextManager.setPositionPickPoint(pick.worldIntersection)
onClicked: function (pick) {
contextManager.setPositionPickPoint(pick.worldIntersection)
}
}

components: [
Expand Down
4 changes: 2 additions & 2 deletions qmlui/qml/fixturesfunctions/3DView/StageSimple.qml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Entity
{
effect: stage.effect
parameters: [
Parameter { name: "diffuse"; value: Qt.color("lightgray") },
Parameter { name: "specular"; value: Qt.color("black") },
Parameter { name: "diffuse"; value: Qt.rgba(211, 211, 211, 1) },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 0 }
]
Expand Down
8 changes: 5 additions & 3 deletions qmlui/qml/fixturesfunctions/3DView/StageTheatre.qml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Entity
{
effect: stage.effect
parameters: [
Parameter { name: "diffuse"; value: Qt.color("lightgray") },
Parameter { name: "specular"; value: Qt.color("black") },
Parameter { name: "diffuse"; value: Qt.rgba(211, 211, 211, 1) },
Parameter { name: "specular"; value: Qt.rgba(0, 0, 0, 1) },
Parameter { name: "shininess"; value: 1.0 },
Parameter { name: "bloom"; value: 0 }
]
Expand Down Expand Up @@ -167,7 +167,9 @@ Entity
ObjectPicker
{
id: stagePicker
onClicked: contextManager.setPositionPickPoint(pick.worldIntersection)
onClicked: function (pick) {
contextManager.setPositionPickPoint(pick.worldIntersection)
}
}

components: [
Expand Down
6 changes: 3 additions & 3 deletions qmlui/qml/fixturesfunctions/3DView/UpsampleFilter.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
limitations under the License.
*/

import Qt3D.Core
import Qt3D.Render
import QtQuick
import Qt3D.Core 2.15
import Qt3D.Render 2.15
import QtQuick 2.15

TechniqueFilter
{
Expand Down
4 changes: 2 additions & 2 deletions qmlui/qml/fixturesfunctions/RightPanel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import QtQuick.Layouts 1.0
import QtQuick.Dialogs

import org.qlcplus.classes 1.0

import "."

SidePanel
Expand Down Expand Up @@ -102,8 +103,7 @@ SidePanel
animatePanel(true)
}

onContentLoaded:
{
onContentLoaded: function(item, ID) {
if (item.hasOwnProperty("functionID"))
item.functionID = itemID
}
Expand Down
4 changes: 3 additions & 1 deletion qmlui/qml/fixturesfunctions/SceneEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@ Rectangle
id: toolbar
visible: !boundToSequence
text: sceneEditor ? sceneEditor.functionName : ""
onTextChanged: sceneEditor.functionName = text
onTextChanged: function(text) {
sceneEditor.functionName = text
}

onBackClicked:
{
Expand Down

0 comments on commit 5383ccd

Please sign in to comment.