이 페이지에서

QGenericPlugin Class

QGenericPlugin 클래스는 플러그인을 위한 추상 기본 클래스입니다. 더 보기...

헤더: #include <QGenericPlugin>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
상속: QObject

공개 함수

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 ` 매개변수로 지정된 유형에 맞는 드라이버를 생성하십시오. 키는 대소문자를 구분하지 않는다는 점에 유의하십시오.

© 2026 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.