Airline pilots generally get the QNH from the airport ATIS or similar. If they don't get it from there, ground control will give it before taxi.
Above the transition level (11,000 feet (3,350 m) in Malaysia, 18,000 feet in the US), the altimeter is set to the standard pressure (29.92 inHg, 1013 hPa), also referred to as QNE. It doesn't take that long to climb through this point, so they would keep the departure QNH set until reaching the transition altitude. They won't need to set it again until they begin their descent near their destination.
So after setting it before taxi, the next time they would need it is on approach before they descend below the transition level. Again, they can get the ATIS from their arrival airport for QNH. If not, the approach controller will give them the QNH.