On Tue, Jun 20, 2006 at 01:09:15PM +0200, Peter Kümmel wrote: > + if (width != -1 && height != -1 && posx != -1 && posy != -1) { > + view.initNormalGeometry(QRect(posx, posy, width, height)); > + view.resize(width, height); > + view.move(posx, posy); > + if (maximize) > + {
if (maximize) { > > -QtView::QtView(unsigned int width, unsigned int height) > +QtView::QtView() > : QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this) That'd be a tab, not spaces. > +QRect QtView::qtViewGeometry() const > +{ > + QRect rec; > + // setX/Y changes the size! > + rec.setX(frameGeometry().x()); > + rec.setY(frameGeometry().y()); > + rec.setWidth(geometry().width()); > + rec.setHeight(geometry().height()); > + return rec; > +} IIRC there's a constructor that avoids the commented pitfall, i.e. return QRect(... .x(), ... y(), .... w .... h) > + if (width()<maxWidth) Grrr. > protected: > /// make sure we quit cleanly > virtual void closeEvent(QCloseEvent * e); > + > +#ifndef Q_OS_WIN32 > + /// > + virtual void resizeEvent(QResizeEvent * e); > + > + /// > + virtual void moveEvent(QMoveEvent * e); > +#endif Tabs for indentation. > private: > /// focus the command buffer widget > void focus_command_widget(); > @@ -112,6 +121,14 @@ > static QMainWindow* mainWidget_; > > GuiImplementation frontend_; > + > +#ifndef Q_OS_WIN32 > + /// > + QRect qtViewGeometry() const; > + > + /// > + QRect normalGeometry_; > +#endif > }; Tabs for indentation. Why do we need the #ifndef? I seemingly forgot the reasoning. > +QRect GuiView::qtViewGeometry() const > +{ > + QRect rec; > + // setX/Y changes the size! > + rec.setX(frameGeometry().x()); > + rec.setY(frameGeometry().y()); > + rec.setWidth(geometry().width()); > + rec.setHeight(geometry().height()); > + return rec; > +} > + > +void GuiView::resizeEvent(QResizeEvent *) Two empty lines between fuctions. Andre'