Changeset f1fb54b9f7 in tspsg for src/mainwindow.cpp
- Timestamp:
- Jan 7, 2010, 2:24:18 AM (14 years ago)
- Branches:
- 0.1.3.145-beta1-symbian, 0.1.4.170-beta2-bb10, appveyor, imgbot, master, readme
- Children:
- 946f442ab0
- Parents:
- 4ccf855df8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mainwindow.cpp
r4ccf855df8 rf1fb54b9f7 450 450 output.append("<p>" + trUtf8("Resulting path:") + "</p>"); 451 451 output.append("<p> " + solver.getSortedPath() + "</p>"); 452 output.append("<p>" + trUtf8("The price is <b>%n</b> unit(s).", "", step->price) + "</p>"); 452 if (isInteger(step->price)) 453 output.append("<p>" + trUtf8("The price is <b>%n</b> unit(s).", "", step->price) + "</p>"); 454 else 455 output.append("<p>" + trUtf8("The price is <b>%1</b> units.").arg(step->price, 0, 'f', 2) + "</p>"); 453 456 if (!solver.isOptimal()) { 454 457 output.append("<p> </p>"); … … 460 463 solutionText->setDocumentTitle(trUtf8("Solution of Variant #%1 task").arg(spinVariant->value())); 461 464 462 // Scrolling to the end of text. 463 solutionText->moveCursor(QTextCursor::End); 465 if (settings->value("Output/ScrollToEnd", DEF_SCROLL_TO_END).toBool()) { 466 // Scrolling to the end of text. 467 solutionText->moveCursor(QTextCursor::End); 468 } 464 469 465 470 toggleSolutionActions(); … … 655 660 line += "<td align=\"center\">"INFSTR"</td>"; 656 661 else 657 line += "<td align=\"center\">" + QVariant(matrix.at(r).at(c)).toString() + "</td>";662 line += isInteger(matrix.at(r).at(c)) ? QString("<td align=\"center\">%1</td>").arg(matrix.at(r).at(c)) : QString("<td align=\"center\">%1</td>").arg(matrix.at(r).at(c), 0, 'f', 2); 658 663 } 659 664 line += "</tr>"; … … 674 679 line += "<td align=\"center\">"INFSTR"</td>"; 675 680 else if ((r == step.candidate.nRow) && (c == step.candidate.nCol)) 676 line += "<td align=\"center\" class=\"selected\">" + QVariant(step.matrix.at(r).at(c)).toString() + "</td>";681 line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\" class=\"selected\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\" class=\"selected\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2); 677 682 else { 678 683 SCandidate cand; … … 680 685 cand.nCol = c; 681 686 if (step.alts.contains(cand)) 682 line += "<td align=\"center\" class=\"alternate\">" + QVariant(step.matrix.at(r).at(c)).toString() + "</td>";687 line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\" class=\"alternate\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\" class=\"alternate\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2); 683 688 else 684 line += "<td align=\"center\">" + QVariant(step.matrix.at(r).at(c)).toString() + "</td>";689 line += isInteger(step.matrix.at(r).at(c)) ? QString("<td align=\"center\">%1</td>").arg(step.matrix.at(r).at(c)) : QString("<td align=\"center\">%1</td>").arg(step.matrix.at(r).at(c), 0, 'f', 2); 685 690 } 686 691 }
Note: See TracChangeset
for help on using the changeset viewer.