Qt Why Use .h And .cpp Rather Than .hpp? - Qt Forum
- Home
- Qt Development
- General and Desktop
- Qt why use .h and .cpp rather than .hpp?
- Oldest to Newest
- Newest to Oldest
- Most Votes
- Reply as topic
-
L Offline
L Offline Limer wrote on last edited by #1 Today I came across this post https://stackoverflow.com/questions/152555/h-or-hpp-for-your-class-definitions , Qt is a C++ framework, and I saw all of them are *.h and *.cpp in source code. So, is there any other reasons not to use *.hpp?
A 1 Reply Last reply 0 -
L Limer Today I came across this post https://stackoverflow.com/questions/152555/h-or-hpp-for-your-class-definitions , Qt is a C++ framework, and I saw all of them are *.h and *.cpp in source code. So, is there any other reasons not to use *.hpp?
A Offline
A Offline aha_1980 Lifetime Qt Champion wrote on last edited by #2 @Limer
I think this question can be answered like most similar questions: Historic reasons.
Also note that all the official includes, like #include <QString> , have no extension at all.
Qt has to stay free or it will die.
1 Reply Last reply 6 -
V Offline
V Offline VRonin wrote on last edited by #3
Header files are not compiled so it doesn't really matter, it's the content of the .cpp file that includes them to determine if they are considered C or C++. It's pure flavour. I normally use .hpp if the header contains definitions (like is the case with templates) and .h if it just contains declarations. The idea is to have some kind of a warning that if you include .hpp in multiple .cpp you are potentially compiling the same code twice. Once again it's just an opinion, you are free to call them as you prefer
"La mort n'est rien, mais vivre vaincu et sans gloire, c'est mourir tous les jours" ~Napoleon Bonaparte
On a crusade to banish setIndexWidget() from the holy land of Qt
1 Reply Last reply 6 -
L Offline
L Offline Limer wrote on last edited by #4 Thanks a lot for your warm response. I see..
1 Reply Last reply 0
- First post Last post Go to my next post
- Categories
- Recent
- Tags
- Popular
- Users
- Groups
- Search
- Get Qt Extensions
- Unsolved
Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.
Từ khóa » .h .cpp .hpp
-
H Or *.hpp For Your Class Definitions - C++ - Stack Overflow
-
Why .h Is More Widely Used Than .hpp For C++ Header Files - Reddit
-
Thoughts On Header File Extensions: .h Vs .hpp - Embedded Artistry
-
HPP – The C++ Header File - Online Converter
-
HPP File Extension - What Is .hpp And How To Open? - ReviverSoft
-
Header Files (C++) - Microsoft Docs
-
Why Don't C++ Standard Headers' Names End With '.h' Or '.hpp'? - Quora
-
C++ Header File (*.h, *.hpp) - RAD Studio - Embarcadero DocWiki
-
Header File Extension .h Or .hpp - C++ Forum
-
What Is The Difference Between .h And .HPP Files? - AnswersToAll
-
C++ – .c Vs .cc Vs. .cpp Vs .hpp Vs .h Vs .cxx - ITecNote
-
[DEBT] Rename .h|.hpp|.cuh|.cu|.cpp Files Properly In Our Cuml C++ ...
-
Interface (.hpp) Versus Implementation (.cpp) Files (and Why They Exist)