[Solved]Crash application with ButtonStyle QtQuickControls
-
[quote author="onek24" date="1394105763"]
@text: qsTr("A button")@
[/quote]
don't work
This button work without text =(
!http://puu.sh/7kWuG.jpg(stylebut)! -
Well i was like 99% sure that the text is the problem due to the fact that it crashes in msvcrt. qStr() was a typo, it is false and has to be qsTr().
I'll see what i can find, give me a second please.--Attach--
Could you please try the text with an empty string?:
@text: ""
text: qsTr("")@ -
Yes that happens because of:
bq. If strCharSet points to a string of zero length, the function returns string.
Reference: "strstr":http://msdn.microsoft.com/en-us/library/aa273008(v=vs.60).aspxIt looks like in line 0x76d2d88b it nulls al and tries to copy it(null) into edi in line 0x76d2d89f. Maybe the nulling happens because the stylesheet requires a own Text for it so your text moves into no Text or null. Could you please try this workaround:
@ Button {
style: ButtonStyle {
background: Rectangle {
implicitWidth: 100
implicitHeight: 25
border.width: control.activeFocus ? 2 : 1
border.color: "#888"
radius: 4
gradient: Gradient {
GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" }
GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" }
}
Text {
text: "A button"
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
}@
or this one:
@ Button {
style: ButtonStyle {
background: Rectangle {
implicitWidth: 100
implicitHeight: 25
border.width: control.activeFocus ? 2 : 1
border.color: "#888"
radius: 4
gradient: Gradient {
GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" }
GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" }
}
}
}
Text {
text: "A button"
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}@ -
[quote author="onek24" date="1394108948"]
@Button {
style: ButtonStyle {
background: Rectangle {
implicitWidth: 100
implicitHeight: 25
border.width: control.activeFocus ? 2 : 1
border.color: "#888"
radius: 4
gradient: Gradient {
GradientStop { position: 0 ; color: control.pressed ? "#ccc" : "#eee" }
GradientStop { position: 1 ; color: control.pressed ? "#aaa" : "#ccc" }
}
Text {
text: "A button"
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
}@
[/quote]Of course its work, but... its like hack :D. Anyway thanks. I think its bug.
-
[quote author="Nexelen" date="1394110035"]
Of course its work, but... its like hack :D. Anyway thanks. I think its bug. [/quote]
Well it's the only solution/workaround i know. Also its not a hack, it's an improvement because you can format the text further, like with font.pixelsize: and so on. -
[quote author="onek24" date="1394108948"]
It looks like in line 0x76d2d88b it nulls al and tries to copy it(null) into edi in line 0x76d2d89f. Maybe the nulling happens because the stylesheet requires a own Text for it so your text moves into no Text or null. [/quote]I dont understand why it use library for 64-bit application... For 32-bit library in forlder System32.
-
You're welcome, glad i could help you with that. :)
You could report this bug to "Bugreports":https://bugreports.qt-project.org/secure/Dashboard.jspa . Maybe it'll help you or other people.