Alright, this seems to be something WM specific then. While it worked on Windows the window stays inactive on X11. Try this:

Qt Code:
  1. // main.cpp
  2. #include <QtGui>
  3.  
  4. class MainWindow : public QMainWindow
  5. {
  6. Q_OBJECT
  7.  
  8. public:
  9. MainWindow(QWidget* parent = 0, Qt::WindowFlags flags = 0)
  10. : QMainWindow(parent, flags)
  11. {
  12. setCentralWidget(new QTextEdit(this));
  13. }
  14.  
  15. public slots:
  16. void activateWindow()
  17. {
  18. QMainWindow::activateWindow();
  19. }
  20. };
  21.  
  22. int main(int argc, char* argv[])
  23. {
  24. QApplication app(argc, argv);
  25. MainWindow win(0, Qt::Tool);
  26. win.show(); // must be called before setting Qt::WA_QuitOnClose
  27. win.setAttribute(Qt::WA_QuitOnClose);
  28. QTimer::singleShot(0, &win, SLOT(activateWindow()));
  29. return app.exec();
  30. }
  31.  
  32. #include "main.moc"
To copy to clipboard, switch view to plain text mode 

PS. Could you update your profile to indicate used platforms, please?