From 07ee5a6ad5205acdcf10819e2c0b4fff6209951c Mon Sep 17 00:00:00 2001 From: SeeLook <945374+SeeLook@users.noreply.github.com> Date: Fri, 17 Feb 2017 15:41:20 +0100 Subject: [PATCH] Missing TnotePair class --- src/libs/core/score/tnoteobject.cpp | 2 +- src/libs/core/score/tnotepair.cpp | 34 ++++++++++++++++++++++ src/libs/core/score/tnotepair.h | 45 +++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 src/libs/core/score/tnotepair.cpp create mode 100644 src/libs/core/score/tnotepair.h diff --git a/src/libs/core/score/tnoteobject.cpp b/src/libs/core/score/tnoteobject.cpp index 16ce6c93c..1643a4475 100644 --- a/src/libs/core/score/tnoteobject.cpp +++ b/src/libs/core/score/tnoteobject.cpp @@ -71,7 +71,7 @@ TnoteObject::TnoteObject(TstaffObject* staffObj) : m_bg = qobject_cast<QQuickItem*>(comp.create()); m_bg->setParentItem(this); QColor bgColor = qApp->palette().highlight().color(); - bgColor.setAlpha(100); + bgColor.setAlpha(50); m_bg->setProperty("color", bgColor); comp.setData("import QtQuick 2.7; Rectangle {}", QUrl()); diff --git a/src/libs/core/score/tnotepair.cpp b/src/libs/core/score/tnotepair.cpp new file mode 100644 index 000000000..ceb6fe83a --- /dev/null +++ b/src/libs/core/score/tnotepair.cpp @@ -0,0 +1,34 @@ +/*************************************************************************** + * Copyright (C) 2017 by Tomasz Bojczuk * + * seelook@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#include "tnotepair.h" +#include "music/tnote.h" +#include "tnoteobject.h" + + +TnotePair::TnotePair(Tnote* n, TnoteObject* ob) : + m_note(n), + m_noteObj(ob) +{ + +} + + +void TnotePair::setNoteObject(TnoteObject* ob) { + m_noteObj = ob; +} diff --git a/src/libs/core/score/tnotepair.h b/src/libs/core/score/tnotepair.h new file mode 100644 index 000000000..db6998891 --- /dev/null +++ b/src/libs/core/score/tnotepair.h @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2017 by Tomasz Bojczuk * + * seelook@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ + +#ifndef TNOTEPAIR_H +#define TNOTEPAIR_H + + +class Tnote; +class TnoteObject; + + +/** + * @todo write docs + */ +class TnotePair +{ +public: + TnotePair(Tnote* n = nullptr, TnoteObject* ob = nullptr); + + Tnote* note() { return m_note; } + TnoteObject* object() { return m_noteObj; } + + void setNoteObject(TnoteObject* ob); + +private: + Tnote *m_note; + TnoteObject *m_noteObj; +}; + +#endif // TNOTEPAIR_H -- GitLab