Diensteabruf integriert
This commit is contained in:
@@ -18,7 +18,9 @@ QVariant: Type[Any] = object
|
||||
QDockWidget: Type[Any] = object
|
||||
QMessageBox: Type[Any] = object
|
||||
QFileDialog: Type[Any] = object
|
||||
QProgressDialog: Type[Any] = object
|
||||
QEventLoop: Type[Any] = object
|
||||
QTimer: Type[Any] = object
|
||||
QUrl: Type[Any] = object
|
||||
QNetworkRequest: Type[Any] = object
|
||||
QNetworkReply: Type[Any] = object
|
||||
@@ -66,6 +68,7 @@ try:
|
||||
from qgis.PyQt.QtWidgets import (
|
||||
QMessageBox as _QMessageBox,
|
||||
QFileDialog as _QFileDialog,
|
||||
QProgressDialog as _QProgressDialog,
|
||||
QWidget as _QWidget,
|
||||
QGridLayout as _QGridLayout,
|
||||
QLabel as _QLabel,
|
||||
@@ -86,6 +89,7 @@ try:
|
||||
)
|
||||
from qgis.PyQt.QtCore import (
|
||||
QEventLoop as _QEventLoop,
|
||||
QTimer as _QTimer,
|
||||
QUrl as _QUrl,
|
||||
QCoreApplication as _QCoreApplication,
|
||||
Qt as _Qt,
|
||||
@@ -100,7 +104,10 @@ try:
|
||||
QT_VERSION = 6
|
||||
QMessageBox = _QMessageBox
|
||||
QFileDialog = _QFileDialog
|
||||
QProgressDialog = _QProgressDialog
|
||||
QProgressDialog = _QProgressDialog
|
||||
QEventLoop = _QEventLoop
|
||||
QTimer = _QTimer
|
||||
QUrl = _QUrl
|
||||
QNetworkRequest = _QNetworkRequest
|
||||
QNetworkReply = _QNetworkReply
|
||||
@@ -176,6 +183,7 @@ except (ImportError, AttributeError):
|
||||
)
|
||||
from PyQt5.QtCore import (
|
||||
QEventLoop as _QEventLoop,
|
||||
QTimer as _QTimer,
|
||||
QUrl as _QUrl,
|
||||
QCoreApplication as _QCoreApplication,
|
||||
Qt as _Qt,
|
||||
@@ -191,6 +199,7 @@ except (ImportError, AttributeError):
|
||||
QMessageBox = _QMessageBox
|
||||
QFileDialog = _QFileDialog
|
||||
QEventLoop = _QEventLoop
|
||||
QTimer = _QTimer
|
||||
QUrl = _QUrl
|
||||
QNetworkRequest = _QNetworkRequest
|
||||
QNetworkReply = _QNetworkReply
|
||||
@@ -291,6 +300,17 @@ except (ImportError, AttributeError):
|
||||
|
||||
QEventLoop = _MockQEventLoop
|
||||
|
||||
class _MockQTimer:
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.timeout = type('Signal', (), {
|
||||
'connect': lambda s, cb: None,
|
||||
})()
|
||||
def setSingleShot(self, v: bool) -> None: pass
|
||||
def start(self, ms: int) -> None: pass
|
||||
def stop(self) -> None: pass
|
||||
|
||||
QTimer = _MockQTimer
|
||||
|
||||
class _MockQUrl(str):
|
||||
def isValid(self) -> bool: return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user