Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

void TextEdit::closeEvent ( QCloseEvent event  )  [protected, virtual]

This event handler is called with the given event when Qt receives a window close request for a top-level widget from the window system.

By default, the event is accepted and the widget is closed. You can reimplement this function to change the way the widget responds to window close requests. For example, you can prevent the window from closing by calling {QEvent::}{ignore()} on all events.

Main window applications typically use reimplementations of this function to check whether the user's work has been saved and ask for permission before closing. For example, the {Application Example} uses a helper function to determine whether or not to close the window:

mainwindows/application/mainwindow.cpp 3 mainwindows/application/mainwindow.cpp 4

See also:
event(), hide(), close(), QCloseEvent, {Application Example}

Reimplemented from QWidget.

Definition at line 136 of file textedit.cpp.

References QEvent::accept(), and QEvent::ignore().

    if (maybeSave())

Generated by  Doxygen 1.6.0   Back to index