mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: use C++ string functions to format plot data
This may appear a bit ominous, as it doesn't generate a string, but a vector of strings (one for each line). However, that is in preparation for the QtQuickification of the profile, where the text-items take such a list. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
422f693f5b
commit
ae299d5e66
4 changed files with 149 additions and 158 deletions
|
@ -93,7 +93,6 @@ void RulerItem2::settingsChanged(bool value)
|
|||
|
||||
void RulerItem2::recalculate()
|
||||
{
|
||||
char buffer[500];
|
||||
QPointF tmp;
|
||||
QFont font;
|
||||
QFontMetrics fm(font);
|
||||
|
@ -112,8 +111,13 @@ void RulerItem2::recalculate()
|
|||
}
|
||||
QLineF line(startPoint, endPoint);
|
||||
setLine(line);
|
||||
compare_samples(dive, pInfo, source->idx, dest->idx, buffer, 500, 1);
|
||||
text = QString(buffer);
|
||||
|
||||
QString text;
|
||||
for (const std::string &s: compare_samples(dive, pInfo, source->idx, dest->idx, 1)) {
|
||||
if (!text.isEmpty())
|
||||
text += '\n';
|
||||
text += QString::fromStdString(s);
|
||||
}
|
||||
|
||||
// draw text
|
||||
QGraphicsView *view = scene()->views().first();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue