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

Method NotebookView

src/frontend/notebook/NotebookView.cpp:29–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27#include <KToggleAction>
28
29NotebookView::NotebookView(Notebook* worksheet)
30 : QWidget()
31 , m_notebook(worksheet) {
32 auto* layout = new QHBoxLayout(this);
33 layout->setContentsMargins(0, 0, 0, 0);
34 m_part = worksheet->part();
35 if (m_part) {
36 layout->addWidget(m_part->widget());
37 initActions();
38 connect(m_notebook, &Notebook::requestProjectContextMenu, this, &NotebookView::createContextMenu);
39 connect(m_notebook, &Notebook::statusChanged, this, &NotebookView::statusChanged);
40 } else {
41 QString msg = QStringLiteral("<b>") + i18n("Failed to initialize %1.", m_notebook->backendName()) + QStringLiteral("</b><br>");
42 msg += worksheet->error();
43 QLabel* label = new QLabel(msg);
44 label->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter);
45 layout->addWidget(label);
46 }
47}
48
49void NotebookView::initActions() {
50 m_actionGroup = new QActionGroup(this);

Callers

nothing calls this directly

Calls 4

backendNameMethod · 0.80
errorMethod · 0.80
partMethod · 0.45
widgetMethod · 0.45

Tested by

no test coverage detected