mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-03 15:55:27 +08:00
qt 6.5.1 original
This commit is contained in:
@ -0,0 +1,21 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(test_add_binary_resources_delayed_file)
|
||||
|
||||
find_package(Qt6Core REQUIRED)
|
||||
|
||||
qt_add_binary_resources(rcc_file "${CMAKE_CURRENT_BINARY_DIR}/test_add_binary_resources_delayed_file.qrc" "${CMAKE_CURRENT_SOURCE_DIR}/existing.qrc")
|
||||
|
||||
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/test_add_binary_resources_delayed_file.qrc" "<!DOCTYPE RCC><RCC version=\"1.0\">
|
||||
<qresource prefix=\"/\">
|
||||
<file alias=\"resource_file.txt\">${CMAKE_CURRENT_SOURCE_DIR}/resource_file.txt</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
")
|
||||
|
||||
add_executable(test_add_binary_resources_delayed_file main.cpp)
|
||||
target_link_libraries(test_add_binary_resources_delayed_file PRIVATE Qt::Core)
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>resource_file_two.txt</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2015 André Klitzing <aklitzing@gmail.com>
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QFile>
|
||||
#include <QResource>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
if (QResource::registerResource("rcc_file.rcc") &&
|
||||
QFile::exists("://resource_file.txt") && QFile::exists("://resource_file_two.txt"))
|
||||
{
|
||||
QResource::unregisterResource("rcc_file.rcc"); // avoid leaks
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
@ -0,0 +1 @@
|
||||
Ken sent me.
|
@ -0,0 +1 @@
|
||||
Hello World!
|
Reference in New Issue
Block a user