qtutils: add text_width() and text_size() helper functions