如何使用PyQt 3.3.6创建表?

时间:2015-06-08 17:11:14

标签: python pyqt python-2.4

我无法访问设计师。我能够制作一个列表(但只能有一列)。我尝试了QTableView和QListView,基本上我可以在互联网上找到的所有内容(尽管它都面向PyQt 4),但没有任何效果。我最近的尝试是QGridView,它产生错误:

" qt.QGridView代表一个C ++抽象类,无法实例化"

代码:

from qt import *
class main_window(QMainWindow):
    def __init__(self, *args):
        apply(QMainWindow.__init__, (self,) + args)
        self.mainWidget = QWidget(self);
        self.vlayout = QVBoxLayout(self.mainWidget, 10, 5)

        self.table = QGridView(self.mainWidget)
        self.vlayout.addWidget(self.table)

def main(args):
    app = QApplication(args)
    win = main_window()
    win.show()
    app.connect(app, SIGNAL("lastWindowClosed()"), app.quit)
    app.exec_loop()

0 个答案:

没有答案