Fix build problems with using qDebug in libraries.
Improve display of grid lines.

- Replace dotted lines with solid transparent lines due to Qt bug on Linux.
- Cause the whole view to update when gridelines are turned on or off or
  have their spacing changed.