Qt DevNet Web Service API

Page  
2

April 11, 2011

Alexandra Alexandra
Hobby Entomologist
607 posts

Very nice! I like it. :)

 Signature 

*THE CAKE IS A LIE*
Web Community Manager - Qt Development Frameworks

April 11, 2011

Andre Andre
Robot Herder
6393 posts

I have so far not been able to compile it yet. QJson is failing to compile at this moment… :-(

April 11, 2011

ZapB ZapB
Ant Farmer
1424 posts

Thank you. I’ll keep adding little bits to it and post back again when it is usable for a little more than looking at your own points ;-)

@Andre, I am using qjson-0.7.1 which I installed via portage. I have not tried building it by hand.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

April 11, 2011

Andre Andre
Robot Herder
6393 posts

Managed to build qjson (from git), and with some adjustments to your code (in the .pro file and in the include of qjson you use), I even managed to build the app. Trying to run it instantly crashes though, so I’ll try for a bit more…

April 11, 2011

ZapB ZapB
Ant Farmer
1424 posts

Impressive! ;-)

I’ve not tried at all on Windows yet. I’ll see if I can get it workign there tonight. I do not know of any platform-specific things though. Maybe I forgot to initialise a pointer in a ctor or something.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

April 11, 2011

Andre Andre
Robot Herder
6393 posts

OK, got it working, it was a simple matter of the executable not being able to find the qjson library when running. Now all I have to do is figure out what the app actually does :-)

April 11, 2011

Andre Andre
Robot Herder
6393 posts

The changes I had to make to make it compile for me:

In qtdevnet.pro, changed the path handling a bit

  1. INCLUDEPATH += $$(QJSONROOT)/src
  2. LIBS += -L$$(QJSONROOT)/lib -lqjson

In profile.cpp, I changed the include for qjson’s parser.h:

  1. #include <parser.h>

This way, I can actually make QJSONROOT point to where I downloaded and build QJson.

April 11, 2011

ZapB ZapB
Ant Farmer
1424 posts

The only thing you can do at present is to go to the “Application->Login…” and enter your QtDevNet credentials (not included support for OpenID yet) and it will login via QNAM (see the Authenticator class). One slight mystery I have not had time to look at yet is why QUrl::toPercentEncoding() will not encode a “/” character. I have to manually replace that with / later. I’ll step into the Qt code later and take a look.

If that works it will start a timer inside the Profile class that polls QtDN for your profile stats once every 60 seconds. The response is parsed using qjson and the properties updated accordingly.

The Profile class is exposed to the QML root context and the qml scene just binds to the properties of it (and one property from the autheticator object which determines if the qml items are visible or not).

It’s just a starter for 10/proof of concept at this stage. Nothing fancy. Having said that it will be simple to extend to cover other features that could be supported by a web API.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

April 11, 2011

ZapB ZapB
Ant Farmer
1424 posts

Thanks for the mods. I’ll patch my source for win support with it.

Edit: I have applied the patch this in svn now.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

April 22, 2011

ZapB ZapB
Ant Farmer
1424 posts

Just a small update. The login dialog is now handled via QML too (the actual network stuff is still in C++ of course). It’s in svn if anybody wants to grab the update. Here’s a screenie (no bling-tastic animations yet though).

QML Login Screen

ps I hope you don’t mind me grabbing artistic assets from the site for use in this client. ;-)

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

April 23, 2011

mariusg mariusg
Ant Farmer
1099 posts

Sweet ZapB, I’ll try out the updates once I get back from the Easter break and to a proper pc :)

 Signature 

Project Manager - Qt Development Frameworks

April 23, 2011

ZapB ZapB
Ant Farmer
1424 posts

OK another hour of playing with QML and the login page now behaves more like you would expect, including things like:

  1. Enabling/disabling login button based on user name and password fields being populated
  2. Visible feedback on login button status (enabled/disabled has focus/no focus)
  3. Tab key navigation between elements

Plus it has some bling now – you’ll have to run it to see it. ;-)

My opinion of QML so far is that it is very nice, but it will be a whole let better once we have one or more decent sets of components to use (desktop components would be really cool – and yes I have seen the blog with them in). It is instructional to develop your own from first principals but requires lots of digging in the docs for QML noobs like me.

Next step is to see if I can get this converted into a mobile app and try in on my N8. Now where did I put that SDK

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

April 24, 2011

ZapB ZapB
Ant Farmer
1424 posts

Sweet! I just managed to get this running on my N8. It’s very awesome to see the same QML animations running on the phone – smoothly too! :D

It took a little bit of trial and error and I am still not quite sure what made it start to deploy properly and I can still not get qjson to build for the qt-simulator target. I’ll write up some instructions on how to do this and commit my mods to the svn repo shortly.

Edit 1: Code to allow this to be built and deployed for Symbian is now in svn.

Edit 2: Figured out what was stopping me from running this on the device originally. I kept getting the “General OS Error” when trying to deploy and run my app. It turns out that it was because of insufficient capabilities in the qjson lib on which my app depends. By changing the TARGET.CAPABILITY line in qjson/src/src.pro to:

  1. TARGET.CAPABILITY = NetworkServices ReadDeviceData WriteDeviceData

allows my app to load the qjson dll on the device (since my app needs access to the Internet). Read about capabilities [wiki.forum.nokia.com] for more info on this.

I have concerns about how this may scale if several apps want to use the same dll but with different capabilities but that’s something to worry about for another day.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

May 2, 2011

ZapB ZapB
Ant Farmer
1424 posts

Marius, I wonder if you could help me with something please? I am trying to add avatar support to my little QtDN client and until the API supports returning the avatar image URL I thought I would take the opportunity to try using QXmlQuery to parse the xhtml of the front page of QtDN to extract the gravatar source url.

This is all going fine until I get this error from QXmlQuery:

  1. Error FODC0002 in tag:trolltech.com,2007:QtXmlPatterns:QIODeviceVariable:inputDocument, at line 74, column 32: Expected '=', but got '>'.

Looking at the page source I see that line 74 is:

  1. <div class="wrapper" {set_mode}>

which of course is not valid xhtml (or xml) as advertised by the doctype. I can work around this by stripping this out before I pass it onto the QXmlQuery of course but would you like me to report this as a bug? Or even better is there an easy fix you can apply to get rid of the above non-valid entry please?

Many thanks.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

May 2, 2011

ZapB ZapB
Ant Farmer
1424 posts

Another piece of invalid xml is found on line 190:

  1. <div class="item"><a href="http://info.arcada.fi/sv/qtquick">http://www.arcada.fi/sites/www.arcada.fi/themes/arcada/media/separate_elements/main_navigation/logo.png</a></div>

The error is:

  1. Error FODC0002 in tag:trolltech.com,2007:QtXmlPatterns:QIODeviceVariable:inputDocument, at line 190, column 180: Opening and ending tag mismatch.

The img element is missing the empty tag specifier – ie it should have a “/” at the end of the img tag.

Edit: This input tag on line 532 is also missing a closing “/”

  1. <input type="text" name="tag_search" id="tag_search_input" value="">

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

Page  
2

  ‹‹ [Suggestion] Remove Quota for wiki edits      Qt Ambassador Badge ››

You must log in to post a reply. Not a member yet? Register here!