Results 1 to 3 of 3

Thread: Subclassing QLineEdit and suppress signal textChanged

  1. #1
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Subclassing QLineEdit and suppress signal textChanged

    Hi,

    I am subclassing QLineEdit in order to check the input string, if can replace a defined two char sequence. G.e. "u:" should transformed in "ü".
    How can I catch the signal textChanged() to perform my changes in a private slot and only after this the signal should go out the the other widgets? If I not suppress the signal, it is going out twice. Once for "u:" and once for the changed "ü". But I want that only the last one is emitted.


    Thanks for suggestions,

    Lykurg

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Subclassing QLineEdit and suppress signal textChanged

    Hi, forget about textChanged() signal but implement a QValidator and install it on the line edit widget.
    J-P Nurmi

  3. The following user says thank you to jpn for this useful post:

    Lykurg (15th February 2008)

  4. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Subclassing QLineEdit and suppress signal textChanged

    QValidator is just perfect for my issue!
    Thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.