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);
|
ui->setupUi(this);
|
||||||
connect(ui->bClear, &QPushButton::clicked, this, &DeviceLog::clear);
|
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()
|
DeviceLog::~DeviceLog()
|
||||||
|
@ -6,14 +6,14 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>810</width>
|
<width>929</width>
|
||||||
<height>211</height>
|
<height>253</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Form</string>
|
<string>Form</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QPlainTextEdit" name="text">
|
<widget class="QPlainTextEdit" name="text">
|
||||||
<property name="readOnly">
|
<property name="readOnly">
|
||||||
@ -55,6 +55,46 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
|
Loading…
Reference in New Issue
Block a user