#include "BufferParams.h"
#include "FuncRequest.h"
+#include "support/debug.h"
#include "support/gettext.h"
#include "support/lassert.h"
namespace frontend {
GuiToc::GuiToc(GuiView & parent, Qt::DockWidgetArea area, Qt::WindowFlags flags)
- : DockView(parent, "toc", qt_("Outline"), area, flags), is_closing_(false)
+ : DockView(parent, "toc", qt_("Outline"), area, flags),
+ widget_(new TocWidget(parent, this)),
+ is_closing_(false)
{
- widget_ = new TocWidget(parent, this);
setWidget(widget_);
setFocusProxy(widget_);
}
-GuiToc::~GuiToc()
-{
- delete widget_;
-}
-
-
void GuiToc::updateView()
{
widget_->updateView();
- return;
}
{
if (!enable)
// In the opposite case, updateView() will be called anyway.
- widget_->updateView();
+ widget_->updateViewNow();
}
void GuiToc::closeEvent(QCloseEvent * /*event*/)
{
is_closing_ = true;
- ((GuiView *)parent())->updateToolbars();
+ static_cast<GuiView *>(parent())->updateToolbars();
is_closing_ = false;
}
Dialog * createGuiToc(GuiView & lv)
{
- GuiToc * toc;
-#ifdef Q_WS_MACX
- // On Mac show at the right and floating
- toc = new GuiToc(lv, Qt::RightDockWidgetArea);
- toc->setFloating(true);
-#else
- toc = new GuiToc(lv);
-#endif
- return toc;
+ return new GuiToc(lv);
}