markdowneditor.cpp:527:26: error: use of undeclared identifier 'round'
int verticalOffset = round(QFontMetricsF(font).averageCharWidth() * ...
^
1 error generated.
there are was 2 solution for me:
1: add #include <cmath> , but I don't like it, because function return float or double value, then result will be cast to int
2: replace round() with qRound() , in returns int , no additional header required (already included with almost every Qt header)
used option 2, this is better solution for me
also deleted extra spaces at the end of some lines in edited file :) (my QtCreator configured to do it automatically on save)
fixed build error on OS X:
there are was 2 solution for me: 1: add
#include <cmath>
, but I don't like it, because function returnfloat
ordouble
value, then result will be cast toint
2: replaceround()
withqRound()
, in returnsint
, no additional header required (already included with almost every Qt header)used option 2, this is better solution for me
also deleted extra spaces at the end of some lines in edited file :) (my QtCreator configured to do it automatically on save)