Improve Qt5 compatibility

Replace QString::toAscii() with QString::toLatin1().
Replace some other methods.

Improve .gitignore to skip *~ files generated by Gedit.

Improve .pro and .pri files.