LRESULT WebInspectorProxy::wndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { LRESULT lResult = 0; bool handled = true; switch (message) { case WM_SIZE: lResult = onSizeEvent(hWnd, message, wParam, lParam, handled); break; case WM_GETMINMAXINFO: lResult = onMinMaxInfoEvent(hWnd, message, wParam, lParam, handled); break; case WM_SETFOCUS: lResult = onSetFocusEvent(hWnd, message, wParam, lParam, handled); break; case WM_CLOSE: lResult = onCloseEvent(hWnd, message, wParam, lParam, handled); break; default: handled = false; break; } if (!handled) lResult = ::DefWindowProc(hWnd, message, wParam, lParam); return lResult; }
bool MWMDIManagerImpl::eventFilter(QObject *obj, QEvent *event) { QEvent::Type t = event->type(); if ( t == QEvent::Close) { QMdiSubWindow* qw = qobject_cast<QMdiSubWindow*>(obj); MDIItem* item = getMDIItem(qw); uiLog.trace(QString("Processing close window request for '%1'").arg(getWindowName(item))); //check if user really wants to close the window, ignore event if not if (!onCloseEvent(item->w)) { uiLog.trace(QString("Ignoring close window request for '%1'").arg(getWindowName(item))); event->ignore(); return true; } // here we sure that window will be closed emit si_windowClosing(item->w); if (item == mdiContentOwner) { // if 'current' window is closed -> clear MDI clearMDIContent(true); } items.removeAll(item); delete item; updateState(); } else if (t == QEvent::WindowStateChange) { QMdiSubWindow* qw = qobject_cast<QMdiSubWindow*>(obj); defaultIsMaximized = qw->isMaximized(); } return QObject::eventFilter(obj, event); }
void TwWindow::onSysCmdEvent( TwSysCmdEvent* ev) { if (ev->id() == Tw::Ev_Close) { onCloseEvent(static_cast<TwCloseEvent*>(ev)); } else { ev->accept(); } }
void AdminWindow::onUserEdited(UserRegiData *userData) { isUserEditBtnClicked = false; UserEdit *userEdit = new UserEdit(); userEdit->setUserData(userData); connect(userEdit, SIGNAL(UserEditButtonClicked(UserRegiData*,UserRegiData*)), this, SLOT(onUserEditButtonClicked(UserRegiData*,UserRegiData*))); connect(userEdit, SIGNAL(onCloseEvent()), this, SLOT(onUserEditFormDestroyed()),Qt::UniqueConnection); userEdit->setWindowModality(Qt::ApplicationModal); userEdit->show(); }
void UserEdit::closeEvent(QCloseEvent *event) { emit onCloseEvent(); }
void CoverArtWidget::closeEvent(QCloseEvent *event) { emit onCloseEvent(); QDockWidget::closeEvent(event); }