Exception
Posted: Wed Dec 04, 2013 6:09 pm
Hello,
I'm coding my first trials with qcad scripting, but I'm encountering problems. I hope somebody can point me in the right direction.
I'm using qcad-pro with a MacOS 1.7.5.
As first trial I have added to the tutorial Menus and Tool Bars a new item called TestDialog.
TestDialog should simply display a dialog made with QtDesigner ( very simple dialog, few buttons and some labels).
MyAction command works fine, while my new command TestDialog, dies silently.
Starting qcad with the -enable-script-debugger I can se that I'm getting an exception :
Following my TestDialog.js source code ... that's a lazy copy of PersistentWidgets without persistence.
Thanks in advance.
Kind Regards
sramp
I'm coding my first trials with qcad scripting, but I'm encountering problems. I hope somebody can point me in the right direction.
I'm using qcad-pro with a MacOS 1.7.5.
As first trial I have added to the tutorial Menus and Tool Bars a new item called TestDialog.
TestDialog should simply display a dialog made with QtDesigner ( very simple dialog, few buttons and some labels).
MyAction command works fine, while my new command TestDialog, dies silently.
Starting qcad with the -enable-script-debugger I can se that I'm getting an exception :
Code: Select all
Uncaught exception at scripts/TestQCAD/TestDialog/TestDialog.js:8: RangeError: Maximum call stack size exceeded.
8 TestDialog.prototype.beginEvent.call(this);
include("../WidgetFactory.js"); include("../TestQCAD.js"); function TestDialog(guiAction) { TestQCAD.call(this, guiAction); } TestDialog.prototype = new TestQCAD(); TestDialog.prototype.beginEvent = function() { TestDialog.prototype.beginEvent.call(this); // Create the dialog from the .ui file using the helper // function WidgetFactory.createWidget(). var dialog = WidgetFactory.createWidget("../TestQCAD/TestDialog","TestDialog.ui"); // Display and execute the dialog: if (!dialog.exec()) { // User hit cancel: this.terminate(); return; } this.terminate(); }; TestDialog.init = function(basePath) { var action = new RGuiAction(qsTr("&Test Dialog"), RMainWindowQt.getMainWindow()); action.setRequiresDocument(true); action.setScriptFile(basePath + "/TestDialog.js"); action.setSortOrder(10); EAction.addGuiActionTo(action, TestQCAD, true, false, false); };BTW I've tried to run the PersistentWidgets starting qcad enabling xdata, but I get another exception :
Code: Select all
Uncaught exception at /Applications/QCAD-Pro.app/Contents/Resources/scripts/WidgetFactory.js:371: TypeError: Result of expression 'widget' [undefined] is not an object.
371 };
Kind Regards
sramp