mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Add free terminal editor widget
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
#include "../realterminal.h"
|
||||
#include "../../qetgraphicsitem/terminalelement.h"
|
||||
#include "../terminalstrip.h"
|
||||
#include "terminalstriptreewidget.h"
|
||||
|
||||
TerminalStripTreeDockWidget::TerminalStripTreeDockWidget(QETProject *project, QWidget *parent) :
|
||||
QDockWidget(parent),
|
||||
@@ -144,6 +145,20 @@ void TerminalStripTreeDockWidget::setSelectedStrip(TerminalStrip *strip) {
|
||||
ui->m_tree_view->setCurrentItem(m_item_strip_H.key(strip));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalStripTreeDockWidget::currentRealTerminal
|
||||
* @return the current real terminal or a null QSharedPointer.
|
||||
*/
|
||||
QSharedPointer<RealTerminal> TerminalStripTreeDockWidget::currentRealTerminal() const
|
||||
{
|
||||
if (auto item = ui->m_tree_view->currentItem()) {
|
||||
if (item->type() == TerminalStripTreeWidget::Terminal) {
|
||||
return m_uuid_terminal_H.value(item->data(0,TerminalStripTreeWidget::UUID_USER_ROLE).toUuid());
|
||||
}
|
||||
}
|
||||
return QSharedPointer<RealTerminal>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief TerminalStripTreeDockWidget::on_m_tree_view_currentItemChanged
|
||||
* @param current
|
||||
|
||||
Reference in New Issue
Block a user