Skip to content

GeoPositionInfoSourceMixin

Base classes

Name Children Inherits
ObjectMixin
prettyqt.core.object

Subclasses

Class Module Description
GeoPositionInfoSource prettyqt.positioning.geopositioninfosource
NmeaPositionInfoSource prettyqt.positioning.nmeapositioninginfosource

⋔ Inheritance diagram

graph TD
  1473573460000["positioning.GeoPositionInfoSourceMixin"]
  1473299815024["core.ObjectMixin"]
  140713234304496["builtins.object"]
  1473299815024 --> 1473573460000
  140713234304496 --> 1473299815024

🛈 DocStrings

Bases: ObjectMixin

Source code in prettyqt\positioning\geopositioninfosource.py
class GeoPositionInfoSourceMixin(core.ObjectMixin):
    def __str__(self):
        return self.sourceName()

    def __repr__(self):
        return get_repr(self)

    def get_error(self) -> ErrorStr:
        """Return error type.

        Returns:
            error type
        """
        return ERRORS.inverse[self.error()]

    def set_preferred_positioning_methods(self, *methods: PositioningMethodStr):
        """Set preferred positioning methods.

        Args:
            methods: positioning methods to use
        """
        flags = POSITIONING_METHODS.merge_flags(methods)
        self.setPreferredPositioningMethods(flags)

    def get_preferred_positioning_methods(self) -> list[PositioningMethodStr]:
        """Return list of preferred positioning methods.

        Returns:
            list of preferred positioning methods
        """
        return POSITIONING_METHODS.get_list(self.preferredPositioningMethods())

    def get_supported_positioning_methods(self) -> list[PositioningMethodStr]:
        """Return list of supported positioning methods.

        Returns:
            list of supported positioning methods
        """
        return POSITIONING_METHODS.get_list(self.supportedPositioningMethods())

get_error() -> ErrorStr

Return error type.

Source code in prettyqt\positioning\geopositioninfosource.py
def get_error(self) -> ErrorStr:
    """Return error type.

    Returns:
        error type
    """
    return ERRORS.inverse[self.error()]

get_preferred_positioning_methods() -> list[PositioningMethodStr]

Return list of preferred positioning methods.

Source code in prettyqt\positioning\geopositioninfosource.py
def get_preferred_positioning_methods(self) -> list[PositioningMethodStr]:
    """Return list of preferred positioning methods.

    Returns:
        list of preferred positioning methods
    """
    return POSITIONING_METHODS.get_list(self.preferredPositioningMethods())

get_supported_positioning_methods() -> list[PositioningMethodStr]

Return list of supported positioning methods.

Source code in prettyqt\positioning\geopositioninfosource.py
def get_supported_positioning_methods(self) -> list[PositioningMethodStr]:
    """Return list of supported positioning methods.

    Returns:
        list of supported positioning methods
    """
    return POSITIONING_METHODS.get_list(self.supportedPositioningMethods())

set_preferred_positioning_methods(*methods: PositioningMethodStr)

Set preferred positioning methods.

Parameters:

Name Type Description Default
methods PositioningMethodStr

positioning methods to use

()
Source code in prettyqt\positioning\geopositioninfosource.py
def set_preferred_positioning_methods(self, *methods: PositioningMethodStr):
    """Set preferred positioning methods.

    Args:
        methods: positioning methods to use
    """
    flags = POSITIONING_METHODS.merge_flags(methods)
    self.setPreferredPositioningMethods(flags)