I understand how to use it, but the syntax of it bothers me. What is \"private slots:\" doing?
I have never seen something between the private keyword and the : in a
Slots are a Qt-specific extension of C++. It only compiles after sending the code through Qt's preprocessor, the Meta-Object Compiler (moc). See http://doc.qt.io/qt-5/moc.html for documentation.
Edit: As Frank points out, moc is only required for linking. The extra keywords are #defined away with the standard preprocessor.