improve add polylines

This commit is contained in:
Sébastien Loriot 2015-11-04 17:51:20 +01:00
parent 7c1ac400e3
commit 209e6deeac
2 changed files with 9 additions and 1 deletions

View File

@ -36,7 +36,7 @@ p, li { white-space: pre-wrap; }
<bool>false</bool>
</property>
<property name="placeholderText">
<string notr="true">New polyline format: A1 A2 A3 B1 B2 B3 C1 C2 C3... </string>
<string notr="true">Polyline format: Ax Ay A3 Bx By Bz ... Zx Zy Zz </string>
</property>
</widget>
</item>

View File

@ -1486,6 +1486,14 @@ void MainWindow::on_addButton_clicked()
int counter = 0;
double coord[3];
bool ok = true;
if (list.isEmpty()) return;
if (list.size()%3!=0){
QMessageBox *msgBox = new QMessageBox;
msgBox->setWindowTitle("Error");
msgBox->setText("ERROR : Input should consists of triplets.");
msgBox->exec();
return;
}
Q_FOREACH(QString s, list)
{
if(!s.isEmpty())