git-svn-id: svn://db.shs.com.ru/libs@27 a8b55f48-bf90-11e4-a774-851b48703e85
This commit is contained in:
@@ -22,7 +22,7 @@ XCheck::XCheck(int index): QWidget() {
|
|||||||
setMouseTracking(true);
|
setMouseTracking(true);
|
||||||
check.setText(QString::number(index + 1) + " ");
|
check.setText(QString::number(index + 1) + " ");
|
||||||
check.setAutoFillBackground(true);
|
check.setAutoFillBackground(true);
|
||||||
spin.setMaximum(99999);
|
spin.setMaximum(KX_X_COUNT - 1);
|
||||||
QBoxLayout * l = new QBoxLayout(QBoxLayout::LeftToRight);
|
QBoxLayout * l = new QBoxLayout(QBoxLayout::LeftToRight);
|
||||||
l->setMargin(0);
|
l->setMargin(0);
|
||||||
l->setSpacing(2);
|
l->setSpacing(2);
|
||||||
@@ -55,6 +55,8 @@ KX_Pult::KX_Pult(): QMainWindow(), config_("kx_pult.conf"), name_("x"), config(p
|
|||||||
ui->treeK->viewport()->installEventFilter(this);
|
ui->treeK->viewport()->installEventFilter(this);
|
||||||
log_menu.addAction(ui->actionClear);
|
log_menu.addAction(ui->actionClear);
|
||||||
prot_x = 0;
|
prot_x = 0;
|
||||||
|
show_x = config.getValue("show_x", true);
|
||||||
|
ui->tab_2->setVisible(show_x);
|
||||||
session.setFile("session_KX_Pult.conf");
|
session.setFile("session_KX_Pult.conf");
|
||||||
session.addEntry(this);
|
session.addEntry(this);
|
||||||
session.addEntry(ui->tabWidget);
|
session.addEntry(ui->tabWidget);
|
||||||
@@ -206,6 +208,7 @@ void KX_Pult::setControlsEnable(bool enable) {
|
|||||||
|
|
||||||
|
|
||||||
void KX_Pult::setX(const KX_X_Data & data) {
|
void KX_Pult::setX(const KX_X_Data & data) {
|
||||||
|
if (!show_x) return;
|
||||||
ui->graphic->lock();
|
ui->graphic->lock();
|
||||||
for (int i = 0; i < KX_X_PACKET_NUM; ++i) {
|
for (int i = 0; i < KX_X_PACKET_NUM; ++i) {
|
||||||
if (!isNormalDouble(data.x_data[i])) continue;
|
if (!isNormalDouble(data.x_data[i])) continue;
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ private:
|
|||||||
KX_Coefficients coeffs;
|
KX_Coefficients coeffs;
|
||||||
__KX_Protocol_X * prot_x;
|
__KX_Protocol_X * prot_x;
|
||||||
int csize, wcnt, timer, timer_update, clear_target;
|
int csize, wcnt, timer, timer_update, clear_target;
|
||||||
bool needWrite, isPause, need_update;
|
bool needWrite, isPause, need_update, show_x;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void loading(QPIConfig & conf);
|
void loading(QPIConfig & conf);
|
||||||
|
|||||||
@@ -581,8 +581,9 @@ QPair<QString, QString> SQLTableWidget::trColumn(const QString & n) {
|
|||||||
|
|
||||||
|
|
||||||
void SQLTableWidget::updateTable(bool save_selection) {
|
void SQLTableWidget::updateTable(bool save_selection) {
|
||||||
if ((!filters_active || !table_opened)) return;
|
if (!filters_active || !table_opened) return;
|
||||||
int sp = ui->view->verticalScrollBar()->value();
|
int vp = ui->view->verticalScrollBar()->value();
|
||||||
|
int hp = ui->view->horizontalScrollBar()->value();
|
||||||
//bool focus = view->hasFocus();
|
//bool focus = view->hasFocus();
|
||||||
QModelIndex csi;
|
QModelIndex csi;
|
||||||
QModelIndexList sl;
|
QModelIndexList sl;
|
||||||
@@ -613,7 +614,6 @@ void SQLTableWidget::updateTable(bool save_selection) {
|
|||||||
ui->labelNew->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
ui->labelNew->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||||
ui->labelFilter->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
ui->labelFilter->setFixedWidth(qMax<int>(ui->view->verticalHeader()->sizeHint().width() + 2, 16));
|
||||||
ui->layoutNew->invalidate();
|
ui->layoutNew->invalidate();
|
||||||
ui->view->verticalScrollBar()->setValue(sp);
|
|
||||||
if (save_selection) {
|
if (save_selection) {
|
||||||
QItemSelectionModel * sm = ui->view->selectionModel();
|
QItemSelectionModel * sm = ui->view->selectionModel();
|
||||||
foreach (const QModelIndex & i, sl)
|
foreach (const QModelIndex & i, sl)
|
||||||
@@ -644,6 +644,8 @@ void SQLTableWidget::updateTable(bool save_selection) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ui->view->verticalScrollBar()->setValue(vp);
|
||||||
|
ui->view->horizontalScrollBar()->setValue(hp);
|
||||||
//if (focus) view->setFocus();
|
//if (focus) view->setFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user