本文整理汇总了C++中QCompleter::setMaxVisibleItems方法的典型用法代码示例。如果您正苦于以下问题:C++ QCompleter::setMaxVisibleItems方法的具体用法?C++ QCompleter::setMaxVisibleItems怎么用?C++ QCompleter::setMaxVisibleItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCompleter
的用法示例。
在下文中一共展示了QCompleter::setMaxVisibleItems方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateArgumentCompleter
void MainWindow::updateArgumentCompleter(QStringList *list, bool google)
{
editingCompleter++;
QCompleter *completer = ui->txtArgument->completer();
if (completer == NULL) {
completer = new QCompleter(*list, ui->txtArgument);
ui->txtArgument->setCompleter(completer);
} else {
QStringListModel *model = new QStringListModel(*list, completer);
completer->setModel(model);
}
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->popup()->installEventFilter(this);
completer->popup()->setItemDelegate(new GoogleResultDelegate());
if (google) {
completer->setMaxVisibleItems(21);
} else {
completer->setMaxVisibleItems(7);
}
completer->setCompletionPrefix(ui->txtArgument->text());
if (!list->isEmpty()) {
completer->complete();
}
editingCompleter--;
}
示例2: showCommands
void Omnibar::showCommands() {
this->setFocus();
this->setText(": ");
QCompleter *completer = this->completer();
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setModelSorting(QCompleter::CaseSensitivelySortedModel);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setFilterMode(Qt::MatchStartsWith);
completer->setMaxVisibleItems(20);
completer->setCompletionPrefix(": ");
completer->complete();
}
示例3: setupCompleter
void Omnibar::setupCompleter() {
// Set gotoEntry completer for jump history
QStringList flagsList = this->getFlags();
QCompleter *completer = new QCompleter(flagsList, this);
completer->setMaxVisibleItems(20);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setModelSorting(QCompleter::CaseSensitivelySortedModel);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setFilterMode(Qt::MatchContains);
QStringListModel *completerModel = (QStringListModel*)(completer->model());
completerModel->setStringList(completerModel->stringList() << this->commands);
this->setCompleter(completer);
}