mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-13 16:34:14 +02:00
Merge pull request #1199 from ispyisail/feature/terminal-strip-drag-drop
Add drag and drop of free terminals onto a terminal strip (#409)
This commit is contained in:
@@ -41,6 +41,9 @@ FreeTerminalEditor::FreeTerminalEditor(QETProject *project, QWidget *parent) :
|
||||
m_model = new FreeTerminalModel(m_project, this);
|
||||
ui->m_table_view->setModel(m_model);
|
||||
ui->m_table_view->setCurrentIndex(m_model->index(0,0));
|
||||
//Selected rows can be dragged onto a strip of the terminal strip tree
|
||||
ui->m_table_view->setDragEnabled(true);
|
||||
ui->m_table_view->setDragDropMode(QAbstractItemView::DragOnly);
|
||||
|
||||
if (m_project) {
|
||||
connect(m_project, &QObject::destroyed, this, &FreeTerminalEditor::reload);
|
||||
@@ -274,6 +277,14 @@ void FreeTerminalEditor::on_m_move_pb_clicked()
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief FreeTerminalEditor::hasPendingEdits
|
||||
* @return true if cells were edited and not yet applied
|
||||
*/
|
||||
bool FreeTerminalEditor::hasPendingEdits() const {
|
||||
return !m_model->modifiedModelRealTerminalData().isEmpty();
|
||||
}
|
||||
|
||||
void FreeTerminalEditor::selectionChanged()
|
||||
{
|
||||
const bool has_selection = !ui->m_table_view->selectionModel()->selectedIndexes().isEmpty();
|
||||
|
||||
Reference in New Issue
Block a user