]> git.lyx.org Git - features.git/commitdiff
Pass the main window (GuiView) to the delimiter dialog so that it is properly handled...
authorAbdelrazak Younes <younes@lyx.org>
Sun, 22 Apr 2007 07:54:36 +0000 (07:54 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 22 Apr 2007 07:54:36 +0000 (07:54 +0000)
* 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
src/frontends/qt4/QDelimiterDialog.C
src/frontends/qt4/QDelimiterDialog.h

index d585dcb5b4e86ee60d4669f7441838ca5d1769af..defc1d792fd8375c5ebfb0678d9a7a7881d96b2c 100644 (file)
@@ -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.
index e3402e725c15eb0070d7d594da18a17cc90081ab..6c1712fbcf1f57f0929885d89b543a137ba68926 100644 (file)
@@ -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<GuiView *>(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);
 
index dded616d9a905328f683f45a9645cd1466aaa888..0fd35577c6087c5d1da414e8de02330895874325 100644 (file)
@@ -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 *);