]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/lyx_gui.C
* frontends/qt3/QtView.C: use QRect ctor, coding style
[lyx.git] / src / frontends / qt4 / lyx_gui.C
index 84d674575b6f889520a914094a45c94d82bb0c34..32ef21f94fa98dccd5eaca2c23b0990d06a3d72e 100644 (file)
@@ -39,7 +39,7 @@
 #include <boost/bind.hpp>
 #include <boost/shared_ptr.hpp>
 
-#include "QtView.h"
+#include "GuiView.h"
 #include "ColorCache.h"
 #include "FontLoader.h"
 #include "QLImage.h"
@@ -59,7 +59,7 @@
 using lyx::support::ltrim;
 using lyx::support::package;
 
-using lyx::frontend::QtView;
+using lyx::frontend::GuiView;
 using lyx::frontend::Application;
 
 namespace os = lyx::support::os;
@@ -194,15 +194,29 @@ void start(string const & batch, vector<string> const & files,
        // this can't be done before because it needs the Languages object
        initEncodings();
 
-       boost::shared_ptr<QtView> view_ptr(new QtView(width, height));
+       boost::shared_ptr<GuiView> view_ptr(new GuiView);
+
        LyX::ref().addLyXView(view_ptr);
 
-       QtView & view = *view_ptr.get();
+       GuiView & view = *view_ptr.get();
 
        view.init();
-               
-       if (posx != -1 && posy != -1) {         
-               view.setGeometry(posx, posy, width, height);
+
+       // only true when the -geometry option was NOT used
+       if (width != -1 && height != -1) {
+               if (posx != -1 && posy != -1) {
+#ifdef Q_OS_WIN32
+                       // FIXME: use only setGeoemtry when Trolltech has
+                       // fixed the qt4/X11 bug
+                       view.setGeometry(posx, posy,width, height);
+#else
+                       view.resize(width, height);
+                       view.move(posx, posy);
+#endif
+               } else {
+                       view.resize(width, height);
+               }
+
                if (maximize)
                        view.setWindowState(Qt::WindowMaximized);
        }