Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, August 2006
Cursor flashing when skipping a QLineEdit


Message 1 in thread

Hi,

I'm using this code ( it results from what ie learned here some time ago ) to 
test if a QLineEdit should get focus or not:

bool LineEdit::eventFilter( QObject *Object, QEvent *Event )
{
  bool SignalRet = TRUE;
  if ( Event->type() == QEvent::FocusIn )
  {
    emit When( &SignalRet );
    if ( !SignalRet )
      focusNextPrevChild( TRUE );
   }
  return(QLineEdit::eventFilter(Object,Event));
}

But, when a QLineEdit is skipped due to a FALSE return from When signal, a 
flashing cursor appears at this QLineEdit. If two or more QLineEdits are 
skipped at one QDialog, each one of them gets a flashing cursor.

The users doesn't like these "fake" cursors. How can i make this "fake" cursor 
disappears?

Thanks

Josinei R. L. Silva

	

	
		
_______________________________________________________ 
Você quer respostas para suas perguntas? Ou você sabe muito e quer compartilhar seu conhecimento? Experimente o Yahoo! Respostas !
http://br.answers.yahoo.com/

--
 [ signature omitted ] 

Message 2 in thread

Josinei Silva [mailto:josinei_listas@xxxxxxxxxxxx] 
> 
> I'm using this code ( it results from what ie learned here 
> some time ago ) to 
> test if a QLineEdit should get focus or not:
> 
> bool LineEdit::eventFilter( QObject *Object, QEvent *Event )
> {
>   bool SignalRet = TRUE;
>   if ( Event->type() == QEvent::FocusIn )
>   {
>     emit When( &SignalRet );
>     if ( !SignalRet )
>       focusNextPrevChild( TRUE );
>    }
>   return(QLineEdit::eventFilter(Object,Event));
> }
> 
> But, when a QLineEdit is skipped due to a FALSE return from When signal, a 
> flashing cursor appears at this QLineEdit. If two or more  QLineEdits are 
> skipped at one QDialog, each one of them gets a flashing cursor.
> 
> The users doesn't like these "fake" cursors. How can i make 
> this "fake" cursor  disappears?

Would returning 'true' help?

I.e. something like

 bool LineEdit::eventFilter( QObject *Object, QEvent *Event )
 {
   if ( Event->type() == QEvent::FocusIn ) {
	   bool SignalRet = true;
	   emit When( &SignalRet );
	   if ( !SignalRet )
	      focusNextPrevChild( true );
	   return true;
   }
   return false;
 }

?

Andre'

--
 [ signature omitted ] 

Message 3 in thread

Andre,

Em Terça 15 Agosto 2006 12:22, André Pönitz escreveu:
>
> Would returning 'true' help?
>

It works :)

I used:


 bool LineEdit::eventFilter( QObject *Object, QEvent *Event )
 {
    if ( Event->type() == QEvent::FocusIn ) {
 	   bool SignalRet = true;
 	   emit When( &SignalRet );
 	   if ( !SignalRet )
              {
 	      focusNextPrevChild( true );
              return true;
              }
    }
    return false;
}

Well, not exactly like this because my eventFilter does somethings more. But 
return true makes the "fake" cursor disappears.

Thanks a lot

Josinei





_______________________________________________________
Você quer respostas para suas perguntas? Ou você sabe muito e quer compartilhar seu conhecimento? Experimente o Yahoo! Respostas !
http://br.answers.yahoo.com/

--
 [ signature omitted ]