Results 1 to 3 of 3

Thread: Complex QCompleter

  1. #1
    Join Date
    May 2008
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Complex QCompleter

    I can do simple QCompleter.
    But need more complex, for work with long file list.
    How i can make Completer like in Windows Explorer ?


  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: Complex QCompleter

    The scrollbar is provided out of the box once the view has enough items. For the resize handle you may try to abuse QSizeGrip like this:
    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char* argv[])
    4. {
    5. QApplication app(argc, argv);
    6.  
    7. QLineEdit lineEdit;
    8.  
    9. QStringList words;
    10. for (int i = 0; i < 200; ++i)
    11. words += QString("word %1").arg(i);
    12.  
    13. QCompleter completer(words);
    14. lineEdit.setCompleter(&completer);
    15. lineEdit.show();
    16.  
    17. QSizeGrip* sizeGrip = new QSizeGrip(completer.popup());
    18. completer.popup()->setCornerWidget(sizeGrip);
    19. completer.popup()->setWindowFlags(Qt::FramelessWindowHint | Qt::SubWindow);
    20.  
    21. return app.exec();
    22. }
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  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: Complex QCompleter

    Please don't use external sites for storing images pasted in the forum.

Similar Threads

  1. a smarter QCompleter
    By ber_44 in forum Qt Programming
    Replies: 7
    Last Post: 30th March 2011, 07:10
  2. get current item from QCompleter
    By evgenM in forum Qt Programming
    Replies: 1
    Last Post: 15th August 2007, 18:16
  3. Move QCompleter on QRect x,y
    By patrik08 in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 10:33
  4. Complex Numbers
    By Max Yaffe in forum Qt Programming
    Replies: 2
    Last Post: 24th May 2007, 17:40
  5. QCompleter + QSqlTableModel problem
    By Lykurg in forum Qt Programming
    Replies: 2
    Last Post: 11th March 2007, 20:59

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.