View Full Version : Complex QCompleter
Amouse
7th May 2008, 09:29
I can do simple QCompleter.
But need more complex, for work with long file list.
How i can make Completer like in Windows Explorer ?
http://www.funkyimg.com/u/490/317/aa1_JPG.jpg
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:
#include <QtGui>
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
QLineEdit lineEdit;
QStringList words;
for (int i = 0; i < 200; ++i)
words += QString("word %1").arg(i);
QCompleter completer(words);
lineEdit.setCompleter(&completer);
lineEdit.show();
QSizeGrip* sizeGrip = new QSizeGrip(completer.popup());
completer.popup()->setCornerWidget(sizeGrip);
completer.popup()->setWindowFlags(Qt::FramelessWindowHint | Qt::SubWindow);
return app.exec();
}
wysota
12th May 2008, 22:39
Please don't use external sites for storing images pasted in the forum.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.