mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-17 03:37:48 -06:00
21 lines
515 B
Python
21 lines
515 B
Python
# Copyright (c) 2019 Ultimaker B.V.
|
|
# Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
from typing import Optional
|
|
|
|
from PyQt5.QtCore import QObject, pyqtSlot
|
|
|
|
from . import networking
|
|
|
|
|
|
#
|
|
# Exposes the util functions to QML using a QObject.
|
|
#
|
|
class QtUtil(QObject):
|
|
|
|
def __init__(self, parent: Optional["QObject"] = None) -> None:
|
|
super().__init__(parent = parent)
|
|
|
|
@pyqtSlot(str, result = bool)
|
|
def isValidIP(self, address: str) -> bool:
|
|
return networking.isValidIP(address)
|