2012-10-05 7 views
0

내 임베디드 시스템에서 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; 
} 
+0

당신은 유효한 입력 상황에 맞는 플러그인을 가지고 있습니까? 응용 프로그램을 실행할 때이 플러그인은 $ QT_PLUGIN_PATH/inputmethods에서 사용할 수 있어야합니다. –

+0

와우 ... 고마워. 나는 잠시 동안 그것에 붙어 있었다. 아래에 답해 주시면 답변을 upvote하겠습니다. – PhilBot

답변

1

상기 QInputContextFactory 클래스 로딩 입력 문맥 플러그인에 프론트 엔드이다. 존재하지 않거나 제대로 전개되지 않은 경우 입력 컨텍스트 플러그인을로드하는 데 실패합니다. 입력 컨텍스트 플러그인은 일반적으로 $QT_PLUGIN_PATH/inputmethods 아래에 저장됩니다. 따라서 해당 디렉토리 내에 플러그인이없는 경우 QInputContextFactorycreate 메소드는 NULL을 리턴합니다.

참고로 Qt는 플러그인 위치를 사용자 정의하기위한 몇 가지 메커니즘을 제공합니다. 다음은이에 대한 자세한 내용에 대해서는 다음을 참조 :

http://qt-project.org/doc/qt-4.8/deployment-plugins.html