This commit is contained in:
yangjiaxuan 2023-06-14 10:21:37 +08:00
parent fa2d0482ac
commit 3f965140f9
2 changed files with 21 additions and 6 deletions

View File

@ -695,12 +695,12 @@ void MainWindow::on_pushButton_getDistortion_clicked()
float distortion = 0.0; float distortion = 0.0;
unsigned int len = sizeof(int); unsigned int len = sizeof(int);
SANE_Status ret = sane_io_control(m_curDevHandle, IO_CTRL_CODE_GET_DISTORTION_DEVS_CHECK_VAL, &distortion, &len); SANE_Status ret = sane_io_control(m_curDevHandle, IO_CTRL_CODE_GET_DISTORTION_DEVS_CHECK_VAL, &distortion, &len);
if (ret != SANE_STATUS_GOOD) if (distortion > 1.2 || distortion < 0.8 || ret != SANE_STATUS_GOOD)
{ {
QMessageBox::information(this, tr("Prompt"), tr("Get failed")); QMessageBox::information(this, tr("Prompt"), tr("Get failed"));
return; return;
} }
ui->lineEdit_distortion->setText(QString::number(distortion)); ui->lineEdit_distortion->setText(QString::number(distortion, 'f', 4));
} }
void MainWindow::on_pushButton_setDistortion_clicked() void MainWindow::on_pushButton_setDistortion_clicked()

View File

@ -70,7 +70,7 @@
<item> <item>
<widget class="QTabWidget" name="tabWidget"> <widget class="QTabWidget" name="tabWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="tab"> <widget class="QWidget" name="tab">
<attribute name="title"> <attribute name="title">
@ -79,8 +79,8 @@
<widget class="QLabel" name="labelDevInfo"> <widget class="QLabel" name="labelDevInfo">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>80</x> <x>70</x>
<y>170</y> <y>30</y>
<width>391</width> <width>391</width>
<height>20</height> <height>20</height>
</rect> </rect>
@ -93,7 +93,7 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>70</x> <x>70</x>
<y>30</y> <y>80</y>
<width>501</width> <width>501</width>
<height>111</height> <height>111</height>
</rect> </rect>
@ -322,6 +322,21 @@
<string>Speed mode:</string> <string>Speed mode:</string>
</property> </property>
</widget> </widget>
<widget class="QTreeWidget" name="treeWidget">
<property name="geometry">
<rect>
<x>240</x>
<y>250</y>
<width>256</width>
<height>192</height>
</rect>
</property>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</widget> </widget>
<widget class="QWidget" name="tab_4"> <widget class="QWidget" name="tab_4">
<attribute name="title"> <attribute name="title">