* Dialog.h
- Dialog::Controller::view(): new method.
* QDelimiterDialog::QDelimiterDialog(): pass the Main Window parent.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17898
a592a061-630c-0410-9148-
cb99ea01b6c8
virtual bool exitEarly() const { return false; }
//@}
+ /// Main Window access.
+ /// This is unfortunately needed for the qt4 frontend and the \c
+ /// QDialogView framework. This permits to give a parent to the
+ /// constructed \c QDialog via a cast to \c GuiView.
+ LyXView * view() { return &parent_.kernel().lyxview(); }
+
protected:
/** \name Controller Access
* Enable the derived classes to access the other parts of the whole.
#include "QDelimiterDialog.h"
#include "GuiApplication.h"
+#include "GuiView.h"
+
#include "qt_helpers.h"
#include "controllers/ControlMath.h"
void QMathDelimiter::build_dialog()
{
- dialog_.reset(new QDelimiterDialog(this));
+ dialog_.reset(new QDelimiterDialog(this,
+ static_cast<GuiView *>(controller().view())));
}
}
-QDelimiterDialog::QDelimiterDialog(QMathDelimiter * form)
- : form_(form)
+QDelimiterDialog::QDelimiterDialog(QMathDelimiter * form, QWidget * parent)
+ : QDialog(parent), form_(form)
{
setupUi(this);
class QDelimiterDialog : public QDialog, public Ui::QDelimiterUi {
Q_OBJECT
public:
- QDelimiterDialog(QMathDelimiter * form);
+ QDelimiterDialog(QMathDelimiter * form, QWidget * parent);
public Q_SLOTS:
void on_leftLW_itemActivated(QListWidgetItem *);
void on_rightLW_itemActivated(QListWidgetItem *);