更新文档

This commit is contained in:
feiyangqingyun
2023-12-06 19:16:34 +08:00
parent e7120ffb24
commit 123a5b4bed
35 changed files with 290 additions and 207 deletions

View File

@@ -230,7 +230,7 @@ void Battery::setValue(double value)
}
this->value = value;
emit valueChanged(value);
Q_EMIT valueChanged(value);
if (animation) {
timer->stop();
timer->start();

View File

@@ -214,8 +214,8 @@ void CpuMemoryLabel::setData()
this->setText(msg);
}
emit textChanged(msg);
emit valueChanged(cpuPercent, memoryPercent, memoryAll, memoryUse, memoryFree);
Q_EMIT textChanged(msg);
Q_EMIT valueChanged(cpuPercent, memoryPercent, memoryAll, memoryUse, memoryFree);
}
QSize CpuMemoryLabel::sizeHint() const

View File

@@ -94,7 +94,7 @@ bool DeviceButton::eventFilter(QObject *watched, QEvent *event)
if (mouseEvent->button() == Qt::LeftButton) {
lastPoint = mouseEvent->pos();
isPressed = true;
emit clicked();
Q_EMIT clicked();
return true;
}
} else if (event->type() == QEvent::MouseMove) {
@@ -108,7 +108,7 @@ bool DeviceButton::eventFilter(QObject *watched, QEvent *event)
} else if (event->type() == QEvent::MouseButtonRelease) {
isPressed = false;
} else if (event->type() == QEvent::MouseButtonDblClick) {
emit doubleClicked();
Q_EMIT doubleClicked();
}
return QWidget::eventFilter(watched, event);

View File

@@ -72,17 +72,17 @@ void DeviceSizeTable::readData()
} else if (result.startsWith("/dev/mmcblk1p")) {
checkSize(result, "SD卡");
QStringList list = result.split(" ");
emit sdcardReceive(list.at(0));
Q_EMIT sdcardReceive(list.at(0));
} else if (result.startsWith("/dev/sd")) {
checkSize(result, "U盘");
QStringList list = result.split(" ");
emit udiskReceive(list.at(0));
Q_EMIT udiskReceive(list.at(0));
}
#else
if (result.startsWith("/dev/sd")) {
checkSize(result, "");
QStringList list = result.split(" ");
emit udiskReceive(list.at(0));
Q_EMIT udiskReceive(list.at(0));
}
#endif
}

View File

@@ -18,7 +18,7 @@ void ImageSwitch::mousePressEvent(QMouseEvent *)
{
imgFile = isChecked ? imgOffFile : imgOnFile;
isChecked = !isChecked;
emit checkedChanged(isChecked);
Q_EMIT checkedChanged(isChecked);
this->update();
}

View File

@@ -52,7 +52,7 @@ bool LightButton::eventFilter(QObject *watched, QEvent *event)
}
} else if (mouseEvent->type() == QEvent::MouseButtonRelease && pressed) {
pressed = false;
emit clicked();
Q_EMIT clicked();
}
return QWidget::eventFilter(watched, event);

View File

@@ -196,7 +196,7 @@ void SaveLog::save(const QString &content)
{
//如果重定向输出到网络则通过网络发出去,否则输出到日志文件
if (toNet) {
emit send(content);
Q_EMIT send(content);
} else {
//目录不存在则先新建目录
QDir dir(path);