src: Fixed refresh of QtUndoRedoView in wrong thread
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user