In the Qt Creature I have just the ok button and close button selected.
this is all the code in the dialog window.
Code: Select all
// Include base class definition:
include("../nTruss.js");
// Constructor calls base class constructor:
function nTrussOptions(guiAction) {
nTruss.call(this, guiAction);
}
// Derive class nTrussOptions from class nTruss:
nTrussOptions.prototype = new nTruss();
nTrussOptions.includeBasePath = includeBasePath;
nTrussOptions.prototype.beginEvent = function() {
nTruss.prototype.beginEvent.call(this);
// Create the dialog from the .ui file using the helper function WidgetFactory.createWidget().
var dialog = WidgetFactory.createWidget(nTrussOptions.includeBasePath,"nTrussOptions.ui");
// Restore the previous user data or display default values as set in Qt Designer:
WidgetFactory.restoreState(dialog);
// Display and execute the dialog:
if (!dialog.exec()) {
dialog.destroy();
EAction.activateMainWindow();
// User hit cancel:
this.terminate();
return;
}
dialog.destroy();
EAction.activateMainWindow();
this.terminate();
};
//! [beginEvent]
// nTrussOptions.init() is called by QCAD to initialize the action and create
// the menu / toolbar for it.
nTrussOptions.init = function(basePath) {
var action = new RGuiAction("Truss &Options", RMainWindowQt.getMainWindow());
action.setScriptFile(basePath + "/nTrussOptions.js");
action.setIcon(basePath + "/nTrussOptions.svg");
action.setDefaultCommands(["Nailing Pattern Options"]);
action.setGroupSortOrder(50);
action.setSortOrder(1);
action.setWidgetNames(["nTrussMenu"]);
};