]> Shamusworld >> Repos - architektonas/blobdiff - src/mainapp/mdiwindow.cpp
Fixed problem with MDI activation.
[architektonas] / src / mainapp / mdiwindow.cpp
index b3d0ac4cb50e1b9ca862a6b084551eb7b58e406e..a592c4bd6bc1f1d9ab335646b3e57c841174f2c2 100644 (file)
@@ -33,15 +33,24 @@ int MDIWindow::idCounter = 0;
  * @param parent Parent widget. Usually a workspace (QMdiArea).
  */
 MDIWindow::MDIWindow(Document * doc, QWidget * parent, const char * name/*= NULL*/,
-       Qt::WindowFlags wflags/*= Qt::WDestructiveClose*/):
-       QMdiSubWindow(parent, Qt::SubWindow), owner(false)//, forceClosing(false)
+       Qt::WindowFlags wflags/*= Qt::SubWindow*/):
+       QMdiSubWindow(parent, Qt::SubWindow), 
+owner(false)
 #warning "!!! wflags is ignored !!!"
 {
 // This warning not longer occurs...!
 //This warning is most likely coming from the QMdiSubWindow() constructor above...
 //#warning "QWidget::setMinimumSize: (/QMdi::ControlLabel) Negative sizes (-1,-1) are not possible"
        initDoc(doc);
-       initView();
+
+       graphicView = new QG_GraphicView(document, this);
+//Let's see if the trouble is in the graphicView...
+//And it is... So... How to fix this???
+       setWidget(graphicView);
+//THIS was the problem... Somehow, setting focus on the this widget was screwing
+//*everything* about the MDI system up!
+//     graphicView->setFocus();
+
        id = idCounter++;
        parentWindow = NULL;
 
@@ -208,20 +217,6 @@ void MDIWindow::initDoc(Document * doc)
        }
 }
 
-/**
- * Initialize the view.
- */
-void MDIWindow::initView()
-{
-       // This is only called once: In the MDIWindow constructor.
-       DEBUG->print("MDIWindow::initView()");
-
-//     graphicView = new QC_GraphicView(document, this);
-       graphicView = new QG_GraphicView(document, this);
-       setWidget(graphicView);
-       graphicView->setFocus();
-}
-
 /**
  * Called when the current pen (color, style, width) has changed.
  * Sets the active pen for the document in this MDI window.