What I'd like to know is how pass my QGLFormat object to QGLContext?
When I try to do this:
Code:
I get this error:
Code:
error: 'QGLContext::QGLContext(const QGLContext&)' is private
Using Qt Creator with Windows 7.
What is wrong here?
Printable View
What I'd like to know is how pass my QGLFormat object to QGLContext?
When I try to do this:
Code:
I get this error:
Code:
error: 'QGLContext::QGLContext(const QGLContext&)' is private
Using Qt Creator with Windows 7.
What is wrong here?
Change
to
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:
This should print T(int), which means the copy-constructor is not used. But this:Code:
#include <iostream> class T { public: T(){ std::cout << "T()\n"; } T(const T&){ std::cout << "T(const T&)\n"; } T(int){ std::cout << "T(int)\n"; } T& operator=(const T& t){ std::cout << "T& operator\n"; } }; int main(){ T t = T(10); return 10; }
does not compile:Code:
#include <iostream> class T { public: T(){ std::cout << "T()\n"; } T(int){ std::cout << "T(int)\n"; } T& operator=(const T& t){ std::cout << "T& operator\n"; } private: T(const T&){ std::cout << "T(const T&)\n"; } }; int main(){ T t = T(10); return 10; }
(tested with g++ 4.5.2)Quote:
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