From 48744f0fbd7c3f4b455c1531af08fb97ce16cd45 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Sun, 22 Apr 2007 07:54:36 +0000 Subject: [PATCH] Pass the main window (GuiView) to the delimiter dialog so that it is properly handled by the window manager. * 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 --- src/frontends/controllers/Dialog.h | 6 ++++++ src/frontends/qt4/QDelimiterDialog.C | 9 ++++++--- src/frontends/qt4/QDelimiterDialog.h | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) 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 *);