내 임베디드 시스템에서 X11, Mac, Win, S60 등이 없습니다. QInputContextFactory 클래스의 create 메서드에서 NULL 포인터 (NULL)가 계속 반환됩니다. QT_NO_LIBRARY가 정의되지 않았 음을 확인했습니다.QtInputContextFactory가 포함 된 대상에서 NULL을 반환합니다.
내 데스크톱에서 Qt 빌드이 작업은 정상적으로 작동합니다.
또한 사용자 지정 키와 부모가 메서드에 전달되었음을 확인했습니다.
이 문제의 원인은 무엇입니까? ->
if (QInputContextFactoryInterface *factory =
qobject_cast<QInputContextFactoryInterface*>(loader()->instance(key))) {
result = factory->create(key);
}
여기서 전체 방법 : Qt는 내
QInputContext *QInputContextFactory::create(const QString& key, QObject *parent)
{
QInputContext *result = 0;
#if defined(Q_WS_X11) && !defined(QT_NO_XIM)
if (key == QLatin1String("xim")) {
result = new QXIMInputContext;
}
#endif
#if defined(Q_WS_WIN)
if (key == QLatin1String("win")) {
result = new QWinInputContext;
}
#endif
#if defined(Q_WS_MAC)
if (key == QLatin1String("mac")) {
result = new QMacInputContext;
}
#endif
#if defined(Q_WS_S60)
if (key == QLatin1String("coefep")) {
result = new QCoeFepInputContext;
}
#endif
#ifdef QT_NO_LIBRARY
Q_UNUSED(key);
#else
qDebug() << "Here we are";
if (QInputContextFactoryInterface *factory =
qobject_cast<QInputContextFactoryInterface*>(loader()->instance(key))) {
result = factory->create(key);
}
#endif
if (result)
result->setParent(parent);
return result;
}
당신은 유효한 입력 상황에 맞는 플러그인을 가지고 있습니까? 응용 프로그램을 실행할 때이 플러그인은 $ QT_PLUGIN_PATH/inputmethods에서 사용할 수 있어야합니다. –
와우 ... 고마워. 나는 잠시 동안 그것에 붙어 있었다. 아래에 답해 주시면 답변을 upvote하겠습니다. – PhilBot