]> git.lyx.org Git - lyx.git/commitdiff
* frontends/qt3/QtView.C: use QRect ctor, coding style
authorPeter Kümmel <syntheticpp@gmx.net>
Fri, 23 Jun 2006 10:19:31 +0000 (10:19 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Fri, 23 Jun 2006 10:19:31 +0000 (10:19 +0000)
* frontends/qt4/lyx_gui.C: coding style
* frontends/qt4/GuiView.C: use QRect ctor, coding style

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14183 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt3/QtView.C
src/frontends/qt4/GuiView.C
src/frontends/qt4/lyx_gui.C

index ca7953d52e278bf5471498c1ef7c460adcf6cc9e..e79be58db63e7155c469fb7e544045a69c757b36 100644 (file)
@@ -58,7 +58,7 @@ int const statusbar_timer_value = 3000;
 
 
 QtView::QtView()
-       : QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
+       : QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
 {
        qApp->setMainWidget(this);
 
@@ -157,36 +157,35 @@ bool QtView::hasFocus() const
        return qApp->activeWindow() == this;
 }
 
+
 void QtView::initFloatingGeometry(QRect const & g)
 {
        floatingGeometry_ = g;
        maxWidth = QApplication::desktop()->width() - 20;
 }
 
+
 void QtView::updateFloatingGeometry()
 {
        if (width() < maxWidth && frameGeometry().x() > 0)
-       {
-               // setX/Y changes the size!
-               floatingGeometry_.setX(x());
-               floatingGeometry_.setY(y());
-               floatingGeometry_.setWidth(width());
-               floatingGeometry_.setHeight(height());
-       }
+               floatingGeometry_ = QRect(x(), y(), width(), height());
 }
 
+
 void QtView::resizeEvent(QResizeEvent *)
 {
        maxWidth = std::max(width(), maxWidth);
-               
-       updateFloatingGeometry();                       
+
+       updateFloatingGeometry();
 }
 
+
 void QtView::moveEvent(QMoveEvent *)
 {
        updateFloatingGeometry();       
 }
 
+
 void QtView::closeEvent(QCloseEvent *)
 {
        updateFloatingGeometry();       
index 840c406b101e669444b2e71b0c7186021c377907..07b77b3c7251d9db9de0aa0b384ba280b5e319e7 100644 (file)
@@ -111,6 +111,7 @@ void GuiView::updateMenu(QAction *action)
        menubar_->update();
 }
 
+
 void GuiView::setWindowTitle(string const & t, string const & it)
 {
        QMainWindow::setWindowTitle(toqstr(t));
@@ -175,22 +176,20 @@ bool GuiView::hasFocus() const
        return qApp->activeWindow() == this;
 }
 
+
 void  GuiView::updateFloatingGeometry() 
 {
-       if (!isMaximized()) {
-               // setX/Y changes the size!
-               floatingGeometry_.setX(x()); 
-               floatingGeometry_.setY(y()); 
-               floatingGeometry_.setWidth(width()); 
-               floatingGeometry_.setHeight(height());
-       }
+       if (!isMaximized())
+               floatingGeometry_ = QRect(x(), y(), width(), height());
 }
 
+
 void GuiView::resizeEvent(QResizeEvent *)
 {
        updateFloatingGeometry();
 }
 
+
 void GuiView::moveEvent(QMoveEvent *)
 {
        updateFloatingGeometry();
@@ -243,6 +242,7 @@ void GuiView::busy(bool yes) const
                QApplication::restoreOverrideCursor();
 }
 
+
 QMainWindow* GuiView::mainWidget()
 {
        return mainWidget_;
index e1d8ce12ed80a06b7e54129b790431fb4e8266a3..32ef21f94fa98dccd5eaca2c23b0990d06a3d72e 100644 (file)
@@ -203,10 +203,8 @@ void start(string const & batch, vector<string> const & files,
        view.init();
 
        // only true when the -geometry option was NOT used
-       if (width != -1 && height != -1)
-       {
-               if (posx != -1 && posy != -1)
-               {
+       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