Week 2: GSoC Project Report

This week I worked on making the UI interactive and configuring the interaction between the comment model and the storyboard model. I also implemented the switching of modes.

The comment model stores the name and visibility of comment fields. It is responsible for the comments menu’s items. Storyboard model’s items have fields to store the contents of each comment field. So whenever a comment is added to the comment model we need to add a child to each storyboard item. Similarly with removing and moving (reordering) of comment items. I connected signals for removing, adding and moving items from the comment model to storyboard model. This signals were used to perform the required actions. Remove and add signals were easy, but qt does not use the moveRows(..) function for drag and drop. Instead it inserts the row to be moved in the desired place and deletes the row. So basically the moving is faked. This results in rowsAdded, dataChanged and rowsRemoved signals. To get the rowsMoved signal I had to reimplement the mimeData and dropMimeData and call moveRows explicitly. Also we must return false in the dropMimeData function otherwise the row at previous position will be deleted as qt assumes the default actions are being followed.

Interaction between comment model and storyboard model.

For drawing the comment boxes we use a QtextDocument and a scrollbar. We store the value to which the item has been scrolled to in a Qt::UserRole field in the index in the model, and use that value to draw the desired part of the text. This makes sure that the data that was visible in the QTextEdit widget while editing is visible when the editor is closed. We also have signals for the scroll bar and its buttons.

There are 3 modes, row, column and grid. Since we have used a QListView it was very easy to implement the three modes. Only the row mode required some extra work as we had to change the orientation of the individual items.

Row mode
Column mode
Grid mode

This week I would implement the 3 views, try to get the UI tested by users and run unit tests on the models and debug any problems so far.

One thought on “Week 2: GSoC Project Report

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create your website with WordPress.com
Get started
%d bloggers like this: