MCPcopy Create free account
hub / github.com/LibreCAD/LibreCAD / execComm

Method execComm

plugins/list/list.cpp:34–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34void LC_List::execComm(Document_Interface *doc,
35 QWidget *parent, QString cmd)
36{
37 Q_UNUSED(parent);
38 Q_UNUSED(cmd);
39 d = doc;
40 QList<Plug_Entity *> obj;
41 bool yes = doc->getSelect(&obj);
42 if (!yes || obj.isEmpty()) return;
43
44 QString text;
45 for (int i = 0; i < obj.size(); ++i) {
46 text.append( QString("%1 %2: ").arg(tr("n")).arg(i+1));
47 text.append( getStrData(obj.at(i)));
48 text.append( "\n");
49 }
50 lc_Listdlg dlg(parent);
51 dlg.setText(text);
52 dlg.exec();
53
54 while (!obj.isEmpty())
55 delete obj.takeFirst();
56}
57
58QString LC_List::getStrData(Plug_Entity *ent) {
59 if( NULL == ent)

Callers 1

execPlugMethod · 0.45

Calls 6

getSelectMethod · 0.80
isEmptyMethod · 0.80
QStringClass · 0.50
sizeMethod · 0.45
atMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected