[SOLVED] Compiling error : 'QTextEdit' Does not name a type
-
Hello, I am working on a small project using Qt 5.3.1. I have included <QtWidgets> at the beginning , but while the declaration of a QTextEdit variable this error occurs : ' 'QTextEdit' does not name a type.'
I also tried to replace #include<QtWidgets> with #include<QTextEdit> but this didn't solve the problem.
Can anybody help me?
-
Can you show the code where it happens ?
-
How was it solved ?
Since it's working, please update the thread title prepending [solved] so other forum users may know a solution has been found :)
-
Ok SGaist I made a some modifications the header files ( I have two header files in total):
-
In the first header file,
I replaced #include<QtGui> with :
#include<QDialog>
#include<QTextEdit>
#include<QPushButton>
#include<QVBoxLayout> -
In the second header file, I replaced #include<QtGui> with #include<QtWidgets>
that's all :)
But how can I update the thread title to [solved] ?
-
-
While it is fine for test code, you should not use module wide includes, it pulls in every class from the module and one side effect is that it slows down compilation time.
To edit the thread title, just edit your original post and there you can change the title :)
-
You're welcome
- Deploy on your computer
- Start Menu -> Qt Version -> Command Prompt (something similar)
- Start Menu -> Qt Version -> Linguist (again something similar)