Peter Kümmel wrote:
Peter Kümmel wrote:
-QtView::QtView(unsigned int width, unsigned int height)
+QtView::QtView()
: QMainWindow(), LyXView(), commandbuffer_(0), frontend_(*this)
{
- resize(width, height);
-
qApp->setMainWidget(this);
- bufferview_.reset(new BufferView(this, width, height));
+ bufferview_.reset(new BufferView(this, width(), height()));
I think there might be a problem there. BufferView needs the size of the
WorkArea but width() and height() will give you the size of the window,
including menubar and toolbars.
No, this is given by frameGeometry, see
http://doc.trolltech.com/4.1/geometry.html
same for Qt3
But I guess this is OK now because a resize event will happen just
afterward and readjust the BufferView to the proper WorkArea size. So I
guess that passing 100x100 or whatever will produce the same effect.
Having an additional look at the docs, it seems I was wrong. But
I had no problems with this code, as you explained.
Yes ;-)
Peter
I think we should use QMainWindow::centralWidget().width/height instead.
In this particular case, yes. But I would prefer to fix the problem at
the source: We don't need the width and height on BufferView creation.
My cleanup will fix that.
Abdel.