Results 1 to 3 of 3

Thread: is there any Widget like searching into Google, only while searching, be appear?

  1. #1
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default is there any Widget like searching into Google, only while searching, be appear?

    is there any Widget that only while searching, be appear like searching into Google? and always have minimum size and never effects on size of other Widgets (like opening a QComboBox window).
    QListWidget is not suitable because of effecting on size of other Widgets when it is going to be bigger and bigger.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,235
    Thanks
    303
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: is there any Widget like searching into Google, only while searching, be appear?

    QListWidget is not suitable because of effecting on size of other Widgets when it is going to be bigger and bigger.
    QListWidget will not change its size unless you let it. If you put it into a layout and set constraints on its maximum size, it will never get any larger than that. If your instance of QListWidget changes in size as you add more items to it, then you haven't implemented your UI design correctly.

  3. #3
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: is there any Widget like searching into Google, only while searching, be appear?

    Thanks d_stranz,
    I need it takes no space like QComboBox window (or google suggested window while searching). Is there any Widget like this? If no, then I must use a QComboBox (with no border). But in this way I need window of QComboBox always be opened. How can it be opened always


    Added after 32 minutes:


    I found that: QCompleter

    Qt Code:
    1. QWidget wdg;
    2.  
    3. QStringList wordList;
    4. wordList << "alpha" << "omega" << "omicron" << "zeta";
    5.  
    6. QLineEdit *lineEdit = new QLineEdit(&wdg);
    7. QCompleter *completer = new QCompleter(wordList,&wdg);
    8.  
    9. completer->setCaseSensitivity(Qt::CaseInsensitive);
    10. completer->setFilterMode(Qt::MatchContains);
    11. lineEdit->setCompleter(completer);
    12.  
    13. wdg.show();
    To copy to clipboard, switch view to plain text mode 
    Last edited by Alex22; 21st January 2016 at 17:49.

Similar Threads

  1. QAbstractListModel searching.
    By ComaWhite in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2009, 18:41
  2. Searching in a list.
    By kaushal_gaurav in forum Qt Programming
    Replies: 4
    Last Post: 15th October 2008, 08:00
  3. searching in a TableWidget
    By peace_comp in forum Qt Programming
    Replies: 1
    Last Post: 17th May 2008, 16:17
  4. Searching a QTable
    By nategoofs in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 22:15
  5. Searching in QListView
    By ct in forum Qt Programming
    Replies: 20
    Last Post: 28th July 2007, 14:40

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.