AnnotationProvider#
Added in version 5.18.
Superclasses: Object
It is used to provide annotations and display them on View and also populate
HoverDisplay when the user hovers over an annotation.
You can subclass this object and implement populate_hover_async and
populate_hover_finish or connect to populate
and call populate or do it asynchronously.
Constructors#
- class AnnotationProvider
- classmethod new() AnnotationProvider#
Used to create a new annotation provider.
Added in version 5.18.
Methods#
- class AnnotationProvider
- add_annotation(annotation: Annotation) None#
Add an annotation to the provider.
Added in version 5.18.
- Parameters:
annotation
- do_populate_hover_async(self, annotation: Annotation, display: HoverDisplay, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
- Parameters:
annotation
display
cancellable
callback
user_data
- do_populate_hover_finish(self, result: AsyncResult) bool#
- Parameters:
result
- async populate_hover_async(self, annotation: Annotation, display: HoverDisplay) bool#
This is the awaitable version of
populate_hover_async().Added in version 5.18.
- Parameters:
annotation – a
Annotationdisplay – a
HoverDisplayto populate
- populate_hover_async(annotation: Annotation, display: HoverDisplay, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
Used to populate the
HoverDisplayasynchronously, usepopulate_hoverto do it synchronously.Added in version 5.18.
- Parameters:
annotation – a
Annotationdisplay – a
HoverDisplayto populatecancellable
callback
user_data
- populate_hover_finish(result: AsyncResult) bool#
Finishes populating the
HoverDisplayasynchronously.Added in version 5.18.
- Parameters:
result
- remove_annotation(annotation: Annotation) bool#
Remove an annotation from the provider.
Added in version 5.18.
- Parameters:
annotation
Signals#
Virtual Methods#
- class AnnotationProvider
- do_populate_hover_async(annotation: Annotation, display: HoverDisplay, cancellable: Cancellable | None = None, callback: Callable[[Object | None, AsyncResult, Any], None] | None = None, user_data: Any = None) None#
Used to populate the
HoverDisplayasynchronously, usepopulate_hoverto do it synchronously.Added in version 5.18.
- Parameters:
annotation – a
Annotationdisplay – a
HoverDisplayto populatecancellable
callback
user_data
- do_populate_hover_finish(result: AsyncResult) bool#
Finishes populating the
HoverDisplayasynchronously.Added in version 5.18.
- Parameters:
result
Fields#
- class AnnotationProvider
- parent_instance#