Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2009

    Question QLineEdit - text lost when receives focus


    In Qt (I'm running it in windows) when QLineEdit receives focus with TAB, existing text is selected.
    In Qt for S60, when QLineEdit receives focus with up/down arrow keys, existing text is deleted.
    If focus is set by clicking on emulator (don't try this with real S60 3.2 though ), text remains.

    Is this how it should work, or is there something fishy under the hood?

    I tried this with "Garden" + S60 3.2 emulator and Qt Creator on windows with same sources.

  2. #2
    Registered User
    Join Date
    Dec 2006

    Re: QLineEdit - text lost when receives focus

    Sounds like a bug to me!

    To be sure the development team see it you could mail the QtS60-feedback mailing list, although I think they check here sometimes too.


  3. #3
    Registered User
    Join Date
    May 2009

    Re: QLineEdit - text lost when receives focus

    until they fix the problem for the next release, you can try the following:

    subclass QLineEdit and reimplement focusInEvent

    void focusInEvent( QFocusEvent* /*e*/) { };

    this will prevent the text being deleted... however, when the user edits the text, first thing that happens is a deletion of the old text even if there is no selection whatsoever (in debug I saw an setText("") before the first character being "appended")
    this might be because there is no cursor in the lineedit;
    in order to prevent this, the user would have to click on the Enter Key which will show the cursor in the lineedit and everything will go as expected form here;

    hope it helps

Similar Threads

  1. A new Text node in M3G
    By ijamardo in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2010-03-02, 11:49
  2. Rotate dynamic text box
    By narender_raul in forum [Archived] Flash Lite on Nokia Devices
    Replies: 2
    Last Post: 2008-12-05, 18:21
  3. NewB Question -> How to obtain text from Text Edit
    By mikedeklerk in forum Symbian
    Replies: 8
    Last Post: 2008-03-17, 14:45
  4. javascript set focus to input text box ??
    By zaponjanx in forum Browsing and Mark-ups
    Replies: 5
    Last Post: 2008-03-12, 09:52
  5. Capturing focus lost on a CEikNumberEditor
    By zipher in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-10-15, 21:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts