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

bool QCoreApplication::sendEvent ( QObject receiver,
QEvent event 
) [inline, static]

Sends event event directly to receiver receiver, using the notify() function. Returns the value that was returned from the event handler.

The event is not deleted when the event has been sent. The normal approach is to create the event on the stack, for example:

        QMouseEvent event(QEvent::MouseButtonPress, pos, 0, 0, 0);
        QApplication::sendEvent(mainWindow, &event);

See also:
postEvent(), notify()

Definition at line 206 of file qcoreapplication.h.

Referenced by QMdiSubWindow::closeEvent(), Q3Table::contentsMouseReleaseEvent(), QGraphicsView::contextMenuEvent(), QDialog::contextMenuEvent(), QGraphicsView::dragEnterEvent(), QGraphicsView::dragLeaveEvent(), QGraphicsView::dragMoveEvent(), QGraphicsView::dropEvent(), QWidget::ensurePolished(), QWidget::event(), QApplication::event(), QMenuBar::event(), QMdiArea::event(), Q3FileDialog::eventFilter(), QCompleter::eventFilter(), Q3DockArea::eventFilter(), Q3ComboBox::eventFilter(), QFontDialog::eventFilter(), QGraphicsView::focusInEvent(), QGraphicsView::focusOutEvent(), QGraphicsView::inputMethodEvent(), QWidget::insertAction(), installTranslator(), Q3Table::keyPressEvent(), QGraphicsView::keyPressEvent(), Q3ListBox::keyPressEvent(), QMenu::keyPressEvent(), QGraphicsView::keyReleaseEvent(), QWidget::lower(), QGraphicsView::mouseDoubleClickEvent(), QAbstractItemView::mouseMoveEvent(), QGraphicsView::mouseMoveEvent(), QGraphicsView::mousePressEvent(), QGraphicsScene::mouseReleaseEvent(), QGraphicsView::mouseReleaseEvent(), QApplication::notify(), QWidget::overrideWindowState(), QAccessible::queryAccessibleInterface(), QWidget::raise(), QWidget::removeAction(), removeTranslator(), QWidget::setAttribute(), QWidget::setContentsMargins(), QGraphicsScene::setFocus(), QApplication::setFont(), QWidget::setParent(), QObject::setProperty(), QApplication::setStyle(), QDialog::setVisible(), QWidget::setWindowState(), QAction::showStatusText(), QWidget::stackUnder(), QAccessibleHeader::text(), QGraphicsView::viewportEvent(), Q3ComboBox::wheelEvent(), QAbstractScrollArea::wheelEvent(), QGraphicsView::wheelEvent(), QApplication::~QApplication(), and QWidget::~QWidget().

{  if (event) event->spont = false; return self ? self->notifyInternal(receiver, event) : false; }


Generated by  Doxygen 1.6.0   Back to index