Yep. The PM is actually appointed by the Queen. But they have to demonstrate that they have enough support in parliament to form a working government. In practice this means that whatever party holds the majority gets to pick the PM. If there is no party with an overall majority (as in 2010) then two or more parties have to reach a coalition agreement.