[PyQt] GUI Designing query

Tomas Sobota tom at sobota.net
Sat Jan 11 17:17:22 GMT 2014


Hi Pankaj,

What I do is capture the close event in the MainWindow class. Like this:

class Main(QMainWindow):
    def __init__(self):
        QMainWindow.__init__(self)
    .
    .
    .
    def closeEvent(self, event):
        if QMessageBox.question(
            self,
            "My App Name",
            self.trUtf8("Do you really want to exit the program?"),
            QMessageBox.Yes|QMessageBox.No) == QMessageBox.No:
            event.ignore()

In your case the logic will be different but this is the event that you
need.

Tom


On Sat, Jan 11, 2014 at 2:18 PM, Pankaj Gupta <pankaj at gaurishiv.org> wrote:

> Hi all,
>
> I am very new to PyQt. As per the requirement I have to disable panel
> close button appears on the GUI at right top most corner. the user must
> close the GUI by clicking the push button available on the GUI.
>
> There are two options I have either I can disable the panel close button
> during the design time or else I can develop a code to shut down the system
> for panel close event.  but I am not able to find out both the options. I
> am not able to disable panel close button at design time or even I am not
> able to figure out how to track panel close event.
>
> Please give me your valuable suggestion for this..
>
> Thanks in advance
>
> --
> Thanks with Regards:
> Pankaj
> Bangalore,Karnatka
> cell: *+91-9035486588 <%2B91-9035486588>*
>
>
>
>
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140111/f0d136ea/attachment.html>


More information about the PyQt mailing list