File: porting_kf6.md

package info (click to toggle)
kf6-ktexteditor 6.23.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,676 kB
  • sloc: cpp: 93,343; javascript: 20,925; xml: 237; sh: 20; ansic: 16; makefile: 8
file content (20 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Porting to KF6KTextEditor

This document describes the changes in the api and what you need to be able to port to KF6 KTextEditor.

## Interfaces are gone

All KTextEditor::Document and KTextEditor::View extension interfaces for e.g., MovingInterface, MarkInterface, ConfigInterface etc were
removed and their API merged into respective view and document class. For porting, you can just remove the interface case and use the
document or view object directly, e.g:
```c++
// KF5
if (auto miface = qobject<KTextEditor::MovingInterface*>(m_doc)) {
    KTextEditor::MovingRange *range = miface->newMovingInterface(...);
}
```
in KF6 becomes:

```c++
    KTextEditor::MovingRange *range = m_doc->newMovingInterface(...);
```