Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 6

Qt-interest Archive, February 2007
qt422 - model/view newbie question


Message 1 in thread

Hi,

I just port a Qt3 tree container to Qt4.
don't want to use model view functionnalities.

I don't see how to parse items in a qtreeview simply under qt422.

I don't have any model, just want to parse the tree in a qtreeview?...
I want to get items of view to get  some associated info. no more

is someone can give me help, good link in doc?


thank you,
Veronique.

--
 [ signature omitted ] 

Message 2 in thread

> I just port a Qt3 tree container to Qt4.
> don't want to use model view functionnalities.
>
> I don't see how to parse items in a qtreeview simply under qt422.
>
> I don't have any model, just want to parse the tree in a qtreeview?...
> I want to get items of view to get  some associated info. no more
Hi,

You might want to take a look at the convenience version with a
built-in model. It's called QTreeWidget and the documentation can be
found here: http://doc.trolltech.com/4.2/qtreewidget

--
 [ signature omitted ] 

Message 3 in thread

thank you, I saw this convenient class doc.
I did'nt find some function that could get all items.
it seams that I may parse recursively items doing something like this:

parsetreewidgetfuntion
{
for(i=0,i <myqtreewidget->topLevelItemCount (),i++)
{
 parse recursively items....
}
}

I would like to verify if there is or not a "getallitems" method like.



J-P Nurmi a écrit :

>> I just port a Qt3 tree container to Qt4.
>> don't want to use model view functionnalities.
>>
>> I don't see how to parse items in a qtreeview simply under qt422.
>>
>> I don't have any model, just want to parse the tree in a qtreeview?...
>> I want to get items of view to get  some associated info. no more
>
> Hi,
>
> You might want to take a look at the convenience version with a
> built-in model. It's called QTreeWidget and the documentation can be
> found here: http://doc.trolltech.com/4.2/qtreewidget
>
> -- 
> J-P Nurmi
>
> -- 
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 4 in thread

> I did'nt find some function that could get all items.
> it seams that I may parse recursively items doing something like this:
>
> parsetreewidgetfuntion
> {
> for(i=0,i <myqtreewidget->topLevelItemCount (),i++)
> {
>  parse recursively items....
> }
> }
>
> I would like to verify if there is or not a "getallitems" method like.

There is an utility class called QTreeWidgetItemIterator for iterating
through the whole tree or parts of it according to the given flags:
http://doc.trolltech.com/4.2/qtreewidgetitemiterator

--
 [ signature omitted ] 

Message 5 in thread

Thank you JP and Andreas.
I didn't see this class (that is just after QTreeWidgetItem in classes 
list :-[ :-[ )


have a nice day.
Veronique.

J-P Nurmi a écrit :

>> I did'nt find some function that could get all items.
>> it seams that I may parse recursively items doing something like this:
>>
>> parsetreewidgetfuntion
>> {
>> for(i=0,i <myqtreewidget->topLevelItemCount (),i++)
>> {
>>  parse recursively items....
>> }
>> }
>>
>> I would like to verify if there is or not a "getallitems" method like.
>
>
> There is an utility class called QTreeWidgetItemIterator for iterating
> through the whole tree or parts of it according to the given flags:
> http://doc.trolltech.com/4.2/qtreewidgetitemiterator
>
> -- 
> J-P Nurmi
>
> -- 
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>

--
 [ signature omitted ] 

Message 6 in thread

On 26.02.07 11:56:45, veronique.lefrere@xxxxxx wrote:
> I would like to verify if there is or not a "getallitems" method like.

No, but you could use the QTreeWidgetItemIterator to iterate over all
items.

Andreas

-- 
 [ signature omitted ]