kdevelop speed drop
F@lk Brettschneider
gigafalk at yahoo.com
Fri May 18 14:46:14 UTC 2001
Roland Krause wrote:
>
> Falk,
> so it turns out that there are two different events!
> Can't the MDI framework distiguish between a temporary focus and a real
> focus in event?
I tried to catch that there. See this (The last line (emit gotFocus())
leads to DocViewMan then):
void QextMdiMainFrm::addWindow( QextMdiChildView* pWnd, int flags)
{
...
QObject::connect( pWnd,
SIGNAL(focusInEventOccurs(QextMdiChildView*)), this,
SLOT(activateView(QextMdiChildView*)) );
...
}
void QextMdiMainFrm::activateView(QextMdiChildView* pWnd)
{
if (m_pCurrentWindow != pWnd) {
m_pCurrentWindow = pWnd;
}
else {
pWnd->m_bInterruptActivation = true;
}
...
}
//============= focusInEvent ===============//
void QextMdiChildView::focusInEvent(QFocusEvent *e)
{
// every widget get a focusInEvent when a popup menu is opened!?! ->
maybe bug of QT
if (e && ((e->reason())==QFocusEvent::Popup)) {
return;
}
activate();
}
//============= activate ===============//
void QextMdiChildView::activate()
{
// this isn't called from focusInEvent,
// but we try to set the focus anyway
// if this _is_ called from focusInEvent,
// it doesn't matter to call it again, looping wont happen
setFocus();
// raise the view and push the taskbar button
emit focusInEventOccurs( this);
...
// check if someone wants that we interrupt the method (because it's
probably unnecessary)
if (m_bInterruptActivation) {
m_bInterruptActivation = FALSE;
return; // nothing to do, we are the active childview, already
}
else {
emit gotFocus(this);
}
}
--------------------------------
If the MDI view is already the one which is the current (raised,
caption-highlighted, with the pushed taskbar button), nothing should
happen in DocViewMan, means DocViewMan shouldn't get the gotFocus(this)
signal.
Until then,
F at lk
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
-
to unsubscribe from this list send an email to kdevelop-devel-request at kdevelop.org with the following body:
unsubscribe »your-email-address«
More information about the KDevelop-devel
mailing list