mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-05-03 03:49:59 +02:00
Fix losing Focus on moving diagram position with keyboard
Due to the changes made in the commit "Add highlight current page in ProjectView", there is a problem when moving diagrams in the ProjectView using the keyboard. The diagrams lose focus after being moved. The cause is: The DiagramItem loses its selection before the move function is executed. The code has been adjusted.
This commit is contained in:
@@ -781,7 +781,13 @@ void GenericPanel::projectDiagramsOrderChanged(QETProject *project,
|
||||
}
|
||||
|
||||
// select the moved diagram
|
||||
setCurrentItem(qtwi_project -> child(from));
|
||||
if(m_selected_item){
|
||||
setCurrentItem(moved_qtwi_diagram);
|
||||
}
|
||||
else{
|
||||
setCurrentItem(qtwi_project -> child(from));
|
||||
}
|
||||
m_selected_item = nullptr;
|
||||
|
||||
emit(panelContentChanged());
|
||||
}
|
||||
@@ -1040,3 +1046,12 @@ void GenericPanel::emitFirstActivated()
|
||||
{
|
||||
emit(firstActivated());
|
||||
}
|
||||
|
||||
/**
|
||||
@brief GenericPanel::setSelectedItem
|
||||
@param selectedItem
|
||||
*/
|
||||
void GenericPanel::setSelectedItem(QTreeWidgetItem *selectedItem)
|
||||
{
|
||||
m_selected_item = selectedItem;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user