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:
26
examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
Normal file
26
examples/widgets/tools/echoplugin/plugin/CMakeLists.txt
Normal file
@ -0,0 +1,26 @@
|
||||
# Copyright (C) 2022 The Qt Company Ltd.
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
qt_add_plugin(echoplugin
|
||||
CLASS_NAME EchoPlugin
|
||||
echoplugin.cpp echoplugin.h
|
||||
)
|
||||
|
||||
set_target_properties(echoplugin PROPERTIES
|
||||
LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/echowindow"
|
||||
)
|
||||
|
||||
target_include_directories(echoplugin PRIVATE
|
||||
../echowindow
|
||||
)
|
||||
|
||||
target_link_libraries(echoplugin PRIVATE
|
||||
Qt6::Core
|
||||
Qt6::Gui
|
||||
Qt6::Widgets
|
||||
)
|
||||
|
||||
install(TARGETS echoplugin
|
||||
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
|
||||
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
|
||||
)
|
11
examples/widgets/tools/echoplugin/plugin/echoplugin.cpp
Normal file
11
examples/widgets/tools/echoplugin/plugin/echoplugin.cpp
Normal file
@ -0,0 +1,11 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
#include "echoplugin.h"
|
||||
|
||||
//! [0]
|
||||
QString EchoPlugin::echo(const QString &message)
|
||||
{
|
||||
return message;
|
||||
}
|
||||
//! [0]
|
23
examples/widgets/tools/echoplugin/plugin/echoplugin.h
Normal file
23
examples/widgets/tools/echoplugin/plugin/echoplugin.h
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2016 The Qt Company Ltd.
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
||||
|
||||
#ifndef ECHOPLUGIN_H
|
||||
#define ECHOPLUGIN_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtPlugin>
|
||||
#include "echointerface.h"
|
||||
|
||||
//! [0]
|
||||
class EchoPlugin : public QObject, EchoInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.Examples.EchoInterface" FILE "echoplugin.json")
|
||||
Q_INTERFACES(EchoInterface)
|
||||
|
||||
public:
|
||||
QString echo(const QString &message) override;
|
||||
};
|
||||
//! [0]
|
||||
|
||||
#endif
|
1
examples/widgets/tools/echoplugin/plugin/echoplugin.json
Normal file
1
examples/widgets/tools/echoplugin/plugin/echoplugin.json
Normal file
@ -0,0 +1 @@
|
||||
{}
|
18
examples/widgets/tools/echoplugin/plugin/plugin.pro
Normal file
18
examples/widgets/tools/echoplugin/plugin/plugin.pro
Normal file
@ -0,0 +1,18 @@
|
||||
#! [0]
|
||||
TEMPLATE = lib
|
||||
CONFIG += plugin
|
||||
QT += widgets
|
||||
INCLUDEPATH += ../echowindow
|
||||
HEADERS = echoplugin.h
|
||||
SOURCES = echoplugin.cpp
|
||||
TARGET = $$qtLibraryTarget(echoplugin)
|
||||
DESTDIR = ../plugins
|
||||
#! [0]
|
||||
|
||||
EXAMPLE_FILES = echoplugin.json
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/tools/echoplugin/plugins
|
||||
INSTALLS += target
|
||||
|
||||
CONFIG += install_ok # Do not cargo-cult this!
|
Reference in New Issue
Block a user