queryEntity
Posted: Thu Jan 23, 2014 5:17 pm
Hello,
I'm encountering a problem when I try to get an entity from the document.
I wrote this code to debug the problem, but QCAD-Pro crashes when I execute the queryEntity.
I have checked step by step with the debugger and I have seen that document is not null.
this.theEntityId is the id of a line obtained with getId() method.
Please, anybody can suggest me where I'm wrong?
Here the diagnostic report
Thank you
sramp
I'm encountering a problem when I try to get an entity from the document.
I wrote this code to debug the problem, but QCAD-Pro crashes when I execute the queryEntity.
I have checked step by step with the debugger and I have seen that document is not null.
this.theEntityId is the id of a line obtained with getId() method.
Please, anybody can suggest me where I'm wrong?
Code: Select all
Entry.prototype.evidenzia = function () {
qDebug("entity length = " + this.theEntityId);
var document = this.getDocument();
var entity = document.queryEntity(this.theEntityId);
qDebug("entity length = " + entity.getId());
}
Code: Select all
Process: QCAD-Pro [1857]
Path: /Applications/QCAD-Pro.app/Contents/MacOS/QCAD-Pro
Identifier: org.qcad
Version: 3.4 (3.4.5)
Code Type: X86 (Native)
Parent Process: launchd [211]
Date/Time: 2014-01-23 16:53:38.772 +0100
OS Version: Mac OS X 10.7.5 (11G63)
Report Version: 9
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x000000005d1621e4
VM Regions Near 0x5d1621e4:
MALLOC_LARGE (freed) 0000000018700000-0000000018c55000 [ 5460K] rw-/rwx SM=PRV
-->
__TEXT 000000008fe9f000-000000008fed2000 [ 204K] r-x/rwx SM=COW /usr/lib/dyld
Application Specific Information:
objc[1857]: garbage collection is OFF
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libqcadcore.dylib 0x01286520 RDocument::queryEntity(int) const + 16
1 libqcadecmaapi.dylib 0x0021045c REcmaDocument::queryEntity(QScriptContext*, QScriptEngine*) + 492
2 QtScript 0x03112fd8 QScriptable::QScriptable() + 3256
3 QtScript 0x0302acc1 0x2f59000 + 859329
sramp