AnnotationProvider#

Added in version 5.18.

class AnnotationProvider(**properties: Any)#

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:
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 HoverDisplay asynchronously, use populate_hover to do it synchronously.

Added in version 5.18.

Parameters:
populate_hover_finish(result: AsyncResult) bool#

Finishes populating the HoverDisplay asynchronously.

Added in version 5.18.

Parameters:

result

remove_all() None#

Removes all annotations from the provider.

Added in version 5.18.

remove_annotation(annotation: Annotation) bool#

Remove an annotation from the provider.

Added in version 5.18.

Parameters:

annotation

Signals#

class AnnotationProvider.signals
changed() None#

The type of the None singleton.

Added in version 5.18.

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 HoverDisplay asynchronously, use populate_hover to do it synchronously.

Added in version 5.18.

Parameters:
do_populate_hover_finish(result: AsyncResult) bool#

Finishes populating the HoverDisplay asynchronously.

Added in version 5.18.

Parameters:

result

Fields#

class AnnotationProvider
parent_instance#