From: Abdelrazak Younes Date: Mon, 22 Jan 2007 11:31:42 +0000 (+0000) Subject: Cleanup Action class: The mother should be the main window (GuiView). This will hopef... X-Git-Tag: 1.6.10~11098 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f653a9e979db0da3baea1c4cae76f501ba392f85;p=features.git Cleanup Action class: The mother should be the main window (GuiView). This will hopefully fix bug 3107 (Tooltips not showing on main window). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16807 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/Action.C b/src/frontends/qt4/Action.C index 504012308e..1aba7f9a8f 100644 --- a/src/frontends/qt4/Action.C +++ b/src/frontends/qt4/Action.C @@ -12,15 +12,14 @@ #include "Action.h" +#include "GuiView.h" +#include "qt_helpers.h" + #include "lyx_cb.h" #include "lyxfunc.h" #include "FuncStatus.h" #include "debug.h" -#include "frontends/LyXView.h" - -#include "qt_helpers.h" - #include "support/lstrings.h" #include @@ -40,9 +39,9 @@ int const statusbar_timer_value = 3000; } // namespace anon -Action::Action(LyXView & lyxView, docstring const & text, +Action::Action(GuiView & lyxView, docstring const & text, FuncRequest const & func, docstring const & tooltip) - : QAction(this), func_(func), lyxView_(lyxView) + : QAction(&lyxView), func_(func), lyxView_(lyxView) { setText(toqstr(text)); setToolTip(toqstr(tooltip)); @@ -51,9 +50,9 @@ Action::Action(LyXView & lyxView, docstring const & text, update(); } -Action::Action(LyXView & lyxView, string const & icon, docstring const & text, +Action::Action(GuiView & lyxView, string const & icon, docstring const & text, FuncRequest const & func, docstring const & tooltip) - : QAction(this), func_(func), lyxView_(lyxView) + : QAction(&lyxView), func_(func), lyxView_(lyxView) { setIcon(QPixmap(icon.c_str())); setText(toqstr(text)); diff --git a/src/frontends/qt4/Action.h b/src/frontends/qt4/Action.h index c037171041..06dbf18898 100644 --- a/src/frontends/qt4/Action.h +++ b/src/frontends/qt4/Action.h @@ -26,6 +26,8 @@ namespace lyx { namespace frontend { +class GuiView; + /** * Action - Qt interface with LyX' FuncRequest. * @@ -35,10 +37,10 @@ class Action: public QAction { Q_OBJECT public: - Action(LyXView & lyxView, lyx::docstring const & text, + Action(GuiView & lyxView, lyx::docstring const & text, FuncRequest const & func, lyx::docstring const & tooltip = lyx::docstring()); - Action(LyXView & lyxView, std::string const & icon, lyx::docstring const & text, + Action(GuiView & lyxView, std::string const & icon, lyx::docstring const & text, FuncRequest const & func, lyx::docstring const & tooltip = lyx::docstring()); void update(); @@ -50,8 +52,7 @@ private Q_SLOTS: private: FuncRequest const & func_ ; - //FuncRequest func_ ; - LyXView & lyxView_; + GuiView & lyxView_; }; diff --git a/src/frontends/qt4/QLToolbar.C b/src/frontends/qt4/QLToolbar.C index 41cce17ae8..79e4ca3003 100644 --- a/src/frontends/qt4/QLToolbar.C +++ b/src/frontends/qt4/QLToolbar.C @@ -193,7 +193,11 @@ void QLToolbar::add(FuncRequest const & func, docstring const & tooltip) if (lyx::getStatus(func).unknown()) break; - Action * action = new Action(owner_, toolbarbackend.getIcon(func), lyx::docstring(), func, tooltip); + Action * action = new Action(owner_, + toolbarbackend.getIcon(func), + tooltip, + func, + tooltip); addAction(action); ActionVector.push_back(action); break;