Sometimes we connect to the internet on our phones using a QR code but we don't know the password. This, happened to me last time. My android phone was connected to the Wi-Fi but when I tried to connect my laptop to it, I didn't know the password.
So, in order to find out the actual password from the QR code, I did the following. There might easier ways to do this, but this method worked for me.
First you need to download an application like 'QR Code Scanner' from the Google Play store, there are many apps for the same purpose, I think others would also work. But the one I used is this app.
After that open your QR code reader app. If you have the QR code on other device just scan it using your phone. However, if you have the photo in your phone's gallery you can upload it tapping the image icon on the QR Code Reader App.
Finally, if the app shows you some advertisement, just skip those and you will get your password and Wi-Fi name.