Eneboo - Documentación para desarrolladores
Métodos públicos | Atributos protegidos
Referencia de la Clase QCloseEvent

The QCloseEvent class contains parameters that describe a close event. Más...

#include <qevent.h>

Diagrama de herencias de QCloseEvent
QEvent QEvent Qt Qt Qt Qt

Lista de todos los miembros.

Métodos públicos

 QCloseEvent ()
bool isAccepted () const
void accept ()
void ignore ()
 QCloseEvent ()
bool isAccepted () const
void accept ()
void ignore ()

Atributos protegidos

bool accpt

Descripción detallada

The QCloseEvent class contains parameters that describe a close event.

Close events are sent to widgets that the user wants to close, usually by choosing "Close" from the window menu, or by clicking the `X' titlebar button. They are also sent when you call QWidget::close() to close a widget programmatically.

Close events contain a flag that indicates whether the receiver wants the widget to be closed or not. When a widget accepts the close event, it is hidden (and destroyed if it was created with the WDestructiveClose flag). If it refuses to accept the close event nothing happens. (Under X11 it is possible that the window manager will forcibly close the window; but at the time of writing we are not aware of any window manager that does this.)

The application's main widget -- QApplication::mainWidget() -- is a special case. When it accepts the close event, Qt leaves the main event loop and the application is immediately terminated (i.e. it returns from the call to QApplication::exec() in the main() function).

The event handler QWidget::closeEvent() receives close events. The default implementation of this event handler accepts the close event. If you do not want your widget to be hidden, or want some special handing, you should reimplement the event handler.

The closeEvent() in the Application Walkthrough shows a close event handler that asks whether to save a document before closing.

If you want the widget to be deleted when it is closed, create it with the WDestructiveClose widget flag. This is very useful for independent top-level windows in a multi-window application.

{QObject}s emits the destroyed() signal when they are deleted.

If the last top-level window is closed, the QApplication::lastWindowClosed() signal is emitted.

The isAccepted() function returns TRUE if the event's receiver has agreed to close the widget; call accept() to agree to close the widget and call ignore() if the receiver of this event does not want the widget to be closed.

Ver también:
QWidget::close(), QWidget::hide(), QObject::destroyed(), QApplication::setMainWidget(), QApplication::lastWindowClosed(), QApplication::exec(), QApplication::quit()

Documentación del constructor y destructor

QCloseEvent::QCloseEvent ( ) [inline]

Constructs a close event object with the accept parameter flag set to FALSE.

Ver también:
accept()
QCloseEvent::QCloseEvent ( ) [inline]

Documentación de las funciones miembro

void QCloseEvent::accept ( ) [inline]

Sets the accept flag of the close event object.

Setting the accept flag indicates that the receiver of this event agrees to close the widget.

The accept flag is not set by default.

If you choose to accept in QWidget::closeEvent(), the widget will be hidden. If the widget's WDestructiveClose flag is set, it will also be destroyed.

Ver también:
ignore(), QWidget::hide()
void QCloseEvent::accept ( ) [inline]
void QCloseEvent::ignore ( ) [inline]
void QCloseEvent::ignore ( ) [inline]

Clears the accept flag of the close event object.

Clearing the accept flag indicates that the receiver of this event does not want the widget to be closed.

The close event is constructed with the accept flag cleared.

Ver también:
accept()
bool QCloseEvent::isAccepted ( ) const [inline]
bool QCloseEvent::isAccepted ( ) const [inline]

Returns TRUE if the receiver of the event has agreed to close the widget; otherwise returns FALSE.

Ver también:
accept(), ignore()

Documentación de los datos miembro

bool QCloseEvent::accpt [protected]

La documentación para esta clase fue generada a partir de los siguientes ficheros:
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'