Warning, /frameworks/ktexteditor/README.md is written in an unsupported language. File is not indexed.
0001 # KTextEditor 0002 0003 Full text editor component 0004 0005 ## Introduction 0006 0007 KTextEditor provides a powerful text editor component that you can embed in your 0008 application, either as a KPart or using the KF6::TextEditor library (if you need 0009 more control). 0010 0011 The text editor component contains many useful features, from syntax 0012 highlighting and automatic indentation to advanced scripting support, making it 0013 suitable for everything from a simple embedded text-file editor to an advanced 0014 IDE. 0015 0016 ## Usage 0017 0018 If you are using CMake, you need to have 0019 0020 ```cmake 0021 find_package(KF6TextEditor) 0022 ``` 0023 0024 (or similar) in your CMakeLists.txt file, and you need to link to KF6::TextEditor. 0025 0026 After that, you can use KTextEditor::Editor to create an editor instance, and 0027 use that to manage KTextEditor::Document instances. 0028 0029 ```cpp 0030 #include <KTextEditor/Document> 0031 #include <KTextEditor/Editor> 0032 #include <KTextEditor/View> 0033 0034 // get access to the global editor singleton 0035 auto editor = KTextEditor::Editor::instance(); 0036 0037 // create a new document 0038 auto doc = editor->createDocument(this); 0039 0040 // create a widget to display the document 0041 auto view = doc->createView(yourWidgetParent); 0042 ``` 0043 0044 See the documentation for these classes for more information. 0045 0046 ## Licensing 0047 0048 Contributions to KTextEditor shall be licensed under [LGPLv2+](LICENSES/LGPL-2.0-or-later.txt). 0049 0050 All files shall contain a proper "SPDX-License-Identifier: LGPL-2.0-or-later" identifier inside a header like: 0051 0052 ```cpp 0053 /* 0054 SPDX-FileCopyrightText: 2021 Christoph Cullmann <cullmann@kde.org> 0055 0056 SPDX-License-Identifier: LGPL-2.0-or-later 0057 */ 0058 ``` 0059 0060 ## Further Documentation 0061 0062 - @ref kte_design 0063 - @ref kte_port_to_5 0064 - @ref kte_guidelines 0065