[bt-devel] tree keys and Qt4 Model/View architecture

Martin Gruner mg.pub at gmx.net
Thu Jun 7 02:46:28 MST 2007


Hi Eeli,

great. Since we don't have model/view in BT1/QT3, using QTreeWidget is 
probably the quickest and most simple solution. Maybe we can introduce M/V 
later, after the port.

I believe that one reason for the first test program's problems with tree 
display is

inline int columnCount(const QModelIndex &parent = QModelIndex()) const 
{return 1;}

It means that the Tree has only one level. Sub-Items have column+1 of their 
parent items, IIRC.

Best regards,

mg

Am Donnerstag, 7. Juni 2007 schrieb Eeli Kaikkonen:
> On Wed, 6 Jun 2007, Eeli Kaikkonen wrote:
> > One thing which might make this slow is that it uses data without an
> > item class. Maybe initializing special items with key data would do the
> > trick.
>
> OK, I learned how to use QTreeWidget. It's much easier, the code is very
> short now. http://iki.fi/eelik/sword/keytreetest2.tar.gz. I just have to
> see if I can get rid of TreeItem in cbooktreechooser.h/cpp completely,
> it would reduce the code some 30%.
>
>   Yours,
> 	Eeli Kaikkonen (Mr.), Oulu, Finland
> 	e-mail: eekaikko at mailx.studentx.oulux.fix (with no x)
>
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel





More information about the bt-devel mailing list