title: How to match tab length to a number of spaces in Qt
body: <p>I'm having trouble making tabs in a QTextEdit be the same size as some number of spaces, say 4.</p>
  
  <p>I'm using Qt 4.8.1 on a mac and I've tried several different monospace fonts. In each case I try using fontMetrics.width() and fontMetrics.boundingRect().width(). Passing in the ' ' and multiplying by 4 and passing in "    " return me consistant sizes, but when I set the tab stop width it's slightly off. What's worse, the error accumulates. If I type 6 tabs and, below, 6 * 4 spaces, the curser ends up in a dramatically different place.</p>
  
  <p>Even tweaking the number by hand I have been unable to find an integer number of pixels that exactly matches and keeps tabs and equivalent spaces consistant.</p>
  
  <p>Has anyone else encountered this issue? Have you found a solution other than to replace tabs with spaces?</p>