autouic: normal header file name startwith ui_* failed
Unsolved
General and Desktop
-
one of my libraries generates a ui_global.h file which contains global
settings for the UI, with autouic enabled this would trigger the inference and subsequently fail on global.ui not actually existing.the following example, ui_global.h is included in LiveBoard.h (LiveBoard is a class based on QMainWindow and has a
.ui
file) and the following error occurredAutoUic error ------------- "SRC:/monitor/ui/LiveBoard.h" includes the uic file "ui_global.h", but the user interface file "global.ui" could not be found in the following directories "SRC:/monitor/ui"
and
set_property(SOURCE ui_global.h PROPERTY SKIP_AUTOUIC ON)
cannot figure this out.
part of my
CMakeLists.txt
cmake_minimum_required(VERSION 3.14) set(PROJ_NAME live_ui) project(${PROJ_NAME} LANGUAGES CXX DESCRIPTION "UI") set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_AUTOUIC ON) set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) find_package(QT NAMES Qt5 REQUIRED COMPONENTS Widgets PrintSupport) find_package(Qt5 REQUIRED COMPONENTS Widgets PrintSupport) include_directories(./) file(GLOB_RECURSE SOURCE_FILES *.cpp *.h *.ui *.qrc) add_library(${PROJ_NAME} SHARED ${SOURCE_FILES}) set_property(SOURCE ui_global.h PROPERTY SKIP_AUTOUIC ON)
If I changed the name of
ui_global.h
togui_global.h
, it works.Anyone can help? Thanks.