PDA

View Full Version : QTreeWidget with Checkbox



xboxnissan
10th May 2012, 03:18
Hi everyone,

I am doing a massive project in Qt, so I can't show all I got, but:

What I want:

7711

QTreeWidget that "knows" just like the Qt Manager Tool when to put checked or not, or put semi-checked.

Is there a model that provides this? My goal is to do a "to-do" list.

If there is no model that provides this, can anyone tell me how to get the source code of the Qt Manager Tool so I can see how Nokia did that (PS: I don't want to implement this myself, I could but if it isn't necessary, I won't make it myself with 10 ifs)?

Thanks!

ChrisW67
10th May 2012, 08:17
Is there a model that provides this?
Any model you care to write attached to a QTreeView (not QTreeWidget). You could build on top of QStandardItemModel, override setData() and rethink check boxes after writes to Qt::CheckStateRole. Shouldn't be too difficult, but it depends on your actual data and requirement.


I am doing a massive project in Qt,
and

PS: I don't want to implement this myself
A massive project by cut and paste. Oh joy.

xboxnissan
11th May 2012, 01:27
Any model you care to write attached to a QTreeView (not QTreeWidget). You could build on top of QStandardItemModel, override setData() and rethink check boxes after writes to Qt::CheckStateRole. Shouldn't be too difficult, but it depends on your actual data and requirement.


and

A massive project by cut and paste. Oh joy.

Listen buddy:

1) I know how to implement it myself alright (I did yesterday). I was WONDERING if there's a model that exists that can do this without having to implement it

2) It's not because it's a massive project that I have to make everything myself (Speaking about making all algorithms that may already exist). I didn't create the Qt Framework to make my program work, I use it. Maybe you prefer make classes that may already exists for your own pleasure, but not me. I prefer using what the Framework has to offer first.

3) Massive Project != Cut & Paste. I have 27 CPP alone, without including the custom .h to make custom Checkboxes or RadioButtons. I know what Massive Projects means. It's my first project ever in Qt, I have a C# and Java past, and I never worked so hard in a project to tell you that copy paste isn't how to make a project done.

Thanks anyway for the response,

xboxnissan

PS: I don't want to implement this myself => I WOULD NOT. In other words, I prefer using the Qt Framework first before even thinking about an algorithm. Why reinvent the wheel?