Results 1 to 2 of 2

Thread: QTextCursor and QScriptEngine

  1. #1
    Join Date
    Apr 2008
    Posts
    104
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default QTextCursor and QScriptEngine

    Hello! I want to make QTextCursor available in QScriptEngine. So I'm trying to compile this code:
    Qt Code:
    1. QTextCursor tc = textEdit->textCursor();
    2. QScriptValue cr = script_engine.newQObject(&tc);
    To copy to clipboard, switch view to plain text mode 

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

    What I'm doing wrong?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QTextCursor and QScriptEngine

    QTextCursor is not a QObject. If you are really determined you can wrap it with a custom QObject subclass.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.