问 题
请教一下大家,想实现在主窗口中点击按钮调用一个新窗口,这个窗口是tablewidget,目前可以实现弹出窗口,但是无法显示表格,只有一个空白窗口。实在找不到原因了,还请大家指点。
这是主窗口代码
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'question.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(344, 244)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.pushButton = QtGui.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(110, 80, 121, 61))
font = QtGui.QFont()
font.setPointSize(17)
self.pushButton.setFont(font)
self.pushButton.setObjectNa