Well, we know that QGC gets all the parameters so either the library you are using is broken, or your code is wrong. I suggest you open a request on the PX discussion boards with a lot more information than this such that someone can help you - for example, I don't even know what library you are using here, or what version of PX4 you are talking to. A working example increases the likelihood someone can and will help you.