mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-27 06:19:36 +00:00
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
This commit is contained in:
parent
1757d1b1cd
commit
48744f0fbd
@ -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.
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 *);
|
||||
|
Loading…
Reference in New Issue
Block a user