Change
Qt Code:
  1. QGLContext mContext = QGLContext( mFormat );
To copy to clipboard, switch view to plain text mode 
to
Qt Code:
  1. QGLContext mContext( mFormat );
To copy to clipboard, switch view to plain text mode 
I think compiler "thinks" you want to use copy-constructor, which is private. But in fact the copy-constructor will not be used in this case. Look here:
Qt Code:
  1. #include <iostream>
  2.  
  3. class T
  4. {
  5. public:
  6. T(){
  7. std::cout << "T()\n";
  8. }
  9. T(const T&){
  10. std::cout << "T(const T&)\n";
  11. }
  12. T(int){
  13. std::cout << "T(int)\n";
  14. }
  15. T& operator=(const T& t){
  16. std::cout << "T& operator\n";
  17. }
  18. };
  19.  
  20. int main(){
  21. T t = T(10);
  22. return 10;
  23. }
To copy to clipboard, switch view to plain text mode 
This should print T(int), which means the copy-constructor is not used. But this:
Qt Code:
  1. #include <iostream>
  2.  
  3. class T
  4. {
  5. public:
  6. T(){
  7. std::cout << "T()\n";
  8. }
  9. T(int){
  10. std::cout << "T(int)\n";
  11. }
  12. T& operator=(const T& t){
  13. std::cout << "T& operator\n";
  14. }
  15. private:
  16. T(const T&){
  17. std::cout << "T(const T&)\n";
  18. }
  19. };
  20.  
  21. int main(){
  22. T t = T(10);
  23. return 10;
  24. }
To copy to clipboard, switch view to plain text mode 
does not compile:
test.cpp: In function 'int main()':
test.cpp:54:3: error: 'T::T(const T&)' is private
test.cpp:60:12: error: within this context
(tested with g++ 4.5.2)