Qt UI: small code refactoring
Qt UI: fix dock menu for Mac OS X

These slots are used only in Mac OS X. But due to bug in moc they cannot be
placed in #ifdef block.