We can do a radial line sweep to solve the problem -
Sort the end points of the line segments w.r.t. the angle the line joining $P$ and the endpoint $Q$ make, break ties w.r.t. distance from $P$. Now when we sweep radially (in the clockwise direction) maintain two types of events 'open' and 'close' which correspond to opening and closing some new line segment. Keep track of how many line segments are 'active' at any given time ('active' means that we have encountered the end point which corresponds to the 'open' event of the line segment but we haven't encountered the other endpoint in the sweep yet). If at any point of time we have exactly one 'active' line segment, then this segment is visible from $P$.
We should be careful that when we start the sweep, we should always start at some 'open' event.
There will be $2n$ such events and keeping track of the number of active segments can be done in constant time per segment (via a hash table or logarithmuc time by using a balanced BST). Hence the dominating step in then algorithm is sorting which takes $\mathcal{O}(n)$ time as required.
As with all computational geometry problems, there might be some corner cases that I have overlooked but the general idea that if at some point of time during the radial line sweep, if we have exactly one active line segment, then it is visible from $P$ is the crux to solve this problem.