0

I have a Python application using PyQT4 to build the GUI, on Linux works fine, but on Windows the signals aren't being received :/

My code is:

import sys
sys.path.append("..")
from ui import Ui_MainWindow
from dlgContador import Ui_dlgContador
from PyQt4 import QtCore, QtGui
from funciones.archivosOps import archivosOps


class ArchivosGui(QtGui.QMainWindow):
    def __init__(self):
        self.archivo=None
        self.app=QtGui.QApplication(sys.argv)
        QtGui.QMainWindow.__init__(self)
        self.mainWindow=Ui_MainWindow()
        self.mainWindow.setupUi(self)
        self.__connectFunctions()
        self.setWindowTitle("Editor de Texto")
        self.show()
        self.app.exec_()


    pass

   def __connectFunctions(self):
    self.connect(self.mainWindow.actionAbrir,QtCore.SIGNAL("activated()"), self.abrir)
    self.connect(self.mainWindow.actionContar_Palabras,QtCore.SIGNAL("activated()"),self.info)
    self.connect(self.mainWindow.actionGuardar,QtCore.SIGNAL("activated()"),self.guardar)
    self.connect(self.mainWindow.actionGuardarComo,QtCore.SIGNAL("activated()"),self.guardarComo)
    pass

What i'm doing wrong ? :/

4

1 回答 1

0

在 QTDesigner for linux 上,QTAction 有一个名为“Activated()”的信号,并且仅在 Linux 上有效,我的做法已被废弃。

只需将“激活()”更改为“触发()”即可正常工作

于 2012-06-07T02:08:07.500 回答