本文整理汇总了C++中QCompleter::setCaseSensitivity方法的典型用法代码示例。如果您正苦于以下问题:C++ QCompleter::setCaseSensitivity方法的具体用法?C++ QCompleter::setCaseSensitivity怎么用?C++ QCompleter::setCaseSensitivity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QCompleter
的用法示例。
在下文中一共展示了QCompleter::setCaseSensitivity方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QDialog
ConnectDialog::ConnectDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::ConnectDialog) {
ui->setupUi(this);
setWindowIcon(QIcon(QString::fromUtf8(":/resources/conceptclienticon.png")));
ui->label->setBuddy(ui->addressEdit);
QStringList wordList;
AnsiString history;
#ifdef _WIN32
h_path = getenv("LOCALAPPDATA");
if (!h_path.Length())
h_path = getenv("APPDATA");
mkdir(h_path + "/ConceptClient-private");
h_path += (char *)"/ConceptClient-history.dat";
#else
h_path = getenv("HOME");
mkdir(h_path + "/.ConceptClient-private", 0777L);
h_path += (char *)"/.ConceptClient-history";
#endif
history.LoadFile(h_path.c_str());
this->history = history;
AnsiString sep = "\n";
int len_sep = sep.Length();
int pos = history.Pos(sep);
int index = 0;
int start = 0;
while (pos > 0) {
if (pos > 1) {
history.c_str()[pos - 1] = 0;
wordList << history.c_str();
}
AnsiString temp = history;
history = temp.c_str() + pos + len_sep - 1;
pos = history.Pos(sep);
}
QCompleter *completer = new QCompleter(wordList);
completer->setCaseSensitivity(Qt::CaseInsensitive);
ui->addressEdit->setCompleter(completer);
ui->addressEdit->setText(QString::fromUtf8("concept://"));
ui->addressEdit->addAction(QIcon(QString::fromUtf8(":/resources/gtk-index.png")), QLineEdit::LeadingPosition);
QAction *action = ui->addressEdit->addAction(QIcon(QString::fromUtf8(":/resources/gtk-delete.png")), QLineEdit::TrailingPosition);
QStyle *l_style = QApplication::style();
ui->OkButton->setIcon(l_style->standardIcon(QStyle::SP_DialogOkButton));
ui->CancelButton->setIcon(l_style->standardIcon(QStyle::SP_DialogCancelButton));
QObject::connect(action, SIGNAL(triggered()), this, SLOT(clearHistory()));
}
示例2: setupLineEdit
void ComboBox::setupLineEdit() {
setInsertPolicy(QComboBox::NoInsert);
setLineEdit(new QLineEdit(this));
QCompleter *currentCompleter = completer();
currentCompleter->setCompletionMode(QCompleter::PopupCompletion);
currentCompleter->setCaseSensitivity(Qt::CaseSensitive);
}
示例3: words
/**
* Constructor of the AddGroupWindow class, generating its window.
* @param favorites List of favorites tags, needed for coloration
* @param parent The parent window
*/
AddGroupWindow::AddGroupWindow(QString selected, QStringList sites, QStringList favorites, QWidget *parent) : QWidget(parent), m_sites(sites)
{
QVBoxLayout *layout = new QVBoxLayout;
QFormLayout *formLayout = new QFormLayout;
m_comboSites = new QComboBox;
m_comboSites->setMaxVisibleItems(20);
m_comboSites->addItems(m_sites);
m_comboSites->setCurrentIndex(m_sites.indexOf(selected));
formLayout->addRow(tr("&Site"), m_comboSites);
m_lineTags = new TextEdit(favorites, this);
m_lineTags->setContextMenuPolicy(Qt::CustomContextMenu);
QStringList completion;
QFile words("words.txt");
if (words.open(QIODevice::ReadOnly | QIODevice::Text))
{
while (!words.atEnd())
{
QByteArray line = words.readLine();
completion.append(QString(line).remove("\r\n").remove("\n").split(" ", QString::SkipEmptyParts));
}
QCompleter *completer = new QCompleter(completion, this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
m_lineTags->setCompleter(completer);
}
formLayout->addRow(tr("&Tags"), m_lineTags);
m_spinPage = new QSpinBox;
m_spinPage->setRange(1, 1000);
m_spinPage->setValue(1);
formLayout->addRow(tr("&Page"), m_spinPage);
m_spinPP = new QSpinBox;
m_spinPP->setRange(1, 1000);
m_spinPP->setValue(1000);
formLayout->addRow(tr("&Images par page"), m_spinPP);
m_spinLimit = new QSpinBox;
m_spinLimit->setRange(1, 1000000);
m_spinLimit->setValue(1000);
formLayout->addRow(tr("&Limite d'images"), m_spinLimit);
m_comboDwl = new QComboBox;
m_comboDwl->setMaxVisibleItems(20);
m_comboDwl->addItems(QStringList() << tr("Oui") << tr("Non"));
m_comboDwl->setCurrentIndex(1);
formLayout->addRow(tr("&Télécharger les image de la liste noire"), m_comboDwl);
layout->addLayout(formLayout);
QHBoxLayout *layoutButtons = new QHBoxLayout;
QPushButton *buttonOk = new QPushButton(tr("Ok"));
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ok()));
layoutButtons->addWidget(buttonOk);
QPushButton *buttonClose = new QPushButton(tr("Fermer"));
connect(buttonClose, SIGNAL(clicked()), this, SLOT(close()));
layoutButtons->addWidget(buttonClose);
layout->addLayout(layoutButtons);
this->setLayout(layout);
this->setWindowIcon(QIcon(":/images/icon.ico"));
this->setWindowTitle(tr("Ajouter groupe"));
this->setWindowFlags(Qt::Window);
this->resize(QSize(400, 0));
}
示例4: 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);
}
示例5: QWizardPage
ConnectionWizardPage::ConnectionWizardPage(QWidget* parent) : QWizardPage(parent)
{
ui.setupUi(this);
setPixmap(QWizard::LogoPixmap, QPixmap(":/resources/oxygen/64x64/actions/save_all.png"));
QSettings settings;
QStringList names = settings.value("connectionNames").toStringList();
QCompleter* completer = new QCompleter(names, ui.lineEditName);
completer->setCaseSensitivity(Qt::CaseInsensitive);
ui.lineEditName->setCompleter(completer);
}
示例6: 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);
}
示例7: 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);
}
}
}
示例8: 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;
}
示例9: 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;
}
示例10: QCompleter
QCompleter *CompleterHelper::completer(const QString &tableName, const QString &columnName, QWidget *parent)
{
QCompleter *completer = new QCompleter(parent);
QString queryText = QString("SELECT DISTINCT %1 FROM %2 ORDER BY %1").arg(columnName).arg(tableName);
QSqlQueryModel *completerModel = new QSqlQueryModel(completer);
completerModel->setQuery(queryText);
completer->setModel(completerModel);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setModelSorting(QCompleter::CaseInsensitivelySortedModel);
return completer;
}
示例11: QLineEdit
QWidget *PoliceStationItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QLineEdit* editor = new QLineEdit(parent);
editor->setFrame(false);
QCompleter* completer = new QCompleter( *m_policeModel->uniqueList( index.column() ),parent );
completer->setCompletionMode( QCompleter::PopupCompletion );
completer->setCaseSensitivity(Qt::CaseInsensitive);
editor->setCompleter(completer);
return editor;
}
示例12: fillMoves
void PokeEdit::fillMoves()
{
movesModel = new PokeMovesModel(m_poke->num(), m_poke->gen(), this, hackMons);
QSortFilterProxyModel *filter = new QSortFilterProxyModel(this);
filter->setSourceModel(movesModel);
ui->moveChoice->setModel(filter);
ui->moveChoice->disconnect(SIGNAL(activated(QModelIndex)), this);
connect(ui->moveChoice, SIGNAL(activated(QModelIndex)), SLOT(moveEntered(QModelIndex)));
#ifdef QT5
ui->moveChoice->horizontalHeader()->setSectionResizeMode(PokeMovesModel::PP, QHeaderView::ResizeToContents);
ui->moveChoice->horizontalHeader()->setSectionResizeMode(PokeMovesModel::Priority, QHeaderView::ResizeToContents);
ui->moveChoice->horizontalHeader()->setSectionResizeMode(PokeMovesModel::Pow, QHeaderView::ResizeToContents);
ui->moveChoice->horizontalHeader()->setSectionResizeMode(PokeMovesModel::Acc, QHeaderView::ResizeToContents);
ui->moveChoice->horizontalHeader()->setSectionResizeMode(PokeMovesModel::Name, QHeaderView::Fixed);
#else
ui->moveChoice->horizontalHeader()->setResizeMode(PokeMovesModel::PP, QHeaderView::ResizeToContents);
ui->moveChoice->horizontalHeader()->setResizeMode(PokeMovesModel::Pow, QHeaderView::ResizeToContents);
ui->moveChoice->horizontalHeader()->setResizeMode(PokeMovesModel::Acc, QHeaderView::ResizeToContents);
ui->moveChoice->horizontalHeader()->setResizeMode(PokeMovesModel::Name, QHeaderView::Fixed);
#endif
ui->moveChoice->horizontalHeader()->resizeSection(PokeMovesModel::Name, 125);
ui->moveChoice->horizontalHeader()->resizeSection(PokeMovesModel::Type, Theme::TypePicture(Type::Normal).width()+5);
ui->moveChoice->setIconSize(Theme::TypePicture(Type::Normal).size());
ui->moveChoice->sortByColumn(PokeMovesModel::Name, Qt::AscendingOrder);
m_moves[0] = ui->move1;
m_moves[1] = ui->move2;
m_moves[2] = ui->move3;
m_moves[3] = ui->move4;
connect(ui->speciesLabel, SIGNAL(clicked()), SLOT(on_pokemonFrame_clicked()));
/* the four move choice items */
for (int i = 0; i < 4; i++)
{
QCompleter *completer = new QCompleter(m_moves[i]);
completer->setModel(ui->moveChoice->model());
completer->setCompletionColumn(PokeMovesModel::Name);
completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setCompletionMode(QCompleter::PopupCompletion);
completer->setCompletionRole(Qt::DisplayRole);
m_moves[i]->setCompleter(completer);
completer->setProperty("move", i);
m_moves[i]->setProperty("move", i);
connect(completer, SIGNAL(activated(QString)), SLOT(changeMove()));
connect(m_moves[i], SIGNAL(returnPressed()), SLOT(changeMove()));
connect(m_moves[i], SIGNAL(editingFinished()), SLOT(changeMove()));
}
}
示例13: 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);
}
示例14: 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();
}
示例15: setGeometry
DataForm::DataForm()
{
setGeometry(0,0,240,320);
login = new QLineEdit(this);
parol = new QLineEdit(this);
count = new QLineEdit(this);
countTo = new QLineEdit(this);
user = new QLineEdit(this);
checkBox = new QCheckBox(this);
comboBox = new QComboBox(this);
QStringList wordList;
wordList << "63000784" << "201789376" << "37376822";
QCompleter *completer = new QCompleter(wordList, this);
completer->setCaseSensitivity(Qt::CaseInsensitive);
user->setCompleter(completer);
QLabel* label1 = new QLabel(this);
QLabel* label2 = new QLabel(this);
QLabel* label3 = new QLabel(this);
QLabel* label6 = new QLabel(this);
QLabel* label7 = new QLabel(this);
label1->setGeometry(5,0,30,25); label1->setText("login");
label2->setGeometry(5,30,30,25); label2->setText("parol");
label3->setGeometry(5,60,30,25); label3->setText("count");
label7->setGeometry(5,90,30,25); label7->setText("offset");
comboBox->setGeometry(5,120,80,25); comboBox->addItem("User"); comboBox->addItem("Group");
label6->setGeometry(5,150,30,25); label6->setText("delete");
checkBox->setGeometry(35,150,200,25); checkBox->setCheckState(Qt::Unchecked);
login->setGeometry(35,0,200,25); login->setText("380678400259");
parol->setGeometry(35,30,200,25); parol->setText("warhammer");
count->setGeometry(35,60,200,25); count->setText("100");
countTo->setGeometry(35,90,200,25); countTo->setText("0");
user->setGeometry(90,120,145,25); user->setText("63000784"); // themarkusfenix - 201789376 - 63000784
QPushButton* start = new QPushButton(this);
start->setGeometry(5,180,230,50); start->setText("Start");
connect(start,SIGNAL(clicked()),this,SLOT(send()));
}