how to use script

Discussion forum for contributors and developers who are using the QCAD version 3 ECMAScript development platform or the C++ plugin interface or who are otherwise looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

how to use script

Postby josh.wu » Thu Feb 13, 2014 4:14 am

I tired to create new app based on QCad,

Code: Select all
   
   RGuiAction cutAction;
   RGuiAction drawLineAction;

   cutAction.setDefaultShortcut(QKeySequence::Cut);
   cutAction.setScriptFile(QString("scripts/Edit/Cut/Cut.js"));
   cutAction.setIcon(QString("scripts/Edit/Cut/Cut.svg"));
   cutAction.addToMenu(ui.menu_E);

   drawLineAction.setDefaultCommands(QStringList()<<QString("drawline"));
   drawLineAction.setScriptFile(QString("scripts/Draw/Line/Line2P/Line2P.js"));
   drawLineAction.setIcon(QString("scripts/Draw/Line/Line2P/Line2P.svg"));
   drawLineAction.setDocumentInterface(documentInterface);
   drawLineAction.setRequiresDocument(true);
   drawLineAction.setSortOrder(100);
   drawLineAction.addToMenu(ui.menu_E);

then, cutAction is ok, but drawLineAction can not work?
josh.wu
Newbie Member
 
Posts: 5
Joined: Sun Jan 19, 2014 10:03 am

Return to QCAD 3 Developers and Contributors

Who is online

Users browsing this forum: No registered users and 1 guest

cron