sorry.. only a short test.. the answer will follow

Qt Code:
  1. //mainwindow.h
  2. //[SKIP]
  3. class MainWindow : public QMainWindow
  4. {
  5. Q_OBJECT
  6.  
  7. public:
  8. MainWindow();
  9.  
  10. protected:
  11. void closeEvent(QCloseEvent *event);
  12.  
  13. private slots:
  14. // [SKIP]
  15. void about();
  16. void indexEnv(); // first steps
  17. void documentWasModified();
  18.  
  19. private:
  20. void createActions();
  21. //[SKIP]
  22.  
  23. PreviewWindow *previewWindow; // first call of a sub dialog
  24.  
  25. QTextEdit *textEdit;
  26. QString curFile;
  27.  
  28. QMenu *fileMenu;
  29. QMenu *editMenu;
  30. QMenu *indexMenu; // first steps to create an index menu --> my own menu
  31. QMenu *helpMenu;
  32.  
  33.  
  34. QToolBar *fileToolBar;
  35. QToolBar *editToolBar;
  36. //[SKIP]
  37. QAction *aboutQtAct;
  38. QAction *indexEnvAct; // first steps to create an index menu --> Action for my own menu
  39. };
  40.  
  41. // mainwindow.cpp
  42. //[SKIP]
  43. void MainWindow::createActions()
  44. {
  45. //[SKIP]
  46. aboutQtAct = new QAction(tr("About &Qt"), this);
  47. aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
  48. connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
  49.  
  50. indexEnvAct = new QAction(tr("&Index Environment settings"), this); // my own action and menu and so on ...
  51. indexEnvAct->setStatusTip(tr("Opens the index environment setting dialog"));
  52. connect(indexEnvAct, SIGNAL(triggered()), qApp, SLOT(indexEnv()));
  53.  
  54. cutAct->setEnabled(false);
  55. copyAct->setEnabled(false);
  56. connect(textEdit, SIGNAL(copyAvailable(bool)),
  57. cutAct, SLOT(setEnabled(bool)));
  58. connect(textEdit, SIGNAL(copyAvailable(bool)),
  59. copyAct, SLOT(setEnabled(bool)));
  60. }
  61.  
  62. void MainWindow::createMenus()
  63. {
  64. //[SKIP]
  65.  
  66. menuBar()->addSeparator();
  67.  
  68. indexMenu = menuBar()->addMenu(tr("&Index"));
  69. indexMenu->addAction(indexEnvAct);
  70. }
  71.  
  72. void MainWindow::indexEnv() // this here is the last part...
  73. {
  74. previewWindow = new PreviewWindow(this);
  75. previewWindow->activateWindow();
  76. previewWindow->show();
  77. }
To copy to clipboard, switch view to plain text mode 

so, now I'm hopping, there is somewhere an error... which I can't find...
Qt Code:
  1. // previewwindow.h
  2. #ifndef PREVIEWWINDOW_H
  3. #define PREVIEWWINDOW_H
  4.  
  5. #include <QWidget>
  6.  
  7. class QTextEdit;
  8.  
  9. class PreviewWindow : public QWidget
  10. {
  11. Q_OBJECT
  12.  
  13. public:
  14. PreviewWindow(QWidget *parent = 0);
  15.  
  16. // void setWindowFlags(Qt::WindowFlags flags);
  17.  
  18. private:
  19. QTextEdit *textEdit;
  20. QPushButton *closeButton;
  21. };
  22.  
  23. #endif
  24.  
  25. // previewwindow.cpp
  26.  
  27. #include <QtGui>
  28.  
  29. #include "previewwindow.h"
  30.  
  31. PreviewWindow::PreviewWindow(QWidget *parent)
  32. : QWidget(parent)
  33. {
  34. textEdit = new QTextEdit;
  35. textEdit->setReadOnly(true);
  36. textEdit->setLineWrapMode(QTextEdit::NoWrap);
  37.  
  38. closeButton = new QPushButton(tr("&Close"));
  39. connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
  40.  
  41. QVBoxLayout *layout = new QVBoxLayout;
  42. layout->addWidget(textEdit);
  43. layout->addWidget(closeButton);
  44. setLayout(layout);
  45.  
  46. setWindowTitle(tr("Preview"));
  47. }
To copy to clipboard, switch view to plain text mode 

Is there an error??
For me it seems correct... the 5 steps you described above seems for me to realised..

thanks in advanced