add GuiView parent to QToc for proper memory management.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17753 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-04-07 00:04:38 +00:00
parent f139b65352
commit 978c87fae7
3 changed files with 5 additions and 5 deletions

View File

@ -304,9 +304,9 @@ Dialogs::DialogPtr Dialogs::build(string const & name)
dialog->bc().bp(new OkApplyCancelReadOnlyPolicy);
#endif
} else if (name == "toc") {
QToc * qtoc = new QToc(*dialog);
dialog->setController(qtoc);
GuiView & gui_view = static_cast<GuiView &>(lyxview_);
QToc * qtoc = new QToc(*dialog, &gui_view);
dialog->setController(qtoc);
dialog->setView(new DockView<QToc, TocWidget>(
*dialog, qtoc, &gui_view, _("Toc")));
dialog->bc().bp(new OkCancelPolicy);

View File

@ -33,8 +33,8 @@ namespace lyx {
namespace frontend {
QToc::QToc(Dialog & parent)
: ControlToc(parent)
QToc::QToc(Dialog & dialog, QObject * parent)
: QObject(parent), ControlToc(dialog)
{
}

View File

@ -31,7 +31,7 @@ class QToc : public QObject, public ControlToc
Q_OBJECT
public:
QToc(Dialog &);
QToc(Dialog &, QObject * parent = 0);
virtual ~QToc() {}
/// \c ControlToc inherited method.