Skip to content

Instantly share code, notes, and snippets.

@astrofrog
Last active March 3, 2016 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astrofrog/42c43f74b6a09fe54cf2 to your computer and use it in GitHub Desktop.
Save astrofrog/42c43f74b6a09fe54cf2 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ScatterWidget</class>
<widget class="QWidget" name="ScatterWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>287</width>
<height>230</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QComboBox" name="xAxisComboBox">
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
import os
from PySide import QtGui
from PySide.QtUiTools import QUiLoader
class Widget(QtGui.QWidget):
def __init__(self, parent=None):
super(Widget, self).__init__(parent=parent)
loader = QUiLoader()
self.ui = loader.load('options_widget.ui', self)
class MainTest(QtGui.QWidget):
def __init__(self, parent=None):
super(MainTest, self).__init__(parent=parent)
self.layout = QtGui.QVBoxLayout()
self.setLayout(self.layout)
def add_widget(self):
self.layout.addWidget(Widget())
app = QtGui.QApplication([])
main = MainTest()
main.show()
main.add_widget()
app.exec_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment