use qt_ui_wrap instead of AUTOUIC

This commit is contained in:
Martin Rotter 2022-02-01 11:02:33 +01:00
parent a01ae48964
commit 8f854b3e77
4 changed files with 60 additions and 3 deletions

View File

@ -74,7 +74,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOUIC OFF)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(NOT CMAKE_BUILD_TYPE)
@ -151,6 +151,10 @@ else()
if(Qt5Core_VERSION VERSION_LESS 5.15.0)
# Compatibility macros.
macro(qt_wrap_ui)
qt5_wrap_ui(${ARGN})
endmacro()
macro(qt_add_resources)
qt5_add_resources(${ARGN})
endmacro()

View File

@ -405,6 +405,52 @@ if(APPLE)
)
endif()
set(UI_FILES
gui/dialogs/formabout.ui
gui/dialogs/formaddaccount.ui
gui/dialogs/formaddeditlabel.ui
gui/dialogs/formbackupdatabasesettings.ui
gui/dialogs/formdatabasecleanup.ui
gui/dialogs/formmain.ui
gui/dialogs/formmessagefiltersmanager.ui
gui/dialogs/formrestoredatabasesettings.ui
gui/dialogs/formsettings.ui
gui/dialogs/formupdate.ui
gui/notifications/notificationseditor.ui
gui/notifications/singlenotificationeditor.ui
gui/reusable/networkproxydetails.ui
gui/newspaperpreviewer.ui
gui/reusable/searchtextwidget.ui
gui/settings/settingsbrowsermail.ui
gui/settings/settingsdatabase.ui
gui/settings/settingsdownloads.ui
gui/settings/settingsfeedsmessages.ui
gui/settings/settingsgeneral.ui
gui/settings/settingsgui.ui
gui/settings/settingslocalization.ui
gui/settings/settingsnotifications.ui
gui/settings/settingsnodejs.ui
gui/settings/settingsshortcuts.ui
gui/toolbars/toolbareditor.ui
network-web/downloaditem.ui
network-web/downloadmanager.ui
services/abstract/gui/authenticationdetails.ui
services/abstract/gui/formaccountdetails.ui
services/abstract/gui/formcategorydetails.ui
services/abstract/gui/formfeeddetails.ui
services/feedly/gui/feedlyaccountdetails.ui
services/gmail/gui/formaddeditemail.ui
services/gmail/gui/formdownloadattachment.ui
services/gmail/gui/gmailaccountdetails.ui
services/greader/gui/greaderaccountdetails.ui
services/owncloud/gui/owncloudaccountdetails.ui
services/reddit/gui/redditaccountdetails.ui
services/standard/gui/formstandardimportexport.ui
services/standard/gui/standardfeeddetails.ui
services/tt-rss/gui/formttrssnote.ui
services/tt-rss/gui/ttrssaccountdetails.ui
services/tt-rss/gui/ttrssfeeddetails.ui)
if(USE_WEBENGINE)
list(APPEND SOURCES
# WebEngine-based web (and message) browser.
@ -436,6 +482,9 @@ if(USE_WEBENGINE)
network-web/networkurlinterceptor.h
network-web/urlinterceptor.h
)
list(APPEND UI_FILES
network-web/adblock/adblockdialog.ui)
else()
list(APPEND SOURCES
# Lite non-WebEngine message browser.
@ -446,6 +495,10 @@ else()
)
endif()
# Deal with .ui files.
qt_wrap_ui(SOURCES ${UI_FILES})
# Bundle resources.
qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/sql.qrc)
qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/rssguard.qrc)
@ -453,6 +506,7 @@ if(APPLE OR WIN32 OR OS2)
qt_add_resources(SOURCES ${CMAKE_SOURCE_DIR}/resources/icons.qrc)
endif()
# Bundle version info.
if(WIN32)
enable_language("RC")
list(APPEND SOURCES "${CMAKE_BINARY_DIR}/rssguard.rc")

View File

@ -52,7 +52,6 @@ FeedMessageViewer::FeedMessageViewer(QWidget* parent) : TabContent(parent), m_to
m_messagesBrowser(new MessagePreviewer(false, this)) {
initialize();
initializeViews();
createConnections();
}

View File

@ -10,7 +10,7 @@ target_compile_definitions(app PRIVATE RSSGUARD_DLLSPEC=Q_DECL_IMPORT)
set_target_properties(app PROPERTIES OUTPUT_NAME ${CMAKE_PROJECT_NAME})
target_include_directories(app PUBLIC
${CMAKE_BINARY_DIR}/src/librssguard/rssguard_autogen/include
${CMAKE_BINARY_DIR}/src/librssguard
)
target_link_libraries(app PUBLIC