Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The debug version has problem: the font weight may be between 0 and 99 #143

Closed
alprist opened this issue Dec 7, 2018 · 1 comment
Closed
Assignees
Labels
bug resolved ui Issues related to profiler_gui

Comments

@alprist
Copy link

alprist commented Dec 7, 2018

When I try to run debug version it has debug error notification about font. This is due to the

common_functions.h

QFont EFont(QFont::StyleHint _hint, const char* _family, int _size, int _weight = -1);

inline QFont EFont(const char* _family, int _size, int _weight = -1) {
    return EFont(QFont::Helvetica, _family, _size, _weight);
}

common_functions.cpp

    QFont EFont(QFont::StyleHint _hint, const char* _family, int _size, int _weight)
    {
        QFont f;
        f.setStyleHint(_hint, QFont::PreferMatch);
        f.setFamily(_family);
        f.setPointSize(_size);
        f.setWeight(_weight);
        return f;
    }

When the font weight is -1, it shouldn't call f.setWeight(_weight); I corrected it in the next way and it started to work:

    QFont EFont(QFont::StyleHint _hint, const char* _family, int _size, int _weight)
    {
        QFont f;
        f.setStyleHint(_hint, QFont::PreferMatch);
        f.setFamily(_family);
        f.setPointSize(_size);
        if (_weight != -1)
        {
            f.setWeight(_weight);
        }
        return f;
    }

Could you please look at the fix and update your sources?

@cas4ey
Copy link
Collaborator

cas4ey commented Jan 9, 2019

@alprist thanks for reporting!

@cas4ey cas4ey self-assigned this Jan 9, 2019
@cas4ey cas4ey added bug resolved ui Issues related to profiler_gui labels Jan 9, 2019
@cas4ey cas4ey closed this as completed Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug resolved ui Issues related to profiler_gui
Projects
None yet
Development

No branches or pull requests

2 participants