Funny behaviour of child widgets in MDI apps.

MDI child widgets (unless you use editable widgets like QTextedit) are dragged in QWorkspace when you move the mouse with pressed left mouse button anywhere inside the widget. This prohibits drawing/measuring with the mouse inside the widget.

Source code below compiles to what I mean.

The MDI example in Qt examples/mainwindows has the same behaviour when the MDI child widget inherits QWidget instead of QTextEdit in the example.
I use Qt 4.2.2. The problem is the same with Linux and Windows.

Any suggestions to overcome this? Feels like a bug, but maybe it`s defined behaviour, and I should just change a windowsFlag somewhere?

================================
Qt Code:
  1. #include <QtGui>
  2. class mdiChild:public QWidget
  3. {
  4. public:
  5. mdiChild():QWidget(){}
  6. };
  7.  
  8. class mainWindow:public QMainWindow
  9. {
  10. public:
  11. mainWindow():QMainWindow() {
  12. QWorkspace* workspace = new QWorkspace;
  13. setCentralWidget(workspace);
  14.  
  15. mdiChild *child = new mdiChild();
  16. workspace->addWindow(child);
  17. child->setGeometry(10,10,200,100);
  18. child->show();
  19. }
  20. };
  21.  
  22. int main(int argc, char *argv[])
  23. {
  24. QApplication app(argc, argv);
  25. mainWindow mainWin;
  26. mainWin.show();
  27. return app.exec();
  28. }
To copy to clipboard, switch view to plain text mode