On Wed, May 31, 2006 at 12:12:53PM +0200, Edwin Leuven wrote: > attached my latest patch > > i'd like to put it in > > any objections?
As usual: Please stick to LyX style. For examples refer to code in src/*.C, not in frontend/whatever. [It's much better nowadays, though] > +{ > + if (parentWidget()) { ....... > + } else resize(sizeHint()); Missing newline. > + int const r0 = right_; > + int const b0 = bottom_; > + right_ = event->x()/colwidth_ + 1; > + bottom_ = event->y()/rowheight_ + 1; Spaces around '/'/ > + > + if (bottom_!=b0 || right_!=r0) > + update(); > + > + QString status = QString("%1x%2").arg(bottom_).arg(right_); Could be const. > + QToolTip::showText(event->globalPos(), status , this); > +} > + > + > +bool InsertTableWidget::event(QEvent * event) > +{ > + if (event->type() == QEvent::MouseMove) { > + QMouseEvent * me = static_cast<QMouseEvent *>(event); > + mouseMoveEvent(me); > + return true; > + } else if (event->type() == QEvent::MouseButtonRelease) { Personal preference here: Drop the 'else' if the 'if' branch ends with an unconditional 'return' > + QMouseEvent * me = static_cast<QMouseEvent *>(event); > + mouseReleaseEvent(me); > + return true; > + } else if (event->type() == QEvent::MouseButtonPress) { > + // swallow this one... > + return true; > + } else if (event->type() == QEvent::Leave) { > + update(); > + return true; > + } > + return QWidget::event(event); > +} Why don't you overload the more specialized handlers (mouseXXXEvent)? They exist for this very reason. > +#define INSERTTABLEWIDGET_H > + > +#include "frontends/LyXView.h" > +#include <QWidget> > + > +class QSize; Should not be needed. > #include <QComboBox> > #include <QToolBar> > #include <QToolButton> > #include <QAction> > -//Added by qt3to4: Good. > - table->setMinimumSize(100,100); Space. Andre'