Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run go fmt on widgets/ #5

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ilius
Copy link

@ilius ilius commented Apr 1, 2023

Copy of therecipe#1287

@ilius
Copy link
Author

ilius commented Apr 1, 2023

Are you going to enable issues?

Also there are lot of references to https://github.com/StarAurryon/qt/

I have some more changes to make. (mostly bug fixes).
Should I add PR on develop branch?

@fluorohead
Copy link

Hello.
I think the same problem exists in your fork as in therecipe/qt :

func main() {
s := "\x89\x50\x4e\x47"
fmt.Println([]byte(s), "len:", len(s))
ba := core.NewQByteArray()
ba.Append6(s)
fmt.Println([]byte((nba.Data())), "len:", len(nba.Data()))
}

Output :
[137 80 78 71] len: 4
[239 191 189 80 78 71] len: 6

s - just a Go string, defined by hex symbols
ba - is a Qt bytearray, generated from s as an input data

Expecting the qbytearray data and length will be equal to s, but there's some undercover transformations.
I suppose golang or Qt converts [0] symbol 137 (\x89) to [239 191 189] (\xEFBFBD), because it's undefined symbol in UTF-8 and must be converted to so named "replacement character".

We don't need such transformation, because it breaks the qpixmap creation from qbytearray.
It'a pity the original therecipe/qt bindings for qbytearray can not work with []byte, only with string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants