Suppose I wanted to have a bitcoin treasure hunt, where QR codes were used. The first person who scanned a given QR code should receive some preset amount of bitcoins. Is this possible? (Preferably with as little need for knowledge on the part of the recipient as possible.) As a bonus, is it possible to have a single QR code to have a "pool" of 5 bitcoins it is attached to, give 1 bitcoin away per scan, but only allow scanning by unique devices. (ie; so 1 QR code could be used to claim 1 bitcoin for 5 unique devices) or easiest just to create 5 QR codes? Essentially the same functionality as the "send to QR code" in the Android client, only in reverse - (Scan QR code, and receive coins)
The easiest way to do this is to have the QR code be a URL. For example,
http://www.example.com/bitcoingiveaway/E34IKJ. Just assign a unique code to each location, the
E34IKJ in my example.
What that web page does is up to you. It has to track how many times it has been accessed, of course. The first time, it can send a form that allows a person to fill in some kind of identifier, which can be a Bitcoin address. You then send them the coins (or if using some kind of account, credit their account).
Making this work without the scanners having Internet access is much trickier. It can be done, but it would require your to control the scanning devices such that they included a time stamp, and there would be no way to reliably inform people whether they were first right at the point of scan.
Another possibility for the "first come, get coins" model is to have the QR code be the actual private key used to claim the Bitcoins.
QR codes are completely passive. They do not collect any information about the devices used to scan it.
If you want to set this up using only the Bitcoin network, you can create QR codes with private keys of Bitcoin addresses. The device used to scan the code should be able to import the private key and send its bitcoins to another address chosen by the user. The user should destroy the QR code afterwards to avoid stealing attempts by other users.
Having a "pool" of bitcoins in a QR code is not possible in this scenario.
Since mobile clients currently can not import private keys, another easy way to do this would be with Instawallet. People would scan an Instawallet QR code, open the url, type in their address and cash out the bitcoins.
But again, this solution does not allow for a bitcoin "pool". If you really want that feature you should design a dedicated website, like David Schwartz suggested in his answer.