Beispiel #1
0
 def get_display_name(
     self,
     datetime: QtCore.QDateTime | TimeTypeStr,
     name_type: NameTypeStr = "default",
     locale: core.Locale | None = None,
 ) -> str:
     if isinstance(datetime, str):
         if datetime not in TIME_TYPE:
             raise InvalidParamError(datetime, TIME_TYPE)
         datetime = TIME_TYPE[datetime]
     if name_type not in NAME_TYPE:
         raise InvalidParamError(name_type, NAME_TYPE)
     if locale is None:
         locale = core.Locale()
     return self.displayName(datetime, NAME_TYPE[name_type], locale)
Beispiel #2
0
 def get_locale(self) -> core.Locale:
     return core.Locale(self.locale())
Beispiel #3
0
 def get_available_locales(self) -> list[core.Locale]:
     return [core.Locale(locale) for locale in self.availableLocales()]
Beispiel #4
0
 def get_locales(self) -> list[core.Locale]:
     return [core.Locale(i) for i in self.locales()]