NotePadPlugin::NotePadPlugin(QWidget* parent, QString ID) : LDPlugin(parent, ID){ QVBoxLayout *vlay = new QVBoxLayout(); this->setLayout( new QVBoxLayout() ); this->layout()->setContentsMargins(0,0,0,0); vlay->setContentsMargins(3,3,3,3); frame = new QFrame(this); frame->setObjectName("notepadbase"); frame->setStyleSheet("QFrame#notepadbase{border-size: 1px; background: rgba(255,255,255,50); color: black;} QFrame{ border: none; border-radius: 3px; background: rgba(255,255,255,100); color: black;}"); this->layout()->addWidget(frame); frame->setLayout(vlay); //Setup the title bar header buttons QHBoxLayout *hlay = new QHBoxLayout(); next = new QToolButton(this); next->setAutoRaise(true); prev = new QToolButton(this); prev->setAutoRaise(true); add = new QToolButton(this); add->setAutoRaise(true); rem = new QToolButton(this); rem->setAutoRaise(true); label = new QLabel(this); label->setAlignment(Qt::AlignCenter); hlay->addWidget(prev); hlay->addWidget(next); hlay->addWidget(label); hlay->addWidget(add); hlay->addWidget(rem); vlay->addLayout(hlay); //Setup the main text widget edit = new QPlainTextEdit(this); edit->setReadOnly(false); vlay->addWidget(edit); //Now setup the initial values cnote = this->settings->value("currentNote", 1).toInt(); maxnote = this->settings->value("availableNotes",1).toInt(); this->setInitialSize(200,300); //Setup the button connections connect(next, SIGNAL(clicked()), this, SLOT(nextNote()) ); connect(prev, SIGNAL(clicked()), this, SLOT(prevNote()) ); connect(add, SIGNAL(clicked()), this, SLOT(newNote()) ); connect(rem, SIGNAL(clicked()), this, SLOT(remNote()) ); connect(edit, SIGNAL(textChanged()), this, SLOT(noteChanged()) ); QTimer::singleShot(0,this, SLOT(loadIcons()) ); QTimer::singleShot(0,this, SLOT(updateContents()) ); }
void MainWindow::createCentralWidget() { mWebView = new EnView(this); mWebView->setContextMenuPolicy(Qt::NoContextMenu); if(isFirstRun) mWebView->setHtml(defaultPage(false)); else mWebView->setHtml(defaultPage(true)); connect(mWebView, SIGNAL(noteClicked(QString)), &mEnExport, SLOT(openNote(QString))); //connect(mWebView, SIGNAL(linkClicked(QUrl)), SLOT(openUrl(QUrl))); QPalette navigationPalette; navigationPalette.setColor(QPalette::Window, QColor(mBgColor)); mToolBar = new QToolBar(this); addToolBar(Qt::TopToolBarArea, mToolBar); mToolBar->setBackgroundRole(QPalette::Window); mToolBar->setAutoFillBackground(true); mToolBar->setPalette(navigationPalette); mToolBar->setMovable(false); mToolBar->setIconSize(QSize(30, 30)); //mPageNumberLabel = new QLabel("4 / 7", this); //mPageNumberLabel->setFont(QFont("Times", 18)); QAction* settingsAction = new QAction(QIcon(":/images/gear2.png"), tr("Settings"), mToolBar); QAction* prevAction = new QAction(QIcon(":/images/prev.png"), tr("Prev"), mToolBar); QAction* nextAction = new QAction(QIcon(":/images/next.png"), tr("Next"), mToolBar); mToolBar->addAction(settingsAction); mToolBar->addAction(prevAction); mToolBar->addAction(nextAction); mNavigationLabel = new QLabel(mToolBar); mNavigationLabel->setFont(QFont("Times", 18)); mToolBar->addWidget(mNavigationLabel); connect(settingsAction, SIGNAL(triggered()), SLOT(loadDialogSettings())); //connect(settingsAction, SIGNAL(triggered()), mDialog, SLOT(show())); connect(prevAction, SIGNAL(triggered()), SLOT(prevNote())); connect(nextAction, SIGNAL(triggered()), SLOT(nextNote())); setCentralWidget(mWebView); }
void TscoreMeasure::setStaff(TscoreStaff* st) { m_staff = st; setParent(st); for (TscoreBeam* b : m_beams) b->changeStaff(st); if (st->firstMeasure() == this) { // this measure was the last and went at the beginning of the next staff auto first = firstNote(); if (first->note()->rtm.tie() > Trhythm::e_tieStart) { // tie continues or ends on first note auto prev = first->prevNote(); if (prev->tie()) prev->tie()->checkStaves(); else // TODO: delete if not occurs qDebug() << debug() << "first note has tie flag set but tie doesn't exists"; } } else if (st->lastMeasure() == this) { // this measure was the first and went at the end of previous staff auto last = lastNote(); if (last->tie()) last->tie()->checkStaves(); } }