Corelib snippets: make widgets optional
Amends f5115a913738aef2ee37b880c2e7275f1045b8ae. Fixes: QTBUG-135397 Change-Id: Ic36e462779bf32429dba85aa50d4a0955993d990 Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
This commit is contained in:
parent
095e6fd084
commit
efe41182fd
@ -8,9 +8,14 @@ add_library(corelib_snippets OBJECT
|
|||||||
target_link_libraries(corelib_snippets PRIVATE
|
target_link_libraries(corelib_snippets PRIVATE
|
||||||
Qt::Core
|
Qt::Core
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::Widgets
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (TARGET Qt::Widgets)
|
||||||
|
target_link_libraries(corelib_snippets PRIVATE
|
||||||
|
Qt::Widgets
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if ("${CMAKE_CXX_COMPILE_FEATURES}" MATCHES "cxx_std_23")
|
if ("${CMAKE_CXX_COMPILE_FEATURES}" MATCHES "cxx_std_23")
|
||||||
set_property(TARGET corelib_snippets PROPERTY CXX_STANDARD 23)
|
set_property(TARGET corelib_snippets PROPERTY CXX_STANDARD 23)
|
||||||
endif()
|
endif()
|
||||||
|
@ -2,6 +2,9 @@
|
|||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||||
|
|
||||||
#include <QtCore/qgenericitemmodel.h>
|
#include <QtCore/qgenericitemmodel.h>
|
||||||
|
|
||||||
|
#ifndef QT_NO_WIDGETS
|
||||||
|
|
||||||
#include <QtWidgets/qlistview.h>
|
#include <QtWidgets/qlistview.h>
|
||||||
#include <QtWidgets/qtableview.h>
|
#include <QtWidgets/qtableview.h>
|
||||||
#include <QtWidgets/qtreeview.h>
|
#include <QtWidgets/qtreeview.h>
|
||||||
@ -203,3 +206,5 @@ list.setModel(&colorModel);
|
|||||||
//! [color_gadget_1]
|
//! [color_gadget_1]
|
||||||
}
|
}
|
||||||
} // namespace multirole_gadget
|
} // namespace multirole_gadget
|
||||||
|
|
||||||
|
#endif // QT_NO_WIDGETS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user