Added compatibility with Qt >=5 in utils.cpp