Search found 8 matches

by cjm
Fri Apr 26, 2019 12:35 am
Forum: QCAD 'How Do I' Questions
Topic: [solved] Grab values from text boxes created by a .ui file
Replies: 6
Views: 592

Re: Grab values from text boxes created by a .ui file

Please be sure to also check out the Qt API doc and search through the extensive QCAD sources for examples. You can simply implement slotMyButton for a toolbutton named MyButton . Have a look at the Line2P example. Many thanks for all your help, andrew! I think I now have everything I need to finis...
by cjm
Thu Apr 18, 2019 12:54 am
Forum: QCAD 'How Do I' Questions
Topic: [solved] Grab values from text boxes created by a .ui file
Replies: 6
Views: 592

Re: Grab values from text boxes created by a .ui file

In this case, you're talking about the options toolbar at the top, not a dialog: var optionsToolBar = EAction.getOptionsToolBar(); var lengthEdit = optionsToolBar.findChild("Length"); Excellent! That works perfectly when I append .text to the end of the findChild methods. Thank you very much! How a...
by cjm
Wed Apr 17, 2019 1:49 pm
Forum: QCAD 'How Do I' Questions
Topic: [solved] Grab values from text boxes created by a .ui file
Replies: 6
Views: 592

Re: Grab values from text boxes created by a .ui file

Let's say your dialog widget is called "dialog": var lengthEdit = dialog.findChild("Length"); Using qDebug("User input: " + dialog.findChild("Length")); returns "ReferenceError: Can't find variable: dialog" I am opening the file with this.setUiOptions("file.ui"); if that helps. Edit: Is this assumi...
by cjm
Wed Apr 17, 2019 10:59 am
Forum: QCAD 'How Do I' Questions
Topic: [solved] Grab values from text boxes created by a .ui file
Replies: 6
Views: 592

[solved] Grab values from text boxes created by a .ui file

Say I have a text box widget created by a .ui file: <widget class="RMathLineEdit" name="Length"> <property name="toolTip"> <string>The length</string> </property> <property name="text"> <string notr="true">1000</string> </property> </widget> and a button: <item> <widget class="QToolButton" name="Con...
by cjm
Thu Aug 10, 2017 5:53 pm
Forum: QCAD 'How Do I' Questions
Topic: Variable from command line / user input
Replies: 6
Views: 2616

Re: Variable from command line / user input

Sorry to bother you again with this, I had to take a break from this project for a while but I now have a few days free to dedicate to making this tool work and would appreciate some more help. If the user enters a value in the command line, your action receives a commandEvent: BrickArch.prototype.c...
by cjm
Thu Jun 29, 2017 9:03 pm
Forum: QCAD 'How Do I' Questions
Topic: Variable from command line / user input
Replies: 6
Views: 2616

Re: Variable from command line / user input

Thank you for your advice, andrew! I have done as you suggested and completely rewritten my tool, testing it periodically for errors and making some substantial improvements from the original. There are only 3 things missing now: Receiving the variables from the command line Math formulas that work ...
by cjm
Sun Jun 25, 2017 8:11 pm
Forum: QCAD 'How Do I' Questions
Topic: Variable from command line / user input
Replies: 6
Views: 2616

Re: Variable from command line / user input

Here is the code I have written so far. Its a bit of a mess and I expect a lot of things are probably in the wrong place. Trying to run it in QCAD produces no results and I don't know how to make QCAD print error messages. //! [include] include("scripts/EAction.js"); //! [include] //! [constructor] ...
by cjm
Sun Jun 25, 2017 7:12 pm
Forum: QCAD 'How Do I' Questions
Topic: Variable from command line / user input
Replies: 6
Views: 2616

Variable from command line / user input

QCAD version: 3.17.1 OS: Windows 10 at work and Devuan GNU/Linux at home Hello, QCAD community, I am new here and would hugely appreciate some pointers on my first project. I am working on a tool/script to automatically generate a 2D template for a brick arch (a trapezium consisting of smaller paral...

Go to advanced search