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())); }
void ComboBox::setupLineEdit() { setInsertPolicy(QComboBox::NoInsert); setLineEdit(new QLineEdit(this)); QCompleter *currentCompleter = completer(); currentCompleter->setCompletionMode(QCompleter::PopupCompletion); currentCompleter->setCaseSensitivity(Qt::CaseSensitive); }
/** * 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)); }
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); }
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); }
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); }
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); } } }
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; }
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; }
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; }
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; }
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())); } }
void QtVoxOxCallBarFrame::fillCompletionList(){ //TODO: this completion list should change when we have SQLite working, so completion list keeps username and we can get their full name like [email protected] or other network QStringList tobeinserted = QStringList(); QString contactId; Config & config = ConfigManager::getInstance().getCurrentConfig(); std::string jabberVoxOxServer = "@" + config.getJabberVoxoxServer(); if(_cUserProfile) { UserProfile & userProfile = _cUserProfile->getUserProfile(); for ( Contacts::const_iterator it = userProfile.getContactList().getContacts().begin(); it != userProfile.getContactList().getContacts().end(); ++it) { contactId = QString::fromStdString(it->second.getContactId());//VOXOX CHANGE by Rolando - 2009.05.11 - gets the contact id if(!contactId.contains(FACEBOOK_SUFFIX)){//VOXOX CHANGE by Rolando - 2009.05.11 - because id of facebook contacts are "number@" // VOXOX CHANGE by ASV 05-12-2009: method "removeDuplicates()" is not part of Q4.4;I had to change it so that it works on the Mac (Qt4.4) if (!tobeinserted.contains(contactId)) { tobeinserted << contactId; } //end VOXOX CHANGE by ASV } QString temp = QString::fromStdString(it->second.getDisplayName()).toLower();//VOXOX CHANGE by Rolando - 2009.05.11 - gets the display name // VOXOX CHANGE by ASV 05-12-2009: method "removeDuplicates()" is not part of Q4.4;I had to change it so that it works on the Mac (Qt4.4) if (!tobeinserted.contains(temp)) { tobeinserted << temp; } //end VOXOX CHANGE by ASV //tobeinserted << QString::fromStdString(it->second.getVoxOxPhone());//TODO: VOXOX CHANGE by Rolando - 2009.05.08 get VoxOx phone number when SQLite be integrated } } // VOXOX CHANGE by ASV 05-12-2009: method "removeDuplicates()" is not part of Q4.4;I had to change it so that it works on the Mac (Qt4.4) //tobeinserted.removeDuplicates(); //end VOXOX CHANGE by ASV if (tobeinserted.size() > 0) { tobeinserted.sort(); QCompleter *completer = new QCompleter(tobeinserted, this); completer->setCompletionMode ( QCompleter::PopupCompletion ); completer->setModelSorting(QCompleter::CaseInsensitivelySortedModel); completer->setCaseSensitivity(Qt::CaseInsensitive); _voxOxToolTipLineEdit->setCompleter(completer); } }
QWidget* TaskContextItemDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { QLineEdit *editor = new QLineEdit(parent);//qobject_cast<QLineEdit*>(QItemDelegate::createEditor(parent, option, index)); editor->setFrame(true); QCompleter *completer = new QCompleter(vcontextModel); completer->setModel(vcontextModel); completer->setCaseSensitivity(Qt::CaseInsensitive); completer->setCompletionMode(QCompleter::InlineCompletion); completer->setCompletionColumn(1); completer->setWrapAround(false); editor->setCompleter(completer); return editor; }
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); }
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(); }
QgsFieldValuesLineEdit::QgsFieldValuesLineEdit( QWidget *parent ) : QgsFilterLineEdit( parent ) , mLayer( nullptr ) , mAttributeIndex( -1 ) , mUpdateRequested( false ) , mGatherer( nullptr ) { QCompleter* c = new QCompleter( this ); c->setCaseSensitivity( Qt::CaseInsensitive ); c->setFilterMode( Qt::MatchContains ); setCompleter( c ); connect( this, &QgsFieldValuesLineEdit::textEdited, this, &QgsFieldValuesLineEdit::requestCompleterUpdate ); mShowPopupTimer.setSingleShot( true ); mShowPopupTimer.setInterval( 100 ); connect( &mShowPopupTimer, &QTimer::timeout, this, &QgsFieldValuesLineEdit::triggerCompleterUpdate ); }
GotoDialog::GotoDialog(const MemoryLayout& ml, DebugSession *session, QWidget* parent) : QDialog(parent), memLayout(ml), currentSymbol(0) { setupUi(this); debugSession = session; if( session ) { // create address completer QCompleter *completer = new QCompleter(session->symbolTable().labelList(true, &ml), this); completer->setCaseSensitivity(Qt::CaseInsensitive); edtAddress->setCompleter(completer); connect(completer, SIGNAL(activated(const QString&)), this, SLOT(addressChanged(const QString&))); } connect(edtAddress, SIGNAL(textEdited(const QString&)), this, SLOT(addressChanged(const QString&))); }
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())); }
void ProjectReader::readScripts(QString &path, QString &name, bool open) { Q_ASSERT(xml.isStartElement() && xml.name() == QLatin1String("Script")); QString n; Highlighter *h; QCompleter *c; CodeEditor *editor = new CodeEditor(name, 0, h); if (open) { editor = 0; mMw->addCodeEditor(path + "/" + name); } else { editor->setUndoRedoEnabled(true); editor->setTabStopWidth(29); #ifdef Q_WS_MAC int size = 12; QFont font("Monaco", size); #endif #ifdef Q_OS_WIN int size = 10; QFont font("Consolas", size); #endif #ifdef Q_OS_LINUX int size = 10; QFont font("Inconsolata-g", size); #endif editor->setFont(font); h = new Highlighter(editor->document()); c = new QCompleter(); c->setModel(mDocumentManager->modelFromFile(":/wordlist.txt")); c->setModelSorting(QCompleter::CaseInsensitivelySortedModel); c->setCaseSensitivity(Qt::CaseInsensitive); c->setWrapAround(false); c->popup()->setStyleSheet("color: #848484; background-color: #2E2E2E; selection-background-color: #424242;"); editor->setCompleter(c); n = path + "/" + name; //qDebug() << "look a script" << n; editor->openFile(path + "/" + name); mMw->addCodeEditor(editor, open); } xml.skipCurrentElement(); }
PokeSelection::PokeSelection(Pokemon::uniqueId pokemon, QAbstractItemModel *pokemonModel) : ui(new Ui::PokeSelection), search(NULL), newwidth(0) { ui->setupUi(this); QSortFilterProxyModel *proxy = new QSortFilterProxyModel(this); proxy->setFilterRegExp("."); proxy->setSourceModel(pokemonModel); this->sourceModel = pokemonModel; this->proxy = proxy; ui->pokemonList->setModel(proxy); QCompleter *completer = new QCompleter(proxy, ui->pokeEdit); completer->setCompletionColumn(1); completer->setCompletionRole(Qt::DisplayRole); completer->setCaseSensitivity(Qt::CaseInsensitive); completer->setCompletionMode(QCompleter::PopupCompletion); ui->pokeEdit->setCompleter(completer); setNum(pokemon); ui->pokemonList->setCurrentIndex(pokemonModel->index(pokemon.pokenum, 1)); ui->pokemonList->scrollTo(ui->pokemonList->currentIndex()); updateSprite(); updateTypes(); if (getGen() <= 1) { ui->shiny->hide(); } else { ui->shiny->show(); } ui->baseStats->setGen(getGen()); connect(completer, SIGNAL(activated(QModelIndex)), SLOT(setPokemon(QModelIndex))); connect(ui->shiny, SIGNAL(toggled(bool)), SLOT(updateSprite())); connect(ui->pokemonList, SIGNAL(pokemonSelected(Pokemon::uniqueId)), SLOT(setNum(Pokemon::uniqueId))); connect(ui->pokemonList, SIGNAL(pokemonSelected(Pokemon::uniqueId)), SLOT(updateSprite())); connect(ui->pokemonList, SIGNAL(pokemonSelected(Pokemon::uniqueId)), SLOT(updateTypes())); connect(ui->pokemonList, SIGNAL(pokemonActivated(Pokemon::uniqueId)), SLOT(finish())); connect(ui->changeSpecies, SIGNAL(clicked()), SLOT(finish())); connect(ui->pokemonFrame, SIGNAL(clicked()), SLOT(toggleSearchWindow())); }
void MainWindow::on_txtSearch_textChanged(QString searchText) { QCompleter *completer = new QCompleter(dataBase.getAllFields(), this); completer->setCaseSensitivity(Qt::CaseInsensitive); ui->txtSearch->setCompleter(completer); if (!searchText.isEmpty()) { proxyModel.setSourceModel(&prefixTable); proxyModel.setFilterKeyColumn(-1); proxyModel.setFilterFixedString(searchText); ui->tableView->setModel(&proxyModel); tableOnProxy = true; } else { ui->tableView->setModel(&prefixTable); tableOnProxy = false; } }
void CreateBooking::addCustomersInForm() { DbMysql* d = DbMysql::getInstance(); QMessageBox msgBox; QCompleter* cl = new QCompleter(this); QStandardItemModel *model = new QStandardItemModel(cl); //ui->roomsList->setCurrentText("-----Select-----"); if(!d->getConnection().open()) { msgBox.critical(this,"Error","Failed to connect database.1"); } else { QSqlQuery query1( "select customer_id,customer_name from customers order by customer_id desc;" ,d->getConnection()); if(!query1.isActive()) { msgBox.critical(this,"Error","Failed to connect database."); } else { //ui->roomsList->addItem("---- Select ----",QVariant::fromValue(-1)); while(query1.next()) { QStandardItem *item = new QStandardItem; item->setText(query1.value(1).toString()); item->setData(query1.value(0).toInt(), Qt::UserRole); model->appendRow(item); } } } cl->setCaseSensitivity(Qt::CaseInsensitive); cl->setModel(model); ui->c_customer_name->setCompleter(cl); //ui->c_customer_name connect(cl, SIGNAL(activated(QModelIndex)),this, SLOT(onItemActivated(QModelIndex))); }
void QgsUniqueValuesWidgetWrapper::initWidget( QWidget* editor ) { mComboBox = qobject_cast<QComboBox*>( editor ); mLineEdit = qobject_cast<QLineEdit*>( editor ); QStringList sValues; QList<QVariant> values; layer()->uniqueValues( fieldIdx(), values ); Q_FOREACH ( const QVariant& v, values ) { if ( mComboBox ) { mComboBox->addItem( v.toString(), v ); } if ( mLineEdit ) { sValues << v.toString(); } } if ( mLineEdit ) { QgsFilterLineEdit* fle = qobject_cast<QgsFilterLineEdit*>( editor ); if ( fle && !( field().type() == QVariant::Int || field().type() == QVariant::Double || field().type() == QVariant::LongLong || field().type() == QVariant::Date ) ) { fle->setNullValue( QSettings().value( "qgis/nullValue", "NULL" ).toString() ); } QCompleter* c = new QCompleter( sValues ); c->setCaseSensitivity( Qt::CaseInsensitive ); 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() ) ); } }
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), m_ui(new Ui::MainWindow) { m_ui->setupUi(this); GLHelperWidget * helperWidget = new GLHelperWidget(m_ui->glWidget); m_ui->vendorValue->setText(helperWidget->getString(GL_VENDOR)); m_ui->rendererValue->setText(helperWidget->getString(GL_RENDERER)); m_ui->versionValue->setText(helperWidget->getString(GL_VERSION)); // Collect extension info and put them into a map with key: corp and value: extension QString exts = helperWidget->getString(GL_EXTENSIONS); QStringList extList = exts.split(" ", QString::SkipEmptyParts); QStringListIterator itList(extList); while (itList.hasNext()) { QString ext = itList.next(); QString corp = ext.split("_").at(1); m_extMap[corp].append(ext); //m_extensionList.append(ext.replace(0, corp.length()+4, "")); m_extensionList.append(ext); } m_extensionList.sort(); // display the extension tree by faking a filter signal on_filterText_textChanged(""); // What to do when an extension was double clicked. connect(m_ui->extensionsTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(extension_doubleClicked(QTreeWidgetItem*,int))); // When a specification page starts loading, is loading, and has been loaded... connect(m_ui->extensionSpecView, SIGNAL(loadStarted()), this, SLOT(loadSpecStarted())); connect(m_ui->extensionSpecView, SIGNAL(loadProgress(int)), this, SLOT(loadSpecProgress(int))); connect(m_ui->extensionSpecView, SIGNAL(loadFinished(bool)), this, SLOT(loadSpecFinished(bool))); // Add extensions to combobox m_ui->extensionComboBox->addItems(m_extensionList); connect(m_ui->extensionComboBox, SIGNAL(activated(QString)), this, SLOT(loadExtensionSpec(QString))); // Autocompleter for filtering extensions QCompleter *completer = new QCompleter(m_extensionList, this); completer->setCaseSensitivity(Qt::CaseInsensitive); m_ui->extensionComboBox->setCompleter(completer); }
void Gui_AdminWindow::createSearch() { list<SmartPtr<User> > lst = _admin->listUsers(); QStringList completions; if(!lst.empty()) { list<SmartPtr<User> >::iterator it = lst.begin(); for(; it != lst.end(); ++it) { QString cmpname = ""; if(UserInfo* uf = dynamic_cast<UserInfo*> ((*it)->account()->info())) cmpname = QString::fromStdString(uf->name()) + " " + QString::fromStdString(uf->surname()); completions.push_back(QString::fromStdString((*it)->account()->username().login())); completions.push_back(cmpname); } } QCompleter* completer = new QCompleter(completions); completer->setCaseSensitivity(Qt::CaseInsensitive); edt[4]->setCompleter(completer); edt[4]->setClearButtonEnabled(true); }
void LineEdit::setHistoryEnabled(bool enabled) { if (enabled == m_historyEnabled) return; m_historyEnabled = enabled; if (m_historyEnabled) { // queued so we learn and update the history list *after* the user selected an item from popup connect(this, SIGNAL(returnPressed()), this, SLOT(learnEntry()), Qt::QueuedConnection); QCompleter *completer = new QCompleter(QStringList(), this); completer->setCaseSensitivity(Qt::CaseInsensitive); completer->setCompletionMode(QCompleter::InlineCompletion); setCompleter(completer); } else { disconnect(this, SIGNAL(returnPressed()), this, SLOT(learnEntry())); delete completer(); setCompleter(NULL); } }
/** Define the QLineEdit to use as zip code editor */ void ZipCountryCompleters::setZipLineEdit(Utils::QButtonLineEdit *zip) { m_zipEdit = zip; // Completer QCompleter *completer = new QCompleter(this); completer->setModel(m_ZipModel); completer->setCompletionColumn(ZipCountryModel::ZipCity); completer->setCaseSensitivity(Qt::CaseInsensitive); completer->setCompletionMode(QCompleter::PopupCompletion); completer->popup()->setAlternatingRowColors(true); m_zipEdit->setCompleter(completer); connect(m_zipEdit, SIGNAL(textChanged(QString)), this, SLOT(zipTextChanged())); connect(completer, SIGNAL(activated(QModelIndex)), this, SLOT(onCompleterIndexActivated(QModelIndex))); // button m_ZipButton = new QToolButton(m_zipEdit); m_ZipButton->setIcon(theme()->icon(Core::Constants::ICONHELP)); m_zipEdit->setRightButton(m_ZipButton); }
View::View() { cities = new QStringListModel(); search = new QLineEdit(); search->setCompleter([this]() { QCompleter* completer = new QCompleter(cities); completer->setCaseSensitivity(Qt::CaseInsensitive); return completer; }()); connect(search, SIGNAL(textEdited(const QString&)), this, SLOT(text_handler(const QString&))); go = new QPushButton(tr("Поиск")); connect(go, SIGNAL(clicked()), this, SLOT(go_handler())); // the next code is all about initializing stack of widgets QFile file(":resources/no_data.html"); assert(file.open(QIODevice::ReadOnly | QIODevice::Text)); no_data = new QWebView(); no_data->setHtml(QTextStream(&file).readAll()); no_data->setGraphicsEffect([]() { QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect(); effect->setOpacity(1.0); return effect; }()); weather = new QWebView(); weather->setGraphicsEffect([]() { QGraphicsOpacityEffect* effect = new QGraphicsOpacityEffect(); effect->setOpacity(1.0); return effect; }()); info = new QStackedWidget(); info->addWidget(no_data); info->addWidget(weather); info->setCurrentIndex(0); place_it(); }
void ProjectManagerPlugin::on_client_merged(qmdiHost *host) { if (m_dockWidget) return; QMainWindow *window = dynamic_cast<QMainWindow*>(host); m_dockWidget = new QDockWidget(window); m_dockWidget->setObjectName("m_dockWidget"); m_dockWidget->setWindowTitle( tr("Project") ); #if 0 m_treeView = new QTreeView(m_dockWidget); m_treeView->setAlternatingRowColors(true); m_dockWidget->setWidget(m_treeView); #else QWidget *w = new QWidget(m_dockWidget); m_gui = new Ui::ProjectManagerGUI; m_gui->setupUi(w); m_dockWidget->setWidget(w); #endif m_projectModel = new FoldersModel(m_gui->filesView); //m_projectModel->processDir("/home/elcuco/src/qtedit4/"); // m_projectModel->processDir("/home/elcuco/src/qt-creator/"); m_projectModel->processDir("/home/elcuco/src/googlecode/qtedit4/trunk/"); // m_projectModel->processDir("c:\\Users\\elcuco\\Source\\qtedit4"); m_gui->filesView->setModel(m_projectModel); window->addDockWidget( Qt::LeftDockWidgetArea, m_dockWidget ); QCompleter *completer = new GenericItemCompleter(); completer->setModel(m_projectModel); completer->setParent(m_gui->filenameLineEdit); completer->setCaseSensitivity(Qt::CaseInsensitive); completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion); completer->setCompletionRole(0); completer->setCompletionPrefix("/"); m_gui->filenameLineEdit->setCompleter(completer); connect(m_gui->filesView,SIGNAL(clicked(QModelIndex)),this,SLOT(onItemClicked(QModelIndex))); connect(m_gui->addDirectoryButton,SIGNAL(clicked()),this,SLOT(onAddDirectoryClicked())); }