Hello All,
I have to port code from 4.8 using QtDesktop to 5.3. After compile and run I get an error:
StyleItem is not a type
This is the code:
import QtQuick 1.1
BaseSlider{
id: slider
property alias tooltip: toolTip.text
groove: StyleItem {
anchors.fill:parent
elementType: "slider"
sunken: pressed
maximum: slider.maximumValue*100
minimum: slider.minimumValue*100
step: slider.stepSize*100
value: slider.value*100
horizontal: slider.orientation == Qt.Horizontal
enabled: slider.enabled
hasFocus: slider.focus
}
// This is margins for the slider length. They should be equal around the half of the handle object width.
leftMargin: 11
rightMargin: 11
handle: handleImg
hoverEnabled: false;
Component {
id: handleImg
Image {
id: rect
property string enabledStateImgSrc : mouseArea.containsMouse ? "images/PlayerSliderBtns_Hover.png" : "images/PlayerSliderBtns_ActiveMC.png";
source: enabled ? enabledStateImgSrc : "images/PlayerSliderBtn.png";
MouseArea {
id: mouseArea
hoverEnabled: true
anchors.fill: parent
onEntered: { showTimer.start(); }
onExited: { toolTip.shown = false; showTimer.stop(); }
}
Timer {
id: showTimer
interval: 600
onTriggered: toolTip.shown = true;
}
}
}
ToolTip{
id: toolTip
offsetX: width/3
offsetY: 1.5*height
}
valueIndicator: null
}
import QtQuick 1.1
BaseSlider{
id: slider
property alias tooltip: toolTip.text
groove: StyleItem {
anchors.fill:parent
elementType: "slider"
sunken: pressed
maximum: slider.maximumValue*100
minimum: slider.minimumValue*100
step: slider.stepSize*100
value: slider.value*100
horizontal: slider.orientation == Qt.Horizontal
enabled: slider.enabled
hasFocus: slider.focus
}
// This is margins for the slider length. They should be equal around the half of the handle object width.
leftMargin: 11
rightMargin: 11
handle: handleImg
hoverEnabled: false;
Component {
id: handleImg
Image {
id: rect
property string enabledStateImgSrc : mouseArea.containsMouse ? "images/PlayerSliderBtns_Hover.png" : "images/PlayerSliderBtns_ActiveMC.png";
source: enabled ? enabledStateImgSrc : "images/PlayerSliderBtn.png";
MouseArea {
id: mouseArea
hoverEnabled: true
anchors.fill: parent
onEntered: { showTimer.start(); }
onExited: { toolTip.shown = false; showTimer.stop(); }
}
Timer {
id: showTimer
interval: 600
onTriggered: toolTip.shown = true;
}
}
}
ToolTip{
id: toolTip
offsetX: width/3
offsetY: 1.5*height
}
valueIndicator: null
}
To copy to clipboard, switch view to plain text mode
Any suggestion what is missing here?
Thanks in advance
Markus
Bookmarks