Пример #1
0
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
0
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
0
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
0
/*
 * 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
0
/** 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
0
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
0
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
0
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
0
void ComboBox::setupLineEdit() {
  setInsertPolicy(QComboBox::NoInsert);

  setLineEdit(new QLineEdit(this));

  QCompleter *currentCompleter = completer();
  currentCompleter->setCompletionMode(QCompleter::PopupCompletion);
  currentCompleter->setCaseSensitivity(Qt::CaseSensitive);
}
Пример #10
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);


}
Пример #11
0
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
0
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
0
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
0
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
0
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;
}
Пример #16
0
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;
}
Пример #17
0
void VideoWindow::loadSubjects()
{
    Database db;
    QList<Subjects> subjects = db.getAllSubjects();
    QStringList completions;
    for(int l = 0; l < subjects.size(); l++){
        Subjects s = subjects.at(l);
        QString name = s.getName().toString();
        completions.push_back(name);
    }
    QCompleter *completer = new QCompleter(completions, this);
    completer->setCompletionMode(QCompleter::PopupCompletion);
    this->ui->subject->setCompleter(completer);
}
Пример #18
0
void VideoWindow::loadSpeceis()
{
    Database db;
    QList<Species> species = db.getAllSpecies();
    QStringList completions;
    for(int l = 0; l < species.size(); l++){
        Species sp = species.at(l);
        QString name = sp.getName().toString();
        completions.push_back(name);
    }
    QCompleter *completer = new QCompleter(completions, this);
    completer->setCompletionMode(QCompleter::PopupCompletion);
    this->ui->species->setCompleter(completer);
}
Пример #19
0
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()));
    }
}
Пример #20
0
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);
	}	

}
Пример #21
0
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;
}
Пример #22
0
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();
}
Пример #23
0
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);
}
Пример #24
0
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 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() ) );
  }
}
Пример #26
0
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);
    }
}
/*
    ToolbarSearch is a very basic search widget that also contains a small history.
    Searches are turned into urls that use Google to perform search
 */
ToolbarSearch::ToolbarSearch(QWidget *parent)
    : SearchLineEdit(parent)
    , m_autosaver(new AutoSaver(this))
    , m_maxSavedSearches(10)
    , m_stringListModel(new QStringListModel(this))
{
    QMenu *m = menu();
    connect(m, SIGNAL(aboutToShow()), this, SLOT(aboutToShowMenu()));
    connect(m, SIGNAL(triggered(QAction*)), this, SLOT(triggeredMenuAction(QAction*)));

    QCompleter *completer = new QCompleter(m_stringListModel, this);
    completer->setCompletionMode(QCompleter::InlineCompletion);
    lineEdit()->setCompleter(completer);

    connect(lineEdit(), SIGNAL(returnPressed()), SLOT(searchNow()));
    setInactiveText(tr("Google"));
    load();
}
/** 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);
}
Пример #29
0
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()));
}
Пример #30
0
AddGeneratorDialog::AddGeneratorDialog(const QStringList& UnitsClasses, QWidget* Parent) :
    openfluid::ui::common::OpenFLUIDDialog(Parent),ui(new Ui::AddGeneratorDialog)
{
    ui->setupUi(this);

    ui->MessageLabel->setText(tr("Add generator"));

    connect(ui->FixedRadioButton,SIGNAL(toggled(bool)),this,SLOT(switchGeneratorOptions()));
    connect(ui->RandomRadioButton,SIGNAL(toggled(bool)),this,SLOT(switchGeneratorOptions()));
    connect(ui->InterpRadioButton,SIGNAL(toggled(bool)),this,SLOT(switchGeneratorOptions()));
    connect(ui->InjectRadioButton,SIGNAL(toggled(bool)),this,SLOT(switchGeneratorOptions()));

    connect(ui->VectorRadioButton,SIGNAL(toggled(bool)),ui->VectorSpinBox,SLOT(setEnabled(bool)));

    connect(ui->VarNameEdit,SIGNAL(textEdited(const QString&)),this,SLOT(checkGlobal()));
    connect(ui->UnitsClassEdit,SIGNAL(textEdited(const QString&)),this,SLOT(checkGlobal()));

    connect(ui->SourcesBrowseButton,SIGNAL(clicked()),this,SLOT(selectSourcesFile()));
    connect(ui->DistriBrowseButton,SIGNAL(clicked()),this,SLOT(selectDistriFile()));

    connect(ui->ButtonBox,SIGNAL(accepted()),this,SLOT(accept()));
    connect(ui->ButtonBox,SIGNAL(rejected()),this,SLOT(reject()));

    switchGeneratorOptions();

    m_Method = openfluid::fluidx::GeneratorDescriptor::Fixed;

    ui->FixedRadioButton->setChecked(true);
    ui->DoubleRadioButton->setChecked(true);
    ui->VectorSpinBox->setEnabled(false);

    ui->VarNameEdit->setPlaceholderText(openfluid::ui::config::PLACEHOLDER_REQUIRED);
    ui->UnitsClassEdit->setPlaceholderText(openfluid::ui::config::PLACEHOLDER_REQUIRED);

    QCompleter* Completer = new QCompleter(UnitsClasses, this);
    Completer->setCaseSensitivity(Qt::CaseInsensitive);
    Completer->setCompletionMode(QCompleter::UnfilteredPopupCompletion);
    ui->UnitsClassEdit->setCompleter(Completer);

    checkGlobal();
}