![]() |
2011-12-27
, 12:16
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#2
|
3) I'm also trying to create a QAbstractListModel for my QML app to use to increase performance and also to follow the MVC design pattern, however I am having trouble understanding the following classes:
http://doc.qt.nokia.com/4.7-snapshot...itemmodel.html
specifically the model.cpp file.
Is the very first method a constructor?
: m_type(type), m_size(size)
And how come there are two thing inside the same file? Animal and AnimalModel? Are there two classes in the same file?
![]() |
2011-12-27
, 12:41
|
Posts: 642 |
Thanked: 486 times |
Joined on Aug 2008
|
#3
|
: m_type(type), m_size(size)
![]() |
2011-12-27
, 13:26
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#4
|
Animal::Animal(const QString &type, const QString &size) { m_type = type; m_size = size; }
![]() |
2011-12-27
, 13:35
|
Posts: 642 |
Thanked: 486 times |
Joined on Aug 2008
|
#5
|
![]() |
2011-12-27
, 13:48
|
|
Posts: 1,637 |
Thanked: 4,424 times |
Joined on Apr 2009
@ Germany
|
#6
|
Ah so what you are saying is initializing member variables like the way it is done in java means we are initializing them twice - first they are initialized to the default values and then set to the values we are passing in? And thus this is a waste of resources? - This makes sense?
I think I'll probably stick to QDomDocument - and do some xpath like expressions with it. The licensing thing might be tricky - but the QJSON is open source and I'm not making any changes to it so I may be fine? Some research needed on that anyway.
Thank you for your help! Very very much appreciated!!!!
![]() |
2011-12-27
, 14:35
|
|
Posts: 2,448 |
Thanked: 9,523 times |
Joined on Aug 2010
@ Wigan, UK
|
#7
|
![]() |
2011-12-28
, 15:04
|
Posts: 642 |
Thanked: 486 times |
Joined on Aug 2008
|
#8
|
Currently in the mix of developing a new app for the Nokia N9 (and N900) I would like to tap into the vast array of developers here to provide me with some pointers on the following points:
1) as part of my application I need to interact with a web service, my options are to use QDomDocument or QJSON.
2) How do I use QJSON? I come from a Java background so I'm not sure how I would need to include it into my application? I know with Java I just drop the jar file and add it to the class path and thats it? Do I need a .so file I can drop into my QML app? If so how would I add this to the classpath?
3) I'm also trying to create a QAbstractListModel for my QML app to use to increase performance and also to follow the MVC design pattern, however I am having trouble understanding the following classes:
http://doc.qt.nokia.com/4.7-snapshot...itemmodel.html
specifically the model.cpp file.
Is the very first method a constructor? And what it m_type/m_size? If it is a constructor it does look very strange? And how come there are two thing inside the same file? Animal and AnimalModel? Are there two classes in the same file?