Skip to content

Commit

Permalink
config: PyQt4 compat 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Jun 8, 2016
1 parent b9258be commit 4bb0cab
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
import os
import sys

from PySide import QtCore, QtGui, QtUiTools

try:
from PySide import QtCore, QtGui, QtUiTools
except ImportError:
from PyQt4 import QtCore, QtGui, uic

# Python 3 compatibility
try:
Expand All @@ -29,12 +31,10 @@ def __init__(self, *args, **kwargs):

self.config = col.OrderedDict()

#self.setLayout(QtGui.QVBoxLayout())
self.ui = QtUiTools.QUiLoader().load("config.ui")
#self.layout().addWidget(self.ui)

print(dir(self))
print(dir(self.ui))
try:
self.ui = QtUiTools.QUiLoader().load("config.ui")
except NameError:
self.ui = uic.loadUi("config.ui")

btn_box = self.ui.buttonBox
ok_btn = btn_box.button(
Expand Down Expand Up @@ -73,8 +73,6 @@ def main(*argv):
app = QtGui.QApplication(sys.argv)
window = Config()
window.show()
window.activateWindow()
window.raise_()
return app.exec_()

if __name__ == "__main__":
Expand Down

0 comments on commit 4bb0cab

Please sign in to comment.