Modifying the line

target_link_libraries(lydkontroll Qt5::Widgets)

to

find_package(Qt5Charts)
target_link_libraries(lydkontroll Qt5::Widgets Qt5::Charts)

got rid of the linking error message. I also had to inlude

using namespace QtCharts;

in the .h file. Then it compiles, links and runs OK. Although it works, I am not sure how "using namespace QtCharts" is related to QtCharts. Is it needed because QtCharts is a separate module?