Logo Search packages:      
Sourcecode: canorus version File versions  Download package

void CAMainWin::on_uiKeySig_activated ( int  row  )  [private, slot]

Changes the number of accidentals.

Definition at line 3035 of file mainwin.cpp.

References CADiatonicKey::diatonicKeyToString(), CADiatonicKey::gender(), CADiatonicKey::numberOfAccs(), CAScoreViewPort::selection(), CAKeySignature::setDiatonicKey(), CAMusElementFactory::setDiatonicKeyGender(), CAMusElementFactory::setDiatonicKeyNumberOfAccs(), and CAFunctionMark::setKey().

Referenced by setupCustomUi().

                                               {
      CADiatonicKey key = CADrawableKeySignature::comboBoxRowToDiatonicKey( row );

      if (mode()==InsertMode) {
            musElementFactory()->setDiatonicKeyNumberOfAccs( key.numberOfAccs() );
            musElementFactory()->setDiatonicKeyGender( key.gender() );
      } else
      if ( mode()==EditMode && currentScoreViewPort() && currentScoreViewPort()->selection().size() ) {
            QList<CADrawableMusElement*> list = currentScoreViewPort()->selection();
            CACanorus::undo()->createUndoCommand( document(), tr("change key signature", "undo") );

            for ( int i=0; i<list.size(); i++ ) {
                  CAKeySignature *keySig = dynamic_cast<CAKeySignature*>(list[i]->musElement());
                  CAFunctionMark *fm = dynamic_cast<CAFunctionMark*>(list[i]->musElement());

                  if ( keySig ) {
                        keySig->setDiatonicKey( key );
                  }

                  if ( fm ) {
                        fm->setKey( CADiatonicKey::diatonicKeyToString( key ) );
                  }
            }

            CACanorus::undo()->pushUndoCommand();
            CACanorus::rebuildUI(document(), currentSheet());
      }
}


Generated by  Doxygen 1.6.0   Back to index