日志内容清空功能。
This commit is contained in:
@@ -45,17 +45,6 @@ void Compare::InitMenu()
|
||||
auto path = item->text();
|
||||
emit sigTryVisit(false, path);
|
||||
});
|
||||
menu_->addAction(tr("添加新行"), this, [this]() {
|
||||
int cnt = ui->tableWidget->rowCount();
|
||||
ui->tableWidget->insertRow(cnt);
|
||||
auto item1 = new QTableWidgetItem("");
|
||||
auto item2 = new QTableWidgetItem("");
|
||||
auto item3 = new QTableWidgetItem("");
|
||||
ui->tableWidget->setItem(cnt, 0, item1);
|
||||
ui->tableWidget->setItem(cnt, 1, item2);
|
||||
ui->tableWidget->setItem(cnt, 2, item3);
|
||||
});
|
||||
menu_->addAction(tr("删除"), this, [this]() { deleteSelectedRows(); });
|
||||
menu_->addAction(tr("尝试打开本地路径"), this, [this]() {
|
||||
auto selected = ui->tableWidget->selectedItems();
|
||||
if (selected.size() != 3) {
|
||||
@@ -70,6 +59,17 @@ void Compare::InitMenu()
|
||||
}
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(path));
|
||||
});
|
||||
menu_->addAction(tr("添加新行"), this, [this]() {
|
||||
int cnt = ui->tableWidget->rowCount();
|
||||
ui->tableWidget->insertRow(cnt);
|
||||
auto item1 = new QTableWidgetItem("");
|
||||
auto item2 = new QTableWidgetItem("");
|
||||
auto item3 = new QTableWidgetItem("");
|
||||
ui->tableWidget->setItem(cnt, 0, item1);
|
||||
ui->tableWidget->setItem(cnt, 1, item2);
|
||||
ui->tableWidget->setItem(cnt, 2, item3);
|
||||
});
|
||||
menu_->addAction(tr("删除"), this, [this]() { deleteSelectedRows(); });
|
||||
menu_->addAction(tr("上传"), this, [this]() { TransToRight(false); });
|
||||
menu_->addAction(tr("下载"), this, [this]() { TransToLeft(false); });
|
||||
menu_->addSeparator();
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QListWidgetItem>
|
||||
#include <QMessageBox>
|
||||
#include <QStandardItem>
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
@@ -25,6 +26,15 @@ void LogPrint::InitControl()
|
||||
connect(styleHints_, &QStyleHints::colorSchemeChanged, this, &LogPrint::ColorChange);
|
||||
#endif
|
||||
ui->pedText->setReadOnly(true);
|
||||
|
||||
connect(ui->btnClear, &QPushButton::clicked, [this]() {
|
||||
QMessageBox::StandardButton reply = QMessageBox::question(this, tr("确认清空"), tr("确定要清空所有内容吗?"),
|
||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||
|
||||
if (reply == QMessageBox::Yes) {
|
||||
ui->pedText->clear();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
std::string LogPrint::now_str()
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>767</width>
|
||||
<height>291</height>
|
||||
<width>831</width>
|
||||
<height>396</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -17,6 +17,33 @@
|
||||
<item>
|
||||
<widget class="QPlainTextEdit" name="pedText"/>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Policy::Maximum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>4000</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="btnClear">
|
||||
<property name="text">
|
||||
<string>清空</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
||||
Reference in New Issue
Block a user