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:
ChuckNr11
2026-04-19 10:44:52 +02:00
parent 03bb97b529
commit f60acad3b3
3 changed files with 28 additions and 1 deletions

View File

@@ -171,6 +171,9 @@ class GenericPanel : public QTreeWidget {
const QString &);
// various other methods
public:
void setSelectedItem(QTreeWidgetItem *selectedItem);
protected:
virtual QString defaultText(QET::ItemType);
virtual QIcon defaultIcon(QET::ItemType);
@@ -222,5 +225,7 @@ class GenericPanel : public QTreeWidget {
representing a title block template
*/
QHash<TitleBlockTemplateLocation, QTreeWidgetItem *> tb_templates_;
QTreeWidgetItem *m_selected_item = nullptr;
};
#endif