Python QDialog从QMainWindow继承def

时间:2015-09-23 12:02:44

标签: class methods pyqt function

我在文件window.py中有一个Python MainWindow(QMainWindow)类,我从文件exportar.py导入一个Movimentos(Qdialog)。

当我打开Qdialog Movimentos时,我如何使用Mainwindow中的def功能?

一直在搜索,无法找到答案,对不起,如果已经回答了。 复制代码但它有大约600行...必须维护一个项目,虽然我有一些python的经验,PyQT不是我的强项。

class Movimentos(QDialog, Ui_Movimentos):
"""
Class documentation goes here.
"""
def __init__(self,  MainWindow):
    """
    Constructor
    """
    QDialog.__init__(self, MainWindow)
    self.setupUi(self)
    self.resize(750, 700)
    #---
    exit=QAction(self) 
    self.connect(exit,SIGNAL('triggered()'),SLOT('close()'))

    self.dteate.setDate(QDate.currentDate())
    self.dteate.setTime(QTime.currentTime())
    self.dteDesde.setDate(QDate.currentDate().addDays(-1))
    self.memcsv = cStringIO.StringIO()
    self.row = []

这是来自主窗口,我称之为Movimentos

@pyqtSignature("")
def on_actionMovimentos_triggered(self):
    self.ctimer.stop()
    try:
        self.wndmov = Movimentos(self)
        self.wndmov.exec_()
    except:
        print "sem conexoes ou erro ao abrir janela"
        pass
    self.ctimer.start(60000)

0 个答案:

没有答案
相关问题