I have a strange problem. I made a simple app with a button, and connected the buttons clicked() to hide() of the mainwindow. When clicking this button the app crashed in windows 2000. I'm using Qt 4.
The program works fine in Linux. Strange. Is this a known bug or something else important that I have missed?

This is main.cpp
Qt Code:
  1. #include <QApplication>
  2. #include "mainwindow.h"
  3. int main(int argc, char *argv[])
  4. { QApplication app(argc, argv);
  5. MainWindow *MainForm = new MainWindow;
  6. MainForm->show();
  7. return app.exec();
  8. }
To copy to clipboard, switch view to plain text mode 
This is mainwindow.h
Qt Code:
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3.  
  4. #include <QMainWindow>
  5. #include "ui_mainwindow.h"
  6.  
  7. class MainWindow : public QMainWindow
  8. {
  9. Q_OBJECT
  10. public:
  11. MainWindow(QWidget * parent = 0);
  12. private:
  13. Ui::MainWindow ui;
  14. };
  15.  
  16. #endif
To copy to clipboard, switch view to plain text mode 

this is mainwindow.cpp
Qt Code:
  1. #include <QtGui>
  2. #include "mainwindow.h"
  3. MainWindow::MainWindow(QWidget *parent)
  4. : QMainWindow(parent, 0)
  5. { ui.setupUi(this);
  6. }
To copy to clipboard, switch view to plain text mode 

this is the ui file
Qt Code:
  1. <ui version="4.0" >
  2. <author></author>
  3. <comment></comment>
  4. <exportmacro></exportmacro>
  5. <class>MainWindow</class>
  6. <widget class="QMainWindow" name="MainWindow" >
  7. <property name="geometry" >
  8. <rect>
  9. <x>0</x>
  10. <y>0</y>
  11. <width>425</width>
  12. <height>248</height>
  13. </rect>
  14. </property>
  15. <property name="windowTitle" >
  16. <string>Test QT DevCPP</string>
  17. </property>
  18. <widget class="QWidget" name="centralWidget" >
  19. <widget class="QPushButton" name="pushButton" >
  20. <property name="geometry" >
  21. <rect>
  22. <x>40</x>
  23. <y>80</y>
  24. <width>75</width>
  25. <height>24</height>
  26. </rect>
  27. </property>
  28. <property name="text" >
  29. <string>PushButton</string>
  30. </property>
  31. </widget>
  32. </widget>
  33. </widget>
  34. <pixmapfunction></pixmapfunction>
  35. <resources/>
  36. <connections>
  37. <connection>
  38. <sender>pushButton</sender>
  39. <signal>clicked()</signal>
  40. <receiver>MainWindow</receiver>
  41. <slot>hide()</slot>
  42. <hints>
  43. <hint type="sourcelabel" >
  44. <x>81</x>
  45. <y>114</y>
  46. </hint>
  47. <hint type="destinationlabel" >
  48. <x>216</x>
  49. <y>146</y>
  50. </hint>
  51. </hints>
  52. </connection>
  53. </connections>
  54. </ui>
To copy to clipboard, switch view to plain text mode 

I can't see anything strange with this, can you?