- A description of what can be done, and how the data is presented
- Showcasing in form of screenshot tutorial.
If you check out the current state of the feature/gui branch in the repository you find the root directory with the following contents:
Code: Select all
./bcf-examples ./bcfplugin |- gui/ | |- comment-list/ | |- design/ | |- examples/ | |- plugin_delegate.py | |- plugin_model.py | |- plugin_panel.py | |- plugin_view.py ./doc ./env ./README.md
As I mentioned before (sometime), I am adhering to the Model/View(/Delegate) paradigm of Qt. For the ones not fluent with this paradigm here a short summary:
With the Model/View paradigm a separation between the presentation of data to the user, and the representation of the data in memory is achieved. The part comprising the model handels the access to the custom data structure and compiles it to a usable form for the View part. The View arranges the Qt widgets in a way that is functional and queries the data to present the user from the accompanying model. The Delegates are (as to my understanding) a second link between the Model and the View. Its main purpose is to handle edit-events on the model. Thus Delegates are responsible for drawing editors into the view and submitting the edited data to the model. I also use it for the drawing the custom elements in the comments list.
For a more comprehensive overview about this topic please refer to Qt Model/View
With this in mind, the intention behind the plugin-*.py files is easy to understand:
- plugin-view.py: contains all views, including the main view tying everything together
- plugin-model.py: provides classes and functions that handle the access to the data model, read in by reader.py
- plugin-delegate.py: handles the editing of some custom views. Currently this file holds code handling the editing and drawing of comments.
The comment list is where the most magic happens at the moment. If you want to change the wording, or the author of a comment, double press on the corresponding item. You will be droped into a QLineEdit, filled with the current content and author. If you hover over a comment a Delete-Button is drawn at the right side, which will delete the comment beneath, if pressed. The positioning of this button is still a bit buggy, which is noticable if the window is resized often. A comment will be written in blue color if it holds a reference to a viewpoint, otherwise it is drawn with black color. In the future I want to implement a shortcut to apply the linked viewpoint. A new comment can be added by entering it in the QLineEdit below the comment list.
Here a note on the editing and adding of comments: I opted for a single QLineEdit (Textbox) for modifying and adding comments, for reasons of complexity. That is why you (or the user) have (has) to adhere to a particular format when modifying or adding. This format is checked by a QValidator object, and is indicated by the placeholder text of the QLineEdit. First and foremost is the comment itself, followed by a space, a double hyphen and a space again. At the end an e-Mail of the author is required. So long story short a comment looks like this:
some text comprising the comment -- firstname.lastname@example.org
This was about it from the description. Now to the screenshots. Following you will find a description of what to see in each picture. To recreate the screenshots (if you want), I used the file Issues_BIMcollab_Example*.bcf from the ./bcf-examples folder.
- screenshot01.png: shows the start up screen
- screenshot02.png: shows the open file dialog after pressing Open
- screenshot03.png: shows the plugin after a project was sucessfully opened (for big projects this takes a while, presumably because all error
messages are still printed to stdout, I plan to write them to an error.log file in the future)
- screenshot04.png: shows a populated comment list, after one topic was selected (in the screenshot it was Topic Intersections check: column inside slab
- screenshot05.png: shows the delete button drawn over the first comment.
- screenshot06.png: shows the comment list after the delete button was pressed on the first comment.
- screenshot07.png: shows the now first comment after it was double pressed with the left mouse key. The content is dropped into a QLineEdit, in the afore mentioned format.
- screenshot08.png: shows the comment list after hello this -- email@example.com was entered in the Textbox (QLineEdit) below the comment list, and enter was pressed.