PDA

View Full Version : QTextCursor and QScriptEngine



roxton
23rd October 2008, 17:39
Hello! I want to make QTextCursor available in QScriptEngine. So I'm trying to compile this code:


QTextCursor tc = textEdit->textCursor();
QScriptValue cr = script_engine.newQObject(&tc);


But the compiler says about the second line:
error: no matching function for call to 'QScriptEngine::newQObject(QTextCursor*)'

What I'm doing wrong?

jacek
31st October 2008, 19:47
QTextCursor is not a QObject. If you are really determined you can wrap it with a custom QObject subclass.