[PySide] Fwd: Defining your own signal

Hedieh Ebrahimi hedieh.ebrahimi at amphos21.com
Tue Oct 29 12:55:40 CET 2013


Hi,

I have a pushbutton which i want to add my own signal and my own defined
signal to it.
So this is how I added it. The idea is when the pushbutton is clicked , a
file dialog opens that asks for a file.  I have my ui objects in a separate
file which i import in this file.


The problem is my file dialog opens before my main window.
Could anybody please help me to fix this.

Thanks in Advance.


class MainAppWindow(QMainWindow):

    def __init__(self,
                 parent=None):
        super(MainAppWindow, self).__init__()

        self.ui = Ui_MainWindow.Ui_MainWindow()
        self.ui.setupUi(self)
        pushed=QtCore.Signal()

        self.connect(self.ui.X_Vel_pushButton, QtCore.SIGNAL("pushed()"),
        self.askforfileBTN(self.ui.X_Vel_lineEdit))


This is the class that runs it :

import sys

from PySide.QtGui import QApplication
from MainAppWindow import MainAppWindow

curApp = QApplication(sys.argv)

mainView = MainAppWindow()
mainView.show()
sys.exit(curApp.exec_())
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20131029/aec69703/attachment.html>


More information about the PySide mailing list