cloose / CuteMarkEd

Qt Markdown Editor
http://cloose.github.io/CuteMarkEd
Other
1.48k stars 319 forks source link

fixed build on OS X #301

Closed Kolcha closed 8 years ago

Kolcha commented 8 years ago

fixed build error on OS X:

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)

cloose commented 8 years ago

Thank you @Kolcha!