Fix piece carrousel context menu crash
This commit is contained in:
parent
b9e26f0b3f
commit
728b2c83c3
|
@ -187,6 +187,8 @@ void VPCarrouselPieceList::dragMoveEvent(QDragMoveEvent* e)
|
||||||
void VPCarrouselPieceList::contextMenuEvent(QContextMenuEvent *event)
|
void VPCarrouselPieceList::contextMenuEvent(QContextMenuEvent *event)
|
||||||
{
|
{
|
||||||
QListWidgetItem* _item = currentItem();
|
QListWidgetItem* _item = currentItem();
|
||||||
|
if(_item != nullptr)
|
||||||
|
{
|
||||||
if(_item->type() == 1001)
|
if(_item->type() == 1001)
|
||||||
{
|
{
|
||||||
VPCarrouselPiece *pieceItem = static_cast<VPCarrouselPiece *> (_item);
|
VPCarrouselPiece *pieceItem = static_cast<VPCarrouselPiece *> (_item);
|
||||||
|
@ -222,6 +224,7 @@ void VPCarrouselPieceList::contextMenuEvent(QContextMenuEvent *event)
|
||||||
contextMenu.exec(event->globalPos());
|
contextMenu.exec(event->globalPos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user