[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Losing the focus
From:       Andras Mantia <amantia () virtualartisans ! com>
Date:       2002-10-09 7:50:46
[Download RAW message or body]

Hi,

 I have a strange bug in Quanta (and a similar one is visible in Kdevelop). 
The KTextEditor part loses the focus from time to time. It means that there 
is no cursor, even if you click on the editor part, you couldn't type any 
text, but you can use the mouse to select text. The focus & cursor can be 
restored with a RMB and than a LMB click. Actually I was able to reproduce 
the focus losing: it happens when a dialog is shown. Like:
[..]
 TagQuickStart *quickDlg = new TagQuickStart(...);
  if (write()->view()->hasFocus()) 
	cout << "Has focus 1 \n"; // Here the view() has focus
  else cout << "No focus1 \n";
  if ( quickDlg->exec() )
   { ...
   }
 delete quickDlg; 
  write()->view()->setFocus();
  if (write()->view()->hasFocus()) cout << "Has focus 2";
  else cout << "No focus2 \n"; //here the view has lost the focus
[...]

As you can see the focus does not come back even after explicitely calling the 
setfocus for view() which had the focus before the dialog was displayed. How 
can I give back the focu to the view() from code? BTW, view() returns a 
pointer to the KTextEditor::View.

 Removing the quickDlg->exec() line "solves" the problem... The dialog itself 
is simple with some QLineEdits and QComboBoxes. (They have StrongFocus 
policy). 

Andras


PS: I CC'd to the kwrite-devel, maybe you can also give me a hint. Please 
include my address in the reply.
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic