go-qml / qml

QML support for the Go language
Other
1.96k stars 189 forks source link

Problem with native appearance #50

Closed sshikaree closed 10 years ago

sshikaree commented 10 years ago

Hi! I've got a problem in Ubuntu 13.10. When i preview UI with qmlscene it looks fine - 2014-03-16 22 27 55 But when i build application with go-qml it looks strange - 2014-03-16 22 30 39

Druage commented 10 years ago

Are you using QGuiApplication instead of QApplication? Look here http://qt-project.org/doc/qt-5/qtquickcontrols-overview.html I was having the same problem.

sshikaree commented 10 years ago

Hmm.. But I don't touch C++ at all. Just opening qml file with Go application.

Druage commented 10 years ago

Is this just a QML file without any backend golang code? If you post the results of your main function, I could solve this for ya.

sshikaree commented 10 years ago

Druage, thanks for helping! Here is simplified example - https://gist.github.com/sshikaree/536cb210c4be4aceead4 . And how it looks in QtCreator: 2014-03-19 08 59 58 and built with go-qml: 2014-03-19 08 59 08

Druage commented 10 years ago

Hmm I was reading the source code and I did not I could only find an instance in the capi where the developer uses QGuiApplication instead of QApplication in the newGuiApplication function. I'm not entirely sure, but this "could" be the issue. The developer would be able to help you more. You would need the QApplication instance because using QApplication applies widget styling. Sorry I couldn't fix the issue for you.

niemeyer commented 10 years ago

Thanks a lot for your help, @Druage. You've probably nailed down the issue. I'll see if using QApplication there solves the problem.

niemeyer commented 10 years ago

It does solve the problem. Thanks for the report @sshikaree, and for pointing out the issue @Druage.

Druage commented 10 years ago

@niemeyer Glad I could be of help and keep up the great work.

sshikaree commented 10 years ago

Great! :-)