修复拖动时渲染错误
This commit is contained in:
parent
891a4de933
commit
9f54bc5ff1
|
@ -14,10 +14,18 @@ accept_panel::AcceptPanel::AcceptPanel(QMainWindow *win, split_frame::ResManager
|
||||||
|
|
||||||
void accept_panel::AcceptPanel::bindWith(split_frame::ViewBase *target)
|
void accept_panel::AcceptPanel::bindWith(split_frame::ViewBase *target)
|
||||||
{
|
{
|
||||||
|
if (target) {
|
||||||
this->setParent(target->widget());
|
this->setParent(target->widget());
|
||||||
this->anchor_view = target;
|
|
||||||
this->paint_panel = this->anchor_view->widget()->grab();
|
if(this->anchor_view != target || this->paint_panel.rect() != target->widget()->rect()){
|
||||||
|
this->paint_panel = target->widget()->grab();
|
||||||
|
}
|
||||||
this->setGeometry(QRect(QPoint(), target->widget()->size()));
|
this->setGeometry(QRect(QPoint(), target->widget()->size()));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this->setParent(bind_win);
|
||||||
|
}
|
||||||
|
this->anchor_view = target;
|
||||||
}
|
}
|
||||||
|
|
||||||
void accept_panel::AcceptPanel::resizeEvent(QResizeEvent *ev)
|
void accept_panel::AcceptPanel::resizeEvent(QResizeEvent *ev)
|
||||||
|
@ -35,6 +43,7 @@ void accept_panel::AcceptPanel::resizeEvent(QResizeEvent *ev)
|
||||||
this->target_type = HoverType::CUBE_UNDEFINED;
|
this->target_type = HoverType::CUBE_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <QDebug>
|
||||||
void accept_panel::AcceptPanel::paintEvent(QPaintEvent *ev)
|
void accept_panel::AcceptPanel::paintEvent(QPaintEvent *ev)
|
||||||
{
|
{
|
||||||
QWidget::paintEvent(ev);
|
QWidget::paintEvent(ev);
|
||||||
|
@ -133,7 +142,7 @@ void accept_panel::AcceptPanel::dropEvent(QDropEvent *ev)
|
||||||
target_type = HoverType::CUBE_UNDEFINED;
|
target_type = HoverType::CUBE_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->setParent(bind_win);
|
this->bindWith(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue