2010-03-17 3 views
1

Qt Script에서 QXmlQuery, QDateTime 등의 비 QObject 기반 클래스에 액세스 할 수있는 좋은 방법이 있습니까?Qt 스크립트에서 비 QObject 기반 개체 액세스

void MyXmlQuery::setQuery (const QString & sourceCode, const QUrl & documentURI) 
{ 
    realxmlquery_.setQuery(sourceCode, documentURI); 
} 

답변

0

이 일을 할 수있는 인터페이스 클래스를 만들 :

내가 볼 수있는 유일한 방법은 QObject를 상속 다른 클래스에 QXmlQuery 포장 및 슬롯으로 내가 Qt는 스크립트에서 액세스해야하는 모든 함수를 선언하는 것입니다.

void MyXmlQuery::setQuery (const QString & sourceCode, const QUrl & documentURI) 
{ 
    this->realxmlquery_->setQuery(sourceCode, documentURI); //realxmlquery is a reference to the Non-qt class! 
}