From 07f7f3102a2ffbac51e0ca40a538365d9bfd9fb9 Mon Sep 17 00:00:00 2001 From: czyt1988 Date: Sat, 13 Jan 2024 00:16:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3qmake=E5=AE=8F=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E4=B8=8D=E7=BB=9F=E4=B8=80=EF=BC=8C=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E7=A7=BB=E5=8A=A8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SARibbonBar.pri | 11 ----------- common.pri | 14 ++++++++++++++ src/SARibbonBar/SARibbonBar.pri | 15 +++------------ 3 files changed, 17 insertions(+), 23 deletions(-) diff --git a/SARibbonBar.pri b/SARibbonBar.pri index f8ca72b7..523d1d01 100644 --- a/SARibbonBar.pri +++ b/SARibbonBar.pri @@ -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 diff --git a/common.pri b/common.pri index 8ebd57fd..81c03385 100644 --- a/common.pri +++ b/common.pri @@ -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 diff --git a/src/SARibbonBar/SARibbonBar.pri b/src/SARibbonBar/SARibbonBar.pri index 844a6332..29ce0e9f 100644 --- a/src/SARibbonBar/SARibbonBar.pri +++ b/src/SARibbonBar/SARibbonBar.pri @@ -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 @@ -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})