mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 09:40:52 +01:00
Minor : fix little gui defect
At opening of terminal strip editor window, click on free terminal in the tree dock don't show up the free terminal table.
This commit is contained in:
@@ -177,17 +177,26 @@ void TerminalStripTreeDockWidget::on_m_tree_view_currentItemChanged(QTreeWidgetI
|
|||||||
}
|
}
|
||||||
|
|
||||||
TerminalStrip *strip_ = nullptr;
|
TerminalStrip *strip_ = nullptr;
|
||||||
if (current->type() == Strip) {
|
bool current_is_free{false};
|
||||||
|
const auto current_type{current->type()};
|
||||||
|
if (current_type == Strip) {
|
||||||
strip_ = m_item_strip_H.value(current);
|
strip_ = m_item_strip_H.value(current);
|
||||||
}
|
}
|
||||||
else if (current->type() == Terminal
|
else if (current_type == Terminal && current->parent())
|
||||||
&& current->parent()
|
{
|
||||||
&& current->parent()->type() == Strip) {
|
const auto parent_type{current->parent()->type()};
|
||||||
strip_ = m_item_strip_H.value(current->parent());
|
if (parent_type == Strip) {
|
||||||
|
strip_ = m_item_strip_H.value(current->parent());
|
||||||
|
} else if (parent_type == FreeTerminal) {
|
||||||
|
current_is_free = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strip_ != m_current_strip) {
|
if (strip_ != m_current_strip) {
|
||||||
setCurrentStrip(strip_);
|
setCurrentStrip(strip_);
|
||||||
|
} else if (current_is_free != m_current_is_free_terminal) {
|
||||||
|
m_current_is_free_terminal = current_is_free;
|
||||||
|
emit currentStripChanged(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ class TerminalStripTreeDockWidget : public QDockWidget
|
|||||||
QHash<QUuid, QSharedPointer<RealTerminal>> m_uuid_terminal_H;
|
QHash<QUuid, QSharedPointer<RealTerminal>> m_uuid_terminal_H;
|
||||||
QHash<QUuid, QPointer<TerminalStrip>> m_uuid_strip_H;
|
QHash<QUuid, QPointer<TerminalStrip>> m_uuid_strip_H;
|
||||||
QVector<QMetaObject::Connection> m_strip_changed_connection;
|
QVector<QMetaObject::Connection> m_strip_changed_connection;
|
||||||
|
bool m_current_is_free_terminal{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TERMINALSTRIPTREEDOCKWIDGET_H
|
#endif // TERMINALSTRIPTREEDOCKWIDGET_H
|
||||||
|
|||||||
Reference in New Issue
Block a user