Change terminal strip editor class

Change parent class from QDialog to QWidget.
Terminal strip editor is now embedded in TerminalStripEditorWindow.
This commit is contained in:
joshua
2022-03-20 18:25:25 +01:00
parent b48ba939de
commit edfb23be23
10 changed files with 322 additions and 788 deletions

View File

@@ -116,6 +116,17 @@ TerminalStripModel::TerminalStripModel(TerminalStrip *terminal_strip, QObject *p
});
}
/**
* @brief TerminalStripModel::setTerminalStrip
* set the current terminal strip of this model to @a terminal_strip.
* @param terminal_strip
*/
void TerminalStripModel::setTerminalStrip(TerminalStrip *terminal_strip)
{
m_terminal_strip = terminal_strip;
reload();
}
int TerminalStripModel::rowCount(const QModelIndex &parent) const
{
Q_UNUSED(parent)
@@ -479,6 +490,19 @@ void TerminalStripModel::buildBridgePixmap(const QSize &pixmap_size)
}
}
/**
* @brief TerminalStripModel::reload
* Reload (reset) the model
*/
void TerminalStripModel::reload()
{
beginResetModel();
m_physical_data.clear();
m_modified_cell.clear();
fillPhysicalTerminalData();
endResetModel();
}
void TerminalStripModel::fillPhysicalTerminalData()
{
//Get all physical terminal