Move implementation details to constructors. Amend 78f457796c

This commit is contained in:
Yuriy Skalko 2020-12-06 18:01:09 +02:00
parent 2f3d0653b3
commit ccbfd22f56
4 changed files with 14 additions and 18 deletions

View File

@ -156,14 +156,8 @@ Dialog * createDialog(GuiView & gv, string const & name)
return new GuiShowFile(gv);
if (name == "findreplace")
return new GuiSearch(gv);
if (name == "findreplaceadv") {
FindAndReplace * gui = new FindAndReplace(gv, Qt::RightDockWidgetArea);
#ifdef Q_OS_MAC
// On Mac show and floating
gui->setFloating(true);
#endif
return gui;
}
if (name == "findreplaceadv")
return new FindAndReplace(gv);
if (name == "graphics")
return new GuiGraphics(gv);
if (name == "include")
@ -194,14 +188,8 @@ Dialog * createDialog(GuiView & gv, string const & name)
return new GuiRef(gv);
if (name == "sendto")
return new GuiSendTo(gv);
if (name == "spellchecker") {
GuiSpellchecker * gui = new GuiSpellchecker(gv, Qt::RightDockWidgetArea);
#ifdef Q_OS_MAC
// On Mac show and floating
gui->setFloating(true);
#endif
return gui;
}
if (name == "spellchecker")
return new GuiSpellchecker(gv);
if (name == "symbols")
return new GuiSymbols(gv);
if (name == "tabularcreate")
@ -217,7 +205,7 @@ Dialog * createDialog(GuiView & gv, string const & name)
if (name == "wrap")
return new GuiWrap(gv);
if (name == "progress")
return new GuiProgressView(gv, Qt::BottomDockWidgetArea);
return new GuiProgressView(gv);
return nullptr;
}

View File

@ -588,6 +588,10 @@ FindAndReplace::FindAndReplace(GuiView & parent,
widget_ = new FindAndReplaceWidget(parent);
setWidget(widget_);
setFocusProxy(widget_);
#ifdef Q_OS_MAC
// On Mac show and floating
setFloating(true);
#endif
connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
widget_, SLOT(dockLocationChanged(Qt::DockWidgetArea)));

View File

@ -46,7 +46,7 @@ class GuiProgressView : public DockView
public:
GuiProgressView(
GuiView & parent, ///< the main window where to dock.
Qt::DockWidgetArea area, ///< Position of the dock (and also drawer)
Qt::DockWidgetArea area = Qt::BottomDockWidgetArea, ///< Position of the dock (and also drawer)
Qt::WindowFlags flags = 0);
~GuiProgressView();

View File

@ -598,6 +598,10 @@ GuiSpellchecker::GuiSpellchecker(GuiView & parent,
widget_ = new SpellcheckerWidget(&parent, this);
setWidget(widget_);
setFocusProxy(widget_);
#ifdef Q_OS_MAC
// On Mac show and floating
setFloating(true);
#endif
}