Build LibreCad using Qt5

I've tested these changes only under Ubuntu 12.10 64 bit. There are changes that address some compiler warnings, too.