On 08/14/2009 02:47 PM, Pavel Sanda wrote:
Pavel Sanda wrote:
issue :) i thought this would be just qt issue not knowing about the selection
manager machinery hard set to listview, which is used by other parts like
citation, so simple touching for modules breaks elsewhere...
finally succeeded to tweak manager so modules pane uses QTreeView and it works
on one
level. i'm bit stuck now since i cant find where are filled the data from
modules
to the dialog - Richard you have implemented that models part?
The available and selected modules are held in GuiIdListModel's,
modules_av_model_ and modules_sel_model_; the selection manager has
pointers to these. The point of this model is reasonably well explained
in the comment at the start of GuiIdListModel.h:
/**
* A QAbstractListModel that associates an identifying string with
* each item, as well as a display string. The display string is set
* with setUIString; the identifying string, with setIDString.
*
* This is intended to be used, for example, with GuiSelectionManager.
* In that case, one needs to recover from selectedModel which items
* have been selected. One may not wish to do so using the string that
* is there *displayed*, since, among other things, that string may be
* translated. So the id can be used to identify the items in this case.
*/
I'm afraid I re-invented the wheel here, though. The layout combo now
does something similar, and it uses native Qt models and such to do what
I was trying to do. So, well, you might want to replace these custom
models with normal Qt ones. I'm guessing that might otherwise make your
job easier.
rh