def create_window(): window = QtGui.QMainWindow() #(1) container = QtGui.QWidget(window) textbox = QtGui.QLineEdit(container) layout = QtGui.QHBoxLayout(container) #(2) container.setLayout(layout) layout.addWidget(textbox) #(3) window.setCentralWidget(container) #(4) return window
def create_window(): window = QtGui.QMainWindow() window.setWindowTitle('Hierarchy Converter') container = QtGui.QWidget(window) label = QtGui.QLabel('Prefix:', container) textbox = QtGui.QLineEdit(container) button = QtGui.QPushButton('Convert', container) layout = QtGui.QHBoxLayout(container) container.setLayout(layout) # Add them to the layout, first widget added is left-most layout.addWidget(label) layout.addWidget(textbox) layout.addWidget(button) window.setCentralWidget(container) return window
def create_window(): win = QtGui.QMainWindow() return win