In order to use another class and it's methods you need to know WHAT to use and HOW to do it:
- it's interface ( what you can use ... )
- implementation of each method ( ... and how )
You know the interface of the class by including it's header file. Knowing the implementation is handled by the compiler - you can compile the class with all your project sources, or link against separate library - note that you don't need to include .cpp (implementation) files of the class you want to use.

Suppose you have a class
Qt Code:
  1. // test.h
  2. class Test{
  3. public:
  4. void method();
  5. };
  6. // test.cpp
  7. void Test::method(){
  8. }
To copy to clipboard, switch view to plain text mode 
In order to use it in your sources you need to:
a) include the class definition
Qt Code:
  1. //other_file.cpp
  2. #include "test.h"
  3.  
  4. //...
  5. Test t;
  6. t.method();
To copy to clipboard, switch view to plain text mode 
b) compile the class implementation files (test.cpp) along with your project OR add it to your project as separate library, compiled earlier
Both a) and b) are mandatory, if you don't have a) - then errors like "Test was not declared" appears, if you don't have b) - you may see something like "undefined reference to Test::method()"

Hope it was clear enough.