Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Tools/SqlBrowser/AddLine.cpp
T
berrux-dev 84f8cfb41f Remove unused code from the Release 2 scope modules
Trim mostly-deletion changes (~700 lines) across the modules the Release
2 build compiles: unused telegrams and receiver/handler code in
TrainingAreaBase (telegrams, recv_from_dds_aes/fts, ism/main/pdm/position
handlers), dead members in SqlBrowser and ProjectDataManagement,
unused LtsPluginManager loader paths, LtsSession unit-test, WlsTetra and
DdsView cleanups, plus the stale include_directories removal in
Lts/CMakeLists.txt. Continues the Release 2 source prune (keep only what
the build compiles).

Excluded from this commit by design: the machine-specific .envrc
(MIGRATE_PIPELINE_ROOT path fix stays uncommitted) and the untracked
qt5-before/ reference tree.
2026-11-17 17:28:48 +01:00

68 lines
1.5 KiB
C++
Executable File

#include "AddLine.h"
#include "ui_AddLinesUi.h"
#include <QtCore/QDebug>
AddLines::AddLines(QWidget* parent)
: QDialog(parent)
, m_ui(new Ui::AddLines)
{
qRegisterMetaType<AddModel*>("AddModel*");
m_ui->setupUi(this);
m_ui->dataView->setModel(&addModel);
connect(m_ui->pbDone, &QPushButton::clicked,
this, &AddLines::slotAddLines);
connect(m_ui->pbAbort, &QPushButton::clicked,
this, &AddLines::close);
connect(m_ui->pbDelete, &QPushButton::clicked,
this, &AddLines::slotDeleteLines);
connect(m_ui->pbClear, &QPushButton::clicked,
this, &AddLines::slotClear);
}
AddLines::~AddLines()
{
delete m_ui;
}
void AddLines::slotDeleteLines()
{
//qWarning() << "slotDeleteLines";
while (m_ui->dataView->selectionModel()->selectedRows().count())
{
const QModelIndexList selectedRows = m_ui->dataView->selectionModel()->selectedRows();
if (selectedRows.at(0).row() == addModel.rowCount()-1) // do not delete empty row!
{
return; // In hope that the selectedRows list is sorted.....
}
addModel.removeRow(selectedRows.at(0).row());
}
}
void AddLines::slotClear()
{
//qWarning() << "slotClear";
addModel.clear();
}
void AddLines::reject()
{
emit signalAddLines(nullptr);
}
void AddLines::copyDataFromModel(DataModel* dataModel)
{
addModel.setHeaderList(dataModel->getHeaderList());
addModel.setTablename(dataModel->getTableName());
}
void AddLines::slotAddLines()
{
this->hide(); // hide until in work..
emit signalAddLines(&addModel);
}