Writing a Qt Quick Graphical Application for reMarkable Paper Tablets
đź’ˇ You will need to have a PC with a Linux environment.
The UI of the reMarkable paper tablets is written using the Qt Quick UI framework.
It is possible to write applications using the Qt Framework for the paper tablets. Please note that currently only pure Qt Quick applications (no Qt Widgets) are supported. To build the application you need to be on Linux. Touch event handling works out of the box, while handling the marker is more involved and not shown here.
You can find the source code for this and other examples on our Github page.
Writing the application
We will write a Qt Quick application. It needs three files:
CMakeLists.txt
for the build system.main.cpp
is the launcher code, it loads the QML file.Main.qml
is our graphical user interface.
Create a file CMakeLists.txt
with the following content:
cmake_minimum_required(VERSION 3.16)
project(hello_remarkable VERSION 0.1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt6 REQUIRED COMPONENTS Quick)
qt_standard_project_setup(REQUIRES 6.5)
qt_add_executable(hello_remarkable main.cpp)
qt_add_qml_module(hello_remarkable
URI remarkable_example
VERSION 1.0
QML_FILES Main.qml)
target_link_libraries(hello_remarkable PRIVATE Qt6::Quick)
And the C++ basic application in main.cpp
:
#include <QGuiApplication>
#include <QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("remarkable_example", "Main");
return app.exec();
}
The application will show a text, which will toggle between hidden/visible on touch.
Finally we write the UI of the application in Main.qml
:
import QtQuick
import QtQuick.Window
Window {
width: Screen.width
height: Screen.height
visible: true
Text {
id: hello_text
x: 50
y: 50
font.pixelSize: 32
text: "Hello reMarkable!"
}
MouseArea {
anchors.fill: parent
onPressed: {
hello_text.visible = !hello_text.visible
}
}
}
Building the application
You need the SDK for your paper tablet (make sure to use the correct version).
Make sure to activate the SDK (replace VERSION
below with your SDK version).
source ~/codex-sdk/rm2/VERSION/environment-setup-cortexa7hf-neon-remarkable-linux-gnueabi
cmake . -B build
cmake --build build
You should now have the application binary in the build directory: build/hello_remarkable
Version 3.17
For software version 3.17 you will need to manually copy libqsgepaper.so
to
the device. You can find the library in the files of the SDK at
~/codex-sdk/rm2/sysroots/cortexa7hf-neon-remarkable-linux-gnueabi/usr/lib/plugins/scenegraph/libqsgepaper.so
Example of how to copy the file to the device:
cd ~/codex-sdk/rm2/sysroots/cortexa7hf-neon-remarkable-linux-gnueabi/usr/lib/plugins/scenegraph
scp libqsgepaper.so root@10.11.99.1:
ssh root@10.11.99.1
mkdir /usr/lib/plugins/scenegraph
mv libqsgepaper.so /usr/lib/plugins/scenegraph/.
Running the application
Copy the application to the device. See the developer mode section for more information on using ssh.
Copy the application to the device using scp. Then use ssh to connect to the device and run commands on it. Stop the remarkable main application, launch your application and finally start the main application again. On reMarkable 1 and 2 you also need to change the touch event coordinates.
scp hello_remarkable root@10.11.99.1:
ssh root@10.11.99.1
systemctl stop xochitl
# reMarkable 1 only:
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS="rotate=180"
# reMarkable 2 only:
export QT_QPA_EVDEV_TOUCHSCREEN_PARAMETERS="rotate=180:invertx"
QT_QUICK_BACKEND=epaper ./hello_remarkable -platform epaper
# when you are done testing the application, stop it with ctrl-c
systemctl start xochitl
Disclaimer
Please note that you will be solely responsible for any changes or modifications you make to our software, including by using Developer Mode. We reserve the right to not provide support to software that has been subject to such changes or modifications. Errors or defects resulting from changes or modifications made by you will not be covered by our Limited Warranty or Protection Plan, or any legal warranty you might have (to the extent permitted under applicable law). reMarkable disclaims all liability in that regard.