Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt Creator: “XYZ does not name a type”

Tags:

c++

qt

qt-creator

This is a very frustrating error message in Qt Creator: ’XYZ’ does not name a type. This usually means that there is an error in the class XYZ that prevents the compiler from generating the type, but there are no additional hints as to what went wrong.

Any suggestions?

like image 295
Tony the Pony Avatar asked Sep 14 '09 13:09

Tony the Pony


1 Answers

I found this problem on qtcreator 3.4.1 and QT 5.4, when I replace such as

#include <QTextEdit>

with

class QTextEdit;

this problem gone.

like image 88
changfeng Avatar answered Oct 03 '22 15:10

changfeng