Skip to content

About

对DTK2 Widget的Qt6移植

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

159 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static Badge Static Badge Static Badge Static Badge


DTK2Widget-Qt6

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
  1. About This Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Original README
  9. Acknowledgements

About This Project

Scrrenshot of Containers, using this library

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.

(Back to top)

Dependencies

  • For building the .deb package:
    • 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:

(Back to top)

Getting Started

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 Dependencies

  1. Installing the packaging tools:

    sudo apt update
    sudo apt install build-essential devscripts debhelper pkg-config git
  2. 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-dev

    Note: After entering the project directory, you may use sudo apt build-dep . to let apt get and install all depencies according to debian/control.

Compiling From Source

If you only want the library but not the deb package, then do the following:

  1. Clone this repository:

    git clone https://gitee.com/GXDE-OS/dtk2widget-qt6.git
    cd dtk2widget-qt6
  2. Use qmake6 to configre the project:

    mkdir build-qt6
    cd build-qt6
    qmake6 ../dtkwidget.pro PREFIX=/usr LIB_INSTALL_DIR=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)
  3. Compile project:

    make -j$(nproc)
  4. Install to system (Optional, this will be write to path under /usr):

    sudo make install

Building With CMake

sudo apt install cmake ninja-build
cmake -B build-cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build-cmake
sudo cmake --install build-cmake

Available options:

  • -DBUILD_EXAMPLES=OFF: Skip the examples.
  • -DBUILD_TOOLS=OFF: Skip dtk-svgc.
  • -DDTK_NO_TRANSLATION=ON
  • -DDTK_STATIC_TRANSLATION=ON
  • -DDTK_STATIC_LIB=ON.

Dialog Transparency

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).

Packaging

This would be recommended if you are using debian-based distros.

sudo apt install cmake fakeroot
chmod a+x ./build-deb
./build-deb -d

You may run./build-deb -c to execute a cleanup.

The .deb artifact may be found in the parent directory of project root.

(Back to top)

Usage

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

(Back to top)

Roadmap

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.

(Back to top)

Contributing

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.

Contributors of This Project

(Back to top)

License

This project is licensed under GNU LESSER GENERAL PUBLIC LICENSE Version 3. You may find the license here.

(Back to top)

Contact

The recommended way to contact us is to fire up a new Issue and describe the problem that you encountered.

(Back to top)

Original README

This project is a fork of Deepin's DTK2, and the original README is available here.

(Back to Top)

Acknowledgements

Thanks to all the third party libraries we used, Best-README-Template, and YOU.

(Back to top)

About

对DTK2 Widget的Qt6移植

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages