From: Petr Vanek <petr@sc...> - 2008-01-11 07:53:24
> okay, i committed my big patch. the vast majority of it is a simple find
> and replace of Q3ListView with toTreeWidget.
> the problem i encountered is that qt _really_ doesn't want you to use
> what they call "item based" widgets. where you create an item and add it
> to a widget. they want you to use a mvc model.
You can theoretically use item based widgets at all. But it is =
Move to MVC widgets is a good choice.
> and -- really cool -- data storage doesn't have to be all strings. so i
> can store my toQValues and sort with them instead of the old way:
> db -> number -> text -> widget -> text -> number -> compare -> text
BTW is there any reason why is toQValue used over new Qt4 QValue at all?
> oh... on a personal note, i'm out of the Marine Corps now. i'm starting
> my civilian job on the 14th, which is why i've been pushing so hard to
> get stuff done on tora. i won't have as much time to hack starting next
> week but i'll be around to finish porting and to support tora.
heh, congrats. And I wish you perfect emplouyer and good job without army
From: Mike Johnson <mrjohnson@mi...> - 2008-01-11 15:13:49
On Fri, 2008-01-11 at 08:53 +0100, Petr Vanek wrote:
> You can theoretically use item based widgets at all. But it is heavy-footed
> for coding.
> Move to MVC widgets is a good choice.
it's cleaner, that's for sure. at the time i just wanted to get the
thing ported and it became very clear that using qtreewidget wasn't
going to do everything we wanted...
> BTW is there any reason why is toQValue used over new Qt4 QValue at all?
lol, i'm glad you noticed that. it originally was a list of QVariants.
two reasons really, one was that i can put custom types in toqvalue. it
gives me a little more flexibility so i can keep what originally came
from the database separate from what's displayed. and i don't have to
convert it to something qt understands before i need to.
then i also had a lot of problems figuring out the type stored in
qvariant. toqvalue has nice methods isInt, isDouble that only return
true if that was the original type stored. qvariant only provides
canConvert<double>(), which returns true for just about everthing i
it took me a while to figure out why my sorts were all out of whack on a
timestamp column, it was because the value was getting converted to a
double then sorted on. (query class returns that as a string.)
> heh, congrats. And I wish you perfect emplouyer and good job without army
> drill ;)
lol, thanks. i just heard though that there was a screwup in hr so i'll
be starting on the 22nd. oh, well... more time to hack on tora,