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

Method getString

librecad/src/main/doc_plugin_interface.cpp:1385–1404  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1383 return ok;
1384}
1385bool Doc_plugin_interface::getString(QString *txt, const QString& message, const QString& title){
1386 bool ok;
1387 QString msg, tit;
1388 if ( message.isEmpty() )
1389 msg = QObject::tr("enter text");
1390 else
1391 msg = message;
1392 if ( title.isEmpty() )
1393 tit = QObject::tr("LibreCAD query");
1394 else
1395 tit = title;
1396
1397 QString text = QInputDialog::getText(main_window, tit,msg, QLineEdit::Normal,
1398 QString(), &ok);
1399 if (ok && !text.isEmpty()) {
1400 txt->clear();
1401 txt->append(text);
1402 }
1403 return ok;
1404}
1405
1406QString Doc_plugin_interface::realToStr(const qreal num, const int units, const int prec){
1407 RS2::LinearFormat lf;

Callers 2

promptLayerNameComboFunction · 0.45
updateVariablesMethod · 0.45

Calls 3

isEmptyMethod · 0.80
QStringClass · 0.50
clearMethod · 0.45

Tested by

no test coverage detected