MCPcopy Create free account
hub / github.com/KDE/labplot / setLabelsFont

Method setLabelsFont

src/backend/worksheet/plots/cartesian/ProcessBehaviorChart.cpp:615–648  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615void ProcessBehaviorChart::setLabelsFont(const QFont& font) {
616 QDEBUG(Q_FUNC_INFO << ", FONT = " << font)
617 Q_D(ProcessBehaviorChart);
618 auto textWrapper = d->centerLabel->text();
619 QTextEdit te(textWrapper.text);
620 te.selectAll();
621 if (font != te.font()) {
622 beginMacro(i18n("%1: set labels font", name()));
623 te.setFontFamily(font.family());
624 te.setFontPointSize(font.pointSize());
625 te.setFont(font);
626 textWrapper.text = te.toHtml();
627 d->centerLabel->setText(textWrapper);
628
629 textWrapper = d->upperLimitLabel->text();
630 te.setText(textWrapper.text);
631 te.selectAll();
632 te.setFontFamily(font.family());
633 te.setFontPointSize(font.pointSize());
634 te.setFont(font);
635 textWrapper.text = te.toHtml();
636 d->upperLimitLabel->setText(textWrapper);
637
638 textWrapper = d->lowerLimitLabel->text();
639 te.setText(textWrapper.text);
640 te.selectAll();
641 te.setFontFamily(font.family());
642 te.setFontPointSize(font.pointSize());
643 te.setFont(font);
644 textWrapper.text = te.toHtml();
645 d->lowerLimitLabel->setText(textWrapper);
646 endMacro();
647 }
648}
649
650void ProcessBehaviorChart::setLabelsFontColor(const QColor& color) {
651 Q_D(ProcessBehaviorChart);

Callers

nothing calls this directly

Calls 6

fontMethod · 0.80
toHtmlMethod · 0.80
textMethod · 0.45
selectAllMethod · 0.45
setFontMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected