NoteView::NoteView(Note* notes) : m_notes(notes) { QHBoxLayout* layout = new QHBoxLayout(this); layout->setContentsMargins(0, 0, 0, 0); m_textEdit = new QTextEdit(this); QPalette palette = m_textEdit->palette(); palette.setColor(QPalette::Base, m_notes->backgroundColor()); palette.setColor(QPalette::Text, m_notes->textColor()); m_textEdit->setPalette(palette); m_textEdit->setFont(m_notes->textFont()); m_textEdit->setText(m_notes->note()); layout->addWidget(m_textEdit); connect(m_notes, SIGNAL(backgroundColorChanged(QColor)), this, SLOT(backgroundColorChanged(QColor))); connect(m_notes, SIGNAL(textColorChanged(QColor)), this, SLOT(textColorChanged(QColor))); connect(m_notes, SIGNAL(textFontChanged(QFont)), this, SLOT(textFontChanged(QFont))); connect(m_textEdit, SIGNAL(textChanged()), this, SLOT(textChanged())); }
NoteDock::NoteDock(QWidget *parent) : QWidget(parent), m_initializing(false), m_notes(0) { ui.setupUi(this); connect(ui.leName, SIGNAL(returnPressed(QString)), this, SLOT(nameChanged(QString))); connect(ui.leComment, SIGNAL(returnPressed(QString)), this, SLOT(commentChanged(QString))); connect(ui.kcbBgColor, SIGNAL(changed(QColor)), this, SLOT(backgroundColorChanged(QColor))); connect(ui.kcbTextColor, SIGNAL(changed(QColor)), this, SLOT(textColorChanged(QColor))); connect(ui.kfrTextFont, SIGNAL(fontSelected(QFont)), this, SLOT(textFontChanged(QFont))); TemplateHandler* templateHandler = new TemplateHandler(this, TemplateHandler::Worksheet); ui.gridLayout->addWidget(templateHandler, 8, 3); templateHandler->show(); connect(templateHandler, SIGNAL(loadConfigRequested(KConfig&)), this, SLOT(loadConfigFromTemplate(KConfig&))); connect(templateHandler, SIGNAL(saveConfigRequested(KConfig&)), this, SLOT(saveConfigAsTemplate(KConfig&))); }
void k9MenuEdit::setFont(const QFont &_value) { if (m_text) m_text->setFont(_value); m_canvas->update(); emit textFontChanged(_value); }