Skip to content

Commit

Permalink
修正qmake宏定义不统一,导致无法移动的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
czyt1988 committed Jan 12, 2024
1 parent cb8ae91 commit 07f7f31
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 23 deletions.
11 changes: 0 additions & 11 deletions SARibbonBar.pri
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,6 @@ INCLUDEPATH += $$PWD/src/SARibbonBar
DEPENDPATH += $$PWD/src/SARibbonBar


equals(QT_MAJOR_VERSION, 5){
greaterThan(QT_MINOR_VERSION, 13){
SA_RIBBON_CONFIG += use_frameless
}
}else{
# qt6.0不支持
greaterThan(QT_MINOR_VERSION, 0){
SA_RIBBON_CONFIG += use_frameless
}
}

contains( SA_RIBBON_CONFIG, use_frameless ) {
!contains(CONFIG,C++17){
CONFIG += c++17
Expand Down
14 changes: 14 additions & 0 deletions common.pri
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,17 @@ defineReplace(saRibbonLibNameMake) {
SARIBBON_SRC_DIR = $$PWD/src # 源代码路径
SARIBBONBAR_PRI_FILE_PATH = $$PWD/SARibbonBar.pri # 源代码路径
SARIBBON_LIB_NAME=$$saRibbonLibNameMake(SARibbonBar)

######################################
# Config | 配置
######################################
#SA_RIBBON_CONFIG 用于定义一些编译选项:
# SA_RIBBON_CONFIG+=use_frameless
# 此选项将使用frameless第三方库,这个选项在SARibbonBar.pri中会自动判断,如果,达到frameless的使用要求将会自动定义
# frameless第三方库必须C++17且只有几个版本的qt可用,目前支持(qt5.14,qt5.15,qt6.4以上)
# 除了上诉版本SA_RIBBON_CONFIG中不会加入use_frameless
# frameless库能实现Ubuntu下和mac下的显示,同时多屏幕的支持也较好
# 使用frameless库,需要定义QWindowKit的安装目录,默认在SARIBBON_BIN_DIR
# SA_RIBBON_QWindowKit_Install_DIR = $$SARIBBON_BIN_DIR
######################################
# SA_RIBBON_CONFIG += use_frameless
15 changes: 3 additions & 12 deletions src/SARibbonBar/SARibbonBar.pri
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@
# 2.要预定义FRAMELESSHELPER_CORE_LIBRARY宏,这样才能导出符号
# 3.要预定义FRAMELESSHELPER_WIDGETS_LIBRARY宏,这样才能导出符号

equals(QT_MAJOR_VERSION, 5){
greaterThan(QT_MINOR_VERSION, 13){
SA_RIBBON_CONFIG += use_frameless
}
}else{
# qt6.0不支持
greaterThan(QT_MINOR_VERSION, 0){
SA_RIBBON_CONFIG += use_frameless
}
}

contains( SA_RIBBON_CONFIG, use_frameless ) {
message("use frameless lib,compile with c+=17")
# 引入第三方库frameless后,必须要求c++17
Expand All @@ -30,7 +19,9 @@ contains( SA_RIBBON_CONFIG, use_frameless ) {
DEFINES += SARIBBON_USE_3RDPARTY_FRAMELESSHELPER=1
}else{
message("do not use_frameless lib,compile with c+=11")
CONFIG += c++11
!contains(CONFIG,C++14){
CONFIG += c++14
}
DEFINES += SARIBBON_USE_3RDPARTY_FRAMELESSHELPER=0
}
message("SA_RIBBON_CONFIG="$${SA_RIBBON_CONFIG})
Expand Down

0 comments on commit 07f7f31

Please sign in to comment.