8#include <QCoreApplication>
15 clearLogAction =
new QAction(
"Clear Log",
this);
16 saveLogAction =
new QAction(
"Save Log",
this);
18 clearLogAction->setIcon(QIcon(
":/clear.svg"));
19 saveLogAction->setIcon(QIcon(
":/file-save.svg"));
21 this->addAction(clearLogAction);
22 this->addAction(saveLogAction);
24 connect(clearLogAction,
SIGNAL(triggered()),
this,SLOT(onClearLog()));
25 connect(saveLogAction,
SIGNAL(triggered()),
this,SLOT(onSaveLog()));
28void LogWidget::onClearLog()
33void LogWidget::onSaveLog()
35 QString logFileName = QFileDialog::getSaveFileName(
this,
"Save the Log",QDir::homePath());
38 f.open(QIODevice::WriteOnly);
40 for(
int i=0; i<count(); i++){
41 QString line = item(i)->text() +
"\n";
42 f.write(line.toLatin1().data());
int SIGNAL(int pid, int signum)