diff --git a/src/frontends/controllers/Dialog.h b/src/frontends/controllers/Dialog.h index d585dcb5b4..defc1d792f 100644 --- a/src/frontends/controllers/Dialog.h +++ b/src/frontends/controllers/Dialog.h @@ -197,6 +197,12 @@ public: 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. diff --git a/src/frontends/qt4/QDelimiterDialog.C b/src/frontends/qt4/QDelimiterDialog.C index e3402e725c..6c1712fbcf 100644 --- a/src/frontends/qt4/QDelimiterDialog.C +++ b/src/frontends/qt4/QDelimiterDialog.C @@ -13,6 +13,8 @@ #include "QDelimiterDialog.h" #include "GuiApplication.h" +#include "GuiView.h" + #include "qt_helpers.h" #include "controllers/ControlMath.h" @@ -70,7 +72,8 @@ QMathDelimiter::QMathDelimiter(Dialog & parent) void QMathDelimiter::build_dialog() { - dialog_.reset(new QDelimiterDialog(this)); + dialog_.reset(new QDelimiterDialog(this, + static_cast(controller().view()))); } @@ -99,8 +102,8 @@ char_type QDelimiterDialog::doMatch(char_type const symbol) const } -QDelimiterDialog::QDelimiterDialog(QMathDelimiter * form) - : form_(form) +QDelimiterDialog::QDelimiterDialog(QMathDelimiter * form, QWidget * parent) + : QDialog(parent), form_(form) { setupUi(this); diff --git a/src/frontends/qt4/QDelimiterDialog.h b/src/frontends/qt4/QDelimiterDialog.h index dded616d9a..0fd35577c6 100644 --- a/src/frontends/qt4/QDelimiterDialog.h +++ b/src/frontends/qt4/QDelimiterDialog.h @@ -29,7 +29,7 @@ class QMathDelimiter; 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 *);