Skip to content
Snippets Groups Projects
Commit ef0d21b8 authored by SeeLook's avatar SeeLook
Browse files

Expose wrapper, added debug item (disabled)

parent 94e911d1
No related branches found
No related tags found
No related merge requests found
......@@ -60,6 +60,19 @@ const qreal rtmGapArray[5][3] = {
};
QString tieDebug(Trhythm::Etie t) {
switch (t) {
case Trhythm::e_tieEnd:
return "TE";
case Trhythm::e_tieStart:
return "TS";
case Trhythm::e_tieCont:
return "TC";
default:
return QString();
}
}
TnoteObject::TnoteObject(TstaffObject* staffObj, TnotePair* wrapper) :
QQuickItem(staffObj->staffItem()),
......@@ -98,6 +111,9 @@ TnoteObject::TnoteObject(TstaffObject* staffObj, TnotePair* wrapper) :
m_flag->setParentItem(m_stem);
m_flag->setX(0.1);
// m_staff->score()->component()->setData("import QtQuick 2.7; Text { font { pixelSize: 1 }}", QUrl());
// m_debug = qobject_cast<QQuickItem*>(m_staff->score()->component()->create());
// m_debug->setParentItem(this);
setColor(qApp->palette().text().color());
setHeight(staffObj->staffItem()->height());
......@@ -214,6 +230,8 @@ void TnoteObject::setNote(const Tnote& n) {
if (updateStem || oldNotePos != static_cast<int>(m_notePosY))
updateNamePos();
// m_debug->setProperty("text", QString("%1 %2").arg(index()).arg(tieDebug(m_note->rtm.tie())));
// m_debug->setY(height() - (2 + index() % 2) * m_debug->height());
// qDebug() << debug() << "set note" << m_note->toText() << m_note->rtm.string() << "note pos" << m_notePosY << "width:" << width();
}
......@@ -261,6 +279,8 @@ void TnoteObject::checkTie() {
updateTieScale();
m_tie->setX(m_head->width());
}
// m_debug->setProperty("text", QString("%1 %2").arg(index()).arg(tieDebug(m_note->rtm.tie())));
// m_debug->setY(height() - (2 + index() % 2) * m_debug->height());
}
......
......@@ -48,6 +48,7 @@ class NOOTKACORE_EXPORT TnoteObject : public QQuickItem
friend class TstaffObject;
friend class TmeasureObject;
friend class TbeamObject;
friend class TnotePair;
public:
explicit TnoteObject(TstaffObject* staffObj = nullptr, TnotePair* wrapper = nullptr);
......@@ -123,6 +124,7 @@ protected:
QQuickItem* tie() { return m_tie; }
QQuickItem* head() { return m_head; }
QQuickItem* nameItem() { return m_name; }
TnotePair* wrapper() { return m_wrapper; }
/**
* @p TnoteObject manages tie itself whenever tie state changes, by calling exactly this method.
......@@ -155,6 +157,8 @@ private:
QQuickItem *m_tie = nullptr;
QQuickItem *m_name = nullptr;
QQuickItem *m_debug;
private:
QQuickItem* createAddLine();
void updateAlter();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment