PyBitmessage-2021-04-27/src/bitmessageqt/widgets.py
Dmitri Bogomolov 51b5e64f34
Initial support for PyQt5 (main window shown) using QtPy package.
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
2021-03-03 18:28:47 +02:00

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)