On 04/04/2014 11:11 AM, Gustavo Niemeyer wrote:
> On Fri, Apr 4, 2014 at 12:54 AM, David Marceau
> <
uticdmar...@gmail.com> wrote:
>> WARNING: THIS IS A RANT
>
> It doesn't feel like a rant. Seems just like good feedback about your
> experience, which is welcome.
>
> (...)
>> The hold-up: go-qml examples are not as comprehensive as qt's toolkit
>> examples/demos(c++,java) or gtk's examples/demos(c++, perl, python,
>> ada). There is a video of gopher running on ubuntu touch, but there is
>> not one ubuntu touch example specifically provided within go-qml
>> examples. They are all desktop only.
>
> Point taken. As we talked before, I do have to go back and work on the
> phone again, as the platform is in development and people have been
> fiddling significantly with it.
>
>> With respect to c++/qtandroid, c++/qt, or c++/gtk or golang/gtk,
>> right now c++/gtk(gtkmm) and golang/gtk(go-gtk) are easier to use.
>> Golang/gtk is most fun to use. The reason: more examples to refer to
>> and it took me 3 days to get what I wanted done with it.
>
> I'm working on Go QML because I honestly think it's a more convenient
> way to build graphic applications, and for my taste we lack good
> alternatives in Go at the moment. With that said, this is not a fight.
Agreed this is far from a fight. It's me ranting about QML itself being
a limited vertical slice subset of the Qt C++ API horizontal breadth.
In all honesty, QML is still too immature for me. As a result, so is
go-qml.
> If go-gtk or any other alternative suits your problem or understanding
> better, you should feel free to use it. There's no need to keep
> bringing a list of options up throughout the conversation.
It's important to give a reference point from other toolkits when
discussing what the QML api lacks. Otherwise you won't have a clear idea
where I am going with this. I really don't want you to waste any effort
implying what I am wishing for when there is a clear example in some
other toolkit using another language that can clearly be used as an
inspiration.
>> I'm still struggling with QML interaction with go and the mailing-list
>> replies are sometimes clear with provided example code and sometimes are
>> foggy with simple URL references to unclear api documentation. I am not
>> criticizing the awesome go-qml work and demo videos. I am saying go-qml
>> isn't as accessible to go-qml wannabe-users to use and go-qml's
>> popularity will only grow if more examples are provided.
>
> Agreed, we need more examples, and I've been adding new ones fairly
> regularly. This is an area where contributions are also easy to
> provide, and welcome. We should just keep examples simple and focused,
> rather than big and convoluted.
>
> (...)
>> know go-qml stuff and honestly qml-only samples don't apply since that
>> isn't the problem space I want to attack. I already have a qml-only gui
> (...)
>> The only curve-ball here is golang-specific and I don't have anything to
>
> The QML language plays a relevant role on any application developed
> with Go QML, so refusing to "attack that problem space" is simply not
> an option. That internal conflict might explain part of the struggle
> there. Note that the very thread we're discussing under is about
> incorrect syntax in the QML file, which is completely unrelated to Go.
This is where I disagree. QML itself is certainly not intuitive and
the fact that I simply can't set a golang registered variable within a
button callback as I do gtk or c++ or java certainly substantiates that
fact. I am not impressed with having to work around that by passing the
parent object to a golang function in order to make that happen.
It doesn't feel right and it seems like a huge workaround to comply with
QML. MORE LINES OF CODE.
>> I think what I am asking for is an example like customtype, but
>> custom-type is non-gui'ish. At the same time all the other examples
>> involves graphics drawing or opengl, which isn't my target either. How
>
> I don't understand what you want here. There are two kinds of QML
> types that may be registered via Go: those that paint, and those that
> do not paint. We have examples for both: the customtype example does
> not paint, the painting and the gopher examples paint. Those that
> paint depend on OpenGL, and those that do not are of course not
> GUI-ish. So what are you looking for?
Ok. Here is what I am looking for(my example request):
-a simple Ubuntu Touch Mainview with a two fields: textfield and a
button. When you click the button, you send the textfield.text to a
golang Gotype.Text.
-That's not just non-gui like customtype, but it resembles it.
-That's not opengl, particle, painting at all because I am just using
the default 2d painting window stuff.
-That's not just qmlscene.go, but it does resemble it because my
attached needs it in order to do the necessary pre-qml housekeeping in
the qml engine, load up the qml file, and do the finalizing housekeeping
in the qml engine when closing.
> Note as well that you don't have to register a type to be able to use
> values from it from QML, unlike you implied in a response to Mark.
> Method parameters, results, etc, will all just work without any
> registration.
>
>> about a reference point:
>>
http://qt-project.org/doc/qt-4.8/dialogs-trivialwizard.html
>>
http://learngtk.org/pygtk-tutorial/assistant.html
>> I would prefer something like the above qt/gtk wizard examples, but
>> showing the qml gui fields contents getting sent down to the golang
>> variables for further processing.
>
> Sorry, but we don't have a wizard or assistant for Go yet, and I don't
> have the time to focus on that myself right now.
>
>>
http://qt-project.org/doc/qt-5/qtqml-syntax-objectattributes.html#signal-handler-attributes
>>
http://qt-project.org/doc/qt-5.0/qtqml/qtqml-javascript-dynamicobjectcreation.html
>>
>> Giving me these two urls didn't cut it unfortunately.
>> It currently seems like a lot of work just to extract a value from qml
>> and send it down to golang for further processing in the backend. I
>
> Sending data from QML to Go is trivial, and there are multiple ways to
> do it. For example, from customtype.qml:
>
> text: "Happy " + GoSingleton.event + ", Go!"
As you observed in my button callback, that is clearly not the case and
it gave an error as you know.
>
> from particle.qml:
>
> onReleased: ctrl.textReleased(parent)
As mentioned above, sending the parent object to a golang callback isn't
exactly what I was looking for either. I will try it.
> What takes a bit of time is when you want to understand how things
> work, such as the basic syntax of QML. It doesn't make sense to
> complain both that there's no documentation and then that reading the
> documentation takes time.
I am not gifted enough to quickly maintain/grasp golang bindings such as
yourself. I am trying to solve subject matter problem space on my own
free time. I am trying to distinguish go-qml from other languages and
their gui bindings.
If I take roughly 3 weeks of skimming over QML/go-qml and reflecting
over it and it's still foggy, then a rant is perhaps not such a bad idea
when you thought a task with it would take 2 days. The subtlety is
there and the popularity of QML and go-qml won't grow until those
subtleties are dealt with.
My first impression with the gopher demo was WOW! The loadup time was
almost instantaneous. The QML files being loaded happen quickly enough.
qt/c++ and gtk/c++ are both instantaneous, but they suffer from a longer
compile time. If go-qml gets it right, it will seriously reduce the
build cycle. That's why I am placing more consideration on go-qml and
ranting about all this.