PDA

View Full Version : QXListView - 'Active List' Demo



rickbsgu
1st February 2008, 21:19
Hi, all -

'QXListView' is what I call an 'active list view' - certain cells respond directly to clicks and look like system widgets - checkboxes, radiobuttons, etc.

For more information, you can see my blog entry here (http://technoblog.kis-systems.com/2008/02/01/qt-demo-qxlistview-active-list/) (Mac OS X/Win/Linux).

You can download the source code and working demos here (http://www.kis-systems.com/examples/QXListView).

I'll try to get some screenshots up, shortly.

I'm seeing some issues on my Linux (Ubuntu VM under Parallels on Mac) that I think are local. Some feedback on this appreciated.

Anyway, let me know what you think.

Thanks,
rickb

fullmetalcoder
1st February 2008, 22:37
The use of absolute path is a qmake project is somewhat weird and annoying (clearly unwise IMO...) and there are many include errors due to case sensitivity under Linux... Remember the only two valids include schemes for Qt headers are suffixed lowercase and not suffixed class-like capitalized names... Mixing both may work on some platforms but not on all...

Anyway I got the example building and running. Looks like it's working but I must say I don't see what's so special about it. Is there more to it than a tree view with a custom model and custom(s) delegate(s) that I missed?
Does the interest lie in the API (I admittedly did not take time to browse the sources...)?

rickbsgu
4th February 2008, 18:11
The use of absolute path is a qmake project is somewhat weird and annoying (clearly unwise IMO...)

Ack. Sorry about that - I left the intermediate /Qt/ directory in the .pro file. If you get rid of that (and define $DEV per the instructions), the .pro file should be smart enough to figure out the rest.


and there are many include errors due to case sensitivity under Linux... Remember the only two valids include schemes for Qt headers are suffixed lowercase and not suffixed class-like capitalized names... Mixing both may work on some platforms but not on all...

Hmm. It built on my installs of Windows, Mac and Linux. Some of the includes are legacy from the 3.x version. I'll look at them.



Anyway I got the example building and running. Looks like it's working but I must say I don't see what's so special about it. Is there more to it than a tree view with a custom model and custom(s) delegate(s) that I missed?
Does the interest lie in the API (I admittedly did not take time to browse the sources...)?
Did you try clicking on the checkboxes, radio buttons, pixmaps in the columns? They should behave as system-type widgets (but aren't). Clicking on the lightbulbs should show third state in the parents, clicking on the lightbulbs header should toggle all the lightbulbs.

You're running on Linux (according to your sig) - I'm having troubles with my Linux installation and can't tell if it's working correctly, there. Might have to bump that up, somehow (VM Ubuntu is giving me spurious events.) (Right now I'm arm-wrestling a Coin3D build of SoQt on the Mac, so my time is constrained.)

(I guess any Model/View app is a view with a custom model and potentially custom delegates... no? I dunno. It seemed to be beastly difficult to get this somewhat simple kind of functionality in Qt3, it certainly was not obvious in Qt4 [to me, anyway].)

thanx,
rickb

jpn
4th February 2008, 18:29
Remember the only two valids include schemes for Qt headers are suffixed lowercase and not suffixed class-like capitalized names... Mixing both may work on some platforms but not on all...
Well actually, it's perfectly valid to mix those two schemes. If you take a look at various Qt source files you'll see that Qt itself does so. Every proper Qt installation on all supported platforms has both header file types. Non-suffixed camel cased - so called convenience header files - are there just to forward the inclusion to corresponding suffixed lower cased header files.

rickbsgu
5th February 2008, 06:28
Well actually, it's perfectly valid to mix those two schemes. If you take a look at various Qt source files you'll see that Qt itself does so. Every proper Qt installation on all supported platforms has both header file types. Non-suffixed camel cased - so called convenience header files - are there just to forward the inclusion to corresponding suffixed lower cased header files.

Crawling around in the source, that's what I noticed, as well.

Thanx,
rickb

fullmetalcoder
5th February 2008, 11:38
Every proper Qt installation on all supported platforms has both header file types. Non-suffixed camel cased - so called convenience header files - are there just to forward the inclusion to corresponding suffixed lower cased header files.
I've been using prebuilt packages for the last three distros I used and none of them featured mixed includes... I guess they've removed them AFTER building the bins. Better to have it working on all possible configurations anyway.;)

jpn
5th February 2008, 11:55
I've been using prebuilt packages for the last three distros I used and none of them featured mixed includes... I guess they've removed them AFTER building the bins. Better to have it working on all possible configurations anyway.;)
Erm, what do you actually mean with mixed includes? Both of these work on every supported platform:


#include <QObject>
#include <qobject.h>

However, due to case sensitive file systems, you cannot do something like this:


#include <qobject>


As already stated, include <QObject> does nothing but further includes <qobject.h>. Lower case header files simply cannot be removed. Without them you have no declarations at all. And why would any distro remove convenience headers?

What you say makes no sense to me. It would mean that it was never safe to use either include scheme.

rickbsgu
5th February 2008, 16:24
I might be doing the latter - although it builds on all three platforms in my environment. I'll check, again, but not for a bit. I'm a bit buried in the process of making a big demo for a prospective client.

Later,
rickb

fullmetalcoder
6th February 2008, 16:11
Erm, what do you actually mean with mixed includes?
Well, basically this : ;)



#include <qobject>



Remember the only two valids include schemes for Qt headers are suffixed lowercase and "not suffixed" class-like-capitalized names... Mixing both may work on some platforms but not on all...
I thought my above statement had been clear enough as to where the problem lies but I may have missed something due to my poor english skills... If so please let me know. Actually I don't think any files were removed. This was just a supposition I made after reading your previous post a bit too fast... :o

Hoping it makes more sens to you now.