#!/usr/bin/env python # -*- coding: utf-8 -*- import sys sys.path.insert(0, "../") import qOSM qOSM.use("PyQt5") from qOSM.common import QOSM import time if qOSM.get_backed() == "PyQt5": from PyQt5.QtCore import * from PyQt5.QtWidgets import * elif qOSM.get_backed() == "PyQt4": from PyQt4.QtCore import * from PyQt4.QtGui import * if __name__ == '__main__': @profile def goCoords(): def resetError(): coordsEdit.setStyleSheet('') try: latitude, longitude = coordsEdit.text().split(",") except ValueError: coordsEdit.setStyleSheet("color: red;") QTimer.singleShot(500, resetError) else:
#!/usr/bin/env python # -*- coding: utf-8 -*- import random import sys sys.path.insert(0, "../") import qOSM qOSM.use("PyQt4") from qOSM.common import QOSM if qOSM.get_backed() == "PyQt5": from PyQt5.QtCore import * from PyQt5.QtWidgets import * elif qOSM.get_backed() == "PyQt4": from PyQt4.QtCore import * from PyQt4.QtGui import * def onTimeout(map, marker): lat, lng = map.positionMarker(marker) lat += 0.01 * random.uniform(-1, 1) lng += 0.01 * random.uniform(-1, 1) map.moveMarker(marker, lat, lng) map.centerAt(lat, lng) if __name__ == '__main__': app = QApplication(sys.argv) w = QDialog()