提问人:黄滨滨 提问时间:11/3/2023 更新时间:11/3/2023 访问量:8
Q_INTERFACE不能使用根命名空间前缀的类
Q_INTERFACE can't work with a class using root namespace prefix
问:
#ifndef PRISMQT_CORE_H
#define PRISMQT_CORE_H
#include "include/prism/qt/core/prismQt_core_global.h"
#include <prism/qt/modular/interfaces/intf_module.h>
#include <QObject>
namespace prism::qt::core{
class PRISMQT_CORE_EXPORT prismQt_core : public ::prism::qt::modular::intfModule
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "prism::qt::modular::intfModule/1.0" FILE "prismQt_core.json")
Q_INTERFACES(::prism::qt::modular::intfModule)
public:
prismQt_core();
// intfModule interface
public:
bool register_types() override;
bool init() override;
bool install() override;
bool uninstall() override;
bool uninit() override;
};
}// namespace prism::qt::core
#endif // PRISMQT_CORE_H
有错误信息:
1>D:/Users/user/Documents/source/repos/dv_app_solution/prism/components/prism_qt_core/src/prismQt_core.h(14):解析错误位于“(”)
我试过了,这仍然是错误的;using ::prism::qt::modular::intfModule
我想知道什么是最佳实践,嵌套命名空间可以工作qt Q_interface
答: 暂无答案
评论