Qt what headers to include?

前端 未结 4 1428
我在风中等你
我在风中等你 2021-02-20 11:42

While programming in C++ with Qt what includes should I make? Just 2 includes

#include 
#include 

or



        
4条回答
  •  生来不讨喜
    2021-02-20 11:56

    If you don't want to bother including each individual class then include entire components:

    #include 
    #include 
    

    And any other QT component you need to use

    #include 
    

    etc.

    If you want to explicitly specify your dependencies then include every individual class

    #include 
    #include 
    #include 
    #include 
    

    and other QT classes you are using.

提交回复
热议问题