本文整理汇总了C++中Preferences::getApplicationFontFamily方法的典型用法代码示例。如果您正苦于以下问题:C++ Preferences::getApplicationFontFamily方法的具体用法?C++ Preferences::getApplicationFontFamily怎么用?C++ Preferences::getApplicationFontFamily使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preferences
的用法示例。
在下文中一共展示了Preferences::getApplicationFontFamily方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_selectApplicationFontBtn_clicked
void PreferencesDialog::on_selectApplicationFontBtn_clicked()
{
Preferences *preferencesMng = Preferences::get_instance();
QString family = preferencesMng->getApplicationFontFamily();
int pointSize = preferencesMng->getApplicationFontPointSize();
bool ok;
QFont font = QFontDialog::getFont( &ok, QFont( family, pointSize ), this );
if ( ok ) {
// font is set to the font the user selected
family = font.family();
pointSize = font.pointSize();
QString familyStr = family;
preferencesMng->setApplicationFontFamily(familyStr);
preferencesMng->setApplicationFontPointSize(pointSize);
} else {
// the user cancelled the dialog; font is set to the initial
// value, in this case Times, 12.
}
QFont newFont(family, pointSize);
applicationFontLbl->setFont(newFont);
applicationFontLbl->setText(family + QString(" %1").arg(pointSize));
}
示例2: applicationFont
//.........这里部分代码省略.........
// max voices
maxVoicesTxt->setValue( pPref->m_nMaxNotes );
// JACK
trackOutsCheckBox->setChecked( pPref->m_bJackTrackOuts );
connect(trackOutsCheckBox, SIGNAL(toggled(bool)), this, SLOT(toggleTrackOutsCheckBox( bool )));
connectDefaultsCheckBox->setChecked( pPref->m_bJackConnectDefaults );
trackOutputComboBox->setCurrentIndex( pPref->m_nJackTrackOutputMode );
//~ JACK
bufferSizeSpinBox->setValue( pPref->m_nBufferSize );
switch ( pPref->m_nSampleRate ) {
case 44100:
sampleRateComboBox->setCurrentIndex( 0 );
break;
case 48000:
sampleRateComboBox->setCurrentIndex( 1 );
break;
case 88200:
sampleRateComboBox->setCurrentIndex( 2 );
break;
case 96000:
sampleRateComboBox->setCurrentIndex( 3 );
break;
default:
ERRORLOG( QString("Wrong samplerate: %1").arg( pPref->m_nSampleRate ) );
}
resampleComboBox->setCurrentIndex( (int) AudioEngine::get_instance()->get_sampler()->getInterpolateMode() );
// Appearance tab
QString applicationFamily = pPref->getApplicationFontFamily();
int applicationPointSize = pPref->getApplicationFontPointSize();
QFont applicationFont( applicationFamily, applicationPointSize );
applicationFontLbl->setFont( applicationFont );
applicationFontLbl->setText( applicationFamily + QString(" %1").arg( applicationPointSize ) );
QString mixerFamily = pPref->getMixerFontFamily();
int mixerPointSize = pPref->getMixerFontPointSize();
QFont mixerFont( mixerFamily, mixerPointSize );
mixerFontLbl->setFont( mixerFont );
mixerFontLbl->setText( mixerFamily + QString(" %1").arg( mixerPointSize ) );
float falloffSpeed = pPref->getMixerFalloffSpeed();
if (falloffSpeed == FALLOFF_SLOW) {
mixerFalloffComboBox->setCurrentIndex(0);
}
else if (falloffSpeed == FALLOFF_NORMAL) {
mixerFalloffComboBox->setCurrentIndex(1);
}
else if (falloffSpeed == FALLOFF_FAST) {
mixerFalloffComboBox->setCurrentIndex(2);
}
else {
ERRORLOG( QString("PreferencesDialog: wrong mixerFalloff value = %1").arg(falloffSpeed) );
}
uiLayoutComboBox->setCurrentIndex( pPref->getDefaultUILayout() );
// Style
QStringList list = QStyleFactory::keys();
uint i = 0;