Limit number of saved lines in devicelog
This commit is contained in:
parent
3358861114
commit
c3bcb70d87
@ -12,6 +12,18 @@ DeviceLog::DeviceLog(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->bClear, &QPushButton::clicked, this, &DeviceLog::clear);
|
||||
connect(ui->limitLines, &QCheckBox::toggled, [=](bool enabled){
|
||||
if(enabled) {
|
||||
ui->text->setMaximumBlockCount(ui->numLines->value());
|
||||
ui->numLines->setEnabled(true);
|
||||
} else {
|
||||
ui->text->setMaximumBlockCount(0);
|
||||
ui->numLines->setEnabled(false);
|
||||
}
|
||||
});
|
||||
connect(ui->numLines, qOverload<int>(&QSpinBox::valueChanged), [=](int lines) {
|
||||
ui->text->setMaximumBlockCount(lines);
|
||||
});
|
||||
}
|
||||
|
||||
DeviceLog::~DeviceLog()
|
||||
|
@ -6,14 +6,14 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>810</width>
|
||||
<height>211</height>
|
||||
<width>929</width>
|
||||
<height>253</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="text">
|
||||
<property name="readOnly">
|
||||
@ -55,6 +55,46 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="spacing">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="limitLines">
|
||||
<property name="text">
|
||||
<string>Only keep</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="numLines">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>100</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>200</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>lines</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
|
Loading…
Reference in New Issue
Block a user