A port to Qt6 for DTK2 Widgets
Read WIKI »
Corresponding Qt Intergration
·
Report a Problem
·
Request New Widgets
Note: This is NOT the official repository of Deepin!!
Table of Contents
Love the apperance of DTK2 but prefer Qt6? We got you!
This repository is the port of Deepin's classical DTK2 Widget to Qt6, we translated the API difference between Qt5 and Qt6 and developed the corresponding GXDE-Qt6-Integration so that you may use Qt6 and DTK2 Widgets at the same time.
- For building the
.debpackage:- debhelper (>= 9)
- pkg-config
- Qt6: (Qt 6.8.2 is preferred)
- qt6-base-dev
- qt6-base-private-dev
- qt6-tools-dev-tools
- qt6-multimedia-dev
- qt6-svg-dev
- qt6-l10n-tools
- qt6-scxml-dev
- DTK:
- libdtk6core-dev
- libdtk6log-dev
- libgsettings-qt6-dev
- X11/System:
- libudev-dev
- libxext-dev
- x11proto-xext-dev
- libxcb-util-dev
- libxrender-dev
- libxi-dev
- libstartup-notification0-dev
- libmtdev-dev
- Graphical:
- libegl1-mesa-dev
- libfontconfig1-dev
- libfreetype6-dev
- libglib2.0-dev
- librsvg2-dev
- Runtime:
This project is built with qmake6 (or CMake if you want) and then packed with Debian's standard debuild process.
The following instruction is based on GXDE 25.3.
-
Installing the packaging tools:
sudo apt update sudo apt install build-essential devscripts debhelper pkg-config git
-
Install devel packages(Be sure to read the Dependencies part):
sudo apt install \ qt6-base-dev qt6-base-private-dev qt6-tools-dev-tools \ qt6-multimedia-dev qt6-svg-dev qt6-l10n-tools qt6-scxml-dev \ libdtk6core-dev libdtk6log-dev libgsettings-qt6-dev \ libudev-dev libxext-dev x11proto-xext-dev libxcb-util-dev \ libxrender-dev libxi-dev libstartup-notification0-dev libmtdev-dev \ libegl1-mesa-dev libfontconfig1-dev libfreetype6-dev \ libglib2.0-dev librsvg2-devNote: After entering the project directory, you may use
sudo apt build-dep .to let apt get and install all depencies according todebian/control.
If you only want the library but not the deb package, then do the following:
-
Clone this repository:
git clone https://gitee.com/GXDE-OS/dtk2widget-qt6.git cd dtk2widget-qt6 -
Use
qmake6to configre the project:mkdir build-qt6 cd build-qt6 qmake6 ../dtkwidget.pro PREFIX=/usr LIB_INSTALL_DIR=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
-
Compile project:
make -j$(nproc) -
Install to system (Optional, this will be write to path under
/usr):sudo make install
sudo apt install cmake ninja-build
cmake -B build-cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build-cmake
sudo cmake --install build-cmakeAvailable options:
-DBUILD_EXAMPLES=OFF: Skip the examples.-DBUILD_TOOLS=OFF: Skipdtk-svgc.-DDTK_NO_TRANSLATION=ON-DDTK_STATIC_TRANSLATION=ON-DDTK_STATIC_LIB=ON.
The opacity of the blurred dialog background (including the About dialog and other DAbstractDialog subclasses) is defined in src/widgets/dialog_constants.h:
namespace DIALOG {
const int BLUR_BACKGROUND_ALPHA_LIGHT = 199; // light: 78% (compact dialogs)
const int BLUR_BACKGROUND_ALPHA_DARK = 199; // dark: 78% (compact dialogs)
}The same value is used on both X11 (dxcb) and Wayland; the window manager's blur capability is no longer probed. Rebuild (and repackage/install) for changes to take effect. It is recommended to check the result with the About dialog on a real X11 + KWin session: increase the value if it looks too transparent, decrease it if it looks too opaque (range 0~255).
This would be recommended if you are using debian-based distros.
sudo apt install cmake fakeroot
chmod a+x ./build-deb
./build-deb -dYou may run./build-deb -c to execute a cleanup.
The .deb artifact may be found in the parent directory of project root.
To use this library, please also install the depended runtime gxde-qt6integration.
To use it in a CMake project:
find_package(Dtk2widget REQUIRED)
target_link_libraries(your_app PRIVATE Dtk2widget::Dtk2widget)If QMake: QT += dtk2widget, or use dtk2widget through pkg-config.
Currently we are making a new example project.
For documentation, please go to our WIKI
Related issue: (Gitee) #IJJXNG
- Fix the crashing caused by depending on Qt5 D-Bus.
- Translate the API difference in the source between Qt5 and Qt6.
- Develop the new Qt integration.
- Add documentations.
- Add new example project.
If you would like to contribute to this project, you're welcome to fork this repository and open a new pull request.
If you want to request new widgets, please open a new Issue.
This project is licensed under GNU LESSER GENERAL PUBLIC LICENSE Version 3. You may find the license here.
The recommended way to contact us is to fire up a new Issue and describe the problem that you encountered.
This project is a fork of Deepin's DTK2, and the original README is available here.
Thanks to all the third party libraries we used, Best-README-Template, and YOU.
