I saw another way of doing what I want. In QT library there's QPlatformOpenGLContext that used as the base for CocoaGLContext. And it used as the base for different platforms too.
Maybe in my case deriving from QPlatformOpenGLContext is more correct than deriving from QOpenGLContext that has no capabilities for polymorphism (it's methods are not virtual).