本文整理汇总了C++中FormWindow::handleEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ FormWindow::handleEvent方法的具体用法?C++ FormWindow::handleEvent怎么用?C++ FormWindow::handleEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormWindow
的用法示例。
在下文中一共展示了FormWindow::handleEvent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: eventFilter
bool FormWindowManager::eventFilter(QObject *o, QEvent *e)
{
if (!o->isWidgetType())
return false;
// If we don't have an active form, we only listen for WindowActivate to speed up integrations
const QEvent::Type eventType = e->type();
if (m_activeFormWindow == 0 && eventType != QEvent::WindowActivate)
return false;
switch (eventType) { // Uninteresting events
case QEvent::Create:
case QEvent::Destroy:
case QEvent::ActionAdded:
case QEvent::ActionChanged:
case QEvent::ActionRemoved:
case QEvent::ChildAdded:
case QEvent::ChildPolished:
case QEvent::ChildRemoved:
#ifndef QT_NO_CLIPBOARD
case QEvent::Clipboard:
#endif
case QEvent::ContentsRectChange:
case QEvent::DeferredDelete:
case QEvent::FileOpen:
case QEvent::LanguageChange:
case QEvent::MetaCall:
case QEvent::ModifiedChange:
case QEvent::Paint:
case QEvent::PaletteChange:
case QEvent::ParentAboutToChange:
case QEvent::ParentChange:
case QEvent::Polish:
case QEvent::PolishRequest:
case QEvent::QueryWhatsThis:
case QEvent::StatusTip:
case QEvent::StyleChange:
case QEvent::Timer:
case QEvent::ToolBarChange:
case QEvent::ToolTip:
case QEvent::WhatsThis:
case QEvent::WhatsThisClicked:
case QEvent::WinIdChange:
case QEvent::DynamicPropertyChange:
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
case QEvent::AcceptDropsChange:
return false;
default:
break;
}
QWidget *widget = static_cast<QWidget*>(o);
if (qobject_cast<WidgetHandle*>(widget)) { // ### remove me
return false;
}
FormWindow *fw = FormWindow::findFormWindow(widget);
if (fw == 0) {
return false;
}
if (QWidget *managedWidget = findManagedWidget(fw, widget)) {
// Prevent MDI subwindows from being closed by clicking at the title bar
if (managedWidget != widget && eventType == QEvent::Close) {
e->ignore();
return true;
}
switch (eventType) {
case QEvent::WindowActivate: {
if (fw->parentWidget()->isWindow() && fw->isMainContainer(managedWidget) && activeFormWindow() != fw) {
setActiveFormWindow(fw);
}
} break;
case QEvent::WindowDeactivate: {
if (o == fw && o == activeFormWindow())
fw->repaintSelection();
} break;
case QEvent::KeyPress: {
QKeyEvent *ke = static_cast<QKeyEvent*>(e);
if (ke->key() == Qt::Key_Escape) {
ke->accept();
return true;
}
}
// don't break...
// Embedded Design: Drop on different form: Make sure the right form
// window/device is active before having the widget created by the factory
case QEvent::Drop:
if (activeFormWindow() != fw)
setActiveFormWindow(fw);
// don't break...
default: {
if (fw->handleEvent(widget, managedWidget, e)) {
return true;
//.........这里部分代码省略.........