QGenericPlugin Class
QGenericPlugin 클래스는 플러그인을 위한 추상 베이스 클래스입니다. 더 보기...
헤더: | #include <QGenericPlugin> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
qmake: | QT += gui |
상속합니다: | QObject |
- 상속된 멤버를 포함한 모든 멤버 목록
- QGenericPlugin은 플러그인 클래스의 일부입니다.
공용 함수
QGenericPlugin(QObject *parent = nullptr) | |
virtual | ~QGenericPlugin() |
virtual QObject * | create(const QString &key, const QString &specification) = 0 |
자세한 설명
마우스 플러그인은 QGenericPlugin을 서브클래싱하고 순수 가상 create() 함수를 다시 구현하여 만들 수 있습니다. Q_PLUGIN_METADATA () 매크로를 사용하여 파생 클래스를 내보내면 QGenericPluginFactory 클래스의 기본 구현이 자동으로 플러그인을 감지하고 런타임에 서버 애플리케이션에 드라이버를 로드합니다. 자세한 내용은 Qt 플러그인 생성 방법을 참조하세요.
json 메타데이터 파일에는 이 플러그인에서 지원하는 키 목록이 포함되어야 합니다.
QGenericPluginFactory 를참조하세요 .
멤버 함수 문서
[explicit]
QGenericPlugin::QGenericPlugin(QObject *parent = nullptr)
주어진 parent 으로 플러그인을 생성합니다.
이 생성자는 플러그인을 내보내는 moc 생성 코드에 의해 자동으로 호출되므로 명시적으로 호출할 필요가 없습니다.
[virtual noexcept]
QGenericPlugin::~QGenericPlugin()
플러그인을 소멸시킵니다.
Qt는 플러그인을 더 이상 사용하지 않을 때 자동으로 소멸시키므로 소멸자를 명시적으로 호출할 필요가 없습니다.
[pure virtual]
QObject *QGenericPlugin::create(const QString &key, const QString &specification)
이 함수를 구현하여 주어진 key 및 specification 매개 변수에 지정된 유형과 일치하는 드라이버를 생성합니다. 키는 대소문자를 구분하지 않습니다.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.