本文整理汇总了C++中QCompleter::setCompletionMode方法的典型用法代码示例。如果您正苦于以下问题:C++ QCompleter::setCompletionMode方法的具体用法?C++ QCompleter::setCompletionMode怎么用?C++ QCompleter::setCompletionMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCompleter
的用法示例。
在下文中一共展示了QCompleter::setCompletionMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
HCopyCard::HCopyCard(QWidget *parent, QSqlDatabase pdb) :
QWidget(parent),
ui(new Ui::HCopyCard)
{
ui->setupUi(this);
db=pdb;
QSqlTableModel *modclienti=new QSqlTableModel(0,db);
modclienti->setTable("anagrafica");
modclienti->setFilter("cliente > 0");
modclienti->setSort(1,Qt::AscendingOrder);
modclienti->select();
ui->cbC->setModel(modclienti);
ui->cbC->setModelColumn(1);
QCompleter *cc = new QCompleter(modclienti);
cc->setCaseSensitivity(Qt::CaseInsensitive);
cc->setCompletionColumn(1);
cc->setCompletionMode(QCompleter::PopupCompletion);
ui->cbC->setCompleter(cc);
getProducts();
connect(ui->cbC,SIGNAL(currentIndexChanged(int)),this,SLOT(getProducts()));
}
示例2: initImagePage
void EnrichmentDialog::initImagePage()
{
imagePage = new QWidget();
QGroupBox *gb = new QGroupBox();
QGridLayout *gl = new QGridLayout(gb);
gl->addWidget(new QLabel( tr("File")), 0, 0);
imagePathBox = new QLineEdit();
QCompleter *completer = new QCompleter(this);
completer->setModel(new QDirModel(completer));
completer->setModelSorting(QCompleter::CaseSensitivelySortedModel);
completer->setCompletionMode(QCompleter::InlineCompletion);
imagePathBox->setCompleter(completer);
gl->addWidget(imagePathBox, 0, 1);
QPushButton *browseBtn = new QPushButton();
connect(browseBtn, SIGNAL(clicked()), this, SLOT(chooseImageFile()));
browseBtn->setIcon(QIcon(":/folder_open.png"));
gl->addWidget(browseBtn, 0, 2);
boxSaveImagesInternally = new QCheckBox(tr("&Save internally"));
connect(boxSaveImagesInternally, SIGNAL(toggled(bool)), this, SLOT(saveImagesInternally(bool)));
gl->addWidget(boxSaveImagesInternally, 1, 1);
gl->setColumnStretch(1, 1);
gl->setRowStretch(2, 1);
QVBoxLayout *layout = new QVBoxLayout(imagePage);
layout->addWidget(gb);
tabWidget->addTab(imagePage, tr( "&Image" ) );
}
示例3: getProducts
void HCopyCard::getProducts()
{
int cliente=ui->cbC->model()->index(ui->cbC->currentIndex(),0).data(0).toInt();
QString query="SELECT ricette.ID_prodotto, prodotti.descrizione FROM ricette, prodotti WHERE prodotti.ID=ricette.ID_prodotto AND ricette.ID IN (SELECT ID_ricetta FROM associazioni WHERE ID_cliente=:id and visualizza=1)order by prodotti.descrizione";
QSqlQuery q(db);
q.prepare(query);
q.bindValue(":id",QVariant(cliente));
q.exec();
QSqlQueryModel *qrm=new QSqlQueryModel();
qDebug()<<"getProds"<<q.lastError().text();
qrm->setQuery(q);
ui->cbP->setModel(qrm);
ui->cbP->setModelColumn(1);
QCompleter *cp = new QCompleter(qrm);
cp->setCaseSensitivity(Qt::CaseInsensitive);
cp->setCompletionColumn(1);
cp->setCompletionMode(QCompleter::PopupCompletion);
ui->cbP->setCompleter(cp);
ui->cbP->setCurrentIndex(-1);
ui->cbP->setCurrentIndex(0);
}
示例4: QWizardPage
/*
* First page
*/
NdwFirstPage::NdwFirstPage(QWizard *parent)
: QWizardPage(parent) {
setupUi(this);
odbcAvailable = QSqlDatabase::drivers().contains("QODBC");
if (!odbcAvailable) {
odbcCheckBox->setEnabled(false);
odbcCheckBox->setToolTip(tr("You have no ODBC driver installed."));
} else {
odbcCheckBox->setToolTip("");
}
registerField("host", hostLineEdit);
registerField("driver", dbTypeComboBox, "currentDriver");
registerField("usesOdbc", odbcCheckBox);
QCompleter *c = new QCompleter(QStringList("localhost"), this);
c->setCompletionMode(QCompleter::InlineCompletion);
hostLineEdit->setCompleter(c);
connect(dbTypeComboBox, SIGNAL(currentIndexChanged(int)),
this, SIGNAL(completeChanged()));
connect(hostLineEdit, SIGNAL(textChanged(QString)),
this, SIGNAL(completeChanged()));
}
示例5: setZipLineEdit
/** Define the QLineEdit to use as zip code editor */
void ZipCountryCompleters::setZipLineEdit(QLineEdit *zip)
{
m_Zip = zip;
// Completer
QCompleter *completer = new QCompleter(this);
completer->setModel(m_Model);
completer->setCompletionColumn(ZipCountryModel::ZipCity);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
completer->popup()->setAlternatingRowColors(true);
zip->setCompleter(completer);
connect(m_Zip, SIGNAL(textChanged(QString)), this, SLOT(zipTextChanged()));
connect(completer, SIGNAL(activated(QModelIndex)), this, SLOT(indexActivated(QModelIndex)));
// button
m_ZipButton = new QToolButton(m_Zip);
m_ZipButton->setToolTip("Zip button");
m_ZipButton->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_ZipButton->setIconSize(QSize(16,16));
m_ZipButton->setIcon(QIcon(QDir::cleanPath(qApp->applicationDirPath() + "/../../../../../global_resources/pixmap/16x16/ok.png")));
m_ZipButton->setMinimumSize(20,20);
m_ZipButton->setMaximumSize(20,20);
m_ZipButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
m_ZipButton->show();
int frameWidth = m_Zip->style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
QSize msz = m_Zip->minimumSizeHint();
m_Zip->setMinimumSize(qMax(msz.width(), m_ZipButton->maximumHeight() + frameWidth * 2 + 2),
qMax(msz.height(), m_ZipButton->maximumHeight() + frameWidth * 2 + 2));
m_Zip->setStyleSheet(QString("padding-left: %1px;").arg(m_ZipButton->sizeHint().width() + frameWidth));
m_Zip->installEventFilter(this);
}
示例6: 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--;
}
示例7: QWidget
ConfigGeneralWidget::ConfigGeneralWidget(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
#ifdef KTIKZ_USE_KDE
ui.historyLengthLabel->setVisible(false);
ui.historyLengthSpinBox->setVisible(false);
ui.toolBarStyleLabel->setVisible(false);
ui.toolBarStyleComboBox->setVisible(false);
#endif
QCompleter *completer = new QCompleter(this);
completer->setModel(new QDirModel(completer));
completer->setCompletionMode(QCompleter::PopupCompletion);
ui.tikzDocEdit->setCompleter(completer);
ui.latexEdit->setCompleter(completer);
ui.pdftopsEdit->setCompleter(completer);
ui.editorEdit->setCompleter(completer);
ui.tikzDocButton->setIcon(Icon("document-open"));
ui.latexButton->setIcon(Icon("document-open"));
ui.pdftopsButton->setIcon(Icon("document-open"));
ui.editorButton->setIcon(Icon("document-open"));
connect(ui.commandsInDockCheck, SIGNAL(toggled(bool)), this, SLOT(setCommandsInDock(bool)));
connect(ui.tikzDocButton, SIGNAL(clicked()), this, SLOT(browseCommand()));
connect(ui.tikzDocSearchButton, SIGNAL(clicked()), this, SLOT(searchTikzDocumentation()));
connect(ui.latexButton, SIGNAL(clicked()), this, SLOT(browseCommand()));
connect(ui.pdftopsButton, SIGNAL(clicked()), this, SLOT(browseCommand()));
connect(ui.editorButton, SIGNAL(clicked()), this, SLOT(browseCommand()));
}
示例8: initWidget
void QgsUniqueValuesWidget::initWidget( QWidget* editor )
{
mComboBox = qobject_cast<QComboBox*>( editor );
mLineEdit = qobject_cast<QLineEdit*>( editor );
QStringList sValues;
QList<QVariant> values;
layer()->uniqueValues( fieldIdx(), values );
Q_FOREACH( QVariant v, values )
{
if ( mComboBox )
{
mComboBox->addItem( v.toString(), v );
}
sValues << v.toString();
}
if ( mLineEdit )
{
QCompleter* c = new QCompleter( sValues );
c->setCompletionMode( QCompleter::PopupCompletion );
mLineEdit->setCompleter( c );
connect( mLineEdit, SIGNAL( textChanged( QString ) ), this, SLOT( valueChanged( QString ) ) );
}
if ( mComboBox )
{
connect( mComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( valueChanged() ) );
}
}
示例9: setupLineEdit
void ComboBox::setupLineEdit() {
setInsertPolicy(QComboBox::NoInsert);
setLineEdit(new QLineEdit(this));
QCompleter *currentCompleter = completer();
currentCompleter->setCompletionMode(QCompleter::PopupCompletion);
currentCompleter->setCaseSensitivity(Qt::CaseSensitive);
}
示例10: QLabel
AddMagazine::AddMagazine()
{
QLabel *ArticleText = new QLabel("Magazine");
ArticleText->setAlignment(Qt::AlignHCenter);
QFont font = ArticleText->font();
font.setBold(true);
ArticleText->setFont(font);
QLabel *NameText = new QLabel("Name");
NameEdit = new QLineEdit;
QLabel*NumeroText = new QLabel("numero");
numberEdit = new QSpinBox;
//Ajout des noms
QList<QString> listname = MagazineDAO::selectAllName();
QListIterator<QString> i(listname);
QStringList wordList;
while(i.hasNext()){
QString tempo = i.next();
wordList.append( tempo);
}
QCompleter *completer = new QCompleter(wordList, this);
completer->setCompletionMode(QCompleter::InlineCompletion);
completer->setCaseSensitivity(Qt::CaseInsensitive);
NameEdit->setCompleter(completer);
QGridLayout *content = new QGridLayout;
content->addWidget(NameText,0,0);
content->addWidget(NumeroText,0,1);
content->addWidget(NameEdit,1,0);
content->addWidget(numberEdit,1,1);
QPushButton *button = new QPushButton("ADD");
QObject::connect(button, SIGNAL(clicked()), this, SLOT(add()));
QVBoxLayout *theme = new QVBoxLayout;
theme->addWidget(ArticleText);
theme->addLayout(content);
theme->addWidget(button);
theme->setMargin(0);
theme->setSpacing(0);
this->resize(800, 200);
this->setLayout(theme);
}
示例11: create_completer
void Minibuffer::create_completer()
{
QStringList wordList;
// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
wordList << "append-to-buffer" << "append-to-file" << "buffer-menu"
<< "counter" << "copy-to-buffer" << "clock-on" << "clock-off"
<< "dired" << "face" << "goto-line" << "insert-buffer" << "insert-to-buffer" << "insert-file"
<< "prepend-to-buffer" << "new" << "rename-buffer" << "shell" << "set-visited-file-name"
<< "search-backward" << "search-forward" << "search-backward-regexp"
<< "search-forward-regexp" << "unix-tutorial" << "redactor-tutorial"
<< "AliceBlue" << "AntiqueWhite" << "Aqua" << "Aquamarine" << "Azure"
<< "Beige" << "Bisque" << "Black" << "BlanchedAlmond" << "Blue"
<< "BlueViolet" << "Brown" << "BurlyWood" << "CadetBlue"
<< "Chartreuse" << "Chocolate" << "Coral" << "CornflowerBlue"
<< "Cornsilk" << "Crimson" << "Cyan" << "DarkBlue" << "DarkCyan"
<< "DarkGoldenRod" << "DarkGray" << "DarkGrey"
<< "DarkGreen" << "DarkKhaki" << "DarkMagenta" << "DarkOliveGreen"
<< "Darkorange" << "DarkOrchid" << "DarkRed" << "DarkSalmon"
<< "DarkSeaGreen" << "DarkSlateBlue" << "DarkSlateGray"
<< "DarkSlateGrey" << "DarkTurquoise" << "DarkViolet" << "DeepPink"
<< "DeepSkyBlue" << "DimGray" << "DimGrey" << "DodgerBlue"
<< "FireBrick" <<"FloralWhite" << "ForestGreen" << "Fuchsia" << "Gainsboro"
<< "GhostWhite" << "Gold" << "GoldenRod" << "Gray" << "Grey" << "Green"
<< "GreenYellow" << "HoneyDew" << "HotPink" << "IndianRed" << "Indigo"
<< "Ivory" << "Khaki" << "Lavender" << "LavenderBlush"
<< "LawnGreen" << "LemonChiffon" << "LightBlue" << "LightCoral"
<< "LightCyan" << "LightGoldenRodYellow" << "LightGray" << "LightGrey"
<< "LightGreen" << "LightPink" << "LightSalmon" << "LightSeaGreen"
<< "LightSkyBlue" << "LightSlateGray" << "LightSlateGrey" << "LightSteelBlue"
<< "LightYellow" << "Lime" << "LimeGreen" << "Linen" << "Magenta"
<< "Maroon" << "MediumAquaMarine" << "MediumBlue" << "MediumOrchid"
<< "MediumPurple" << "MediumSeaGreen" << "MediumSlateBlue" << "MediumSpringGreen"
<< "MediumTurquoise" << "MediumVioletRed" << "MidnightBlue"
<< "MintCream" << "MistyRose" << "Moccasin" << "NavajoWhite"
<< "Navy" << "OldLace" << "Olive" << "OliveDrab" << "Orange"
<< "OrangeRed" << "Orchid" << "PaleGoldenRod" << "PaleGreen" << "PaleTurquoise"
<< "PaleVioletRed" << "PapayaWhip" << "PeachPuff" << "Peru" << "Pink"
<< "Plum" << "PowderBlue" << "Purple" << "Red" << "RosyBrown" << "RoyalBlue"
<< "SaddleBrown" << "Salmon" << "SandyBrown" << "SeaGreen"
<< "SeaShell" << "Sienna" << "Silver" << "SkyBlue" << "SlateBlue"
<< "SlateGray" << "SlateGrey" << "Snow" << "SpringGreen" << "SteelBlue"
<< "Tan" << "Teal" << "Thistle" << "Tomato" << "Turquoise"
<< "Violet" << "Wheat" << "White" << "WhiteSmoke" << "Yellow" << "YellowGreen";
QCompleter *completer = new QCompleter(wordList, this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setCompletionMode(QCompleter::InlineCompletion);
set_completer(completer);
}
示例12: cityChanged
void SearchWidget::cityChanged(const QString &city)
{
if (m_loaded) {
QStringList suggestions, inputSuggestions;
bool found = m_addrLookup->GetPlaceSuggestions(city, 20, &suggestions, &inputSuggestions);
if (found) {
QCompleter *c = new QCompleter(suggestions, this);
c->setCompletionMode(QCompleter::PopupCompletion);
c->setCaseSensitivity(Qt::CaseInsensitive);
m_city->setCompleter(c);
}
}
}
示例13: PythonCompleterListView
QCompleter *createCompleter()
{
PythonCompleterListView *lstView = new PythonCompleterListView();
lstView->setItemDelegateForColumn(0, new PythonCompleterDelegate());
QCompleter *completer = new QCompleter();
completer->setPopup(lstView);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setCaseSensitivity(Qt::CaseSensitive);
completer->setModelSorting(QCompleter::CaseSensitivelySortedModel);
return completer;
}
示例14: loadUsers
void VideoWindow::loadUsers(){
Database db;
QList<Users> users = db.getAllUsers();
QStringList completions;
for(int l = 0; l < users.size(); l++){
Users u = users.at(l);
QString name = u.getName().toString();
completions.push_back(name);
}
QCompleter *completer = new QCompleter(completions, this);
completer->setCompletionMode(QCompleter::PopupCompletion);
this->ui->observer->setCompleter(completer);
}
示例15: updateTargetCompleter
void MainWindow::updateTargetCompleter()
{
QStringList *targets = new QStringList();
for (QList<Target *>::const_iterator i = targetList_->cbegin(); i != targetList_->cend(); i++) {
targets->append((*i)->getName());
}
QCompleter *completer = new QCompleter(*targets, ui->txtTarget);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setCompletionMode(QCompleter::InlineCompletion);
ui->txtTarget->setCompleter(completer);
delete targets;
}