code format
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#include "matrixedit.h"
|
||||
|
||||
#include "ui_matrixedit.h"
|
||||
|
||||
#include <QBoxLayout>
|
||||
|
||||
|
||||
@@ -9,7 +11,7 @@ MatrixEdit::MatrixEdit(QWidget * parent): QWidget(parent) {
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
||||
ui->table->setSizeAdjustPolicy(QAbstractScrollArea::AdjustToContents);
|
||||
#endif
|
||||
connect(ui->table, SIGNAL(cellChanged(int,int)), this, SIGNAL(changed()));
|
||||
connect(ui->table, SIGNAL(cellChanged(int, int)), this, SIGNAL(changed()));
|
||||
ro = false;
|
||||
}
|
||||
|
||||
@@ -52,18 +54,14 @@ void MatrixEdit::clear(bool ident) {
|
||||
i->setText((ident && (r == c)) ? "1" : "0");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void MatrixEdit::changeEvent(QEvent * e) {
|
||||
QWidget::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
case QEvent::LanguageChange: ui->retranslateUi(this); break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +82,8 @@ QVector<double> MatrixEdit::vector() const {
|
||||
}
|
||||
|
||||
|
||||
QVector<QVector<double> > MatrixEdit::matrix() const {
|
||||
QVector<QVector<double> > ret;
|
||||
QVector<QVector<double>> MatrixEdit::matrix() const {
|
||||
QVector<QVector<double>> ret;
|
||||
if (ui->table->columnCount() < 1 || ui->table->rowCount() < 1) return ret;
|
||||
int cc = ui->table->columnCount();
|
||||
ret.resize(ui->table->rowCount());
|
||||
@@ -123,7 +121,7 @@ void MatrixEdit::setVector(const QVector<double> & v) {
|
||||
}
|
||||
|
||||
|
||||
void MatrixEdit::setMatrix(const QVector<QVector<double> > & v) {
|
||||
void MatrixEdit::setMatrix(const QVector<QVector<double>> & v) {
|
||||
clear();
|
||||
if (v.isEmpty()) return;
|
||||
if (v[0].isEmpty()) return;
|
||||
|
||||
Reference in New Issue
Block a user