xp-sp3: change grammer to support Qt5.6.3 for xp with sp3 system.
This commit is contained in:
@@ -110,7 +110,7 @@ void Connecter::RefreshClient()
|
||||
auto frame = QSharedPointer<FrameBuffer>::create();
|
||||
frame->data = infoPack(info);
|
||||
frame->type = FBT_SER_MSG_ASKCLIENTS;
|
||||
auto sendRet = ClientCore::syncInvoke(clientCore_, [this, frame]() { return clientCore_->Send(frame); });
|
||||
auto sendRet = ClientCore::syncInvoke(clientCore_, frame);
|
||||
if (!sendRet) {
|
||||
qCritical() << QString(tr("send ask client list failed."));
|
||||
return;
|
||||
|
||||
@@ -47,7 +47,6 @@ private:
|
||||
private:
|
||||
Ui::Connecter* ui;
|
||||
bool connceted_{false};
|
||||
std::thread thContext_;
|
||||
std::function<void(const QString& id)> remoteCall_;
|
||||
ClientCore* clientCore_;
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
#include <ClientCore.h>
|
||||
#include <FileTrans.h>
|
||||
#include <InfoDirFile.h>
|
||||
#include <QMenu>
|
||||
#include <QMutex>
|
||||
#include <QWidget>
|
||||
#include <Util.h>
|
||||
#include <QMutex>
|
||||
#include <QMenu>
|
||||
#include <memory>
|
||||
|
||||
namespace Ui {
|
||||
class FileManager;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
#include <QDateTime>
|
||||
#include <QListWidgetItem>
|
||||
#include <QStandardItem>
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
@@ -17,9 +19,11 @@ LogPrint::LogPrint(QWidget* parent) : QWidget(parent), ui(new Ui::LogPrint)
|
||||
|
||||
void LogPrint::InitControl()
|
||||
{
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
isLightMode_ = QGuiApplication::styleHints()->colorScheme() == Qt::ColorScheme::Light;
|
||||
styleHints_ = QGuiApplication::styleHints();
|
||||
connect(styleHints_, &QStyleHints::colorSchemeChanged, this, &LogPrint::ColorChange);
|
||||
#endif
|
||||
ui->pedText->setReadOnly(true);
|
||||
}
|
||||
|
||||
@@ -29,13 +33,19 @@ std::string LogPrint::now_str()
|
||||
auto time_t_now = std::chrono::system_clock::to_time_t(now);
|
||||
auto milliseconds = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()) % 1000;
|
||||
|
||||
// std::ostringstream timestamp;
|
||||
// timestamp << std::put_time(std::localtime(&time_t_now), "%H:%M:%S") << "." << std::setfill('0') << std::setw(3)
|
||||
// << milliseconds.count() << " ";
|
||||
|
||||
char timeStr[20];
|
||||
std::strftime(timeStr, sizeof(timeStr), "%H:%M:%S", std::localtime(&time_t_now));
|
||||
std::ostringstream timestamp;
|
||||
timestamp << std::put_time(std::localtime(&time_t_now), "%H:%M:%S") << "." << std::setfill('0') << std::setw(3)
|
||||
<< milliseconds.count() << " ";
|
||||
timestamp << timeStr << "." << std::setfill('0') << std::setw(3) << milliseconds.count() << " ";
|
||||
|
||||
return timestamp.str();
|
||||
}
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
void LogPrint::ColorChange(Qt::ColorScheme scheme)
|
||||
{
|
||||
if (scheme == Qt::ColorScheme::Dark) {
|
||||
@@ -45,6 +55,7 @@ void LogPrint::ColorChange(Qt::ColorScheme scheme)
|
||||
}
|
||||
RePrintLog();
|
||||
}
|
||||
#endif
|
||||
|
||||
LogPrint::~LogPrint()
|
||||
{
|
||||
|
||||
@@ -36,7 +36,10 @@ public:
|
||||
|
||||
public:
|
||||
std::string now_str();
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
void ColorChange(Qt::ColorScheme scheme);
|
||||
#endif
|
||||
|
||||
private:
|
||||
void InitControl();
|
||||
@@ -51,7 +54,11 @@ private:
|
||||
QMap<PrintType, QBrush> lightMap_;
|
||||
QMap<PrintType, QBrush> darkMap_;
|
||||
QVector<LogEntry> logEntries_;
|
||||
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
|
||||
QStyleHints* styleHints_{};
|
||||
#endif
|
||||
|
||||
QStandardItemModel* model_;
|
||||
};
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <QMimeData>
|
||||
#include <QPainter>
|
||||
#include <Util.h>
|
||||
#include <functional>
|
||||
|
||||
#include "GuiUtil/Public.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user