本文整理汇总了C++中dataChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ dataChanged函数的具体用法?C++ dataChanged怎么用?C++ dataChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dataChanged函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: QWidget
FormLibraryEditor::FormLibraryEditor(QWidget* parent, Qt::WindowFlags flags)
: QWidget(parent, flags)
, ui(new Ui::FormLibraryEditor)
, ui_user_pwd(new Ui::DialogUserPassword)
, cwall(QSqlDatabase::database("cwall"))
, modelDiffucalty(new QSqlTableModel(this, cwall))
, modelRanges(new QSqlTableModel(this, cwall))
, modelCompetitionTypes(new QSqlTableModel(this, cwall))
, modelAgeGroups(new QSqlTableModel(this, cwall))
, modelTeams(new QSqlTableModel(this, cwall))
, modelCompetitors(new QSqlRelationalTableModel(this, cwall))
, modelUser(new QSqlTableModel(this, cwall))
{
ui->setupUi(this);
setMinimumWidth(600);
QAction *actionSeparator = new QAction(this);
actionSeparator->setSeparator(true);
QAction *actionSeparator1 = new QAction(this);
actionSeparator1->setSeparator(true);
modelDiffucalty->setTable("lib_climbdifficalty");
ui->listViewDiffucalties->setModel(modelDiffucalty);
ui->listViewDiffucalties->setModelColumn(modelDiffucalty->fieldIndex("label"));
modelDiffucalty->sort(modelDiffucalty->fieldIndex("id"), Qt::AscendingOrder);
modelDiffucalty->select();
modelDiffucalty->setEditStrategy(QSqlTableModel::OnManualSubmit);
ui->actionDifficultyCommit->setDisabled(true);
if (User::current()->isSuperuser() & DialogConfigure::cfg()->registration()) {
ui->listViewDiffucalties->setContextMenuPolicy(Qt::ActionsContextMenu);
ui->listViewDiffucalties->addAction(ui->actionDifficultyUpdate);
ui->listViewDiffucalties->addAction(ui->actionDifficultyCommit);
ui->listViewDiffucalties->addAction(actionSeparator);
ui->listViewDiffucalties->addAction(ui->actionDifficultyAdd);
ui->listViewDiffucalties->addAction(ui->actionDifficultyDelete);
connect(ui->listViewDiffucalties, SIGNAL(pressed(QModelIndex)), this, SLOT(currentDiffChanged(QModelIndex)));
connect(ui->listViewDiffucalties, SIGNAL(activated(QModelIndex)), this, SLOT(currentDiffChanged(QModelIndex)));
connect(modelDiffucalty, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelChange()));
} else {
ui->listViewDiffucalties->setEditTriggers(QAbstractItemView::NoEditTriggers);
}
modelRanges->setTable("lib_sportrange");
ui->listViewSportRanges->setModel(modelRanges);
ui->listViewSportRanges->setModelColumn(modelRanges->fieldIndex("label"));
modelRanges->sort(modelRanges->fieldIndex("id"), Qt::AscendingOrder);
modelRanges->select();
ui->listViewSportRanges->setEditTriggers(QAbstractItemView::NoEditTriggers);
modelCompetitionTypes->setTable("lib_competitiontype");
ui->tableViewCompetitionTypes->setModel(modelCompetitionTypes);
modelCompetitionTypes->select();
ui->tableViewCompetitionTypes->hideColumn(modelCompetitionTypes->fieldIndex("prefix"));
ui->tableViewCompetitionTypes->hideColumn(modelCompetitionTypes->fieldIndex("id"));
modelCompetitionTypes->setEditStrategy(QSqlTableModel::OnManualSubmit);
if (User::current()->isSuperuser() & DialogConfigure::cfg()->registration()) {
ui->tableViewCompetitionTypes->addAction(ui->actionCTypeCommit);
ui->tableViewCompetitionTypes->addAction(ui->actionCTypeUpdate);
ui->actionCTypeCommit->setDisabled(true);
connect(modelCompetitionTypes, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelChange()));
} else {
ui->tableViewCompetitionTypes->setEditTriggers(QAbstractItemView::NoEditTriggers);
}
modelAgeGroups->setTable("lib_agegroup");
ui->tableViewAgeGroups->setModel(modelAgeGroups);
modelAgeGroups->select();
ui->tableViewAgeGroups->hideColumn(modelAgeGroups->fieldIndex("id"));
modelAgeGroups->sort(modelAgeGroups->fieldIndex("id"), Qt::AscendingOrder);
modelAgeGroups->setEditStrategy(QSqlTableModel::OnManualSubmit);
if (DialogConfigure::cfg()->registration()) {
ui->tableViewAgeGroups->addAction(ui->actionAgeGroupUpdate);
ui->tableViewAgeGroups->addAction(ui->actionAgeGroupCommit);
ui->tableViewAgeGroups->addAction(actionSeparator);
ui->tableViewAgeGroups->addAction(ui->actionAgeGroupAdd);
ui->tableViewAgeGroups->addAction(ui->actionAgeGroupDelete);
ui->actionAgeGroupCommit->setDisabled(true);
ui->actionAgeGroupDelete->setDisabled(true);
connect(modelAgeGroups, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelChange()));
connect(ui->tableViewAgeGroups, SIGNAL(activated(QModelIndex)), this, SLOT(currentAgrpChanged(QModelIndex)));
connect(ui->tableViewAgeGroups, SIGNAL(pressed(QModelIndex)), this, SLOT(currentAgrpChanged(QModelIndex)));
} else {
ui->tableViewAgeGroups->setEditTriggers(QAbstractItemView::NoEditTriggers);
}
modelTeams->setTable("lib_team");
ui->tableViewTeams->setModel(modelTeams);
ui->tableViewTeams->hideColumn(modelTeams->fieldIndex("gid"));
modelTeams->sort(modelTeams->fieldIndex("gid"), Qt::AscendingOrder);
modelTeams->select();
ui->tableViewTeams->addAction(ui->actionTeamCommit);
ui->tableViewTeams->addAction(ui->actionTeamUpdate);
ui->tableViewTeams->addAction(actionSeparator);
ui->tableViewTeams->addAction(ui->actionTeamAdd);
ui->tableViewTeams->addAction(ui->actionTeamDelete);
modelTeams->setEditStrategy(QSqlTableModel::OnManualSubmit);
ui->actionTeamCommit->setDisabled(true);
ui->actionTeamDelete->setDisabled(true);
connect(modelTeams, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(modelChange()));
connect(ui->tableViewTeams, SIGNAL(activated(QModelIndex)), this, SLOT(currentTeamChanged(QModelIndex)));
//.........这里部分代码省略.........
开发者ID:pitikov,项目名称:cwall.qt4,代码行数:101,代码来源:formlibraryeditor.cpp
示例2: dataChanged
void EntryAttachmentsModel::attachmentChange(const QString& key)
{
int row = m_entryAttachments->keys().indexOf(key);
Q_EMIT dataChanged(index(row, 0), index(row, columnCount()-1));
}
开发者ID:nandhp,项目名称:keepassx,代码行数:5,代码来源:EntryAttachmentsModel.cpp
示例3: CharCommand
void QHexEditPrivate::insert(int index, char ch)
{
QUndoCommand *charCommand = new CharCommand(&_xData, CharCommand::insert, index, ch);
_undoStack->push(charCommand);
emit dataChanged();
}
开发者ID:djandruczyk,项目名称:emstune,代码行数:6,代码来源:qhexedit_p.cpp
示例4: Q_ASSERT
void PrettyMailboxModel::xtConnectStatusChanged(QModelIndex index)
{
Q_ASSERT(index.model() == this);
emit dataChanged(index, index);
}
开发者ID:RonnyPfannschmidt,项目名称:trojita,代码行数:5,代码来源:PrettyMailboxModel.cpp
示例5: index
void HistoryModel::entryUpdated(int offset)
{
QModelIndex idx = index(offset, 0);
emit dataChanged(idx, idx);
}
开发者ID:Afreeca,项目名称:qt,代码行数:5,代码来源:history.cpp
示例6: index
void BookmarksModel::entryChanged(BookmarkNode *item)
{
QModelIndex idx = index(item);
emit dataChanged(idx, idx);
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:5,代码来源:bookmarks.cpp
示例7: dataChanged
void QgsGraduatedSymbolRendererV2Model::updateLabels()
{
emit dataChanged( createIndex( 0, 2 ), createIndex( mRenderer->ranges().size(), 2 ) );
}
开发者ID:nicanor-b,项目名称:QGIS,代码行数:4,代码来源:qgsgraduatedsymbolrendererv2widget.cpp
示例8: switch
//.........这里部分代码省略.........
settings.setValue("fUseUPnP", value.toBool());
MapPort(value.toBool());
break;
case MinimizeOnClose:
fMinimizeOnClose = value.toBool();
settings.setValue("fMinimizeOnClose", fMinimizeOnClose);
break;
// default proxy
case ProxyUse:
if (settings.value("fUseProxy") != value) {
settings.setValue("fUseProxy", value.toBool());
setRestartRequired(true);
}
break;
case ProxyIP: {
// contains current IP at index 0 and current port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
// if that key doesn't exist or has a changed IP
if (!settings.contains("addrProxy") || strlIpPort.at(0) != value.toString()) {
// construct new value from new IP and current port
QString strNewValue = value.toString() + ":" + strlIpPort.at(1);
settings.setValue("addrProxy", strNewValue);
setRestartRequired(true);
}
}
break;
case ProxyPort: {
// contains current IP at index 0 and current port at index 1
QStringList strlIpPort = settings.value("addrProxy").toString().split(":", QString::SkipEmptyParts);
// if that key doesn't exist or has a changed port
if (!settings.contains("addrProxy") || strlIpPort.at(1) != value.toString()) {
// construct new value from current IP and new port
QString strNewValue = strlIpPort.at(0) + ":" + value.toString();
settings.setValue("addrProxy", strNewValue);
setRestartRequired(true);
}
}
break;
#ifdef ENABLE_WALLET
case SpendZeroConfChange:
if (settings.value("bSpendZeroConfChange") != value) {
settings.setValue("bSpendZeroConfChange", value);
setRestartRequired(true);
}
break;
#endif
case DisplayUnit:
setDisplayUnit(value);
break;
case ThirdPartyTxUrls:
if (strThirdPartyTxUrls != value.toString()) {
strThirdPartyTxUrls = value.toString();
settings.setValue("strThirdPartyTxUrls", strThirdPartyTxUrls);
setRestartRequired(true);
}
break;
case Language:
if (settings.value("language") != value) {
settings.setValue("language", value);
setRestartRequired(true);
}
break;
case CoinControlFeatures:
fCoinControlFeatures = value.toBool();
settings.setValue("fCoinControlFeatures", fCoinControlFeatures);
emit coinControlFeaturesChanged(fCoinControlFeatures);
break;
case DatabaseCache:
if (settings.value("nDatabaseCache") != value) {
settings.setValue("nDatabaseCache", value);
setRestartRequired(true);
}
break;
case ThreadsScriptVerif:
if (settings.value("nThreadsScriptVerif") != value) {
settings.setValue("nThreadsScriptVerif", value);
setRestartRequired(true);
}
break;
case Listen:
if (settings.value("fListen") != value) {
settings.setValue("fListen", value);
setRestartRequired(true);
}
break;
case MiningIntensity:
if (settings.value("nMiningIntensity") != value.toInt()) {
settings.setValue("nMiningIntensity", value.toInt());
setRestartRequired(true);
}
default:
break;
}
}
emit dataChanged(index, index);
return successful;
}
开发者ID:MaxGuevara,项目名称:quark,代码行数:101,代码来源:optionsmodel.cpp
示例9: dataChanged
void LinearCurveSegmentModel::on_endChanged()
{
emit dataChanged();
}
开发者ID:gitter-badger,项目名称:i-score,代码行数:4,代码来源:LinearCurveSegmentModel.cpp
示例10: organicKnob
void organicInstrumentView::modelChanged()
{
organicInstrument * oi = castModel<organicInstrument>();
const float y=91.0f;
const float rowHeight = 26.0f;
const float x=53.0f;
const float colWidth = 24.0f;
m_numOscillators = oi->m_numOscillators;
m_fx1Knob->setModel( &oi->m_fx1Model );
m_volKnob->setModel( &oi->m_volModel );
if( m_oscKnobs != NULL )
{
delete[] m_oscKnobs;
}
m_oscKnobs = new OscillatorKnobs[ m_numOscillators ];
// Create knobs, now that we know how many to make
for( int i = 0; i < m_numOscillators; ++i )
{
// setup harmonic knob
knob * harmKnob = new organicKnob( this );
harmKnob->move( x + i * colWidth, y - rowHeight );
harmKnob->setObjectName( "harmKnob" );
connect( &oi->m_osc[i]->m_harmModel, SIGNAL( dataChanged() ),
this, SLOT( updateKnobHint() ) );
// setup waveform-knob
knob * oscKnob = new organicKnob( this );
oscKnob->move( x + i * colWidth, y );
connect( &oi->m_osc[i]->m_oscModel, SIGNAL( dataChanged() ),
this, SLOT( updateKnobHint() ) );
oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i + 1 ) + " ", QString() );
// setup volume-knob
knob * volKnob = new knob( knobStyled, this );
volKnob->setVolumeKnob( true );
volKnob->move( x + i * colWidth, y + rowHeight*1 );
volKnob->setFixedSize( 21, 21 );
volKnob->setHintText( tr( "Osc %1 volume:" ).arg(
i + 1 ) + " ", "%" );
// setup panning-knob
knob * panKnob = new organicKnob( this );
panKnob->move( x + i * colWidth, y + rowHeight*2 );
panKnob->setHintText( tr("Osc %1 panning:").arg(
i + 1 ) + " ", "" );
// setup knob for fine-detuning
knob * detuneKnob = new organicKnob( this );
detuneKnob->move( x + i * colWidth, y + rowHeight*3 );
detuneKnob->setHintText( tr( "Osc %1 stereo detuning" ).arg( i + 1 )
+ " ", " " +
tr( "cents" ) );
m_oscKnobs[i] = OscillatorKnobs( harmKnob, volKnob, oscKnob, panKnob, detuneKnob );
// Attach to models
m_oscKnobs[i].m_harmKnob->setModel( &oi->m_osc[i]->m_harmModel );
m_oscKnobs[i].m_volKnob->setModel( &oi->m_osc[i]->m_volModel );
m_oscKnobs[i].m_oscKnob->setModel( &oi->m_osc[i]->m_oscModel );
m_oscKnobs[i].m_panKnob->setModel( &oi->m_osc[i]->m_panModel );
m_oscKnobs[i].m_detuneKnob->setModel( &oi->m_osc[i]->m_detuneModel );
}
updateKnobHint();
}
开发者ID:hhalmet,项目名称:lmms,代码行数:71,代码来源:organic.cpp
示例11: Instrument
organicInstrument::organicInstrument( InstrumentTrack * _instrument_track ) :
Instrument( _instrument_track, &organic_plugin_descriptor ),
m_modulationAlgo( Oscillator::SignalMix, Oscillator::SignalMix, Oscillator::SignalMix),
m_fx1Model( 0.0f, 0.0f, 0.99f, 0.01f , this, tr( "Distortion" ) ),
m_volModel( 100.0f, 0.0f, 200.0f, 1.0f, this, tr( "Volume" ) )
{
m_numOscillators = 8;
m_osc = new OscillatorObject*[ m_numOscillators ];
for (int i=0; i < m_numOscillators; i++)
{
m_osc[i] = new OscillatorObject( this, i );
m_osc[i]->m_numOscillators = m_numOscillators;
// Connect events
connect( &m_osc[i]->m_oscModel, SIGNAL( dataChanged() ),
m_osc[i], SLOT ( oscButtonChanged() ) );
connect( &m_osc[i]->m_harmModel, SIGNAL( dataChanged() ),
m_osc[i], SLOT( updateDetuning() ) );
connect( &m_osc[i]->m_volModel, SIGNAL( dataChanged() ),
m_osc[i], SLOT( updateVolume() ) );
connect( &m_osc[i]->m_panModel, SIGNAL( dataChanged() ),
m_osc[i], SLOT( updateVolume() ) );
connect( &m_osc[i]->m_detuneModel, SIGNAL( dataChanged() ),
m_osc[i], SLOT( updateDetuning() ) );
m_osc[i]->updateVolume();
}
/* m_osc[0]->m_harmonic = log2f( 0.5f ); // one octave below
m_osc[1]->m_harmonic = log2f( 0.75f ); // a fifth below
m_osc[2]->m_harmonic = log2f( 1.0f ); // base freq
m_osc[3]->m_harmonic = log2f( 2.0f ); // first overtone
m_osc[4]->m_harmonic = log2f( 3.0f ); // second overtone
m_osc[5]->m_harmonic = log2f( 4.0f ); // .
m_osc[6]->m_harmonic = log2f( 5.0f ); // .
m_osc[7]->m_harmonic = log2f( 6.0f ); // .*/
if( s_harmonics == NULL )
{
s_harmonics = new float[ NUM_HARMONICS ];
s_harmonics[0] = log2f( 0.5f );
s_harmonics[1] = log2f( 0.75f );
s_harmonics[2] = log2f( 1.0f );
s_harmonics[3] = log2f( 2.0f );
s_harmonics[4] = log2f( 3.0f );
s_harmonics[5] = log2f( 4.0f );
s_harmonics[6] = log2f( 5.0f );
s_harmonics[7] = log2f( 6.0f );
s_harmonics[8] = log2f( 7.0f );
s_harmonics[9] = log2f( 8.0f );
s_harmonics[10] = log2f( 9.0f );
s_harmonics[11] = log2f( 10.0f );
s_harmonics[12] = log2f( 11.0f );
s_harmonics[13] = log2f( 12.0f );
s_harmonics[14] = log2f( 13.0f );
s_harmonics[15] = log2f( 14.0f );
s_harmonics[16] = log2f( 15.0f );
s_harmonics[17] = log2f( 16.0f );
}
for (int i=0; i < m_numOscillators; i++) {
m_osc[i]->updateVolume();
m_osc[i]->updateDetuning();
}
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateAllDetuning() ) );
}
开发者ID:hhalmet,项目名称:lmms,代码行数:71,代码来源:organic.cpp
示例12: Model
EnvelopeAndLfoParameters::EnvelopeAndLfoParameters(
float _value_for_zero_amount,
Model * _parent ) :
Model( _parent ),
m_used( false ),
m_predelayModel( 0.0, 0.0, 2.0, 0.001, this, tr( "Predelay" ) ),
m_attackModel( 0.0, 0.0, 2.0, 0.001, this, tr( "Attack" ) ),
m_holdModel( 0.5, 0.0, 2.0, 0.001, this, tr( "Hold" ) ),
m_decayModel( 0.5, 0.0, 2.0, 0.001, this, tr( "Decay" ) ),
m_sustainModel( 0.5, 0.0, 1.0, 0.001, this, tr( "Sustain" ) ),
m_releaseModel( 0.1, 0.0, 2.0, 0.001, this, tr( "Release" ) ),
m_amountModel( 0.0, -1.0, 1.0, 0.005, this, tr( "Modulation" ) ),
m_valueForZeroAmount( _value_for_zero_amount ),
m_pahdFrames( 0 ),
m_rFrames( 0 ),
m_pahdEnv( NULL ),
m_rEnv( NULL ),
m_pahdBufSize( 0 ),
m_rBufSize( 0 ),
m_lfoPredelayModel( 0.0, 0.0, 1.0, 0.001, this, tr( "LFO Predelay" ) ),
m_lfoAttackModel( 0.0, 0.0, 1.0, 0.001, this, tr( "LFO Attack" ) ),
m_lfoSpeedModel( 0.1, 0.001, 1.0, 0.0001,
SECS_PER_LFO_OSCILLATION * 1000.0, this,
tr( "LFO speed" ) ),
m_lfoAmountModel( 0.0, -1.0, 1.0, 0.005, this, tr( "LFO Modulation" ) ),
m_lfoWaveModel( SineWave, 0, NumLfoShapes, this, tr( "LFO Wave Shape" ) ),
m_x100Model( false, this, tr( "Freq x 100" ) ),
m_controlEnvAmountModel( false, this, tr( "Modulate Env-Amount" ) ),
m_lfoFrame( 0 ),
m_lfoAmountIsZero( false ),
m_lfoShapeData( NULL )
{
m_amountModel.setCenterValue( 0 );
m_lfoAmountModel.setCenterValue( 0 );
if( s_lfoInstances == NULL )
{
s_lfoInstances = new LfoInstances();
}
instances()->add( this );
connect( &m_predelayModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_attackModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_holdModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_decayModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_sustainModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_releaseModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_amountModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_lfoPredelayModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_lfoAttackModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_lfoSpeedModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_lfoAmountModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_lfoWaveModel, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( &m_x100Model, SIGNAL( dataChanged() ),
this, SLOT( updateSampleVars() ) );
connect( engine::mixer(), SIGNAL( sampleRateChanged() ),
this, SLOT( updateSampleVars() ) );
m_lfoShapeData =
new sample_t[engine::mixer()->framesPerPeriod()];
updateSampleVars();
}
开发者ID:CallisteHanriat,项目名称:lmms,代码行数:79,代码来源:EnvelopeAndLfoParameters.cpp
示例13: expKnobVal
//.........这里部分代码省略.........
if( static_cast<int>( floorf( m_amount * 1000.0f ) ) == 0 )
{
m_rFrames = 0;
}
// if the buffers are too small, make bigger ones - so we only alloc new memory when necessary
if( m_pahdBufSize < m_pahdFrames )
{
sample_t * tmp = m_pahdEnv;
m_pahdEnv = new sample_t[m_pahdFrames];
delete tmp;
m_pahdBufSize = m_pahdFrames;
}
if( m_rBufSize < m_rFrames )
{
sample_t * tmp = m_rEnv;
m_rEnv = new sample_t[m_rFrames];
delete tmp;
m_rBufSize = m_rFrames;
}
const float aa = m_amountAdd;
for( f_cnt_t i = 0; i < predelay_frames; ++i )
{
m_pahdEnv[i] = aa;
}
f_cnt_t add = predelay_frames;
const float afI = ( 1.0f / attack_frames ) * m_amount;
for( f_cnt_t i = 0; i < attack_frames; ++i )
{
m_pahdEnv[add+i] = i * afI + aa;
}
add += attack_frames;
const float amsum = m_amount + m_amountAdd;
for( f_cnt_t i = 0; i < hold_frames; ++i )
{
m_pahdEnv[add + i] = amsum;
}
add += hold_frames;
const float dfI = ( 1.0 / decay_frames ) * ( m_sustainLevel -1 ) * m_amount;
for( f_cnt_t i = 0; i < decay_frames; ++i )
{
/*
m_pahdEnv[add + i] = ( m_sustainLevel + ( 1.0f -
(float)i / decay_frames ) *
( 1.0f - m_sustainLevel ) ) *
m_amount + m_amountAdd;
*/
m_pahdEnv[add + i] = amsum + i*dfI;
}
const float rfI = ( 1.0f / m_rFrames ) * m_amount;
for( f_cnt_t i = 0; i < m_rFrames; ++i )
{
m_rEnv[i] = (float)( m_rFrames - i ) * rfI;
}
// save this calculation in real-time-part
m_sustainLevel = m_sustainLevel * m_amount + m_amountAdd;
const float frames_per_lfo_oscillation = SECS_PER_LFO_OSCILLATION *
engine::mixer()->processingSampleRate();
m_lfoPredelayFrames = static_cast<f_cnt_t>( frames_per_lfo_oscillation *
expKnobVal( m_lfoPredelayModel.value() ) );
m_lfoAttackFrames = static_cast<f_cnt_t>( frames_per_lfo_oscillation *
expKnobVal( m_lfoAttackModel.value() ) );
m_lfoOscillationFrames = static_cast<f_cnt_t>(
frames_per_lfo_oscillation *
m_lfoSpeedModel.value() );
if( m_x100Model.value() )
{
m_lfoOscillationFrames /= 100;
}
m_lfoAmount = m_lfoAmountModel.value() * 0.5f;
m_used = true;
if( static_cast<int>( floorf( m_lfoAmount * 1000.0f ) ) == 0 )
{
m_lfoAmountIsZero = true;
if( static_cast<int>( floorf( m_amount * 1000.0f ) ) == 0 )
{
m_used = false;
}
}
else
{
m_lfoAmountIsZero = false;
}
m_bad_lfoShapeData = true;
emit dataChanged();
}
开发者ID:CallisteHanriat,项目名称:lmms,代码行数:101,代码来源:EnvelopeAndLfoParameters.cpp
示例14: switch
bool SoilProfile::setData(const QModelIndex &index, const QVariant &value, int role)
{
if(index.parent()!=QModelIndex() || m_readOnly)
return false;
if (role == Qt::EditRole) {
switch (index.column()) {
case ThicknessColumn:
if (index.row() < (rowCount() - 1)) {
// Soil layers
bool success;
const double d = value.toDouble(&success);
if (!success)
return false;
m_soilLayers.at(index.row())->setThickness(d);
updateDepths();
emit dataChanged(this->index(index.row(), DepthColumn),
this->index(rowCount(), DepthColumn));
break;
} else {
// Rock layer
return false;
}
case SoilTypeColumn:
// Check if it is the final layer and if the SoilType can be identified
if (index.row() < (rowCount() - 1)) {
if (SoilType* st = m_soilTypeCatalog->soilTypeOf(value)) {
m_soilLayers.at(index.row())->setSoilType(st);
break;
}
} else {
return false;
}
case VelocityColumn:
case StdevColumn:
{
bool success;
const double d = value.toDouble(&success);
if (!success)
return false;
if (index.column() == VelocityColumn)
velocityLayer(index.row())->setAvg(d);
else if (index.column() == StdevColumn)
velocityLayer(index.row())->setStdev(d);
break;
}
case MinColumn:
case MaxColumn:
{
bool success;
const double d = value.toDouble(&success);
if (!success)
return false;
if (index.column() == MinColumn)
velocityLayer(index.row())->setMin(d);
else if(index.column() == MaxColumn)
velocityLayer(index.row())->setMax(d);
break;
}
case DepthColumn:
case VariedColumn:
default:
return false;
}
} else if(role == Qt::CheckStateRole) {
switch (index.column()) {
case MinColumn:
velocityLayer(index.row())->setHasMin(value.toBool());
break;
case MaxColumn:
velocityLayer(index.row())->setHasMax(value.toBool());
break;
case VariedColumn:
velocityLayer(index.row())->setIsVaried(value.toBool());
break;
}
}
emit dataChanged(index, index);
return true;
}
开发者ID:arkottke,项目名称:strata,代码行数:87,代码来源:SoilProfile.cpp
示例15: dataChanged
void IxModel::raiseEvent_dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles /* = QVector<int>() */) { Q_EMIT dataChanged(topLeft, bottomRight, roles); }
开发者ID:arBmind,项目名称:QxORM-1.32,代码行数:1,代码来源:IxModel.cpp
示例16: QObject
QHexEditDataReader::QHexEditDataReader(QHexEditData *hexeditdata, QObject *parent): QObject(parent), _dirtybuffer(false), _bufferpos(-1), _hexeditdata(hexeditdata)
{
connect(hexeditdata, SIGNAL(dataChanged(qint64,qint64,QHexEditData::ActionType)), this, SLOT(onDataChanged(qint64,qint64,QHexEditData::ActionType)));
this->_buffereddata.resize(QHexEditData::BUFFER_SIZE);
}
开发者ID:ashimidashajia,项目名称:QHexEdit,代码行数:5,代码来源:qhexeditdatareader.cpp
示例17: dataChanged
void VersionData::setSoftName(const QString &value)
{
m_softName = value;
emit dataChanged();
}
开发者ID:Legotckoi,项目名称:EColor,代码行数:5,代码来源:versionchecker.cpp
示例18: QWidget
WorkflowEditor::WorkflowEditor(WorkflowView *p)
: QWidget(p),
owner(p),
custom(NULL),
customWidget(NULL),
subject(NULL),
actor(NULL),
onFirstTableShow(true)
{
GCOUNTER( cvar, tvar, "WorkflowEditor" );
setupUi(this);
specialParameters = new SpecialParametersPanel(this);
tableSplitter->insertWidget(0, specialParameters);
specialParameters->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
table->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
specialParameters->hide();
#ifdef Q_OS_MAC
QString style("QGroupBox::title {margin-top: 1px; margin-left: 15px;}");
editorBox->setStyleSheet(style);
#endif
QVBoxLayout *inputScrollAreaContainerLayout = new QVBoxLayout();
inputScrollAreaContainerLayout->setContentsMargins(0, 0, 0, 0);
inputScrollAreaContainerLayout->setSpacing(0);
inputScrollAreaContainerLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
inputScrollAreaContainer->setLayout(inputScrollAreaContainerLayout);
inputPortBox->setEnabled(false);
inputPortBox->setVisible(true);
connect(inputPortBox, SIGNAL(toggled(bool)), SLOT(sl_changeVisibleInput(bool)));
QVBoxLayout *outputScrollAreaContainerLayout = new QVBoxLayout();
outputScrollAreaContainerLayout->setContentsMargins(0, 0, 0, 0);
outputScrollAreaContainerLayout->setSpacing(0);
outputScrollAreaContainerLayout->setSizeConstraint(QLayout::SetMinAndMaxSize);
outputScrollAreaContainer->setLayout(outputScrollAreaContainerLayout);
outputPortBox->setEnabled(false);
outputPortBox->setVisible(true);
connect(outputPortBox, SIGNAL(toggled(bool)), SLOT(sl_changeVisibleOutput(bool)));
caption->setMinimumHeight(nameEdit->sizeHint().height());
actorModel = new ActorCfgModel(this, owner);
proxyModel = new ActorCfgFilterProxyModel(this);
proxyModel->setSourceModel(actorModel);
table->setModel(proxyModel);
table->horizontalHeader()->setSectionsClickable(false);
table->horizontalHeader()->setSectionResizeMode(QHeaderView::Interactive);
table->verticalHeader()->hide();
table->verticalHeader()->setDefaultSectionSize(QFontMetrics(QFont()).height() + 6);
table->setItemDelegate(new SuperDelegate(this));
table->installEventFilter(this);
reset();
doc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
propDoc->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
doc->installEventFilter(this);
connect(nameEdit, SIGNAL(editingFinished()), SLOT(editingLabelFinished()));
connect(table->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), SLOT(sl_showPropDoc()));
connect(table->model(), SIGNAL(dataChanged(QModelIndex, QModelIndex)), SLOT(handleDataChanged(QModelIndex, QModelIndex)));
// FIXME
//connect(doc, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(sl_contextMenuForDoc(const QPoint &)));
table->setTabKeyNavigation(true);
}
开发者ID:ugeneunipro,项目名称:ugene,代码行数:72,代码来源:WorkflowEditor.cpp
示例19: walletdb
bool OptionsModel::setData(const QModelIndex & index, const QVariant & value, int role)
{
bool successful = true; /* set to false on parse error */
if(role == Qt::EditRole)
{
CWalletDB walletdb(wallet->strWalletFile);
switch(index.row())
{
case StartAtStartup:
successful = SetStartOnSystemStartup(value.toBool());
break;
case MinimizeToTray:
fMinimizeToTray = value.toBool();
walletdb.WriteSetting("fMinimizeToTray", fMinimizeToTray);
break;
case MapPortUPnP:
fUseUPnP = value.toBool();
walletdb.WriteSetting("fUseUPnP", fUseUPnP);
#ifdef USE_UPNP
MapPort(fUseUPnP);
#endif
break;
case MinimizeOnClose:
fMinimizeOnClose = value.toBool();
walletdb.WriteSetting("fMinimizeOnClose", fMinimizeOnClose);
break;
case ConnectSOCKS4:
fUseProxy = value.toBool();
walletdb.WriteSetting("fUseProxy", fUseProxy);
break;
case ProxyIP:
{
// Use CAddress to parse and check IP
CAddress addr(value.toString().toStdString() + ":1");
if (addr.IsValid())
{
addrProxy.SetIP(addr);
walletdb.WriteSetting("addrProxy", addrProxy);
}
else
{
successful = false;
}
}
break;
case ProxyPort:
{
int nPort = atoi(value.toString().toAscii().data());
if (nPort > 0 && nPort < std::numeric_limits<unsigned short>::max())
{
addrProxy.SetPort(nPort);
walletdb.WriteSetting("addrProxy", addrProxy);
}
else
{
successful = false;
}
}
break;
case Fee: {
nTransactionFee = value.toLongLong();
walletdb.WriteSetting("nTransactionFee", nTransactionFee);
}
break;
case DisplayUnit: {
int unit = value.toInt();
nDisplayUnit = unit;
walletdb.WriteSetting("nDisplayUnit", nDisplayUnit);
emit displayUnitChanged(unit);
}
case DisplayAddresses: {
bDisplayAddresses = value.toBool();
walletdb.WriteSetting("bDisplayAddresses", bDisplayAddresses);
}
default:
break;
}
}
emit dataChanged(index, index);
return successful;
}
开发者ID:huatai,项目名称:bitcoin,代码行数:82,代码来源:optionsmodel.cpp
示例20: QGraphicsView
//.........这里部分代码省略.........
timeLine->setMinimum(0);
timeLine->setMaximum(TIME_INITIAL_MAX);
timeLine->setTickInterval(10);
timeLine->setColor(getColor(TIME_GRID));
timeLine->setLine(
fromPercent(10, Qt::Horizontal),
fromPercent(90, Qt::Vertical),
fromPercent(90, Qt::Horizontal),
fromPercent(90, Qt::Vertical)
);
timeLine->setOrientation(Qt::Horizontal);
timeLine->setTickSize(fromPercent(1, Qt::Vertical));
timeLine->setTextColor(getColor(TIME_TEXT));
timeLine->updateTicks();
scene()->addItem(timeLine);
depthLine = new Ruler();
depthLine->setMinimum(0);
depthLine->setMaximum(M_OR_FT(40,120));
depthLine->setTickInterval(M_OR_FT(10,30));
depthLine->setLine(
fromPercent(10, Qt::Horizontal),
fromPercent(10, Qt::Vertical),
fromPercent(10, Qt::Horizontal),
fromPercent(90, Qt::Vertical)
);
depthLine->setOrientation(Qt::Vertical);
depthLine->setTickSize(fromPercent(1, Qt::Horizontal));
depthLine->setColor(getColor(DEPTH_GRID));
depthLine->setTextColor(getColor(SAMPLE_DEEP));
depthLine->updateTicks();
scene()->addItem(depthLine);
timeString = new QGraphicsSimpleTextItem();
timeString->setFlag(QGraphicsItem::ItemIgnoresTransformations);
timeString->setBrush(profile_color[TIME_TEXT].at(0));
scene()->addItem(timeString);
depthString = new QGraphicsSimpleTextItem();
depthString->setFlag(QGraphicsItem::ItemIgnoresTransformations);
depthString->setBrush(profile_color[SAMPLE_DEEP].at(0));
scene()->addItem(depthString);
diveBg = new QGraphicsPolygonItem();
diveBg->setPen(QPen(QBrush(),0));
scene()->addItem(diveBg);
#define ADDBTN(obj, icon, text, horizontal, vertical, tooltip, value, slot) \
obj = new Button(); \
obj->setPixmap(QPixmap(icon)); \
obj->setPos(fromPercent(horizontal, Qt::Horizontal), fromPercent(vertical, Qt::Vertical)); \
obj->setToolTip(QString(tooltip.arg(value))); \
scene()->addItem(obj); \
connect(obj, SIGNAL(clicked()), this, SLOT(slot));
QString incrText;
if (prefs.units.length == units::METERS)
incrText = tr("10m");
else
incrText = tr("30ft");
ADDBTN(plusDepth, ":plus", "" , 5, 5, tr("Increase maximum depth by %1"), incrText, increaseDepth());
ADDBTN(lessDepth, ":minimum","" , 2, 5, tr("Decreases maximum depth by %1"), incrText, decreaseDepth());
ADDBTN(plusTime, ":plus", "" , 95, 95, tr("Increase minimum time by %1"), tr("10min"), increaseTime());
ADDBTN(lessTime, ":minimum","" , 92, 95, tr("Decreases minimum time by %1"), tr("10min"), decreaseTime());
#undef ADDBTN
minMinutes = TIME_INITIAL_MAX;
QAction *action = NULL;
#define ADD_ACTION( SHORTCUT, Slot ) \
action = new QAction(this); \
action->setShortcut( SHORTCUT ); \
action->setShortcutContext(Qt::WindowShortcut); \
addAction(action); \
connect(action, SIGNAL(triggered(bool)), this, SLOT( Slot ))
ADD_ACTION(Qt::Key_Escape, keyEscAction());
ADD_ACTION(Qt::Key_Delete, keyDeleteAction());
ADD_ACTION(Qt::Key_Up, keyUpAction());
ADD_ACTION(Qt::Key_Down, keyDownAction());
ADD_ACTION(Qt::Key_Left, keyLeftAction());
ADD_ACTION(Qt::Key_Right, keyRightAction());
#undef ADD_ACTION
// Prepare the stuff for the gas-choices.
gasListView = new QListView();
gasListView->setWindowFlags(Qt::Popup);
gasListView->setModel(airTypes());
gasListView->hide();
gasListView->installEventFilter(this);
connect(gasListView, SIGNAL(activated(QModelIndex)), this, SLOT(selectGas(QModelIndex)));
connect(plannerModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(drawProfile()));
connect(plannerModel, SIGNAL(rowsInserted(const QModelIndex&,int,int)),
this, SLOT(pointInserted(const QModelIndex&, int, int)));
connect(plannerModel, SIGNAL(rowsRemoved(const QModelIndex&, int, int)),
this, SLOT(pointsRemoved(const QModelIndex&, int, int)));
setRenderHint(QPainter::Antialiasing);
}
开发者ID:LuisaDomingues,项目名称:subsurface,代码行数:101,代码来源:diveplanner.cpp
注:本文中的dataChanged函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神 |
请发表评论