Dmitri Bogomolov
51b5e64f34
QtPy is a compatibility layer which allows to use the code written for PyQt5 with any python Qt binding: PyQt4, PyQt5, pyside or pyside2. Main differences in PyQt5: - all widget classes are now in QtWidgets package, not QtGui; - QString obsoleted by unicode (sip API 2); - changed the way of signals connection. Closes: #1191
16 lines
339 B
Python
16 lines
339 B
Python
from qtpy import uic
|
|
import os.path
|
|
import paths
|
|
|
|
|
|
def resource_path(resFile):
|
|
baseDir = paths.codePath()
|
|
for subDir in ("ui", "bitmessageqt"):
|
|
path = os.path.join(baseDir, subDir, resFile)
|
|
if os.path.isfile(path):
|
|
return path
|
|
|
|
|
|
def load(resFile, widget):
|
|
uic.loadUi(resource_path(resFile), widget)
|