items.bookmark_items#
Bookmark items at their core are simple file paths made up of a server
, job
and root
components. We usually store them in the following form:
1{
2 '//path/to/my/server/my_job/my_shots': {
3 'server': '//path_to_my/server',
4 'job': 'my_job',
5 'root': 'my_shots'
6 }
7}
BookmarkItemModel
is responsible for loading saved bookmark items and
BookmarkItemView
for displaying them. See
BookmarkItemModel.item_generator()
for how the model finds saved bookmark items.
Properties like description, frame-range, frame-rate, or ShotGrid linkage are stored in
sqlite3 databases located at each bookmark item’s root folder. See
bookmarks.database
more details.
Throughout the app, data interfaces usually require a bookmark item, commonly as
separate server, job, root arguments. See active()
to
see how active path components can be queried.
Hint
The term “active” refers to items the user has activated, e.g. double-clicked. When an item is activated all path components that make up that item will become active.
1server = common.active('server')
2job = common.active('job')
3root = common.active('root')
4
5# Or...
6
7server, job, root = common.active('root', args=True)
Model items store their path segments using the
ParentPathRole
role. E.g.:
1# ...in case of a QtCore.QModelIndex item:
2server, job, root = index.data(common.ParentPathRole)[0:3]
Classes:
|
The model used store the data necessary to display bookmark item. |
|
The view used to display bookmark item. |
|
Context menu associated with the BookmarkItemView. |
- class bookmarks.items.bookmark_items.BookmarkItemModel(parent=None)[source]#
Bases:
ItemModel
The model used store the data necessary to display bookmark item.
Methods:
The data type of the model.
Returns the default item size.
The custom dictionary key used to save filter settings to the user settings file.
flags
(index)Overrides the flag behaviour to disable drag if the alt modifier is not pressed.
init_data
(**kwargs)Function wrapper.
Returns the items to be processed by
init_data()
.Save the active bookmark item.
The bookmark list's source paths.
- filter_setting_dict_key()[source]#
The custom dictionary key used to save filter settings to the user settings file.
- flags(index)[source]#
Overrides the flag behaviour to disable drag if the alt modifier is not pressed.
- init_data(**kwargs)#
Function wrapper.
- item_generator()[source]#
Returns the items to be processed by
init_data()
.
- class bookmarks.items.bookmark_items.BookmarkItemView(parent=None)[source]#
Bases:
ThreadedItemView
The view used to display bookmark item.
See
BookmarkItemModel
.Classes:
alias of
BookmarkItemViewContextMenu
alias of
BookmarkItemViewDelegate
Methods:
add_item_action
(index)Action to execute when the add item icon is clicked.
edit_item_action
(index)Action to execute when the edit item icon is clicked.
Returns an informative hint text.
Returns the model class associated with this view.
Inline buttons count.
- ContextMenu#
alias of
BookmarkItemViewContextMenu
Methods:setup
()Creates the context menu.
- Delegate#
alias of
BookmarkItemViewDelegate
Methods:paint
(painter, option, index)Paints a
bookmarks.items.bookmark_items.BookmarkItemView
item.setEditorData
(self, editor, index)setModelData
(self, editor, model, index)sizeHint
(option, index)Returns the item's size hint.
Attributes:
fallback_thumb
The item's default thumbnail image
- class bookmarks.items.bookmark_items.BookmarkItemViewContextMenu(index, parent=None)[source]#
Bases:
BaseContextMenu
Context menu associated with the BookmarkItemView.
- refresh()#
Refreshes the collector and repopulates the widget.
Methods:
setup
()Creates the context menu.