diff --git a/QtScrcpy/adb/adbprocess.cpp b/QtScrcpy/adb/adbprocess.cpp index c84645d..5dcd92c 100644 --- a/QtScrcpy/adb/adbprocess.cpp +++ b/QtScrcpy/adb/adbprocess.cpp @@ -53,20 +53,20 @@ void AdbProcess::initSignals() } else { emit adbProcessResult(AER_ERROR_START); QString err = QString("qprocess start error:%1 %2").arg(program()).arg(arguments().join(" ")); - qCritical(err.toStdString().c_str()); + qCritical() << err.toStdString().c_str(); } }); connect(this, &QProcess::readyReadStandardError, this, [this]() { QString tmp = QString::fromUtf8(readAllStandardError()).trimmed(); m_errorOutput += tmp; - qWarning(QString("AdbProcess::error:%1").arg(tmp).toStdString().data()); + qWarning() << QString("AdbProcess::error:%1").arg(tmp).toStdString().data(); }); connect(this, &QProcess::readyReadStandardOutput, this, [this]() { QString tmp = QString::fromUtf8(readAllStandardOutput()).trimmed(); m_standardOutput += tmp; - qInfo(QString("AdbProcess::out:%1").arg(tmp).toStdString().data()); + qInfo() << QString("AdbProcess::out:%1").arg(tmp).toStdString().data(); }); connect(this, &QProcess::started, this, [this]() { emit adbProcessResult(AER_SUCCESS_START); }); diff --git a/QtScrcpy/device/controller/inputconvert/inputconvertgame.cpp b/QtScrcpy/device/controller/inputconvert/inputconvertgame.cpp index 739d0e2..0e1c722 100644 --- a/QtScrcpy/device/controller/inputconvert/inputconvertgame.cpp +++ b/QtScrcpy/device/controller/inputconvert/inputconvertgame.cpp @@ -13,7 +13,7 @@ InputConvertGame::~InputConvertGame() {} void InputConvertGame::mouseEvent(const QMouseEvent *from, const QSize &frameSize, const QSize &showSize) { // 处理开关按键 - if (m_keyMap.isSwitchOnKeyboard() == false && m_keyMap.getSwitchKey() == from->button()) { + if (m_keyMap.isSwitchOnKeyboard() == false && m_keyMap.getSwitchKey() == static_cast(from->button())) { if (from->type() != QEvent::MouseButtonPress) { return; } diff --git a/QtScrcpy/device/decoder/fpscounter.h b/QtScrcpy/device/decoder/fpscounter.h index d39df67..badb958 100644 --- a/QtScrcpy/device/decoder/fpscounter.h +++ b/QtScrcpy/device/decoder/fpscounter.h @@ -24,7 +24,7 @@ private: void resetCounter(); private: - quint32 m_counterTimer = 0; + qint32 m_counterTimer = 0; quint32 m_curRendered = 0; quint32 m_curSkipped = 0; diff --git a/QtScrcpy/device/device.cpp b/QtScrcpy/device/device.cpp index c0e6a26..fe87af9 100644 --- a/QtScrcpy/device/device.cpp +++ b/QtScrcpy/device/device.cpp @@ -211,7 +211,7 @@ void Device::initSignals() connect(m_server, &Server::connectToResult, this, [this](bool success, const QString &deviceName, const QSize &size) { if (success) { double diff = m_startTimeCount.elapsed() / 1000.0; - qInfo(QString("server start finish in %1s").arg(diff).toStdString().c_str()); + qInfo() << QString("server start finish in %1s").arg(diff).toStdString().c_str(); // update ui if (m_videoForm) { diff --git a/QtScrcpy/device/recorder/recorder.cpp b/QtScrcpy/device/recorder/recorder.cpp index 2bd29eb..a8130af 100644 --- a/QtScrcpy/device/recorder/recorder.cpp +++ b/QtScrcpy/device/recorder/recorder.cpp @@ -102,7 +102,7 @@ bool Recorder::open(const AVCodec *inputCodec) if (ret < 0) { char errorbuf[255] = { 0 }; av_strerror(ret, errorbuf, 254); - qCritical(QString("Failed to open output file: %1 %2").arg(errorbuf).arg(m_fileName).toUtf8().toStdString().c_str()); + qCritical() << QString("Failed to open output file: %1 %2").arg(errorbuf).arg(m_fileName).toUtf8().toStdString().c_str(); // ostream will be cleaned up during context cleaning avformat_free_context(m_formatCtx); m_formatCtx = Q_NULLPTR; @@ -118,10 +118,10 @@ void Recorder::close() if (m_headerWritten) { int ret = av_write_trailer(m_formatCtx); if (ret < 0) { - qCritical(QString("Failed to write trailer to %1").arg(m_fileName).toUtf8().toStdString().c_str()); + qCritical() << QString("Failed to write trailer to %1").arg(m_fileName).toUtf8().toStdString().c_str(); m_failed = true; } else { - qInfo(QString("success record %1").arg(m_fileName).toStdString().c_str()); + qInfo() << QString("success record %1").arg(m_fileName).toStdString().c_str(); } } else { // the recorded file is empty diff --git a/QtScrcpy/device/render/qyuvopenglwidget.h b/QtScrcpy/device/render/qyuvopenglwidget.h index 949b4ac..cdeb2d0 100644 --- a/QtScrcpy/device/render/qyuvopenglwidget.h +++ b/QtScrcpy/device/render/qyuvopenglwidget.h @@ -12,7 +12,7 @@ class QYUVOpenGLWidget Q_OBJECT public: explicit QYUVOpenGLWidget(QWidget *parent = nullptr); - virtual ~QYUVOpenGLWidget(); + virtual ~QYUVOpenGLWidget() override; QSize minimumSizeHint() const override; QSize sizeHint() const override; @@ -22,9 +22,9 @@ public: void updateTextures(quint8 *dataY, quint8 *dataU, quint8 *dataV, quint32 linesizeY, quint32 linesizeU, quint32 linesizeV); protected: - void initializeGL(); - void paintGL(); - void resizeGL(int width, int height); + void initializeGL() override; + void paintGL() override; + void resizeGL(int width, int height) override; private: void initShader(); diff --git a/QtScrcpy/device/server/server.cpp b/QtScrcpy/device/server/server.cpp index 2226980..6dfe5a7 100644 --- a/QtScrcpy/device/server/server.cpp +++ b/QtScrcpy/device/server/server.cpp @@ -255,7 +255,7 @@ bool Server::startServerByStep() // try to connect until the server socket is listening on the device. m_serverSocket.setMaxPendingConnections(2); if (!m_serverSocket.listen(QHostAddress::LocalHost, m_params.localPort)) { - qCritical(QString("Could not listen on port %1").arg(m_params.localPort).toStdString().c_str()); + qCritical() << QString("Could not listen on port %1").arg(m_params.localPort).toStdString().c_str(); m_serverStartStep = SSS_NULL; if (m_tunnelForward) { disableTunnelForward(); diff --git a/QtScrcpy/device/server/videosocket.cpp b/QtScrcpy/device/server/videosocket.cpp index fae8ff5..bc4a396 100644 --- a/QtScrcpy/device/server/videosocket.cpp +++ b/QtScrcpy/device/server/videosocket.cpp @@ -45,7 +45,7 @@ qint32 VideoSocket::subThreadRecvData(quint8 *buf, qint32 bufSize) bool VideoSocket::event(QEvent *event) { - if (event->type() == QScrcpyEvent::VideoSocket) { + if (static_cast(event->type()) == QScrcpyEvent::VideoSocket) { onReadyRead(); return true; } diff --git a/QtScrcpy/device/stream/stream.cpp b/QtScrcpy/device/stream/stream.cpp index 17c96de..4e26d34 100644 --- a/QtScrcpy/device/stream/stream.cpp +++ b/QtScrcpy/device/stream/stream.cpp @@ -27,19 +27,18 @@ static void avLogCallback(void *avcl, int level, const char *fmt, va_list vl) switch (level) { case AV_LOG_PANIC: case AV_LOG_FATAL: - qFatal(localFmt.toUtf8()); - break; + qFatal("%s", localFmt.toUtf8().data()); case AV_LOG_ERROR: - qCritical(localFmt.toUtf8()); + qCritical() << localFmt.toUtf8(); break; case AV_LOG_WARNING: - qWarning(localFmt.toUtf8()); + qWarning() << localFmt.toUtf8(); break; case AV_LOG_INFO: - qInfo(localFmt.toUtf8()); + qInfo() << localFmt.toUtf8(); break; case AV_LOG_DEBUG: - //qDebug(localFmt.toUtf8()); + // qDebug() << localFmt.toUtf8(); break; } diff --git a/QtScrcpy/devicemanage/devicemanage.cpp b/QtScrcpy/devicemanage/devicemanage.cpp index f6ad67e..9d6e113 100644 --- a/QtScrcpy/devicemanage/devicemanage.cpp +++ b/QtScrcpy/devicemanage/devicemanage.cpp @@ -212,6 +212,7 @@ void DeviceManage::onControlStateChange(Device *device, Device::GroupControlStat void DeviceManage::onMouseEvent(const QMouseEvent *from, const QSize &frameSize, const QSize &showSize) { + Q_UNUSED(frameSize) QMapIterator> i(m_devices); while (i.hasNext()) { i.next(); @@ -228,6 +229,7 @@ void DeviceManage::onMouseEvent(const QMouseEvent *from, const QSize &frameSize, void DeviceManage::onWheelEvent(const QWheelEvent *from, const QSize &frameSize, const QSize &showSize) { + Q_UNUSED(frameSize) QMapIterator> i(m_devices); while (i.hasNext()) { i.next(); @@ -244,6 +246,7 @@ void DeviceManage::onWheelEvent(const QWheelEvent *from, const QSize &frameSize, void DeviceManage::onKeyEvent(const QKeyEvent *from, const QSize &frameSize, const QSize &showSize) { + Q_UNUSED(frameSize) QMapIterator> i(m_devices); while (i.hasNext()) { i.next(); diff --git a/QtScrcpy/main.cpp b/QtScrcpy/main.cpp index 27665dd..9af29c2 100644 --- a/QtScrcpy/main.cpp +++ b/QtScrcpy/main.cpp @@ -98,10 +98,9 @@ int main(int argc, char *argv[]) g_mainDlg->setWindowTitle(Config::getInstance().getTitle()); g_mainDlg->show(); - qInfo(QObject::tr("This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the " - "following address:") - .toUtf8()); - qInfo(QString("QtScrcpy %1 ").arg(QCoreApplication::applicationVersion()).toUtf8()); + qInfo() << QObject::tr("This software is completely open source and free. Strictly used for illegal purposes, or at your own risk. You can download it at the " + "following address:").toUtf8(); + qInfo() << QString("QtScrcpy %1 ").arg(QCoreApplication::applicationVersion()).toUtf8(); int ret = a.exec();