src: Fixed refresh of QtUndoRedoView in wrong thread

This commit is contained in:
Eberhard Graether
2015-07-20 15:02:01 +02:00
parent 73aa6080aa
commit 0f9e72d553
2 changed files with 11 additions and 2 deletions
+8 -2
View File
@@ -7,6 +7,7 @@
QtUndoRedoView::QtUndoRedoView(ViewLayout* viewLayout)
: UndoRedoView(viewLayout)
, m_refreshFunctor(std::bind(&QtUndoRedoView::doRefreshView, this))
, m_setRedoButtonEnabledFunctor(std::bind(&QtUndoRedoView::doSetRedoButtonEnabled, this, std::placeholders::_1))
, m_setUndoButtonEnabledFunctor(std::bind(&QtUndoRedoView::doSetUndoButtonEnabled, this, std::placeholders::_1))
{
@@ -29,8 +30,7 @@ void QtUndoRedoView::initView()
void QtUndoRedoView::refreshView()
{
setStyleSheet();
m_widget->refreshStyle();
m_refreshFunctor();
}
void QtUndoRedoView::setStyleSheet()
@@ -38,6 +38,12 @@ void QtUndoRedoView::setStyleSheet()
m_widget->setStyleSheet(utility::getStyleSheet("data/gui/undoredo_view/undoredo_view.css").c_str());
}
void QtUndoRedoView::doRefreshView()
{
setStyleSheet();
m_widget->refreshStyle();
}
void QtUndoRedoView::doSetRedoButtonEnabled(bool enabled)
{
m_widget->setRedoButtonEnabled(enabled);
+3
View File
@@ -24,9 +24,12 @@ public:
virtual void setUndoButtonEnabled(bool enabled);
private:
void doRefreshView();
void doSetRedoButtonEnabled(bool enabled);
void doSetUndoButtonEnabled(bool enabled);
QtThreadedFunctor<void> m_refreshFunctor;
QtThreadedFunctor<bool> m_setRedoButtonEnabledFunctor;
QtThreadedFunctor<bool> m_setUndoButtonEnabledFunctor;