diff --git a/TODO b/TODO index abd510cc562b3749f70053c46abbf9a6e3436af0..5da8a1cbfca880cd2c617544ef456b8f3aa5af61 100755 --- a/TODO +++ b/TODO @@ -21,7 +21,6 @@ - notes number in levels should be randomized, given value will be just a maximum and without rhythms odd number sounds better -- consider to remove names on the score in single note mode - revert to native style under MacOs when Qt5 - misc library can crash under Win due to uninitialized Tglobals *gl diff --git a/changes b/changes index 4edc6bc8c0e8332cee777aed2f6448bbc9fe0ea8..e3e359ee78ba9ee84a6c381fa18e956d1502291d 100644 --- a/changes +++ b/changes @@ -1,5 +1,6 @@ 1.1.3 alpha - - two pitch detection methods merged into single two-steps method + - two pitch detection methods merged into single, two-steps method + - exam question tips are movable and were improved BUGS FIXES - flickering of an analyze chart put right @@ -7,12 +8,12 @@ - exams/exercises support for playing melodies from a score - exams/exercises support for writing listened melodies - recognizing new mistake types related to melodies - - added tuning fork button to play middle a in exams based on listening - - added pop-up panes to manage quick manage a note in a score + - added tuning fork button to play middle A in exams based on listening + - added pop-up panes to quick manage a note in a score - improved randomization, all notes from range will occur equally - simple import/export melodies to XML (music) format Under the hood - - binary format of exam files (*.noo) changed to text based one + - binary format of exam files (*.noo) changed to text based - saving melodies and related information in *.noo files - dividing and cleaning monolithic code of examining process diff --git a/src/exam/tcanvas.cpp b/src/exam/tcanvas.cpp index df15d342b92dfe997541424a67a1bbb0ffda94cf..7306c9c635d5bb5579f6af42bc093bd2cc3a5dba 100644 --- a/src/exam/tcanvas.cpp +++ b/src/exam/tcanvas.cpp @@ -95,7 +95,10 @@ void Tcanvas::resultTip(TQAunit* answer, int time) { m_resultTip = new TgraphicsTextTip(wasAnswerOKtext(answer, TexecutorSupply::answerColor(answer->mistake()), bigFont())); m_scene->addItem(m_resultTip); m_resultTip->setZValue(100); - m_resultTip->setScale(m_scale); + if (answer->isNotSoBad()) + m_resultTip->setScale(m_scale); + else + m_resultTip->setScale(m_scale * 1.2); setResultPos(); if (gl->E->showWrongPlayed && gl->E->showWrongPlayed && !answer->melody() && answer->answerAsSound() && !answer->isCorrect() && m_window->sound->note().note) @@ -404,7 +407,10 @@ void Tcanvas::sizeChanged() { m_scale = m_scale * ((double)m_newSize.height() / hi); m_maxTipWidth = m_view->width() / 3; if (m_resultTip) { - m_resultTip->setScale(m_scale);; + if (m_exam->curQ().isNotSoBad()) + m_resultTip->setScale(m_scale); + else + m_resultTip->setScale(m_scale * 1.2); setResultPos(); } if (m_tryAgainTip) { @@ -477,7 +483,7 @@ bool Tcanvas::eventFilter(QObject* obj, QEvent* event) { int Tcanvas::getMaxTipHeight() { if (m_nameFree || m_scoreFree) - return m_window->score->height() * 0.8; + return m_window->score->height() * 0.6; else return m_window->guitar->height() * 1.2; } diff --git a/src/exam/texamexecutor.cpp b/src/exam/texamexecutor.cpp index 4964340bb6fa25092c3a37af246fd1a14d0e24e7..b63b738ab71a7c99d90ef9516dbc5c17fe346885 100755 --- a/src/exam/texamexecutor.cpp +++ b/src/exam/texamexecutor.cpp @@ -517,7 +517,7 @@ void TexamExecutor::checkAnswer(bool showResults) { } if (curQ.questionAsNote()) questNote = curQ.qa_2.note; - answNote = *mW->score->getNote(0); + answNote = mW->score->getNote(0); } if (curQ.answerAsName()) { if (curQ.questionAsName()) diff --git a/src/gui/tmainview.cpp b/src/gui/tmainview.cpp index c6d47e7253617e7845628430d95d681fc9765ff3..362a5e33d5c539164160457aeb5b1245c7967508 100644 --- a/src/gui/tmainview.cpp +++ b/src/gui/tmainview.cpp @@ -71,14 +71,14 @@ void TmainView::addNoteName(QWidget* name) { m_name = name; m_name->installEventFilter(this); m_name->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); - m_scoreAndNameLay->insertStretch(0); - m_scoreAndNameLay->addStretch(0); +// m_scoreAndNameLay->insertStretch(0); +// m_scoreAndNameLay->addStretch(0); m_nameLay = new QBoxLayout(QBoxLayout::TopToBottom); m_nameLay->addStretch(); m_nameLay->addWidget(m_name); m_nameLay->addStretch(); m_scoreAndNameLay->addLayout(m_nameLay); - m_scoreAndNameLay->addStretch(0); +// m_scoreAndNameLay->addStretch(0); // m_score->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); } } @@ -89,9 +89,9 @@ void TmainView::takeNoteName() { m_nameLay->removeWidget(m_name); delete m_nameLay; m_name = 0; - delete m_scoreAndNameLay->takeAt(0); - delete m_scoreAndNameLay->takeAt(1); - delete m_scoreAndNameLay->takeAt(1); +// delete m_scoreAndNameLay->takeAt(0); +// delete m_scoreAndNameLay->takeAt(1); +// delete m_scoreAndNameLay->takeAt(1); } } diff --git a/src/libs/core/graphics/tdropshadoweffect.cpp b/src/libs/core/graphics/tdropshadoweffect.cpp index b4da95d887192000e7c539130097d525e1947071..54ab389dc794c28ebb400af56057a2c0256ff492 100644 --- a/src/libs/core/graphics/tdropshadoweffect.cpp +++ b/src/libs/core/graphics/tdropshadoweffect.cpp @@ -18,15 +18,19 @@ #include "tdropshadoweffect.h" -#include <tcolor.h> +// #include <tcolor.h> +#include <QApplication> +#include <QPalette> TdropShadowEffect::TdropShadowEffect(QColor color) { - setBlurRadius(10); - setOffset(1, 1); - if (color == -1) - setColor(Tcolor::shadow); - else - setColor(color); + setBlurRadius(10); + setOffset(4, 4); +// setColor(qApp->palette().text().color()); + if (color == -1) + setColor(qApp->palette().text().color()); +// setColor(Tcolor::shadow); + else + setColor(color); } diff --git a/src/libs/core/graphics/tgraphicstexttip.cpp b/src/libs/core/graphics/tgraphicstexttip.cpp index 95babb65ee08ced933a46c3c3565be46cca15ffc..99e4b6391b672a7cdcdd92b68ed691ca872e0703 100644 --- a/src/libs/core/graphics/tgraphicstexttip.cpp +++ b/src/libs/core/graphics/tgraphicstexttip.cpp @@ -43,10 +43,10 @@ void TgraphicsTextTip::alignCenter(QGraphicsTextItem* tip) { void TgraphicsTextTip::setDropShadow(QGraphicsTextItem* tip, QColor shadowColor) { TdropShadowEffect *shadow = new TdropShadowEffect(); - if (shadowColor != -1) - shadow->setColor(QColor(shadowColor.name())); - else - shadow->setColor(Tcolor::shadow); +// if (shadowColor != -1) +// shadow->setColor(QColor(shadowColor.name())); +// else + shadow->setColor(qApp->palette().text().color()); tip->setGraphicsEffect(shadow); } diff --git a/src/libs/core/score/tscorenote.cpp b/src/libs/core/score/tscorenote.cpp index 17a656eff877474d5735dc64ce0171881b02e934..b9a1f599e3e091a0f3e1d9d01205ec14ba137704 100644 --- a/src/libs/core/score/tscorenote.cpp +++ b/src/libs/core/score/tscorenote.cpp @@ -130,9 +130,9 @@ TscoreNote::TscoreNote(TscoreScene* scene, TscoreStaff* staff, int index) : m_mainNote->setZValue(34); // under m_mainAccid->setZValue(m_mainNote->zValue()); if (staff->isPianoStaff()) - setAmbitus(40, 1); + setAmbitus(40, 2); else - setAmbitus(34, 1); + setAmbitus(34, 2); connect(this, SIGNAL(statusTip(QString)), scene, SLOT(statusTipChanged(QString))); checkEmptyText(); } @@ -273,7 +273,11 @@ void TscoreNote::markNote(QColor blurColor) { m_mainNote->setGraphicsEffect(0); } else { m_mainNote->setPen(QPen(blurColor, 0.2)); - m_mainNote->setGraphicsEffect(new TdropShadowEffect(blurColor)); + QGraphicsDropShadowEffect *bluredPen = new QGraphicsDropShadowEffect(); + bluredPen->setBlurRadius(10); + bluredPen->setColor(QColor(blurColor.name())); + bluredPen->setOffset(0.5, 0.5); + m_mainNote->setGraphicsEffect(bluredPen /*TdropShadowEffect(blurColor)*/); } update(); } @@ -377,8 +381,8 @@ void TscoreNote::enableNoteAnim(bool enable, int duration) { void TscoreNote::setAmbitus(int lo, int hi) { - m_ambitMin = qBound(1, lo, (int)m_height - 1); - m_ambitMax = qBound(1, hi, (int)m_height - 1); + m_ambitMin = qBound(2, lo, (int)m_height - 1); + m_ambitMax = qBound(2, hi, (int)m_height - 1); } @@ -417,10 +421,6 @@ void TscoreNote::paint(QPainter* painter, const QStyleOptionGraphicsItem* option painter->drawLine(QLineF(0.5, staff()->upperLinePos() - 1.0, 6.5, staff()->upperLinePos() - 2.0)); qreal loLine = staff()->isPianoStaff() ? staff()->lowerLinePos() : staff()->upperLinePos(); painter->drawLine(QLineF(0.5, loLine + 10.0, 6.5, loLine + 9.0)); -// painter->setBrush(emptyNoteColor); -// painter->scale(1.0 / scoreScene()->views()[0]->transform().m11(), 1.0 / scoreScene()->views()[0]->transform().m11()); -// painter->rotate(270); -// painter->drawText(0, 0, 7.0 * scoreScene()->views()[0]->transform().m11(), m_height * scoreScene()->views()[0]->transform().m11(), Qt::AlignCenter, "put\nin\na\nnote"); } } @@ -466,8 +466,8 @@ void TscoreNote::hoverLeaveEvent(QGraphicsSceneHoverEvent* event) { void TscoreNote::hoverMoveEvent(QGraphicsSceneHoverEvent* event) { -// if ((event->pos().y() >= m_ambitMax) && (event->pos().y() <= m_ambitMin)) { - if ((event->pos().y() >= 1) && (event->pos().y() <= m_height - 3.0)) { + if ((event->pos().y() >= m_ambitMax) && (event->pos().y() <= m_ambitMin)) { +// if ((event->pos().y() >= 2.0) && (event->pos().y() <= m_height - 3.0)) { if (staff()->isPianoStaff() && // dead space between staves (event->pos().y() >= staff()->upperLinePos() + 10.6) && (event->pos().y() <= staff()->lowerLinePos() - 2.4)) { hideWorkNote(); diff --git a/src/libs/core/score/tscorescene.cpp b/src/libs/core/score/tscorescene.cpp index 8c70bf46138f2e66e7ed8fa1a7be2b3b892cad73..02080c1b45ad02816f343f9f2487057baeab6350 100644 --- a/src/libs/core/score/tscorescene.cpp +++ b/src/libs/core/score/tscorescene.cpp @@ -177,7 +177,11 @@ void TscoreScene::initNoteCursor(TscoreNote* scoreNote) { workColor = qApp->palette().highlight().color(); workColor.setAlpha(200); m_workNote = TscoreNote::createNoteHead(scoreNote); - m_workNote->setGraphicsEffect(new TdropShadowEffect(workColor)); + QGraphicsDropShadowEffect *workEffect = new QGraphicsDropShadowEffect(); + workEffect->setOffset(3.0, 3.0); + workEffect->setBlurRadius(15); + workEffect->setColor(qApp->palette().text().color()); + m_workNote->setGraphicsEffect(workEffect); m_workAccid = new QGraphicsSimpleTextItem(); m_workAccid->setBrush(QBrush(workColor)); m_workAccid->setParentItem(m_workNote); diff --git a/src/libs/core/score/tscorestaff.cpp b/src/libs/core/score/tscorestaff.cpp index 79005a95f00fab15f3c0c677a0d454c6a785e89e..675036b5794e9651cbc8a6367737269da0480782 100755 --- a/src/libs/core/score/tscorestaff.cpp +++ b/src/libs/core/score/tscorestaff.cpp @@ -46,7 +46,7 @@ TscoreStaff::TscoreStaff(TscoreScene* scene, int notesNr) : m_keySignature(0), m_upperLinePos(16.0), m_lowerStaffPos(0.0), m_height(40.0), - m_externWidth(0.0), m_viewWidth(0.0), + m_viewWidth(0.0), m_offset(TnoteOffset(3, 2)), m_isPianoStaff(false), m_scordature(0), m_enableScord(false), @@ -220,8 +220,8 @@ void TscoreStaff::takeNotes(QList<TscoreNote*>& nList, int from, int to) { void TscoreStaff::updateSceneRect() { - QRectF scRec = mapToScene(boundingRect()).boundingRect(); - scene()->setSceneRect(0.0, 0.0, scRec.width() + (isPianoStaff() ? 2.5 : 1.5), scRec.height()); +// QRectF scRec = mapToScene(boundingRect()).boundingRect(); +// scene()->setSceneRect(0.0, 0.0, scRec.width() + (isPianoStaff() ? 2.5 : 1.5), scRec.height()); } @@ -374,7 +374,10 @@ void TscoreStaff::setViewWidth(qreal viewW) { if (viewW != m_viewWidth) { m_viewWidth = viewW; int oldMax = m_maxNotesCount; - m_maxNotesCount = getMaxNotesNr(mapFromScene(viewW, 0.0).x()); + if (viewW > 0.0) + m_maxNotesCount = getMaxNotesNr(mapFromScene(viewW, 0.0).x()); + else + m_maxNotesCount = 0; updateLines(); // calls updateWidth() as well updateNotesPos(); } @@ -632,8 +635,6 @@ void TscoreStaff::updateWidth() { m_width = 10.0 + off + m_scoreNotes.size() * m_scoreNotes[0]->boundingRect().width() + 2.0; if (m_viewWidth > 0.0) m_width = m_viewWidth; - else if (m_externWidth > m_width) - m_width = m_externWidth; } diff --git a/src/libs/core/score/tscorestaff.h b/src/libs/core/score/tscorestaff.h index 1c72af98699b16cd24c5299151f702c9eaf68a81..33a8d7b8b879623d3d3536cd9415262ffe6467f7 100644 --- a/src/libs/core/score/tscorestaff.h +++ b/src/libs/core/score/tscorestaff.h @@ -161,11 +161,6 @@ public: int fixNotePos(int pianoPos); /** Checks is note position on grand staff and adds 2 to it. */ qreal notesOffset(); /** X Position of first TscoreNote on the staff (depends on clef, key and scordature) */ - /** Width of a staff sets by external function. - * It is preferred when it is bigger than width calculated by updateWidth() */ - void setExternalWidth(qreal w) { m_externWidth = w; updateLines(); } - qreal externalWidth() { return m_externWidth; } - /** Informs a staff about QGraphicsView width displaying this staff. * With this value the staff determines maximal lines width and maximal notes count. * If not set (0.0) - single staff, If set - m_externWidth is ignored. @@ -173,8 +168,8 @@ public: void setViewWidth(qreal viewW); /** Returns maximal note number which staff can display in single line in view area. - * If 0 - staff is in linear mode */ - int maxNoteCount() { return m_maxNotesCount; } + * or current notes count if staff is in linear mode */ + int maxNoteCount() { return m_maxNotesCount ? m_maxNotesCount : count(); } //--- note controllers/switches /** Switches when note segments have colored background after their note are set */ @@ -277,7 +272,6 @@ private: QList<TscoreNote*> m_scoreNotes; qreal m_upperLinePos, m_lowerStaffPos; qreal m_height, m_width; - qreal m_externWidth; // width set from outside qreal m_viewWidth; // width of QGraphicsView in scene coordinates. TnoteOffset m_offset; bool m_isPianoStaff; diff --git a/src/libs/core/score/tsimplescore.cpp b/src/libs/core/score/tsimplescore.cpp index 4f51e953425e5849473d929a4ba829b05b3236d9..a816eac26f6a8d144dd58e1689053e73c324d044 100644 --- a/src/libs/core/score/tsimplescore.cpp +++ b/src/libs/core/score/tsimplescore.cpp @@ -294,14 +294,12 @@ void TsimpleScore::noteWasClicked(int index) { QSize TsimpleScore::sizeHint() const { - return m_sizeHint; -// return QWidget::sizeHint(); + return QWidget::sizeHint(); } QSize TsimpleScore::minimumSizeHint() const { return QWidget::minimumSizeHint(); -// return m_sizeHint; } @@ -313,8 +311,7 @@ bool TsimpleScore::isPianoStaff() { void TsimpleScore::setBGcolor(QColor bgColor) { bgColor.setAlpha(230); - viewport()->setStyleSheet( - QString("border: 1px solid palette(Text); border-radius: 10px; %1;").arg(Tcolor::bgTag(bgColor))); + viewport()->setStyleSheet(QString("border: 1px solid palette(Text); border-radius: 10px; %1;").arg(Tcolor::bgTag(bgColor))); } //########################################################################################################## @@ -327,29 +324,17 @@ void TsimpleScore::resizeEvent(QResizeEvent* event) { hh = event->size().height(); ww = event->size().width(); } -// int scrollV; -// if (horizontalScrollBar()->isVisible()) { -// hh -= horizontalScrollBar()->height(); -// scrollV = horizontalScrollBar()->value(); -// } + if (hh == 0) + return; + scene()->setSceneRect(0.0, 0.0, ww, hh); qreal staffOff = 1.0; if (staff()->isPianoStaff()) staffOff = 2.0; - qreal factor = ((qreal)hh / (staff()->height() + 2.0)) / transform().m11(); + qreal factor = ((qreal)hh / (staff()->height()/* + 0.4*/)) / transform().m11(); scale(factor, factor); -// staff()->setExternalWidth((width()) / transform().m11() - (1.0 + staffOff)); -// if (horizontalScrollBar()->isVisible()) { -// horizontalScrollBar()->setValue(scrollV); -// } - staff()->setPos(staffOff, 0.05); - staff()->updateSceneRect(); -// resize(mapFromScene(m_scene->sceneRect()).boundingRect().size() + QSize(1, 1)); -// resize(mapFromScene(m_scene->sceneRect()).boundingRect().width(), height() - 2); -// setSizeHint(QSize(mapFromScene(m_scene->sceneRect()).boundingRect().size().width() + 1, height() - 2)); -// setSizeHint(size()); - setSizeHint(mapFromScene(m_scene->sceneRect()).boundingRect().size() + QSize(1, 1)); -// setMaximumWidth(m_sizeHint.width()); -// setSceneRect(scoreScene()->sceneRect()); + if (width() > (staff()->width() + staffOff + 1.0) * transform().m11()) + staffOff = ((ww / transform().m11() - (staff()->width() /*+ staffOff + 2.0*/)) / 2.0); + staff()->setPos(staffOff, 0.0); } diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 778ea2337d3d86f044df4e50ee815a931161a719..bc99b4ad5d8d048829576495a13c220b3ebd1aec 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -478,7 +478,6 @@ void MainWindow::soundWasFinished(Tchunk& chunk) { } - void MainWindow::setSingleNoteMode(bool isSingle) { if (isSingle && score->insertMode() != TmultiScore::e_single) { if (!ex) @@ -632,6 +631,10 @@ void MainWindow::updateSize(QSize newS) { bar->adjustSize(); // nootBar->setIconSize(QSize(newS.height() / 22, height() / 22)); int baseH = qMin(newS.height(), newS.width()); + if (score->insertMode() == TmultiScore::e_single) + noteName->setMaximumWidth(newS.width() / 2); + else + noteName->setMaximumWidth(QWIDGETSIZE_MAX); noteName->resize(baseH / 40); m_statLab->setFixedHeight(newS.height() / 10); QFont f = m_statLab->font(); diff --git a/src/notename/tnotename.cpp b/src/notename/tnotename.cpp index a7b735f3800ddb486f73f0f272d266e4654d83a1..38a2972c5fe536db7ddb259298d79b260a3a304b 100755 --- a/src/notename/tnotename.cpp +++ b/src/notename/tnotename.cpp @@ -74,7 +74,6 @@ TnoteName::TnoteName(QWidget *parent) : connect(m_prevNoteButt, SIGNAL(clicked()), this, SLOT(prevNoteSlot())); m_nameLabel = new TnoteNameLabel("", this); -// m_nameLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred); connect(m_nameLabel, SIGNAL(blinkingFinished()), this, SLOT(correctAnimationFinished())); QBoxLayout *nameLay = new QBoxLayout(QBoxLayout::LeftToRight); @@ -101,31 +100,11 @@ TnoteName::TnoteName(QWidget *parent) : // ACCID BUTTONS TOOOLBAR m_accLay = new QBoxLayout(QBoxLayout::LeftToRight); - m_accLay->addStretch(2); -#if defined(Q_OS_MAC) - TnooFont nf(15); -#else - TnooFont nf(10); -#endif - m_dblFlatButt = new TpushButton("B", this); - m_dblFlatButt->setFont(nf); - m_accLay->addWidget(m_dblFlatButt); - m_accLay->addStretch(1); - connect(m_dblFlatButt, SIGNAL(clicked()), this, SLOT(accidWasChanged())); - m_flatButt = new TpushButton("b", this); - m_flatButt->setFont(nf); - m_accLay->addWidget(m_flatButt); - m_accLay->addStretch(1); - connect(m_flatButt, SIGNAL(clicked()), this, SLOT(accidWasChanged())); - m_sharpButt = new TpushButton("#", this); - m_sharpButt->setFont(nf); - m_accLay->addWidget(m_sharpButt); - m_accLay->addStretch(1); - connect(m_sharpButt, SIGNAL(clicked()), this, SLOT(accidWasChanged())); - m_dblSharpButt = new TpushButton("x", this); - m_dblSharpButt->setFont(nf); - m_accLay->addWidget(m_dblSharpButt); - connect(m_dblSharpButt, SIGNAL(clicked()), this, SLOT(accidWasChanged())); + m_accLay->addStretch(2); + m_dblFlatButt = createAccidButton("B"); + m_flatButt = createAccidButton("b"); + m_sharpButt = createAccidButton("#"); + m_dblSharpButt = createAccidButton("x"); m_accLay->addStretch(2); m_buttonsLay->addLayout(m_accLay); // OCTAVE BUTTONS TOOLBAR @@ -171,15 +150,6 @@ TnoteName::TnoteName(QWidget *parent) : m_buttonsLay->addLayout(m_upOctaveLay); m_buttonsLay->addLayout(m_loOctaveLay); m_prevOctButton = -1; -// QList<TpushButton*> allButtons = findChildren<TpushButton*>(); -// foreach(TpushButton *bu, allButtons) { -// bu->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); -// } -// m_buttonsLay->setSizeConstraint(QLayout::SetMinimumSize); -// m_noteLay->setSizeConstraint(QLayout::SetMinimumSize); -// m_accLay->setSizeConstraint(QLayout::SetMinimumSize); -// m_upOctaveLay->setSizeConstraint(QLayout::SetMinimumSize); -// m_loOctaveLay->setSizeConstraint(QLayout::SetMinimumSize); connect(m_octaveGroup, SIGNAL(buttonClicked(int)), this, SLOT(octaveWasChanged(int))); @@ -198,16 +168,12 @@ TnoteName::TnoteName(QWidget *parent) : TnoteName::~TnoteName() { -// setParent(0); //s release TnoteName to be able delete m_menu -// if (m_menu) -// delete m_menu; } //#################################################################################################### //########################################## PUBLIC ################################################# //#################################################################################################### - /** @p scoreFactor parameter is used in resizeEvent() method * because TnoteName gets its size only after the menu invokes exec() */ void TnoteName::exec(QPoint pos, qreal scoreFactor) { @@ -219,8 +185,8 @@ void TnoteName::exec(QPoint pos, qreal scoreFactor) { } if (m_menuLay == 0) m_menuLay = new QVBoxLayout; - show(); m_menu = new QMenu(m_menuParent); + show(); m_menuLay->addWidget(this); m_menu->setLayout(m_menuLay); m_menu->setObjectName("m_menu"); @@ -310,17 +276,17 @@ void TnoteName::setEnabledEnharmNotes(bool isEnabled) { } } - +int m_fontSize = 12; +bool m_isMenu = false; void TnoteName::resize(int fontSize) { if (fontSize) { + m_fontSize = fontSize; QFont f = QFont(m_noteButtons[0]->font().family()); f.setPixelSize(fontSize); - for (int i = 0; i < 7; i++) { + for (int i = 0; i < 7; i++) m_noteButtons[i]->setFont(f); - } - for (int i = 0; i < 8; i++) { + for (int i = 0; i < 8; i++) m_octaveButtons[i]->setFont(f); - } f = QFont(m_dblFlatButt->font().family()); f.setPointSize(fontSize); QFontMetrics fMetr(f); @@ -329,28 +295,62 @@ void TnoteName::resize(int fontSize) { fact *= 1.2; #endif f.setPointSize(f.pointSize() * fact); - m_dblFlatButt->setFont(f); - m_flatButt->setFont(f); - m_sharpButt->setFont(f); - m_dblSharpButt->setFont(f); + for (int i = 0; i < m_accidButtons.size(); ++i) + m_accidButtons[i]->setFont(f); // #if defined (Q_OS_ANDROID) - QList<TpushButton*> allButtons = findChildren<TpushButton*>(); - foreach(TpushButton *bu, allButtons) { - bu->setFixedWidth(bu->fontMetrics().width(bu->text()) + 15); - bu->setFixedHeight(fontSize * 1.5); - } + int widthOffset = 0; + if (m_isMenu) + widthOffset = 15; + setButtonsSize(widthOffset, fontSize * 1.5); // #if defined (Q_OS_ANDROID) // #else // m_nameLabel->setFixedHeight(fontSize * 3); // #endif - m_nameLabel->setFixedHeight(fontSize * 4); + int nameHfactor = 5; + if (m_isMenu) + nameHfactor = 4; + m_nameLabel->setFixedHeight(fontSize * nameHfactor); m_nextNoteButt->setFixedHeight(m_nameLabel->height()); m_prevNoteButt->setFixedHeight(m_nameLabel->height()); updateSizeHint(); + adjustSize(); + if (m_isMenu) { + m_nameLabel->setMinimumWidth(0); + m_nameLabel->setMaximumWidth(QWIDGETSIZE_MAX); + } else + m_nameLabel->setFixedWidth(m_sizeHint.width() * 0.8); + } +} + + +void TnoteName::setButtonsSize(int widthOff, int fixedH, bool skipOctaves) { + for (int i = 0; i < 7; i++) { + m_noteButtons[i]->setFixedHeight(fixedH); + fixButtonWidth(widthOff, m_noteButtons[i]); + } + if (!skipOctaves) { + for (int i = 0; i < 8; i++) { + m_octaveButtons[i]->setFixedHeight(fixedH); + fixButtonWidth(widthOff, m_octaveButtons[i]); + } + } + for (int i = 0; i < m_accidButtons.size(); ++i) { + m_accidButtons[i]->setFixedHeight(fixedH); + fixButtonWidth(widthOff, m_accidButtons[i]); } } +void TnoteName::fixButtonWidth(int widthOff, QPushButton* butt) { + if (widthOff) + butt->setFixedWidth(butt->fontMetrics().width(butt->text()) + widthOff); + else { + butt->setMinimumWidth(0); + butt->setMaximumWidth(QWIDGETSIZE_MAX); + } +} + + /** Variables declared here have been used nowhere so far. */ void TnoteName::setAmbitus(Tnote lo, Tnote hi) { m_ambitMin = lo.chromatic(); @@ -359,6 +359,7 @@ void TnoteName::setAmbitus(Tnote lo, Tnote hi) { void TnoteName::enableArrows(bool en) { + m_isMenu = en; if (en) { m_prevNoteButt->show(); m_nextNoteButt->show(); @@ -366,8 +367,7 @@ void TnoteName::enableArrows(bool en) { m_prevNoteButt->hide(); m_nextNoteButt->hide(); } - updateSizeHint(); - updateGeometry(); + resize(m_fontSize); } @@ -451,7 +451,7 @@ void TnoteName::forceAccidental(char accid) { } -void TnoteName::markNameLabel(QColor markColor) { +void TnoteName::markNameLabel(const QColor& markColor) { m_nameLabel->markText(QColor(markColor.name())); } @@ -512,8 +512,6 @@ void TnoteName::correctName(Tnote& goodName, const QColor& color, bool isWrong) void TnoteName::resizeEvent(QResizeEvent* ) { -// resize((m_menuParent->geometry().height() / 40)); -// m_nameLabel->setFixedHeight(m_menuParent->geometry().height() / 10); if (!m_menu) return; m_menu->resize(size()); @@ -528,7 +526,7 @@ bool TnoteName::event(QEvent* event) { QStatusTipEvent *se = static_cast<QStatusTipEvent *>(event); emit statusTipRequired(se->tip()); } - return QWidget::event(event); + return QWidget::event(event); } @@ -586,7 +584,7 @@ void TnoteName::setNoteName(char noteNr, char octNr, char accNr) { } -void TnoteName::setButtons(Tnote note) { +void TnoteName::setButtons(const Tnote& note) { m_noteButtons[note.note-1]->setChecked(true); checkAccidButtons(note.alter); if (note.octave >= -3 && note.octave <= 4) { @@ -643,23 +641,39 @@ char TnoteName::getSelectedAccid() { void TnoteName::updateSizeHint() { - int fixW; - if (buttonsDirection() == QBoxLayout::BottomToTop || buttonsDirection() == QBoxLayout::TopToBottom) - fixW = widthForVertical(); - else - fixW = widthForHorizontal(); - fixW += m_noteLay->spacing() * 2; - if (m_nextNoteButt->isVisible()) - fixW += m_nextNoteButt->width() * 2; - m_sizeHint.setWidth(fixW); + int fixW; + if (buttonsDirection() == QBoxLayout::BottomToTop || buttonsDirection() == QBoxLayout::TopToBottom) + fixW = widthForVertical(); + else + fixW = widthForHorizontal(); + fixW += m_noteLay->spacing() * 2; + if (m_nextNoteButt->isVisible()) + fixW += m_nextNoteButt->width() * 2; + m_sizeHint.setWidth(fixW); // if (m_nextNoteButt->isVisible()) // fixW = fixW - m_nextNoteButt->width() * 4; - int fixH = m_nameLabel->height(); - if (buttonsDirection() == QBoxLayout::BottomToTop || buttonsDirection() == QBoxLayout::TopToBottom) - fixH = m_flatButt->width() * 7 + m_noteLay->spacing() * 8; - else - fixH += m_flatButt->width() * 4 + m_noteLay->spacing() * 5; - m_sizeHint.setHeight(fixH); + int fixH = m_nameLabel->height(); + if (buttonsDirection() == QBoxLayout::BottomToTop || buttonsDirection() == QBoxLayout::TopToBottom) + fixH = m_flatButt->width() * 7 + m_noteLay->spacing() * 8; + else + fixH += m_flatButt->width() * 4 + m_noteLay->spacing() * 5; + m_sizeHint.setHeight(fixH); +} + + +TpushButton* TnoteName::createAccidButton(const QString& accidText) { +#if defined(Q_OS_MAC) + TnooFont nf(15); +#else + TnooFont nf(10); +#endif + TpushButton *accidButt = new TpushButton(accidText, this); + accidButt->setFont(nf); + m_accLay->addWidget(accidButt); + m_accLay->addStretch(1); + connect(accidButt, &TpushButton::clicked, this, &TnoteName::accidWasChanged); + m_accidButtons << accidButt; + return accidButt; } diff --git a/src/notename/tnotename.h b/src/notename/tnotename.h index e44a71d4341be352681fb3ac5d05eb78749f74fd..7ad89f5fd6f4f1feb0f43b5955d20bca7a029d0f 100755 --- a/src/notename/tnotename.h +++ b/src/notename/tnotename.h @@ -35,8 +35,7 @@ class QButtonGroup; /** * This widget displays note name and buttons to manipulate it. - * Since Nootka 1.1.0 it is squeezed into QMenu, so it exist temporary - * It has to be invoked with exec() method + * Since Nootka 1.1.0 it can be squeezed into QMenu, (score invokes it with exec() method. */ class TnoteName : public QWidget { @@ -79,7 +78,7 @@ public: virtual QSize sizeHint() const; /** Marks m_nameLabel with given color. When clearNoteName() is invoked - marks are cleared. */ - void markNameLabel(QColor markColor); + void markNameLabel(const QColor& markColor); /** Highlights and check given accid button */ void forceAccidental(char accid); @@ -112,6 +111,7 @@ private: TpushButton *m_noteButtons[7]; TpushButton *m_octaveButtons[8]; TpushButton *m_dblFlatButt, *m_flatButt, *m_sharpButt, *m_dblSharpButt; + QList<TpushButton*> m_accidButtons; /** List of buttons with accidental symbols. */ QButtonGroup *m_noteGroup, *m_octaveGroup; QPushButton *m_nextNoteButt, *m_prevNoteButt; int m_prevOctButton; /** Keeps index of previous selected octave button, none if -1 */ @@ -132,17 +132,20 @@ private: void setNoteName(char noteNr, char octNr, char accNr); void setNameText(); - /** Sets note, accid and octave buttons according to given note. */ - void setButtons(Tnote note); + void setButtons(const Tnote& note); /** Sets note, accidental and octave buttons according to given note. */ - /** Presses accidental button or uncheck them all if accid none (0). */ + /** Presses accidental button or un-check them all if accidental none (0). */ void checkAccidButtons(char accid); void uncheckAccidButtons(); void uncheckAllButtons(); - /** Returns current state of accid buttons converted to accidental value [-2 to 2] */ - char getSelectedAccid(); + char getSelectedAccid(); /** Returns current state of accidental buttons converted to accidental value [-2 to 2] */ void updateSizeHint(); + void setButtonsSize(int widthOff, int fixedH, bool skipOctaves = false); /** Iterates all buttons and adjust their size to context (text) */ + TpushButton* createAccidButton(const QString& accidText); + + /** Sets fixed button width to its text width + @p widthOff or reset to default when @p widthOff = 0. */ + void fixButtonWidth(int widthOff, QPushButton* butt); private slots: void noteWasChanged(int noteNr); diff --git a/src/score/tmainscore.cpp b/src/score/tmainscore.cpp index 52317da7af5a6d3ab0ead88ad174f031cd138400..c14be9ac1bc95ca3274b03541300a92a447d747f 100644 --- a/src/score/tmainscore.cpp +++ b/src/score/tmainscore.cpp @@ -72,8 +72,8 @@ TmainScore::TmainScore(QMainWindow* mw, QWidget* parent) : setAnimationsEnabled(gl->useAnimations); setEnabledDblAccid(gl->S->doubleAccidentalsEnabled); setEnableKeySign(gl->S->keySignatureEnabled); -// if (gl->S->keySignatureEnabled) -// staff()->scoreKey()->showKeyName(true); + if (staff()->scoreKey()) + staff()->scoreKey()->showKeyName(gl->S->showKeySignName); connect(scoreScene()->right(), SIGNAL(nameMenu(TscoreNote*)), SLOT(showNameMenu(TscoreNote*))); // setAmbitus(Tnote(gl->loString().chromatic()-1), @@ -124,8 +124,10 @@ void TmainScore::acceptSettings() { setClef(Tclef(gl->S->clef)); // Enable/disable key signatures if ((bool)staff()->scoreKey() != gl->S->keySignatureEnabled) { - setEnableKeySign(gl->S->keySignatureEnabled); + setEnableKeySign(gl->S->keySignatureEnabled); } + if (staff()->scoreKey()) + staff()->scoreKey()->showKeyName(gl->S->showKeySignName); restoreNotesSettings(); // Note names on the score if (gl->S->nameColor != scoreScene()->nameColor()) { @@ -218,7 +220,7 @@ void TmainScore::getMelody(Tmelody* mel, const QString& title) { mel->setKey(keySignature()); mel->setClef(clef().type()); for (int i = 0; i < notesCount(); ++i) { - Tchunk n(*getNote(i), Trhythm(Trhythm::e_none)); + Tchunk n(getNote(i), Trhythm(Trhythm::e_none)); mel->addNote(n); } } @@ -226,14 +228,17 @@ void TmainScore::getMelody(Tmelody* mel, const QString& title) { void TmainScore::setInsertMode(TmainScore::EinMode mode) { if (mode != insertMode()) { + blockSignals(true); bool ignoreThat = false; if ((mode == e_record && insertMode() == e_multi) || (mode == e_multi && insertMode() == e_record)) ignoreThat = true; TmultiScore::setInsertMode(mode); + blockSignals(false); if (ignoreThat) return; if (mode == e_single) { m_nameMenu->enableArrows(false); + staff()->noteSegment(0)->removeNoteName(); m_currentNameSegment = staff()->noteSegment(0); enableCorners(false); m_nameMenu->show(); @@ -241,6 +246,8 @@ void TmainScore::setInsertMode(TmainScore::EinMode mode) { m_nameMenu->enableArrows(true); m_nameMenu->hide(); enableCorners(true); + if (gl->S->namesOnScore) + staff()->noteSegment(0)->showNoteName(); } } } @@ -344,7 +351,7 @@ bool TmainScore::isAccidToKeyAnimEnabled() { int TmainScore::widthToHeight(int hi) { - return qRound((qreal)hi / sizeHint().height()) * sizeHint().width(); + return qRound((qreal)hi / height()) * width(); } @@ -355,8 +362,8 @@ int TmainScore::widthToHeight(int hi) { void TmainScore::isExamExecuting(bool isIt) { if (isIt) { - if (insertMode() == e_single) - resizeSlot(); +// if (insertMode() == e_single) +// resizeSlot(); enableCorners(false); disconnect(this, SIGNAL(noteWasChanged(int,Tnote)), this, SLOT(whenNoteWasChanged(int,Tnote))); disconnect(m_nameMenu, SIGNAL(noteNameWasChanged(Tnote)), this, SLOT(menuChangedNote(Tnote))); @@ -375,12 +382,12 @@ void TmainScore::isExamExecuting(bool isIt) { // c.setAlpha(255); // staff()->noteSegment(1)->setColor(c); // } - c.setAlpha(80); + c.setAlpha(30); m_questMark->setBrush(QBrush(c)); m_questMark->setText("?"); - m_questMark->setScale(((sizeHint().height() / transform().m11()) / m_questMark->boundingRect().height())); - m_questMark->setPos(((sizeHint().width() / transform().m11()) - m_questMark->boundingRect().width() * m_questMark->scale()) / 2, - ((sizeHint().height() / transform().m11()) - m_questMark->boundingRect().height() * m_questMark->scale()) / 2 ); + m_questMark->setScale(((height() / transform().m11()) / m_questMark->boundingRect().height())); + m_questMark->setPos(((width() / transform().m11()) - m_questMark->boundingRect().width() * m_questMark->scale()) / 2, + ((height() / transform().m11()) - m_questMark->boundingRect().height() * m_questMark->scale()) / 2 ); m_questMark->setZValue(4); setScoreDisabled(true); setClefDisabled(true); @@ -500,13 +507,16 @@ void TmainScore::setReadOnlyReacted(bool doIt) { void TmainScore::markAnswered(QColor blurColor, int noteNr) { if (noteNr < notesCount()) { + TscoreNote *sn; + if (insertMode() == e_single) + sn = staff()->noteSegment(noteNr); + else + sn = noteFromId(noteNr); if (blurColor == -1) - noteFromId(noteNr)->markNote(-1); + sn->markNote(-1); else - noteFromId(noteNr)->markNote(QColor(blurColor.lighter().name())); + sn->markNote(QColor(blurColor.lighter().name())); } -// else -// qDebug() << "TmainScore: Try to mark a note that not exists!"; } @@ -581,7 +591,7 @@ void TmainScore::correctAccidental(Tnote& goodNote) { m_correctNoteNr = 0; m_goodNote = goodNote; QPen pp(QColor(gl->EnotBadColor.name()), 0.5); - if (getNote(0)->alter != m_goodNote.alter) { + if (getNote(0).alter != m_goodNote.alter) { m_bliking = new TblinkingItem(staff()->noteSegment(0)->mainAccid()); } else { m_bliking = new TblinkingItem(staff()->noteSegment(0)); @@ -841,22 +851,22 @@ void TmainScore::resizeEvent(QResizeEvent* event) { TmultiScore::resizeEvent(event); if (width() < 300) return; - if (insertMode() == e_single) { - if (m_nameMenu->size().width() + sizeHint().width() > mainWindow()->width()) { - if (m_nameMenu->buttonsDirection() == QBoxLayout::LeftToRight || m_nameMenu->buttonsDirection() == QBoxLayout::RightToLeft) { - qDebug() << "name is too big. Changing direction "; - m_nameMenu->setDirection(QBoxLayout::BottomToTop); - } - } else { - if (m_nameMenu->buttonsDirection() == QBoxLayout::BottomToTop || m_nameMenu->buttonsDirection() == QBoxLayout::TopToBottom) { - if (m_nameMenu->widthForHorizontal() + size().width() < mainWindow()->width()) { - qDebug() << "There is enough space for horizontal name. Changing"; - m_nameMenu->setDirection(QBoxLayout::LeftToRight); - } - } - } -// setFixedWidth(mapFromScene(scoreScene()->sceneRect()).boundingRect().width() + 1); - } +// if (insertMode() == e_single) { +// if (m_nameMenu->size().width() + width() > mainWindow()->width()) { +// if (m_nameMenu->buttonsDirection() == QBoxLayout::LeftToRight || m_nameMenu->buttonsDirection() == QBoxLayout::RightToLeft) { +// qDebug() << "name is too big. Changing direction "; +// m_nameMenu->setDirection(QBoxLayout::BottomToTop); +// } +// } else { +// if (m_nameMenu->buttonsDirection() == QBoxLayout::BottomToTop || m_nameMenu->buttonsDirection() == QBoxLayout::TopToBottom) { +// if (m_nameMenu->widthForHorizontal() + size().width() < mainWindow()->width()) { +// qDebug() << "There is enough space for horizontal name. Changing"; +// m_nameMenu->setDirection(QBoxLayout::LeftToRight); +// } +// } +// } +// // setFixedWidth(mapFromScene(scoreScene()->sceneRect()).boundingRect().width() + 1); +// } setBarsIconSize(); performScordatureSet(); // To keep scordature size up to date with score size } diff --git a/src/score/tmultiscore.cpp b/src/score/tmultiscore.cpp index b21d35ef872589e5ee5ee437d2b95a63983bb849..61624be3bbac265f530f9eb924fab3788625b6d7 100644 --- a/src/score/tmultiscore.cpp +++ b/src/score/tmultiscore.cpp @@ -67,6 +67,8 @@ void TmultiScore::setInsertMode(TmultiScore::EinMode mode) { if (ignoreThat) return; if (mode == e_single) { + scoreScene()->left()->enableToAddNotes(false); // It has to be invoked before deleteNotes() to hide 'enter note' text + scoreScene()->right()->enableToAddNotes(false); deleteNotes(); staff()->setStafNumber(-1); staff()->setViewWidth(0.0); @@ -76,24 +78,19 @@ void TmultiScore::setInsertMode(TmultiScore::EinMode mode) { staff()->insertNote(2, true); setControllersEnabled(true, false); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - scoreScene()->left()->enableToAddNotes(false); - scoreScene()->right()->enableToAddNotes(false); m_currentIndex = 0; - setAlignment(Qt::AlignLeft); - setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); - resizeEvent(0); } else { staff()->setStafNumber(0); - deleteNotes(); + staff()->removeNote(2); + staff()->removeNote(1); setControllersEnabled(true, true); scoreScene()->left()->enableToAddNotes(true); scoreScene()->right()->enableToAddNotes(true); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); setMaximumWidth(QWIDGETSIZE_MAX); // revert what TsimpleScore 'broke' - setAlignment(Qt::AlignCenter); - setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - resizeEvent(0); + setNote(0, Tnote()); } + resizeEvent(0); } } @@ -124,11 +121,14 @@ void TmultiScore::setNote(int index, const Tnote& note) { -Tnote* TmultiScore::getNote(int index) { - if (index >= 0 && index < notesCount()) - return noteFromId(index)->note(); - else - return 0; +Tnote TmultiScore::getNote(int index) { + if (index >= 0 && index < notesCount()) { + if (insertMode() == e_single) + return *staff()->getNote(index); + else + return *noteFromId(index)->note(); + } else + return Tnote(); } @@ -249,7 +249,7 @@ void TmultiScore::deleteNotes() { /** To call TsimpleScore::resizeEvent twice solves problem * with adjusting score size to scene (staff) in single note mode. */ void TmultiScore::resizeSlot() { - TsimpleScore::resizeEvent(0); +// TsimpleScore::resizeEvent(0); } @@ -259,12 +259,16 @@ void TmultiScore::resizeEvent(QResizeEvent* event) { hh = event->size().height(); ww = event->size().width(); } - if (ww < 300) - return; +// if (ww < 300) +// return; if (m_inMode == e_single) { + if (ww < 300) + return; TsimpleScore::resizeEvent(event); - QTimer::singleShot(10, this, SLOT(resizeSlot())); +// QTimer::singleShot(10, this, SLOT(resizeSlot())); } else { + if (ww < 400) + return; QList<TscoreNote*> allNotes; for (int i = 0; i < m_staves.size(); i++) { // grab all TscoreNote m_staves[i]->takeNotes(allNotes, 0, m_staves[i]->count() - 1); @@ -273,7 +277,7 @@ void TmultiScore::resizeEvent(QResizeEvent* event) { if (staff()->isPianoStaff()) staffOff = 1.1; hh = qMin<int>(hh, qMin<int>(qApp->desktop()->screenGeometry().width(), qApp->desktop()->screenGeometry().height()) / 2); - qreal factor = (((qreal)hh / (staff()->height() + 2.0)) / transform().m11()) / m_scale; + qreal factor = (((qreal)hh / (staff()->height() + 0.4)) / transform().m11()) / m_scale; scale(factor, factor); int stavesNumber; // how many staves are needed for (int i = 0; i < m_staves.size(); i++) { @@ -300,7 +304,7 @@ void TmultiScore::resizeEvent(QResizeEvent* event) { } if (i == 0) - m_staves[i]->setPos(staffOff, 0.05); + m_staves[i]->setPos(staffOff, 0.0/*, 0.05*/); else { qreal yOff = 4.0; if (staff()->hasScordature() && i == 1) @@ -316,7 +320,7 @@ void TmultiScore::resizeEvent(QResizeEvent* event) { void TmultiScore::updateSceneRect() { qreal sh; if (m_staves.size() == 1) - sh = (staff()->height() + 0.1) * m_scale; + sh = (staff()->height()/* + 0.1*/) * m_scale; else sh = m_staves.last()->pos().y() + m_staves.last()->height(); QRectF scRec = staff()->mapToScene(QRectF(0.0, 0.0, diff --git a/src/score/tmultiscore.h b/src/score/tmultiscore.h index 1d0d188c8343f5b22f6d17598ff74ea789989849..1796813282f1a4544b01941becda12658424e4a7 100644 --- a/src/score/tmultiscore.h +++ b/src/score/tmultiscore.h @@ -66,7 +66,7 @@ public: virtual void setNote(const Tnote& note); /** Sets current note */ virtual void setNote(int index, const Tnote& note); /** Sets note of @p index to @p note */ - virtual Tnote* getNote(int index); + Tnote getNote(int index); virtual void setEnableKeySign(bool isEnabled); diff --git a/src/settings/tguitarsettings.cpp b/src/settings/tguitarsettings.cpp index 3edd2f5978d862439f3b64de49402bd06b0b3851..5928e7532119a81c16259c9798aa2fb3bf2c57f3 100755 --- a/src/settings/tguitarsettings.cpp +++ b/src/settings/tguitarsettings.cpp @@ -58,7 +58,7 @@ TguitarSettings::TguitarSettings(QWidget *parent) : m_tuneView = new TsimpleScore(6, this); m_tuneView->setControllersEnabled(true, false); m_tuneView->scoreScene()->setPointedColor(gl->S->pointerColor); - m_tuneView->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding); + m_tuneView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); tuneLay->addWidget(m_tuneView); m_tuneView->setClef(gl->S->clef);