Qt Quick best practices wiki page
Page |
1 |
Couldn’t find a Qt Quick best practices and guidelines page, along with the DOs and DONTs. So thought of creating one here [developer.qt.nokia.com]
This is just a place holder and have put in a few points, and of course some obvious ones. Will add more to it soon.
Feel free to add your findings and help the wiki page grow.
18 replies
Looks good :-)
Maybe mandatory rules like uniqueness of the id property [doc.qt.nokia.com] could be separated. Are there already conventions about indentation and commenting style? Loking on the link above 4 spaces plus line end comments seems to be preferred.
BTW: is there a way to subscribe to wiki changes?
How about some DOs / DONTs for cross-platform QtQuick?
What about using fixed size width, height, x, y vs anchors/locations. Fixed sizes seem overused, even in the examples.
Also, if you don’t specify a font size, it could be anything it seems. Even if it looks fine on one platform, it be quite different on another unless you specify. Important to consider.
DONTs are a good idea i find. What about starting an own wiki page for it? I’ll help as I can.
I suggested the title Qt Quick Donts [developer.qt.nokia.com] on the best practices page.
Happy wikiing :)
So should the cross-platform (i.e. cross-resolution) DONTs go in there? You should always try to make your code cross-platform I think. Especially important to learn from the start. However, I’m not so sure on how important it is to make the QML rotatable.
It’s quite amazing when you do the right practices and your code works on devices you’ve never even seen before.
There was a nice app on Qt-Apps made in QML for Linux Desktop. Worked perfect on Symbian devices even though the developer had never used or seen one.
So should the cross-platform (i.e. cross-resolution) DONTs go in there? You should always try to make your code cross-platform I think. Especially important to learn from the start. However, I’m not so sure on how important it is to make the QML rotatable.
If it is actually possible to write platform dependend QML, then I think that it should be included (sorry I’m not an experienced QML developer, I tried hacking some examples up to now)
I find the idea of the reverse style so appealing. :)
I have often seen in code (for example the Twitter app in SDK), they use specific font sizes and widths.
I ran it on Windows, looks fine. Though, the app is clearly designed for a mobile device with its small space constraints. So I tried it on Symbian, hideous. I spent a day fixing it up and it looks great now.
It’s funny because they admit this in the code. I saw a comment that they should use anchors instead. Definitely wiki material.
You must log in to post a reply. Not a member yet? Register here!




