QT: made some more buttons work, improved code