Me and Qt Quick / QML

symbiatch - 19.03.2011 14.20 - mobiili ohjelmointi 

Oh, just wanted to let you know something: I kinda like Qt Quick / QML. It's quite nifty for UIs (naturally since it's copying WPF's XAML ;). It didn't take that long to get into the basic notation, get lists running, some animations etc. Pretty good.

I still have a problem with Qt Creator (in addition to the one I already wrote about). I'm not used to it. It doesn't function like I'm used to. See what I did there? I'm not blaming the IDE, it doesn't have to be exactly like Visual Studio. But it would help ;)

What I don't like is that there are no tabs in the editor. There is a listbox that shows the opened files. There's also a subwindow that shows them. Not the way I like it.

Also I don't like the find functionality. Ctrl-F shows it, it finds stuff, but when I press Esc, it still stays on the screen. And the found words are highlighted. I don't want that. I have to close it every time I use it :(

Also: a kingdom for automatic generation of property methods (AGGGGH!) and why can't I use QList with ListView? All I get is errors about not finding the properties if I don't use QList. And I want to use real types!

I would be happiest with Visual Studio. I had the add-in version 1.1.7. It shows up in VS 2008 and 2010 that I have installed. It kinda works in 2008 but not in 2010. It loads the .pro file and makes a project out of it in 2008, but in 2010 it can't. The project file version is off. Grh. Also in 2008 QML is nowhere to be found. And it doesn't seem to support anything else than desktop. Grhfmggh.

Oh, 1.1.8 is available. Let's install that. Or rather, uninstall the previous one, then install this one. They're still using the crappy Nullsoft installer and not MSI packages. Oh you poor devil children :P

Ok, 1.1.8 won't work either. Why does it say it supports 2010 if it clearly doesn't? Or does it allow creating new projects, just not converting .pros? Gah. 2008 time again...

In 2008 it just gave an error. The system cannot find the file specified. Care to elaborate on which file? No. I don't want to. Naturally. To the command line...

Visual Studio 2010 command line. Ran the command (which the add-in in 2008 kindly did show me), got warnings about Unknown version (160) of MSVC detected for .vcproj. Unknown? You said this add-in was for 2010?

Visual Studio 2008 command line. No errors, warnings about deprecated unescaped backslashes (it's always nice when Nokia ships things that generate warnings). But I got the .vcproj file. Still no QML files in the project, so clearly it doesn't support it. Build and all I get is ERROR PRJ0019: A tool returned an error code from "RCC Project.qrc". Care to elaborate on what error code and which tool? No. I don't want to.

What this means is that by "upgrading" to VS add-in 1.1.8 I lost the ability to even import .pro files. It worked in 1.1.7 a few minutes ago. Not anymore. Oh yeah, I've got the source, I could fix it. But it's not my place to fix it.

So, it's back to Qt Creator. Clearly the Visual Studio add-in is there just to allow people to do something, but not to allow people to actually develop stuff with it. At least if you want to use QML or target mobile devices. That's nice, Nokia. Very nice. Goes so well together with your decision previously to can Carbide.vs, which was the only usable IDE for Symbian development in my book. Carbide.c++ never got to the stage where it was really usable, mainly because of Eclipse.

Disclaimer: yes, I do know that Trolltech did the VS add-ins and it's not Nokia's fault entirely. But hey, they could've at least told the Qt developers that it would be nice if people could actually use QML in Visual Studio (without manual work) and target mobile devices. Even if it means manually making SIS files etc, but just let me test stuff in the simulator...


Qt Creator is Broken, Horribly

symbiatch - 19.03.2011 09.51 - mobiili ohjelmointi 

Better to write a separate story about this problem I ran into. It's a big one, really. It might not affect that many people, but it did me. And it's a possibility for a disaster.

As many people know, the Symbian SDK is still in the dark ages. It can't handle spaces in path names. Stupid. And since I'm not an idiot, I don't want to have all my projects in some C:\mystuff. I want to have them where they belong and that is under my profile directory. Which, of course, has spaces in the path.

Tried to compile a Qt app. Didn't work, the spaces. Ok. Copied the project to c:\nokiaisstupid\project\ (not really, but I'm pissed off right now). Compiled, it works. Nice.

Opened a QML file from the Qt Creator. Edited it. Ran in the simulator. Nothing changed. What the heck? Changed something else. Nothing. Strange.

Changed the original file. Changes were visible. Umm, what? Qt Creator opens files from the new location, but builds them from the old! That's nice. And no, clean all doesn't fix it.

Let's remove the original file altogether. Ran just fine. Edited the new file. Still uses the old file. Which doesn't even exist anymore! So it caches stuff somewhere like an idiot?

Clean all. Rebuild all. Still using the old version. Which still doesn't exist.

Search all files in the project directory for the old path. Not found. Search all files in the project directory for main.qml. All point to the new path.

Close the simulator. Close Qt Creator. Still the old version!

So, where the hell is this old version cached? Why does Qt Creator still use it, even though the path is not in the project files, the file doesn't exist etc?

Oh well, let's build a deployment SIS for the device. Maybe it'll notice that something's missing then. Nope! 329 warnings from the Qt SDK itself, none from my code. No errors. SIS created.

Install SIS on device. Oh, right. I can't install the smart installer version, since it doesn't seem to work on E7. Let's send the stupid installer version then. Wow! It uses the new version. As it should.

So, I'm stuck in a situation where Qt Creator doesn't realize that it should use the new file. It keeps its old version somewhere deep inside the simulator and doesn't give up on it.

How about it, Nokia? A quick fix for this in order? Or should I just never create projects in one place and then move them? And recreate the whole project that's currently not working?

The root cause for all this is the stupidity that is simulator work: there is a separate build folder for simulator stuff. Which has a separate makefile. And the build directory is per user. And the path stayed the same. And the makefile has a relative path (as it should). So it just kept on copying the wrong files.

So the fix as I see it: don't use any stupid separate folder for the simulator! Everything I do on a project X should be either inside the project X's folder or somewhere in simulator's/Qt Creator's folder structure. No folders should be created anywhere else. It's just stupid. Oh, right. You can't do that. Since Qmake does not support build directories below the source directory. Cool. But it still builds this one quite nicely without problems when I put it under the source folder. Maybe I'm just lucky.

Or at least use relative paths or give an error message. Yes, there is a warning, but it doesn't say why or what things will be caused by not fixing paths by hand.

So there. I'm sure this will go under "a minor thing that nobody notices since they'll never move files around."

Recap: when Qt Creator creates makefiles for building, please use absolute paths. Also, please use a folder under ProgramData or some other reasonable place. Don't clutter my project folder with Project-build-desktop, Project-build-Symbian, Project-build-maemo etc. They're not my projects. They're just build results. Which are NOT laid out like this in any other IDE that I know of.

Please? Pretty please?


Qt 4.7.2, E7 and Stuff

symbiatch - 18.03.2011 23.52 - mobiili ohjelmointi 

Now it's naturally time to try to get my Qt Quick application into the E7 for testing. Updated Qt to 4.7.2 (it's nice that it's only some gigabytes when updating...). Qt Creator up and added device configuration. Build, get a warning about spaces in paths and build bar goes red. Nothing happens. For some time. Change view to Compile Output and there's the typical error about missing path, path being cut at space. Great.

So there are two problems here, still: Symbian toolchains don't handle spaces in paths and Qt Creator can't even show errors in the Build Issues view when building for Symbian.

Hey, it's 2011. When will you guys understand that? It's NOT ok to install your stuff into the root folder. Not even if you can't make stuff work with spaces. Because the correct thing to do is fix it so that it does.

So now I have to save my Qt projects somewhere else than all other projects I do, just because Nokia can't get SDKs done right? That's sooo cool.

Oh well. Let's see if I can at least get the device connected to Qt Creator and get stuff in it. USB connected, drivers installing... And no, I will NOT install Ovi Suite to this machine!

CODA installed on device. Reboot. USB cable in, device says that debug services are available. Qt Creator won't show the device in project settings. I didn't expect anything else...

Setting Up Development Environment for Symbian has been read and done. But noo, naturally it won't work. So what's next? Maybe it won't work with CODA, you have to have App Trk? Though the documentation doesn't say so. Let's try that...

Nope. Not available in Qt Creator still...

Well, let's just make a SIS out of it and send it to the device without Qt Creator. But, how? Build, done. No SIS file. Deploy? No, that would require a connection to the device. Which I don't have. So...? I'm a total newbie with Qt Creator and it clearly isn't as simple as it could be. It seems that I have to create a new build step that runs make sis. Manual work is always great.

But that requires manual installation of Qt on the device. Not nice. So I have to use make installer_sis. Now I get a package that doesn't complain. Testing on device...

Installing... This'n'that... Error: device not supported. Oh really? Why not? E7 isn't supported? That's not going to help. Let's try installing the sis package from the SDK manually. As I said, I do like manual work when developing. It'd be much better for the end users, too, if they had to install Qt manually, don't you say?

Installing... Installation complete! So, yes, E7 is supported. Just not by the smart installer. Ok, this whole thing is beta (even by name, I think it will be beta quality for a long time still), maybe they'll fix it soon.

Try installing the smart version again. No go, not supported. Install without the "smart installer" and it went through. Not so smart after all.

But woohoo, it runs! So, all I have to do now is send the SIS file manually every time I build, since the connection from Qt Creator to the device won't work. And I can't use the "smart installer" since it won't work with an actual device.

So, anyone more familiar with Qt Creator and development who can tell me what I'm doing wrong? It must be me doing things wrong, it can't really be that these things don't work, can it?

Also as a side rant: why the heck hasn't Nokia implemented a better support for Symbian in Qt Creator? "Oh, you can use the testing UIDs when developing and when you want to send the app to Symbian Signed, you must remember to change the UID by hand to another value." Umm, hello? Isn't this supposed to be done by the IDE, not by the developer? Ah, sorry, forgot: manual work is fun. And not error prone.

And it's nice that compiling Qt application for Symbian causes hundreds of warnings. No, not a single one from my code. They're all from the Qt code! Developer 101 time: warnings are bad. You shouldn't get any when compiling. Even if they're "only" warnings. Clearly Nokia doesn't know this.

What the heck?!? When I copied the project to another location (because the Symbian SDK can't handle spaces), cleaned everything many times, but STILL the Qt Creator loads QML files from the wrong place! That is, when I double-click a file to open it in editor, it loads it from newpath\test.qml. When I build the app (for the simulator, at least), it loads it from oldpath\test.qml. Which obviously doesn't work. Separate path handling for project viewing and building? Hello? Idiots anyone? Sheesh!

Kommentoi  |  Omat jutut  |  Muiden jutut  |  Kategoriat  |   kirjaudu