Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 771004d968
Fetching contributors…

Cannot retrieve contributors at this time

87 lines (75 sloc) 2.839 kb
//=============================================================================
// MuseScore
// Music Composition & Notation
// $Id:$
//
// Copyright (C) 2012 Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENSE.GPL
//=============================================================================
#include "libmscore/score.h"
#include "libmscore/element.h"
#include "inspector.h"
#include "inspectorGroupElement.h"
//---------------------------------------------------------
// InspectorGroupElement
//---------------------------------------------------------
InspectorGroupElement::InspectorGroupElement(QWidget* parent)
: InspectorBase(parent)
{
QWidget* w = new QWidget;
ge.setupUi(w);
layout->addWidget(w);
ge.color->setColor(Qt::black);
connect(ge.setColor, SIGNAL(clicked()), SLOT(setColor()));
connect(ge.setVisible, SIGNAL(clicked()), SLOT(setVisible()));
connect(ge.setInvisible, SIGNAL(clicked()), SLOT(setInvisible()));
}
//---------------------------------------------------------
// setColor
//---------------------------------------------------------
void InspectorGroupElement::setColor()
{
if (inspector->el().isEmpty())
return;
Score* score = inspector->el().front()->score();
score->startCmd();
foreach(Element* e, inspector->el()) {
if (e->getProperty(P_COLOR) != QVariant(ge.color->color()))
score->undoChangeProperty(e, P_COLOR, ge.color->color());
}
score->endCmd();
}
//---------------------------------------------------------
// setVisible
//---------------------------------------------------------
void InspectorGroupElement::setVisible()
{
if (inspector->el().isEmpty())
return;
Score* score = inspector->el().front()->score();
score->startCmd();
foreach(Element* e, inspector->el()) {
if (!e->getProperty(P_VISIBLE).toBool())
e->score()->undoChangeProperty(e, P_VISIBLE, true);
}
score->endCmd();
}
//---------------------------------------------------------
// setInvisible
//---------------------------------------------------------
void InspectorGroupElement::setInvisible()
{
if (inspector->el().isEmpty())
return;
Score* score = inspector->el().front()->score();
score->startCmd();
foreach(Element* e, inspector->el()) {
if (e->getProperty(P_VISIBLE).toBool())
e->score()->undoChangeProperty(e, P_VISIBLE, false);
}
score->endCmd();
}
Jump to Line
Something went wrong with that request. Please try again.