Пример #1
0
void BaseFilter::initAction()
{
	if (m_action)
		return;

    m_action = new QAction(getIcon(), getEntryName(), this);
    m_action->setStatusTip(getStatusTip());
    //connect this action
    connect(m_action, SIGNAL(triggered()), this, SLOT(performAction()));
}
Пример #2
0
void TscoreClef::setClef(Tclef clef) {
    if (clef.type() == Tclef::e_pianoStaff) {
        if (!m_lowerClef) {
            m_lowerClef = new TscoreClef(scoreScene(), staff(), Tclef(Tclef::e_bass_F));
            m_lowerClef->setPos(0.5, getYclefPos(m_lowerClef->clef()) - (16.0 - staff()->lowerLinePos()) + 0.1);
            connect(m_lowerClef, SIGNAL(clefChanged(Tclef)), this, SLOT(lowerClefChanged(Tclef)));
        } else // clefs already set to piano mode
            return;
        clef.setClef(Tclef::e_treble_G);
    } else {
        if (m_lowerClef)
            delete m_lowerClef;
    }
    m_clef = clef;
    m_currClefInList = getClefPosInList(m_clef);
    m_textClef->setText(QString(clefToChar(m_clef.type())));
    qreal fineOff = 0.1;
    if (clef.type() == Tclef::e_bass_F || clef.type() == Tclef::e_bass_F_8down)
        fineOff = 0.0;
    setPos(0.5, getYclefPos(m_clef) - (16.0 - staff()->upperLinePos()) + fineOff);
    getStatusTip();
}