I have been studying the SDI/MDI example in my Qt4 and in my book Foundations of Qt development. I have two questions. I tried to provide enough details. If I wrote to much I apologize.

1.

In the Qt4 example there is a line of code

Qt Code:
  1. newAct->setShortcuts(QKeySequence::New);
To copy to clipboard, switch view to plain text mode 

The line with same functionality in the book is

Qt Code:
  1. newAction->setShortcut( tr("Ctrl+N") );
To copy to clipboard, switch view to plain text mode 

I have read the help provided with the Qt there is a whole table of values for enum QKeySequence::StandardKey. As far as I have managed to conclude the first version
Qt Code:
  1. QKeySequence::QKeySequence ( StandardKey key )
To copy to clipboard, switch view to plain text mode 
is platform dependent. It doesn't say, as far as I can see if second version
Qt Code:
To copy to clipboard, switch view to plain text mode 
is platform dependent.

Is there any real difference between these to versions and if there are some what are they?

2.

There was a thread about this but it didn't clarify it for me at all.

If I have type class B for instance and I want to use it as a member in my type class A. Code that I would use would look something like this.

class_B.h
Qt Code:
  1. #ifndef CLASS_B_H
  2. #define CLASS_B_H
  3.  
  4. class B
  5. {
  6. //some code
  7. }
  8.  
  9. #endif
To copy to clipboard, switch view to plain text mode 

class_B.cpp
Qt Code:
  1. #include "class_B.h"
  2. //some code
To copy to clipboard, switch view to plain text mode 

class_A.h
Qt Code:
  1. #ifndef CLASS_A_H
  2. #define CLASS_A_H
  3.  
  4. #include "class_B.h"
  5.  
  6. class A
  7. {
  8. private:
  9. B b;
  10. //some code
  11. }
  12.  
  13. #endif
To copy to clipboard, switch view to plain text mode 

In the example in Qt class MainWindow derived from QMainWindow has QAction class member among others. But instead of including the QAction header the code is

Qt Code:
  1. QT_BEGIN_NAMESPACE
  2. class QAction;
  3. class QMenu;
  4. class QTextEdit;
  5. QT_END_NAMESPACE
To copy to clipboard, switch view to plain text mode 

Will somebody explain to me what this code do exactly or where can I read it in details. I failed to find it in the Qt help. Why not just include all the headers? I know that namespace for instance can be a problem. When using for instance string from Standard template library even when you include the string header you need to write using std::string or to declare every string object with std:string sBuffer so that compiler can use the right type.

I would appreciate any help you can provide. Thanks in advance.