2022-03-19 00:02:05 +01:00
|
|
|
# Falkon QML Tutorial - 1. Introduction
|
|
|
|
|
|
|
|
Hello, in this series I would like to introduce and describe how to write extensions for [Falkon](https://www.falkon.org/) web browser with QML.
|
|
|
|
|
|
|
|
Starting with Falkon 3.2 there is support for installing extensions from store which can be found at [store.falkon.org](https://store.falkon.org/)
|
|
|
|
|
|
|
|
Falkon supports extensions written in C++, Python and QML.
|
|
|
|
This series will go over the QML implementation.
|
|
|
|
|
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
2022-03-19 03:03:24 +01:00
|
|
|
1. Knowledge of C++ (Beneficial, Optional)
|
2022-03-19 00:02:05 +01:00
|
|
|
There is no way around this, while there are times when just looking at documentation is enough I prefer the code.
|
|
|
|
2. The Falkon source code
|
|
|
|
* The source code for stable release of Falkon can be found at [download.kde.org/stable/falkon/](https://download.kde.org/stable/falkon/)
|
|
|
|
* The latest source code can be found at the [Gitlab](https://invent.kde.org/network/falkon)
|
|
|
|
3. Knowledge of QML, QtQuick and Qt
|
|
|
|
It is good to have Qt documentation and Qt development tools like [Qt Designer](https://doc.qt.io/qt-5/qtdesigner-manual.html) at hand.
|
|
|
|
|
|
|
|
|
|
|
|
## Limitations
|
|
|
|
|
2022-03-30 22:09:58 +02:00
|
|
|
> **NOTE:** First I have to mention that I do not know much about QML
|
|
|
|
development, only bits here and there.
|
2022-03-19 00:02:05 +01:00
|
|
|
|
2022-03-30 22:09:58 +02:00
|
|
|
* The instance of `FalkonAction` (toolbar button) is shared between all
|
2022-03-19 13:23:04 +01:00
|
|
|
Falkon windows in the same instance. This makes it unsuitable for
|
|
|
|
showing live status of website since it will be totaly broken the moment
|
|
|
|
another window is opened and I do not want to see that happening to my
|
2022-03-30 22:09:58 +02:00
|
|
|
extensions.
|
|
|
|
* The button created with `FalkonAction` always requires to have `popup`
|
|
|
|
property present or it will not work properly (e.g. icon will be
|
|
|
|
missing from the button, maybe more).
|
2022-06-20 23:29:24 +02:00
|
|
|
* The extension settings window cannot be closed from within QML code
|
2022-03-30 22:09:58 +02:00
|
|
|
(e.g. by pressing a "Cancel" button).
|
2022-04-14 08:36:11 +02:00
|
|
|
* At the moment Enums in QML are a bit unintuitive and even partialy
|
|
|
|
broken (not present at all while they should). I will try to revise and
|
|
|
|
redesign this in the future.
|
2022-03-19 00:02:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
## Falkon module
|
|
|
|
|
2022-03-19 13:29:26 +01:00
|
|
|
To access Falkon specific features and functions inside the QML script
|
|
|
|
you need to use `Falkon` module.
|
2022-03-19 00:02:05 +01:00
|
|
|
|
|
|
|
```qml
|
|
|
|
import org.kde.falkon 1.0 as Falkon
|
|
|
|
```
|