To generate a qr-code for a wifi config, you must encode the following URL in the qr-code:
WIFI:S:<SSID>;T:<WPA|WEP|>;P:<password>;;
If the network is hidden, then add H:true;
:
WIFI:S:<SSID>;T:<WPA|WEP|>;P:<password>;H:true;;
You can try it here: https://zxing.appspot.com/generator.