Refactor pqTextEditTest

The pqTextEditTest was a little bit flaky on Unix. Also make the test more
qt like to leverage QTest powerful methods.

Change-Id: I887af09c0e9d6fd0f60da4ece914527fe9797019