def open_link(url: QUrl): if url.scheme() == "orange": # define custom actions within Orange here if url.host() == "enable-statistics": settings = QSettings() settings.setValue("reporting/send-statistics", True) UsageStatistics.set_enabled(True) if not settings.contains('reporting/machine-id'): settings.setValue('reporting/machine-id', str(uuid.uuid4())) else: QDesktopServices.openUrl(url)