Doc: Replace Qt 5 QtGraphicalEffects code snippet with Qt 6 MultiEffect

Qt Graphical Effects was deprecated in Qt 6 and replaced with the
MultiEffect type. Fix code snippets in Qt 6 documentation to use the
MultiEffect QML type instead of the deprecated Qt Graphical Effects
type.

Fixes: QTBUG-119992
Change-Id: I27c11ed013880978656f86b6322bf3e4bfa18812
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit a95df6a234)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 134261baf9)
(cherry picked from commit 22b81f1bb8)
This commit is contained in:
Andreas Eliasson 2024-01-17 10:47:50 +01:00 committed by Qt Cherry-pick Bot
parent bc6bc514f0
commit 76b72cb1c7
1 changed files with 7 additions and 6 deletions

View File

@ -77,7 +77,7 @@
\code
// +Material/CustomButton.qml
import QtQuick
import QtGraphicalEffects
import QtQuick.Effects
import QtQuick.Controls
import QtQuick.Controls.Material
@ -93,11 +93,12 @@
radius: width / 2
layer.enabled: control.enabled
layer.effect: DropShadow {
verticalOffset: 1
color: Material.dropShadowColor
samples: control.pressed ? 20 : 10
spread: 0.5
layer.effect: MultiEffect {
shadowEnabled: true
shadowHorizontalOffset: 3
shadowVerticalOffset: 3
shadowColor: Material.dropShadowColor
shadowBlur: control.pressed ? 0.8 : 0.4
}
}
}