Flow Production Tracking Search Completers
Global Search Completer
The global search completer is a QCompleter instance for use with widgets that allow input of Flow Production Tracking entities. The completer can be customized to search across a given set of entity types.
Once a user selects an object, a signal fires to indicate that an entity was activated.
- class search_completer.GlobalSearchCompleter(parent=None)[source]
A standalone
PySide.QtGui.QCompleter
class for matching PTR entities to typed text.- Signal:
entity_selected(str, int)
- Provided for backward compatibility.entity_activated
is emitted at the same time with an additionalname
value. Fires when someone selects an entity inside the search results. The returned parameters are entitytype
and entityid
.- Signal:
entity_activated(str, int, str)
- Fires when someone activates an entity inside the search results. Essentially the same asentity_selected
only the parameters returned aretype
,id
andname
.- Modes:
MODE_LOADING, MODE_NOT_FOUND, MODE_RESULT
- Used to identify the mode of an item in the completion list- Model role:
MODE_ROLE
- Stores the mode of an item in the completion list (see modes above)- Model role:
SG_DATA_ROLE
- Role for storing shotgun data in the model- Parameters:
parent (
QWidget
) – Parent widget
- get_result(model_index)[source]
Return the entity data for the supplied model index or None if there is no data for the supplied index.
- Parameters:
model_index (
QModelIndex
) – The index of the model to return the result for.- Returns:
The entity dict for the supplied model index.
- Return type:
dict
: orNone
- set_searchable_entity_types(types_dict)[source]
Specify a dictionary of entity types with optional search filters to limit the breadth of the widget’s search.
Use this method to override the default searchable entity types dictionary which looks like this:
{ "Asset": [], "Shot": [], "Task": [], "HumanUser": [["sg_status_list", "is", "act"]], # only active users "Group": [], "ClientUser": [["sg_status_list", "is", "act"]], # only active users "ApiUser": [], "Version": [], "PublishedFile": [], }
- Parameters:
types_dict – A dictionary of searchable types with optional filters
- caseSensitivity(self) PySide2.QtCore.Qt.CaseSensitivity
- clear()
Manually clear the contents of the completer’s popup view.
- completionMode(self) PySide2.QtWidgets.QCompleter.CompletionMode
- completionModel(self) PySide2.QtCore.QAbstractItemModel
- static connect(arg__1: PySide2.QtCore.QObject, arg__2: bytes, arg__3: Callable, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) bool
- static connect(self, arg__1: bytes, arg__2: Callable, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) bool
- static connect(self, arg__1: bytes, arg__2: PySide2.QtCore.QObject, arg__3: bytes, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) bool
- static connect(self, sender: PySide2.QtCore.QObject, signal: bytes, member: bytes, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) PySide2.QtCore.QMetaObject.Connection
- static connect(sender: PySide2.QtCore.QObject, signal: PySide2.QtCore.QMetaMethod, receiver: PySide2.QtCore.QObject, method: PySide2.QtCore.QMetaMethod, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) PySide2.QtCore.QMetaObject.Connection
- static connect(sender: PySide2.QtCore.QObject, signal: bytes, receiver: PySide2.QtCore.QObject, member: bytes, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) PySide2.QtCore.QMetaObject.Connection
- currentIndex(self) PySide2.QtCore.QModelIndex
- destroy()
Should be called before the widget is closed
- static disconnect(arg__1: PySide2.QtCore.QMetaObject.Connection) bool
- static disconnect(arg__1: PySide2.QtCore.QObject, arg__2: bytes, arg__3: Callable) bool
- static disconnect(self, arg__1: bytes, arg__2: Callable) bool
- static disconnect(self, receiver: PySide2.QtCore.QObject, member: Optional[bytes] = None) bool
- static disconnect(self, signal: bytes, receiver: PySide2.QtCore.QObject, member: bytes) bool
- static disconnect(sender: PySide2.QtCore.QObject, signal: PySide2.QtCore.QMetaMethod, receiver: PySide2.QtCore.QObject, member: PySide2.QtCore.QMetaMethod) bool
- static disconnect(sender: PySide2.QtCore.QObject, signal: bytes, receiver: PySide2.QtCore.QObject, member: bytes) bool
- filterMode(self) PySide2.QtCore.Qt.MatchFlags
- findChildren(self, arg__1: type, arg__2: PySide2.QtCore.QRegExp) Iterable
- findChildren(self, arg__1: type, arg__2: PySide2.QtCore.QRegularExpression) Iterable
- findChildren(self, arg__1: type, arg__2: str = '') Iterable
- get_current_result()
Returns the result from the current item in the completer popup or
None
if there is no current item.- Returns:
The entity dict for the current result
- Return type:
dict
: orNone
- get_first_result()
Returns the first result from the current item in the completer popup or
None
if there are no results.- Returns:
The entity dict for the first result
- Return type:
dict
: orNone
- metaObject(self) PySide2.QtCore.QMetaObject
- model(self) PySide2.QtCore.QAbstractItemModel
- modelSorting(self) PySide2.QtWidgets.QCompleter.ModelSorting
- parent(self) PySide2.QtCore.QObject
- popup(self) PySide2.QtWidgets.QAbstractItemView
- search(text)
Triggers the popup to display results based on the supplied text.
- Parameters:
text – current contents of editor
- sender(self) PySide2.QtCore.QObject
- set_bg_task_manager(task_manager)
Specify the background task manager to use to pull data in the background. Data calls to Shotgun will be dispatched via this object.
- Parameters:
task_manager (
BackgroundTaskManager
) – Background task manager to use
- startTimer(self, interval: int, timerType: PySide2.QtCore.Qt.TimerType = PySide2.QtCore.Qt.TimerType.CoarseTimer) int
- thread(self) PySide2.QtCore.QThread
- widget(self) PySide2.QtWidgets.QWidget
Hierarchical Search Completer
The hierarchical search completer is a QCompleter instance for use with widgets that allow input of Flow Production Tracking entities. The completer can be customized to search in a site’s complete hierarchy or in a single project.
Once a user selects an object, a signal fires to indicate that a node from the hierarchy was selected.
- class search_completer.HierarchicalSearchCompleter(parent=None)[source]
A standalone
PySide.QtGui.QCompleter
class for matching PTR entities to typed text.If defaults to searching inside the current context’s project and to only show entities.
- Signal:
node_activated(str, int, str, str, list)
- Fires when someone activates a node inside the search results. The parameters aretype
,id
,name
,label_path
andincremental_path
. If the node activated is not an entity,type
andid
will beNone
.- Modes:
MODE_LOADING, MODE_NOT_FOUND, MODE_RESULT
- Used to identify the mode of an item in the completion list- Model role:
MODE_ROLE
- Stores the mode of an item in the completion list (see modes above)- Model role:
SG_DATA_ROLE
- Role for storing shotgun data in the model- Parameters:
parent (
QWidget
) – Parent widget
- property search_root
The entity under which the search will be done. If
None
, the search will be done for the whole site.The entity is a
dict
with keysid
andtype
. Note that onlyProject
entities are supported at the moment.
- property show_entities_only
Indicates if only entities will be shown in the search results.
If set to
True
, only entities will be shown.
- property seed_entity_field
The seed entity to use when searching for entity.
Can be
PublishedFile.entity
orVersion.entity
.
- caseSensitivity(self) PySide2.QtCore.Qt.CaseSensitivity
- clear()
Manually clear the contents of the completer’s popup view.
- completionMode(self) PySide2.QtWidgets.QCompleter.CompletionMode
- completionModel(self) PySide2.QtCore.QAbstractItemModel
- static connect(arg__1: PySide2.QtCore.QObject, arg__2: bytes, arg__3: Callable, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) bool
- static connect(self, arg__1: bytes, arg__2: Callable, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) bool
- static connect(self, arg__1: bytes, arg__2: PySide2.QtCore.QObject, arg__3: bytes, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) bool
- static connect(self, sender: PySide2.QtCore.QObject, signal: bytes, member: bytes, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) PySide2.QtCore.QMetaObject.Connection
- static connect(sender: PySide2.QtCore.QObject, signal: PySide2.QtCore.QMetaMethod, receiver: PySide2.QtCore.QObject, method: PySide2.QtCore.QMetaMethod, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) PySide2.QtCore.QMetaObject.Connection
- static connect(sender: PySide2.QtCore.QObject, signal: bytes, receiver: PySide2.QtCore.QObject, member: bytes, type: PySide2.QtCore.Qt.ConnectionType = PySide2.QtCore.Qt.ConnectionType.AutoConnection) PySide2.QtCore.QMetaObject.Connection
- currentIndex(self) PySide2.QtCore.QModelIndex
- destroy()
Should be called before the widget is closed
- static disconnect(arg__1: PySide2.QtCore.QMetaObject.Connection) bool
- static disconnect(arg__1: PySide2.QtCore.QObject, arg__2: bytes, arg__3: Callable) bool
- static disconnect(self, arg__1: bytes, arg__2: Callable) bool
- static disconnect(self, receiver: PySide2.QtCore.QObject, member: Optional[bytes] = None) bool
- static disconnect(self, signal: bytes, receiver: PySide2.QtCore.QObject, member: bytes) bool
- static disconnect(sender: PySide2.QtCore.QObject, signal: PySide2.QtCore.QMetaMethod, receiver: PySide2.QtCore.QObject, member: PySide2.QtCore.QMetaMethod) bool
- static disconnect(sender: PySide2.QtCore.QObject, signal: bytes, receiver: PySide2.QtCore.QObject, member: bytes) bool
- filterMode(self) PySide2.QtCore.Qt.MatchFlags
- findChildren(self, arg__1: type, arg__2: PySide2.QtCore.QRegExp) Iterable
- findChildren(self, arg__1: type, arg__2: PySide2.QtCore.QRegularExpression) Iterable
- findChildren(self, arg__1: type, arg__2: str = '') Iterable
- get_current_result()
Returns the result from the current item in the completer popup or
None
if there is no current item.- Returns:
The entity dict for the current result
- Return type:
dict
: orNone
- get_first_result()
Returns the first result from the current item in the completer popup or
None
if there are no results.- Returns:
The entity dict for the first result
- Return type:
dict
: orNone
- metaObject(self) PySide2.QtCore.QMetaObject
- model(self) PySide2.QtCore.QAbstractItemModel
- modelSorting(self) PySide2.QtWidgets.QCompleter.ModelSorting
- parent(self) PySide2.QtCore.QObject
- popup(self) PySide2.QtWidgets.QAbstractItemView
- search(text)
Triggers the popup to display results based on the supplied text.
- Parameters:
text – current contents of editor
- sender(self) PySide2.QtCore.QObject
- set_bg_task_manager(task_manager)
Specify the background task manager to use to pull data in the background. Data calls to Shotgun will be dispatched via this object.
- Parameters:
task_manager (
BackgroundTaskManager
) – Background task manager to use
- startTimer(self, interval: int, timerType: PySide2.QtCore.Qt.TimerType = PySide2.QtCore.Qt.TimerType.CoarseTimer) int
- thread(self) PySide2.QtCore.QThread
- widget(self) PySide2.QtWidgets.QWidget
- get_result(model_index)[source]
Returns an item from the result list.
Here’s an example:
{ "label": "bunny_020", "incremental_path": [ "/Project/65", "/Project/65/Shot", "/Project/65/Shot/sg_sequence/Sequence/5" ], "path_label": "Shots", "ref": { "id": 5, "type": "Sequence" }, "project_id": 65 }
- Parameters:
model_index (
QModelIndex
) – The index of the model to return the result for.- Returns:
The
dict
for the supplied model index.- Return type:
dict
orNone