Issues porting from 4.8 -> 5.3 with QtDestkop
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:
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
}
Any suggestion what is missing here?
Thanks in advance
Markus
Re: Issues porting from 4.8 -> 5.3 with QtDestkop
Is there a specific reason that you are using QtQuick 1 and not QtQuick 2? Do you have Qt desktop components installed? Where is the import for them?
Re: Issues porting from 4.8 -> 5.3 with QtDestkop
I was reading here that Qt Desktop Components are now part of QtQuick.
There is no reason I am using QtQuick 1 and not QtQuick 2. The article did not mention I have to use 2.
I have never ported anything with QML so this is all new to me.
The original code before my 'port' looked like this:
Code:
import QtQuick 1.1
import QtDesktop 0.1 as Desktop
BaseSlider{
id: slider
groove: Desktop.StyleItem {
anchors.fill:parent
elementType: "slider"
...
Re: Issues porting from 4.8 -> 5.3 with QtDestkop
I have no idea what article you mean and no, Qt desktop components is not part of QtQuick now. It has been replaced by QtQuick controls which has a different api.
Re: Issues porting from 4.8 -> 5.3 with QtDestkop
OK Thanks that was a misunderstanding. I downloaded the Qt desktop components now but the 'make' step failed, producing this error :
./qtmenu.h:30:10: fatal error: 'QtGui/qmenu.h' file not found
What am I missing here?
Re: Issues porting from 4.8 -> 5.3 with QtDestkop
You cannot just build Qt Desktop Components for Qt5, they are not compatible. You'd have to port the plugin to Qt5 first (QMenu is now part of QtWidgets and not QtGui).