添加ExtractUnit切换信号
This commit is contained in:
parent
3f8d4b9614
commit
36649a7d8e
|
@ -59,8 +59,11 @@ void SequenceView::tidyRuleAt(const QModelIndex& idx)
|
|||
rule_insv->saveTo(obj);
|
||||
auto bytes = QJsonDocument(obj).toJson(QJsonDocument::Compact);
|
||||
_seqs_model->setData(param_index, QString::fromUtf8(bytes));
|
||||
|
||||
this->resizeColumnsToContents();
|
||||
}
|
||||
|
||||
#include <QItemSelectionModel>
|
||||
SequenceView::SequenceView(QWidget* p /*= nullptr*/)
|
||||
:QTableView(p),
|
||||
_seqs_model(new QStandardItemModel),
|
||||
|
@ -81,10 +84,14 @@ SequenceView::SequenceView(QWidget* p /*= nullptr*/)
|
|||
connect(this, &QTableView::customContextMenuRequested, this, &SequenceView::customTranslateRuleEdit);
|
||||
connect(rule_delegate, &RuleSelectDelegate::dataChanged, this, &SequenceView::tidyRuleAt);
|
||||
connect(int_delegate, &IntDelegate::valueChanged, this, &SequenceView::tidyRuleAt);
|
||||
|
||||
auto select_model = this->selectionModel();
|
||||
connect(select_model, &QItemSelectionModel::currentRowChanged, [=](const QModelIndex &curr){
|
||||
emit this->currentRuleChanged(_rule_list[curr.row()]);
|
||||
});
|
||||
}
|
||||
|
||||
#include <QMenu>
|
||||
#include <QJsonDocument>
|
||||
void SequenceView::customTranslateRuleEdit(const QPoint& pos)
|
||||
{
|
||||
QMenu immediate;
|
||||
|
@ -123,7 +130,6 @@ void SequenceView::removeTranslateUnit()
|
|||
|
||||
}
|
||||
|
||||
#include "TranslateBasic.h"
|
||||
TranslateBasic::TranslateBasic()
|
||||
{
|
||||
std::shared_ptr<ExtractUnit> u_ptr = std::make_shared<BytesAsBitCombine>();
|
||||
|
|
|
@ -59,11 +59,15 @@ public:
|
|||
};
|
||||
|
||||
class SequenceView : public QTableView {
|
||||
Q_OBJECT
|
||||
private:
|
||||
QStandardItemModel* const _seqs_model;
|
||||
std::shared_ptr<TranslateBasic> base = nullptr;
|
||||
QList<std::shared_ptr<ExtractUnit>> _rule_list;
|
||||
|
||||
signals:
|
||||
void currentRuleChanged(std::shared_ptr<ExtractUnit> u) const;
|
||||
|
||||
public:
|
||||
void tidyRuleAt(const QModelIndex& idx_rule);
|
||||
|
||||
|
|
Loading…
Reference in New Issue