MCPcopy Create free account
hub / github.com/KDE/kdevelop / initPreview

Method initPreview

kdevplatform/shell/settings/editstyledialog.cpp:80–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80void EditStyleDialog::initPreview()
81{
82 m_document = KTextEditor::Editor::instance()->createDocument(this);
83 m_document->setReadWrite(false);
84 m_document->setHighlightingMode(m_style.modeForMimetype(m_mimeType));
85
86 m_view = m_document->createView(m_ui.textEditor);
87 auto* layout2 = new QVBoxLayout(m_ui.textEditor);
88 layout2->setContentsMargins(0, 0, 0, 0);
89 layout2->addWidget(m_view);
90 m_ui.textEditor->setLayout(layout2);
91
92 m_view->setStatusBarEnabled(false);
93 m_view->setConfigValue(QStringLiteral("dynamic-word-wrap"), false);
94 m_view->setConfigValue(QStringLiteral("icon-bar"), false);
95 m_view->setConfigValue(QStringLiteral("scrollbar-minimap"), false);
96 m_view->show();
97}
98
99void EditStyleDialog::updatePreviewText(const QString &text)
100{

Callers

nothing calls this directly

Calls 4

modeForMimetypeMethod · 0.80
showMethod · 0.80
createViewMethod · 0.45
addWidgetMethod · 0.45

Tested by

no test coverage detected