The clean solution is to separate your concerns. Have one source file that interacts with Qt, which uses Qt stuff. Then have another source file that interacts with OpenGL, using glLoadGen's stuff.
If you have a function that conceptually needs both, have it call functions in the OpenGL interacting code when it needs to talk to GL. So if you want to change the viewport on window resizing, you have the Qt code detect the resize and then call a function that goes to the OpenGL-interacting code to actually call glViewport
.
That way, if you ever need to switch from Qt, you only need to replace the code that interacts with Qt.
That being said, glLoadGen is not actually an OpenGL loading library. It's a generator for OpenGL loading libraries. It's an extensible platform. So if it's really that important to you to stick your rendering code inside of your UI code (which, generally speaking, is bad form), you could write a generator style that was actually compatible with Qt.
Of course, writing a glLoadGen style isn't trivial. You'll have to know some Lua scripting, and you have to read up on how the generation system actually works.