Reginald Stadlbauer wrote: > > On Mon, 30 Aug 1999, Stephan Kulow wrote: > >"Dirk A. Mueller" wrote: > >> > >> Stephan Kulow wrote: > >> > >> > Who put the obsolete warning in ktablistbox header? > >> > >> me. > >> > >> > Not that I mind to get rid of it, but it's API is > >> > rather very different from the one of QListView, > >> > so the porting isn't that easy. > >> > >> that's right. If porting would be easy, I would have done it myself and > >> committed it instead of putting the obsolete warning into the header > >> file ;) > >> > >> > Has someone a tip how to get an easy mapping from integer->item in > >> > that row without iterating over the whole list each time (which > >> > should get way too slow)? > >> > >> yes: don't use such a mapping. It is unnecessary. and btw it is faulty, > >> as the mapping may change when the sort order is changed by the user. > >> > >> I know libkfile relies on such a mapping. I tried to fix it for some > >> hours, but ended up deleting the modifications and put a "redesign the > >> way libkfile tries to handle the files" on my TODO list. > >> > >> Note that currently libkfile rebuilds the list whenever sort-order is > >> changed. QListView makes that obsolete. > >> > >But QListView isn't the only view. How often do I have to repeat that? > > And, what's the problem? I'm doing following in the new QFileDIalog (same is > done in Windows), which has also more that one view: > > When inserting the items insert them sorted as configured by the user (the user > can say sort by name, date, size, etc.) So you can use the same sort aligorithm > for inserting items in each view (have to set setSorting( -1 ) when inserting > in the listview) > > Now, when the user clicks on the header, the listview gets resorted as the user > wants it (done by the listview). If the sorting configuration is changed by the > user (in the config dialog or whereever), and you don't want to reinsert all > items sorted, you can do listview->setSorting( columnWhichSchouldSort() ) for > the listview. Or if you want to use the same algorith is this case as for > the other views, reinsert the items using your sort algorithm. But sorting by > clicking on the header doesn't influence the other views, as in the other views > you just sort it when inserting it and changing the sortorder in the listview by > clicking a header doesn't set the sorting configuration, but that sortorder is > just valid as long as the listview lives. To cite Arnt here "I lost the context ... somewhen" :) > > This means, setting the sorting configuration using the dialog sets it for all > views and remebers it, clicking on the header is just valid for the current > view as long as this one is visible. > > So, I can't really see a problem there.... Sure, but the completion triggers an integer! It's not about sorting, but about the right sorting. Greetings, Stephan -- Programmers, heed this: If someone starts asking you about agricultural genomes, it's likely time to get a handler. zdnet.com about Torvalds