Skip to content

Commit

Permalink
feat: adapt for Qt 6.8
Browse files Browse the repository at this point in the history
Adaptation work based on Qt 6.8, modified relevant
interfaces and configuration files.
  • Loading branch information
JWWTSL committed Dec 27, 2024
1 parent 4cb611a commit b6141c6
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 21 deletions.
13 changes: 8 additions & 5 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ Maintainer: Deepin Packages Builder <[email protected]>
Build-Depends:
debhelper (>= 9),
pkg-config,
qt5-qmake,
qt6-base-dev,
qt6-base-dev-tools,
qt6-base-private-dev,
libxcb-util0-dev,
libdtkgui-dev,
libdtkwidget-dev,
qttools5-dev-tools,
libqt5svg5-dev,
libdtk6gui-dev,
libdtk6widget-dev,
qt6-tools-dev-tools,
qt6-tools-dev,
qt6-svg-dev,
libxtst-dev
Standards-Version: 3.9.8
Homepage: http://www.deepin.org
Expand Down
19 changes: 17 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
#!/usr/bin/make -f

export QT_SELECT=5
# 设置 Qt6 环境
export QT_SELECT=qt6
# 使用系统 PATH 中的 qmake6
export QMAKE=qmake6

include /usr/share/dpkg/default.mk

# 指定使用 qmake 构建系统
export DH_OPTIONS := --buildsystem=qmake

%:
dh $@
dh $@ --buildsystem=qmake

override_dh_auto_configure:
$(QMAKE) \
VERSION=$(VERSION) \
PREFIX=/usr \
LIB_INSTALL_DIR=/usr/lib/$(DEB_HOST_MULTIARCH) \
VERSION_UPSTREAM=$(DEB_VERSION_UPSTREAM) \
DEFINES+="VERSION=$(DEB_VERSION_UPSTREAM)"
57 changes: 44 additions & 13 deletions deepin-picker.pro
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,25 @@
TEMPLATE = app
TARGET = deepin-picker

# 合并 Qt 模块配置
versionAtLeast(QT_VERSION, 6.0.0) {
# Qt6 specific configurations
QT += core widgets gui dbus

PKGCONFIG += dtk6widget dtk6gui xcb xcb-util
QMAKE_LRELEASE = /usr/lib/qt6/bin/lrelease
} else {
# Qt5 specific configurations
QT += core widgets gui dbus
PKGCONFIG += dtkwidget dtkcore dtkgui xcb xcb-util
QMAKE_LRELEASE = lrelease
}

CONFIG += link_pkgconfig
CONFIG += c++11
PKGCONFIG += dtkwidget dtkgui

RESOURCES = deepin-picker.qrc
# xcb xcb-util

# Input
HEADERS += \
src/cpickermanager.h \
Expand All @@ -31,10 +45,11 @@ SOURCES += \
src/utils.cpp \
src/main.cpp

QT += core
QT += widgets
QT += gui
QT += dbus
# 移除不必要的注释
# QT += core
# QT += widgets
# QT += gui
# QT += dbus

QMAKE_CXXFLAGS += -g

Expand Down Expand Up @@ -74,13 +89,29 @@ translations.files = $$TRANSLATIONS_COMPILED
INSTALLS += translations
CONFIG *= update_translations release_translations

CONFIG(update_translations) {
isEmpty(lupdate):lupdate=lupdate
system($$lupdate -no-obsolete -locations none $$_PRO_FILE_)
}
CONFIG(release_translations) {
isEmpty(lrelease):lrelease=lrelease
system($$lrelease $$_PRO_FILE_)
QT6_LUPDATE = /usr/lib/qt6/bin/lupdate
QT6_LRELEASE = /usr/lib/qt6/bin/lrelease
DEFAULT_LUPDATE = lupdate
DEFAULT_LRELEASE = lrelease

versionAtLeast(QT_VERSION, 6.0.0) {
CONFIG(update_translations) {
isEmpty(lupdate):lupdate=$$QT6_LUPDATE
system($$lupdate -no-obsolete -locations none $$_PRO_FILE_)
}
CONFIG(release_translations) {
isEmpty(lrelease):lrelease=$$QT6_LRELEASE
system($$lrelease $$_PRO_FILE_)
}
} else {
CONFIG(update_translations) {
isEmpty(lupdate):lupdate=$$DEFAULT_LUPDATE
system($$lupdate -no-obsolete -locations none $$_PRO_FILE_)
}
CONFIG(release_translations) {
isEmpty(lrelease):lrelease=$$DEFAULT_LRELEASE
system($$lrelease $$_PRO_FILE_)
}
}

DSR_LANG_PATH += $$DSRDIR/translations
Expand Down
1 change: 1 addition & 0 deletions src/cpickermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <QPainterPath>

Check warning on line 15 in src/cpickermanager.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QPainterPath> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QProcessEnvironment>

Check warning on line 16 in src/cpickermanager.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QProcessEnvironment> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QTimer>

Check warning on line 17 in src/cpickermanager.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QTimer> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QFile>

Check warning on line 18 in src/cpickermanager.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QFile> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include "settings.h"
#include "utils.h"
Expand Down
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <QDBusConnection>

Check warning on line 8 in src/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QDBusConnection> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QApplication>

Check warning on line 9 in src/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QApplication> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QScreen>

Check warning on line 10 in src/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QScreen> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QDesktopWidget>
#include <QCommandLineParser>

Check warning on line 11 in src/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QCommandLineParser> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <DWidgetUtil>

Check warning on line 12 in src/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <DWidgetUtil> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QProcess>

Check warning on line 13 in src/main.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QProcess> not found. Please note: Cppcheck does not need standard library headers to get proper results.
Expand Down

0 comments on commit b6141c6

Please sign in to comment.