本文整理汇总了C++中QStringListModel::stringList方法的典型用法代码示例。如果您正苦于以下问题:C++ QStringListModel::stringList方法的具体用法?C++ QStringListModel::stringList怎么用?C++ QStringListModel::stringList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStringListModel
的用法示例。
在下文中一共展示了QStringListModel::stringList方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getReparse
QHash<QString,QVariant> getReparse()
{
QHash<QString,QVariant> data;
int g=0;
for(int i=0;i<8;++i){
g=(g<<1)+Shield::shieldG[i];
}
data["/Shield/Group"]=g;
data["/Shield/Regexp"]=rm->stringList();
data["/Shield/Sender"]=sm->stringList();
data["/Shield/Limit"]=Config::getValue("/Shield/Limit",5);
return data;
}
示例2: folderSelected
void ConversationPage::folderSelected(const QModelIndex& index)
{
MPopupList *popupList = qobject_cast<MPopupList *>(sender());
if (!popupList)
return;
QStringListModel *model = (QStringListModel *) popupList->itemModel();
QStringList folders = model->stringList();
m_downloadFolder = QDir::homePath() + "/" + folders[index.row()];
QMailMessagePart::Location location = m_selectedAttachment.location();
location.setContainingMessageId(m_id);
if (m_selectedAttachment.hasBody())
{
// The content has already been downloaded to local device. No need to retrieve part from server.
emit downloadCompleted();
return;
}
m_retrievalAction = new QMailRetrievalAction(this);
connect(m_retrievalAction, SIGNAL(activityChanged(QMailServiceAction::Activity)),
this, SLOT(activityChanged(QMailServiceAction::Activity)));
m_retrievalAction->retrieveMessagePart(location);
}
示例3: setTextStyleValues
void MRichTextEditDialogsManager::setTextStyleValues(const QString &fontfamily, int fontPointSize,
const QColor &fontColor)
{
Q_ASSERT(fontFamilyCombo);
int familyIndex = -1;
QStringListModel *fontFamilyModel = dynamic_cast<QStringListModel *>(fontFamilyCombo->itemModel());
if (fontFamilyModel) {
QStringList fontFamilies = fontFamilyModel->stringList();
familyIndex = fontFamilies.indexOf(fontfamily);
}
fontFamilyCombo->setCurrentIndex(familyIndex);
Q_ASSERT(fontSizeCombo);
QStringList fontSizeValues = generateFontSizeComboValues();
QStringListModel *fontSizeModel = dynamic_cast<QStringListModel *>(fontSizeCombo->itemModel());
if (fontSizeModel) {
fontSizeModel->setStringList(fontSizeValues);
}
//% "%L1 points"
QString fontSize(qtTrId("qtn_comm_font_size_value").arg(fontPointSize));
int sizeIndex = fontSizeValues.indexOf(fontSize);
fontSizeCombo->setCurrentIndex(sizeIndex);
Q_ASSERT(fontColorCombo);
fontColorCombo->setPickedColor(fontColor);
}
示例4: completionWords
QStringList CodeEditor::completionWords() const{
QStringList words;
QStringListModel *model = qobject_cast<QStringListModel*>(completer_->model());
if(model){
words=model->stringList();
}
return words;
}
示例5: configure
void ClickToFlashPlugin::configure()
{
QDialog dialog;
Ui_ClickToFlashSettings ui;
ui.setupUi(&dialog);
QStringListModel *model = new QStringListModel(m_whitelist, ui.whitelist);
ui.whitelist->setModel(model);
if (dialog.exec() == QDialog::Accepted) {
m_whitelist = model->stringList();
save();
}
}
示例6: saveSettings
void Settings::saveSettings() {
QSettings settings;
QStringListModel* model = (QStringListModel*) ui.patternListView->model();
settings.setValue(SETTINGS_PATTERNS, model->stringList());
model = (QStringListModel*) ui.directoryListView->model();
settings.setValue(SETTINGS_DIRECTORIES, model->stringList());
settings.setValue(SETTINGS_MATCH_CASE, ui.matchCaseCheckBox->isChecked());
settings.setValue(SETTINGS_DATE_MATCH, ui.dateMatchGroupBox->isChecked());
if (ui.dateOption0RadioButton->isChecked()) {
settings.setValue(SETTINGS_DATE_OPTION, 0);
} else {
settings.setValue(SETTINGS_DATE_OPTION, 1);
}
settings.setValue(SETTINGS_DATE, ui.dateOption1dateTimeEdit->dateTime());
disconnect(ui.patternListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(changeDeletePatternButtonState()));
disconnect(ui.directoryListView->selectionModel(), SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this, SLOT(changeDeleteDirectoryButtonState()));
hide();
emit settingsChanged();
}
示例7: themeChanged
void AppearanceSettings::themeChanged(int index)
{
// Launch web browser for more themes
if(index == (m_themeCombo->count() - 1)) {
QProcess::execute("arora", QStringList() << "http://qtmoko.sourceforge.net/apps/category-themes.html");
QStringListModel *model = qobject_cast<QStringListModel *>(m_themeCombo->model());
QStringList oldThemes = model->stringList();
loadThemes();
// Find theme which was installed
model = qobject_cast<QStringListModel *>(m_themeCombo->model());
QStringList newThemes = model->stringList();
for(int i = 0; i < newThemes.count(); i++) {
if(oldThemes.count() <= i || oldThemes[i] != newThemes[i]) {
m_prevIndex = i;
break;
}
}
m_themeCombo->setCurrentIndex(m_prevIndex);
return;
}
Theme *theme = m_themes.value(index, 0);
if (!theme)
return;
m_prevIndex = index;
QStringListModel *model;
model = qobject_cast<QStringListModel *>(m_colorCombo->model());
model->setStringList(theme->colorSchemeNames());
m_colorCombo->setCurrentIndex(theme->currentColorIndex());
model = qobject_cast<QStringListModel *>(m_backgroundCombo->model());
model->setStringList(theme->backgrounds());
m_backgroundCombo->setCurrentIndex(theme->currentBackgroundIndex());
}
示例8: file
void CFX2DCsvImportDialog::addCsvFile()
{
QStringList selFiles = QFileDialog::getOpenFileNames (this,tr("open csv file")//打开csv文件
,QString()
,tr("Ansys CFX csv file(*.csv)")//Ansys CFX csv file(*.csv)
);
if(selFiles.size ()<=0)
return;
QStringListModel* model = getStringListModel ();
if(!model)
return;
QStringList slist = model->stringList ();
slist += selFiles;
model->setStringList (slist);
}
示例9: 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);
}
示例10: on_butRemoveInputFileNames_clicked
void ImageProcessDialog::on_butRemoveInputFileNames_clicked()
{
if(ui->listViewInputFileNames->model())
{
ui->listViewInputFileNames->model()->removeRow(ui->listViewInputFileNames->currentIndex().row());
QStringListModel* sss = (QStringListModel*)ui->listViewInputFileNames->model();
this->imageFileNames.clear();
this->imageFileNames = sss->stringList();
qDebug()<<this->imageFileNames;
}
}
示例11: noMatch
void MigraineMainWindow::noMatch(const QString &name)
{
QStringList names;
QStringListModel *model;
if (noMatchListView->model())
{
model = static_cast<QStringListModel*>(noMatchListView->model());
names = model->stringList();
}
else
{
model = new QStringListModel(noMatchListView);
}
names << name;
model->setStringList(names);
noMatchListView->setModel(model);
}
示例12: initMapList
void MenuWidget::initMapList()
{
QDirIterator it("data/arenas");
QStringListModel *filelist = new QStringListModel(this->mapListView);
QStringList list;
while (it.hasNext())
{
it.next();
if (!it.fileInfo().isFile())
continue;
qDebug() << "Found arena" << it.fileName();
list << it.fileName();
}
filelist->setStringList(list);
qDebug() << "string count" << filelist->stringList().count();
mapListView->setModel(filelist);
mapListView->setMovement(QListView::Static);
mapListView->setEditTriggers(QAbstractItemView::NoEditTriggers);
mapListView->setSelectionMode(QAbstractItemView::SingleSelection);
}