вот, что код того, что сделал с QtDesigner
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file ‘main.ui’
#
# Created: Wed Jan 9 15:12:52 2008
# by: PyQt4 UI code generator 4.3.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
class Ui_mainCHM(object):
def setupUi(self, mainCHM):
mainCHM.setObjectName(“mainCHM”)
mainCHM.resize(QtCore.QSize(QtCore.QRect(0,0,641,463).size()).expandedTo(mainCHM.minimumSizeHint()))
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(mainCHM.sizePolicy().hasHeightForWidth())
mainCHM.setSizePolicy(sizePolicy)
mainCHM.setModal(True)
self.verticalLayout = QtGui.QWidget(mainCHM)
self.verticalLayout.setGeometry(QtCore.QRect(0,0,641,461))
self.verticalLayout.setObjectName(“verticalLayout”)
self.vboxlayout = QtGui.QVBoxLayout(self.verticalLayout)
self.vboxlayout.setObjectName(“vboxlayout”)
self.allTabs = QtGui.QTabWidget(self.verticalLayout)
self.allTabs.setObjectName(“allTabs”)
self.clients = QtGui.QWidget()
self.clients.setObjectName(“clients”)
self.clientsTable = QtGui.QTableWidget(self.clients)
self.clientsTable.setWindowModality(QtCore.Qt.NonModal)
self.clientsTable.setGeometry(QtCore.QRect(0,0,631,381))
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum,QtGui.QSizePolicy.Maximum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.clientsTable.sizePolicy().hasHeightForWidth())
self.clientsTable.setSizePolicy(sizePolicy)
self.clientsTable.setAlternatingRowColors(True)
self.clientsTable.setShowGrid(True)
self.clientsTable.setSortingEnabled(True)
self.clientsTable.setObjectName(“clientsTable”)
self.allTabs.addTab(self.clients,“”)
self.vboxlayout.addWidget(self.allTabs)
self.hboxlayout = QtGui.QHBoxLayout()
self.hboxlayout.setObjectName(“hboxlayout”)
self.loadBut = QtGui.QPushButton(self.verticalLayout)
self.loadBut.setObjectName(“loadBut”)
self.hboxlayout.addWidget(self.loadBut)
self.addBut = QtGui.QPushButton(self.verticalLayout)
self.addBut.setObjectName(“addBut”)
self.hboxlayout.addWidget(self.addBut)
self.delBut = QtGui.QPushButton(self.verticalLayout)
self.delBut.setObjectName(“delBut”)
self.hboxlayout.addWidget(self.delBut)
spacerItem = QtGui.QSpacerItem(40,20,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Minimum)
self.hboxlayout.addItem(spacerItem)
self.exitBut = QtGui.QPushButton(self.verticalLayout)
self.exitBut.setObjectName(“exitBut”)
self.hboxlayout.addWidget(self.exitBut)
self.vboxlayout.addLayout(self.hboxlayout)
self.retranslateUi(mainCHM)
self.allTabs.setCurrentIndex(0)
QtCore.QObject.connect(self.exitBut,QtCore.SIGNAL(“clicked()”),mainCHM.close)
QtCore.QMetaObject.connectSlotsByName(mainCHM)
def retranslateUi(self, mainCHM):
mainCHM.setWindowTitle(QtGui.QApplication.translate(“mainCHM”, “mainCHMs”, None, QtGui.QApplication.UnicodeUTF8))
self.clientsTable.setRowCount(0)
self.clientsTable.clear()
self.clientsTable.setColumnCount(7)
self.clientsTable.setRowCount(0)
headerItem = QtGui.QTableWidgetItem()
headerItem.setText(QtGui.QApplication.translate(“mainCHM”, “Улица”, None, QtGui.QApplication.UnicodeUTF8))
self.clientsTable.setHorizontalHeaderItem(0,headerItem)
headerItem1 = QtGui.QTableWidgetItem()
headerItem1.setText(QtGui.QApplication.translate(“mainCHM”, “Дом”, None, QtGui.QApplication.UnicodeUTF8))
self.clientsTable.setHorizontalHeaderItem(1,headerItem1)
headerItem2 = QtGui.QTableWidgetItem()
headerItem2.setText(QtGui.QApplication.translate(“mainCHM”, “Кв.”, None, QtGui.QApplication.UnicodeUTF8))
self.clientsTable.setHorizontalHeaderItem(2,headerItem2)
headerItem3 = QtGui.QTableWidgetItem()
headerItem3.setText(QtGui.QApplication.translate(“mainCHM”, “IP”, None, QtGui.QApplication.UnicodeUTF8))
self.clientsTable.setHorizontalHeaderItem(3,headerItem3)
headerItem4 = QtGui.QTableWidgetItem()
headerItem4.setText(QtGui.QApplication.translate(“mainCHM”, “Тел.”, None, QtGui.QApplication.UnicodeUTF8))
self.clientsTable.setHorizontalHeaderItem(4,headerItem4)
headerItem5 = QtGui.QTableWidgetItem()
headerItem5.setText(QtGui.QApplication.translate(“mainCHM”, “ФИО”, None, QtGui.QApplication.UnicodeUTF8))
self.clientsTable.setHorizontalHeaderItem(5,headerItem5)
headerItem6 = QtGui.QTableWidgetItem()
headerItem6.setText(QtGui.QApplication.translate(“mainCHM”, “Прим.”, None, QtGui.QApplication.UnicodeUTF8))
self.clientsTable.setHorizontalHeaderItem(6,headerItem6)
self.allTabs.setTabText(self.allTabs.indexOf(self.clients), QtGui.QApplication.translate(“mainCHM”, “Клиенты”, None, QtGui.QApplication.UnicodeUTF8))
self.loadBut.setText(QtGui.QApplication.translate(“mainCHM”, “Загрузить”, None, QtGui.QApplication.UnicodeUTF8))
self.addBut.setText(QtGui.QApplication.translate(“mainCHM”, “Добавить”, None, QtGui.QApplication.UnicodeUTF8))
self.delBut.setText(QtGui.QApplication.translate(“mainCHM”, “Удалить”, None, QtGui.QApplication.UnicodeUTF8))
self.exitBut.setText(QtGui.QApplication.translate(“mainCHM”, “Выход”, None, QtGui.QApplication.UnicodeUTF8))