本文整理汇总了C++中Preferences::getCustomKeyCodes方法的典型用法代码示例。如果您正苦于以下问题:C++ Preferences::getCustomKeyCodes方法的具体用法?C++ Preferences::getCustomKeyCodes怎么用?C++ Preferences::getCustomKeyCodes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preferences
的用法示例。
在下文中一共展示了Preferences::getCustomKeyCodes方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: regex
PrefsDialog::PrefsDialog(QWidget *parent): QDialog(parent),ui(new Ui::PrefsDialog) {
// map dropdown values to indices
listMetadataWrite << METADATA_WRITE_NONE;
listMetadataWrite << METADATA_WRITE_PREPEND;
listMetadataWrite << METADATA_WRITE_APPEND;
listMetadataWrite << METADATA_WRITE_OVERWRITE; // out of range for some fields
listMetadataWriteKey << METADATA_WRITE_NONE;
listMetadataWriteKey << METADATA_WRITE_OVERWRITE;
listMetadataFormat << METADATA_FORMAT_KEYS;
listMetadataFormat << METADATA_FORMAT_CUSTOM;
listMetadataFormat << METADATA_FORMAT_BOTH;
// UI
ui->setupUi(this);
this->setWindowFlags(Qt::WindowTitleHint | Qt::CustomizeWindowHint);
// get values from preferences
Preferences p;
ui->writeToFilesAutomatically->setChecked(p.getWriteToFilesAutomatically());
ui->parallelBatchJobs->setChecked(p.getParallelBatchJobs());
ui->skipFilesWithExistingTags->setChecked(p.getSkipFilesWithExistingTags());
ui->applyFileExtensionFilter->setChecked(p.getApplyFileExtensionFilter());
ui->maxDuration->setValue(p.getMaxDuration());
ui->tagFormat->setCurrentIndex(listMetadataFormat.indexOf(p.getMetadataFormat()));
ui->metadataWriteTitle->setCurrentIndex(listMetadataWrite.indexOf(p.getMetadataWriteTitle()));
ui->metadataWriteArtist->setCurrentIndex(listMetadataWrite.indexOf(p.getMetadataWriteArtist()));
ui->metadataWriteAlbum->setCurrentIndex(listMetadataWrite.indexOf(p.getMetadataWriteAlbum()));
ui->metadataWriteComment->setCurrentIndex(listMetadataWrite.indexOf(p.getMetadataWriteComment()));
ui->metadataWriteGrouping->setCurrentIndex(listMetadataWrite.indexOf(p.getMetadataWriteGrouping()));
ui->metadataWriteKey->setCurrentIndex(listMetadataWriteKey.indexOf(p.getMetadataWriteKey()));
ui->metadataWriteFilename->setCurrentIndex(listMetadataWrite.indexOf(p.getMetadataWriteFilename()));
ui->metadataDelimiter->setText(p.getMetadataDelimiter());
ui->iTunesLibraryPath->setText(p.getITunesLibraryPath());
ui->traktorLibraryPath->setText(p.getTraktorLibraryPath());
ui->seratoLibraryPath->setText(p.getSeratoLibraryPath());
QStringList ckc = p.getCustomKeyCodes();
ui->majKey0->setText(ckc[0]); ui->minKey0->setText(ckc[1]);
ui->majKey1->setText(ckc[2]); ui->minKey1->setText(ckc[3]);
ui->majKey2->setText(ckc[4]); ui->minKey2->setText(ckc[5]);
ui->majKey3->setText(ckc[6]); ui->minKey3->setText(ckc[7]);
ui->majKey4->setText(ckc[8]); ui->minKey4->setText(ckc[9]);
ui->majKey5->setText(ckc[10]); ui->minKey5->setText(ckc[11]);
ui->majKey6->setText(ckc[12]); ui->minKey6->setText(ckc[13]);
ui->majKey7->setText(ckc[14]); ui->minKey7->setText(ckc[15]);
ui->majKey8->setText(ckc[16]); ui->minKey8->setText(ckc[17]);
ui->majKey9->setText(ckc[18]); ui->minKey9->setText(ckc[19]);
ui->majKey10->setText(ckc[20]); ui->minKey10->setText(ckc[21]);
ui->majKey11->setText(ckc[22]); ui->minKey11->setText(ckc[23]);
ui->silence->setText(ckc[24]);
ui->filterFileExtensions->setText(p.getFilterFileExtensions().join(","));
// enable/disable fields as necessary
metadataDelimiterEnabled();
applyFileExtensionFilterEnabled();
//relative sizing on Mac/Linux only
#ifndef Q_OS_WIN
QFont smallerFont;
smallerFont.setPointSize(smallerFont.pointSize() - 2);
for (int i=0; i<ui->gridLayoutKeyCodes->count(); i++) {
if (!ui->gridLayoutKeyCodes->itemAt(i)->isEmpty() && ui->gridLayoutKeyCodes->itemAt(i)->widget()->inherits("QLabel")) {
ui->gridLayoutKeyCodes->itemAt(i)->widget()->setFont(smallerFont);
}
}
#endif
// validation of file extension filtering
QRegExp regex("^([a-z0-9]+,?)*$");
QValidator *validator = new QRegExpValidator(regex, this);
ui->filterFileExtensions->setValidator(validator);
}
示例2: QDialog
//.........这里部分代码省略.........
// get values from preferences
Preferences p;
ui->writeToFilesAutomatically->setChecked(p.getWriteToFilesAutomatically());
ui->parallelBatchJobs->setChecked(p.getParallelBatchJobs());
ui->writeToTagComment->setChecked(p.getWriteToTagComment());
ui->writeToTagGrouping->setChecked(p.getWriteToTagGrouping());
ui->writeToTagKey->setChecked(p.getWriteToTagKey());
ui->writeToFilePrefix->setChecked(p.getWriteToFilePrefix());
ui->writeToFileSuffix->setChecked(p.getWriteToFileSuffix());
ui->filenameDelimiter->setText(p.getFilenameDelimiter());
ui->skipFilesWithExistingTags->setChecked(p.getSkipFilesWithExistingTags());
ui->temporalWindow->setCurrentIndex(listTemporalWindow.indexOf(p.getTemporalWindow()));
ui->segmentation->setCurrentIndex(listSegmentation.indexOf(p.getSegmentation()));
ui->similarityMeasure->setCurrentIndex(listSimilarityMeasure.indexOf(p.getSimilarityMeasure()));
ui->tagFormat->setCurrentIndex(listTagFormat.indexOf(p.getTagFormat()));
ui->hopSize->setCurrentIndex(listHopSize.indexOf(p.getHopSize()));
ui->fftFrameSize->setCurrentIndex(listFftFrameSize.indexOf(p.getFftFrameSize()));
ui->octaves->setValue(p.getOctaves());
ui->bps->setValue(p.getBpo()/12);
ui->octaveOffset->setChecked(p.getOffsetToC());
ui->dFactor->setValue(p.getDFactor());
ui->toneProfile->setCurrentIndex(listToneProfile.indexOf(p.getToneProfile()));
ui->hcdfPeakPickingNeighbours->setValue(p.getHcdfPeakPickingNeighbours());
ui->arbitrarySegments->setValue(p.getArbitrarySegments());
ui->hcdfGaussianSize->setValue(p.getHcdfGaussianSize());
ui->tuningMethod->setCurrentIndex(listTuningMethod.indexOf(p.getTuningMethod()));
ui->hcdfGaussianSigma->setValue(p.getHcdfGaussianSigma());
ui->stFreq->setCurrentIndex(listStartingFreq.indexOf(p.getStartingFreqA()));
ui->directSkStretch->setValue(p.getDirectSkStretch());
ui->detunedBandWeight->setValue(p.getDetunedBandWeight());
ui->iTunesLibraryPath->setText(p.getITunesLibraryPath());
ui->traktorLibraryPath->setText(p.getTraktorLibraryPath());
ui->seratoLibraryPath->setText(p.getSeratoLibraryPath());
std::vector<float> ctp = p.getCustomToneProfile();
ui->maj0->setValue(ctp[0]);
ui->maj1->setValue(ctp[1]);
ui->maj2->setValue(ctp[2]);
ui->maj3->setValue(ctp[3]);
ui->maj4->setValue(ctp[4]);
ui->maj5->setValue(ctp[5]);
ui->maj6->setValue(ctp[6]);
ui->maj7->setValue(ctp[7]);
ui->maj8->setValue(ctp[8]);
ui->maj9->setValue(ctp[9]);
ui->maj10->setValue(ctp[10]);
ui->maj11->setValue(ctp[11]);
ui->min0->setValue(ctp[12]);
ui->min1->setValue(ctp[13]);
ui->min2->setValue(ctp[14]);
ui->min3->setValue(ctp[15]);
ui->min4->setValue(ctp[16]);
ui->min5->setValue(ctp[17]);
ui->min6->setValue(ctp[18]);
ui->min7->setValue(ctp[19]);
ui->min8->setValue(ctp[20]);
ui->min9->setValue(ctp[21]);
ui->min10->setValue(ctp[22]);
ui->min11->setValue(ctp[23]);
QStringList ckc = p.getCustomKeyCodes();
ui->majKey0->setText(ckc[0]); ui->minKey0->setText(ckc[1]);
ui->majKey1->setText(ckc[2]); ui->minKey1->setText(ckc[3]);
ui->majKey2->setText(ckc[4]); ui->minKey2->setText(ckc[5]);
ui->majKey3->setText(ckc[6]); ui->minKey3->setText(ckc[7]);
ui->majKey4->setText(ckc[8]); ui->minKey4->setText(ckc[9]);
ui->majKey5->setText(ckc[10]); ui->minKey5->setText(ckc[11]);
ui->majKey6->setText(ckc[12]); ui->minKey6->setText(ckc[13]);
ui->majKey7->setText(ckc[14]); ui->minKey7->setText(ckc[15]);
ui->majKey8->setText(ckc[16]); ui->minKey8->setText(ckc[17]);
ui->majKey9->setText(ckc[18]); ui->minKey9->setText(ckc[19]);
ui->majKey10->setText(ckc[20]); ui->minKey10->setText(ckc[21]);
ui->majKey11->setText(ckc[22]); ui->minKey11->setText(ckc[23]);
ui->silence->setText(ckc[24]);
// enable/disable fields as necessary
tuningEnabled();
binAdaptiveTuningEnabled();
segmentationEnabled();
customProfileEnabled();
filenameDelimiterEnabled();
//relative sizing on Mac only
#ifdef Q_OS_MAC
QFont smallerFont;
smallerFont.setPointSize(smallerFont.pointSize() - 2);
for(int i=0; i<ui->gridLayoutKeyCodes->count(); i++)
if(!ui->gridLayoutKeyCodes->itemAt(i)->isEmpty())
if(ui->gridLayoutKeyCodes->itemAt(i)->widget()->inherits("QLabel"))
ui->gridLayoutKeyCodes->itemAt(i)->widget()->setFont(smallerFont);
for(int i=0; i<ui->customMajor->count(); i++)
if(!ui->customMajor->itemAt(i)->isEmpty())
if(ui->customMajor->itemAt(i)->widget()->inherits("QLabel"))
ui->customMajor->itemAt(i)->widget()->setFont(smallerFont);
for(int i=0; i<ui->customMinor->count(); i++)
if(!ui->customMinor->itemAt(i)->isEmpty())
if(ui->customMinor->itemAt(i)->widget()->inherits("QLabel"))
ui->customMinor->itemAt(i)->widget()->setFont(smallerFont);
#endif
}