Results 1 to 4 of 4

Thread: QLineEdit: with builtin clear button, how to

  1. #1
    Join Date
    Jun 2008
    Posts
    88
    Thanks
    4
    Thanked 4 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11
    Wiki edits
    1

    Default QLineEdit: with builtin clear button, how to

    I'm trying to make a filter widget based off a QLineEdit similar to the GtkEntry or iTunes' search bar that has a builtin clear button to clear the text in the widget.

    iTunes:


    Gtk:


    Whats the best way to go about this? Does anyone have something that already does it so I don't need to re-invent the wheel?
    Attached Images Attached Images

  2. #2
    Join Date
    Jun 2008
    Posts
    88
    Thanks
    4
    Thanked 4 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11
    Wiki edits
    1

    Default Re: QLineEdit: with builtin clear button, how to

    Once again I answer my own question.

    For those interested labs.trolltech.com has already implemented this for you:

    lineedit with a clear button/

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QLineEdit: with builtin clear button, how to

    You may also take a look at wwWidgets that also contain this kind of widget and also allow you to create your own widgets with buttons in different configurations.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Jun 2008
    Posts
    88
    Thanks
    4
    Thanked 4 Times in 3 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11
    Wiki edits
    1

    Default Re: QLineEdit: with builtin clear button, how to

    Very cool stuff, I wish I had known before I implemented it.

    I implemented something thats very similar to the search line edit in firefox:
    Attached Images Attached Images

Similar Threads

  1. clear all QLineEdit
    By jaca in forum Qt Programming
    Replies: 7
    Last Post: 5th August 2016, 07:06
  2. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13
  3. QValidator, regular expressions and QLineEdit
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 01:25

Tags for this Thread

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.