From 42f64e14e04997887b93248dd1b7d5fd10b302d7 Mon Sep 17 00:00:00 2001 From: SeeLook <seelook@gmail.com> Date: Tue, 1 Nov 2016 14:30:34 +0100 Subject: [PATCH] Missing destructor, some cleaning --- src/gui/tbgpixmap.cpp | 7 +++++++ src/gui/tbgpixmap.h | 1 + src/score/tmainscore.cpp | 7 +------ src/score/tmultiscore.cpp | 1 - 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gui/tbgpixmap.cpp b/src/gui/tbgpixmap.cpp index 9b64c4df9..c76e9ec58 100644 --- a/src/gui/tbgpixmap.cpp +++ b/src/gui/tbgpixmap.cpp @@ -36,6 +36,13 @@ TbgPixmap::TbgPixmap() : m_instance = this; } + +TbgPixmap::~TbgPixmap() +{ + m_instance = 0; +} + + void TbgPixmap::update(const QSize& windowSize, int instr, int guitarHeight, int XIIfretXpos, int fingerboardX, bool rightHanded) { if (windowSize != m_windowSize || instr != m_instr || m_rightHanded != rightHanded) { Einstrument in = static_cast<Einstrument>(instr); diff --git a/src/gui/tbgpixmap.h b/src/gui/tbgpixmap.h index 33ec66521..03182e3a5 100644 --- a/src/gui/tbgpixmap.h +++ b/src/gui/tbgpixmap.h @@ -37,6 +37,7 @@ class TbgPixmap : public QPixmap public: TbgPixmap(); + ~TbgPixmap(); static TbgPixmap* instance() { return m_instance; } diff --git a/src/score/tmainscore.cpp b/src/score/tmainscore.cpp index d2760c550..ba0464a5a 100644 --- a/src/score/tmainscore.cpp +++ b/src/score/tmainscore.cpp @@ -85,8 +85,7 @@ TmainScore::TmainScore(QMainWindow* mw, QWidget* parent) : createNoteName(); isExamExecuting(false); setNote(0, Tnote()); // To display fake empty note properly -// setStyleSheet(QString()); -// setStyleSheet(QLatin1String("border-radius: 10px;")); // reset style sheet - we are using paint event here + viewport()->setStyleSheet(QStringLiteral("border-radius: 10px;")); setBGcolor(palette().base().color()); } @@ -643,7 +642,6 @@ void TmainScore::paintEvent(QPaintEvent* event) { if (!BG_PIX->isNull() && event->rect().bottomRight().x() >= BG_PIX->globalPos().x()) { painter.drawPixmap(BG_PIX->globalPos().x() , BG_PIX->globalPos().y() - y(), *BG_PIX); } - painter.setBrush(m_bgColor); painter.setPen(Qt::NoPen); if (event->rect().x() <= ROUNDNESS || painter.viewport().width() - (event->rect().x() + event->rect().width()) <= ROUNDNESS) @@ -890,9 +888,6 @@ void TmainScore::resizeEvent(QResizeEvent* event) { return; setBarsIconSize(); performScordatureSet(); // To keep scordature size up to date with score size -// setBgPixmapPos(m_bgPixPos); -// QPointF zero = mapToScene(QPoint(0, 0)); -// m_bgItem->setRect(zero.x(), zero.y(), width(), height()); } diff --git a/src/score/tmultiscore.cpp b/src/score/tmultiscore.cpp index 9852a8a6e..7c30385d0 100644 --- a/src/score/tmultiscore.cpp +++ b/src/score/tmultiscore.cpp @@ -43,7 +43,6 @@ TmultiScore::TmultiScore(QMainWindow* mw, QWidget* parent) : m_selectReadOnly(false), m_isDisabled(false) { setObjectName("m_mainScore"); - setStyleSheet("TsimpleScore#m_mainScore { background: transparent }"); setContentsMargins(2, 2, 2, 2); setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); staff()->setZValue(11); // to be above next staves - TnoteControl requires it -- GitLab