Warning, /frameworks/kparts/README.md is written in an unsupported language. File is not indexed.
0001 # KParts 0002 0003 Plugin framework for user interface components 0004 0005 ## Introduction 0006 0007 This library implements the framework for KDE parts, which are 0008 elaborate widgets with a user-interface defined in terms of actions 0009 (menu items, toolbar icons). 0010 0011 0012 ## Usage 0013 0014 If you are using CMake, you need to have 0015 0016 find_package(KF6Parts NO_MODULE) 0017 0018 (or similar) in your CMakeLists.txt file, and you need to link to KF6::Parts. 0019 0020 The main class is KParts::Part. This, or one of its subclasses, is what authors 0021 of parts implement, and how users of parts interact with them. 0022 0023 Applications wishing to embed a part need to inherit their main window from 0024 KParts::MainWindow and provide a so-called shell GUI, which provides a basic 0025 skeleton GUI with part-independent functionality/actions. 0026 0027 Some KParts applications won't be specific to a given part, but expect 0028 to be able to embed, for instance, all types of viewers out there. For this 0029 the basic functionality of any viewer has been implemented in 0030 KParts::ReadOnlyPart, which viewer-like parts should inherit from. 0031 The same applies to KParts::ReadWritePart, which is for editor-like parts. 0032 0033 You can add actions to an existing KParts app from "outside", defining 0034 the code for those actions in a shared library. This mechanism is 0035 obviously called plugins, and implemented by KParts::Plugin. 0036 0037 For a complete, and very simple, example of how to use KParts to display 0038 any kind of file (i.e. making a generic viewer), see the documentation for 0039 KMimeTypeTrader::createPartInstanceFromQuery(). 0040 0041