5 |
5 |
6 """ |
6 """ |
7 Module to get the object name, class name or signatures of a Qt form (*.ui). |
7 Module to get the object name, class name or signatures of a Qt form (*.ui). |
8 """ |
8 """ |
9 |
9 |
|
10 import contextlib |
|
11 import json |
10 import sys |
12 import sys |
11 import json |
|
12 import xml.etree.ElementTree # secok |
13 import xml.etree.ElementTree # secok |
13 import contextlib |
|
14 |
14 |
15 try: |
15 try: |
|
16 from PyQt5 import uic |
16 from PyQt5.QtCore import QByteArray, QMetaMethod |
17 from PyQt5.QtCore import QByteArray, QMetaMethod |
17 from PyQt5.QtWidgets import QAction, QApplication, QWidget |
18 from PyQt5.QtWidgets import QAction, QApplication, QWidget |
18 from PyQt5 import uic |
|
19 except ModuleNotFoundError: |
19 except ModuleNotFoundError: |
20 print("PyQt5 could not be found.") |
20 print("PyQt5 could not be found.") |
21 sys.exit(1) |
21 sys.exit(1) |
22 except ImportError as err: |
22 except ImportError as err: |
23 print("PyQt5 could not be imported. Issue: {0}".format(str(err))) |
23 print("PyQt5 could not be imported. Issue: {0}".format(str(err))) |