Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adapt for Qt 6.8 #43

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
deepin-picker (6.0.4) UNRELEASED; urgency=medium

* feat: adapt for Qt 6.8

-- Tian ShiLin <[email protected]> Mon, 20 Jan 2025 13:31:13 +0800

deepin-picker (6.0.3) unstable; urgency=medium

*rmove kwayland-shell
Expand Down
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 @@ -12,9 +12,10 @@
#include <QDebug>
#include <QDBusInterface>
#include <QDBusReply>
#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 @@ -5,13 +5,12 @@
#include <DMainWindow>
#include <DRegionMonitor>

#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.
#include <DWindowManagerHelper>
#include <QDebug>
#include <QPointer>
Expand Down
Loading