Cura/cura/Utils/QtUtil.py
2019-04-29 15:53:08 +02:00

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)