Summary of Methods needed to achieve read-write support

Registered by whatnick

This blueprint lists all the methods required to achieve read/write support to the buffer holding the document in TocModel.

Blueprint information

Status:
Not started
Approver:
Rob Oakes
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
whatnick
Definition:
New
Series goal:
None
Implementation:
Informational Informational
Milestone target:
None

Sprints

Whiteboard

The current implemented methods include - in Text3.cpp:

1) dragMove (move paragraph to a certain segment in the document tree)

2) setData(see http://doc.trolltech.com/4.6/model-view-creating-models.html, An Editable Model). When a title is updated in a particular view (corkboard or outline pane or document map [existing]), setData is used to call relevant methods in the buffer that then modify the existing title. Must make sure that the index is valid, the item is of the correct type, and the role is supported. By default, QStandardItemModel uses EditRole. However, in the existing TocModel this includes both a label (Chapter, Item, etc.) and the information that needs to be edited (Title, etc.). The EditRole needs to be subclassed so that it only manipulates the title, and not any associated labels. [ Where is the necessary EditRole defined ? EditRole is a Qt enum indicating that all data is editable it does not perform any filtering].

3) flags( see http://doc.trolltech.com/4.6/model-view-creating-models.html, An Editable Model). Prior to making changes, a delegate checks to see whether an item is editable before creating an editor. The model must let the delegate know that its item are editable. This is done by returning the correct flags for each item in the mode; in this case, we enable all items and make them both selectable and editable ...

4) dataChanged(see http://doc.trolltech.com/4.6/qabstractitemmodel.html#dataChanged). Signal emitted when the underlying data of the model has been changed. This causes all all other views to update.
See notes on using function dispatch mechanism to deal with change of data content - http://wiki.lyx.org/Devel/NotesOnDispatchMechanism.

Text Manipulation Methods:

1) Locate beginning and end of relevant text in the buffer of title.
2) Substitute updated text from view into buffer.
3) Remove old text from buffer (may be incorporated into item 2)

[ Use find and replace technique to locate in context matches in the buffer - regexp]

Relevant Qt Reference:

1) Simple Tree Model (Subclass of QAbstractItemView, see http://doc.trolltech.com/4.6/itemviews-simpletreemodel.html). Example describes how to read data from an underlying data store and translate that information into model that can be used by the model/view architecture.
2) Model Subclassing Reference (see http://doc.trolltech.com/4.6/model-view-model-subclassing.html)

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.