I have tried out a few QMC5883L compass modules over the last few weeks and have noticed that the modules show approximately four times the values written by the HMC5883L module.
Unfortunately, I have no information that there are QMC5833L modules that also work. Therefore I suggest and ask you to adapt the code accordingly.
---- snip of libraries/AP_Compass/AP_Compass_QMC5883L.cpp - function AP_Compass_QMC5883L::timer ----
void AP_Compass_QMC5883L::timer()
{
struct PACKED {
le16_t rx;
le16_t ry;
le16_t rz;
} buffer;
/* orig const float range_scale = 1000.0f / 3000.0f; */
const float range_scale = 1000.0f / (3000.0f * 4.0f);
buffer.rx = 0;
buffer.ry = 0;
buffer.rz = 0;
uint8_t status;
if(!_dev->read_registers(QMC5883L_REG_STATUS,&status,1)){
return;
}
---- snip end ----
If there are QMC5883L modules with different output values, you could introduce a factor-value or enable a new QMC5883Lx4 as an I2C device, which then enables conversion with a factor of 4.