mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-01-22 20:04:32 +08:00
update
This commit is contained in:
parent
96fef84c2d
commit
3f6ef13cd0
@ -1,6 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "misc-misplaced-const"
|
|
||||||
|
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
#include <DbgHelp.h>
|
#include <DbgHelp.h>
|
||||||
@ -78,6 +76,4 @@ LONG WINAPI MyUnhandledExceptionFilter(EXCEPTION_POINTERS *exp) {
|
|||||||
arguments << "-crashed=" + dumpFilePath;
|
arguments << "-crashed=" + dumpFilePath;
|
||||||
QProcess::startDetached(QGuiApplication::applicationFilePath(), arguments);
|
QProcess::startDetached(QGuiApplication::applicationFilePath(), arguments);
|
||||||
return EXCEPTION_EXECUTE_HANDLER;
|
return EXCEPTION_EXECUTE_HANDLER;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,6 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "NotImplementedFunctions"
|
|
||||||
|
|
||||||
#include <QQuickItem>
|
#include <QQuickItem>
|
||||||
#include <QQuickPaintedItem>
|
#include <QQuickPaintedItem>
|
||||||
@ -31,5 +29,3 @@ private:
|
|||||||
QPoint _center;
|
QPoint _center;
|
||||||
QSharedPointer<QQuickItemGrabResult> _grabResult;
|
QSharedPointer<QQuickItemGrabResult> _grabResult;
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,6 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "NotImplementedFunctions"
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
@ -21,5 +19,3 @@ private:
|
|||||||
private:
|
private:
|
||||||
QFileSystemWatcher _watcher;
|
QFileSystemWatcher _watcher;
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,6 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "NotImplementedFunctions"
|
|
||||||
|
|
||||||
#include <QtQuick/QQuickItem>
|
#include <QtQuick/QQuickItem>
|
||||||
#include <QOpenGLFunctions>
|
#include <QOpenGLFunctions>
|
||||||
@ -14,11 +12,11 @@ Q_OBJECT
|
|||||||
public:
|
public:
|
||||||
explicit OpenGLItem(QQuickItem *parent = nullptr);
|
explicit OpenGLItem(QQuickItem *parent = nullptr);
|
||||||
|
|
||||||
[[nodiscard]] QQuickFramebufferObject::Renderer *createRenderer() const override;
|
QQuickFramebufferObject::Renderer *createRenderer() const override;
|
||||||
|
|
||||||
void timerEvent(QTimerEvent *) override;
|
void timerEvent(QTimerEvent *) override;
|
||||||
|
|
||||||
[[nodiscard]] qreal t() const { return m_t; }
|
qreal t() const { return m_t; }
|
||||||
|
|
||||||
void setT(qreal t);
|
void setT(qreal t);
|
||||||
|
|
||||||
@ -29,5 +27,3 @@ signals:
|
|||||||
private:
|
private:
|
||||||
qreal m_t{};
|
qreal m_t{};
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,5 +1,3 @@
|
|||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "NotImplementedFunctions"
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -30,5 +28,3 @@ SINGLETON(InitializrHelper)
|
|||||||
|
|
||||||
Q_SIGNAL void success(const QString &path);
|
Q_SIGNAL void success(const QString &path);
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,7 +1,3 @@
|
|||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "UnusedParameter"
|
|
||||||
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
|
|
||||||
|
|
||||||
#include "Network.h"
|
#include "Network.h"
|
||||||
|
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
@ -666,5 +662,3 @@ NetworkParams *Network::deleteJsonArray(const QString &url) {
|
|||||||
void Network::setInterceptor(QJSValue interceptor) {
|
void Network::setInterceptor(QJSValue interceptor) {
|
||||||
this->_interceptor = std::move(interceptor);
|
this->_interceptor = std::move(interceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,6 +1,4 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "NotImplementedFunctions"
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QtQml/qqml.h>
|
#include <QtQml/qqml.h>
|
||||||
@ -206,13 +204,13 @@ SINGLETON(Network)
|
|||||||
void handleDownload(NetworkParams *params, NetworkCallable *result);
|
void handleDownload(NetworkParams *params, NetworkCallable *result);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static void sendRequest(QNetworkAccessManager *manager, QNetworkRequest request, NetworkParams *params, QNetworkReply *&reply, bool isFirst, const QPointer<NetworkCallable>& callable);
|
static void sendRequest(QNetworkAccessManager *manager, QNetworkRequest request, NetworkParams *params, QNetworkReply *&reply, bool isFirst, const QPointer<NetworkCallable> &callable);
|
||||||
|
|
||||||
static void addQueryParam(QUrl *url, const QMap<QString, QVariant> ¶ms);
|
static void addQueryParam(QUrl *url, const QMap<QString, QVariant> ¶ms);
|
||||||
|
|
||||||
static void addHeaders(QNetworkRequest *request, const QMap<QString, QVariant> &headers);
|
static void addHeaders(QNetworkRequest *request, const QMap<QString, QVariant> &headers);
|
||||||
|
|
||||||
void saveResponse(const QString& key, const QString& response);
|
void saveResponse(const QString &key, const QString &response);
|
||||||
|
|
||||||
QString readCache(const QString &key);
|
QString readCache(const QString &key);
|
||||||
|
|
||||||
@ -222,14 +220,12 @@ private:
|
|||||||
|
|
||||||
static QString headerList2String(const QList<QNetworkReply::RawHeaderPair> &data);
|
static QString headerList2String(const QList<QNetworkReply::RawHeaderPair> &data);
|
||||||
|
|
||||||
static void printRequestStartLog(const QNetworkRequest& request, NetworkParams *params);
|
static void printRequestStartLog(const QNetworkRequest &request, NetworkParams *params);
|
||||||
|
|
||||||
static void printRequestEndLog(const QNetworkRequest& request, NetworkParams *params, QNetworkReply *&reply, const QString &response);
|
static void printRequestEndLog(const QNetworkRequest &request, NetworkParams *params, QNetworkReply *&reply, const QString &response);
|
||||||
|
|
||||||
static QString map2String(const QMap<QString, QVariant> &map);
|
static QString map2String(const QMap<QString, QVariant> &map);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QJSValue _interceptor;
|
QJSValue _interceptor;
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,6 +1,3 @@
|
|||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
|
|
||||||
|
|
||||||
#include "SettingsHelper.h"
|
#include "SettingsHelper.h"
|
||||||
|
|
||||||
#include <QDataStream>
|
#include <QDataStream>
|
||||||
@ -31,5 +28,3 @@ void SettingsHelper::init(char *argv[]) {
|
|||||||
const QString iniFilePath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/" + iniFileName;
|
const QString iniFilePath = QStandardPaths::writableLocation(QStandardPaths::AppLocalDataLocation) + "/" + iniFileName;
|
||||||
m_settings.reset(new QSettings(iniFilePath, QSettings::IniFormat));
|
m_settings.reset(new QSettings(iniFilePath, QSettings::IniFormat));
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,5 +1,3 @@
|
|||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtCore/qobject.h>
|
#include <QtCore/qobject.h>
|
||||||
@ -43,4 +41,3 @@ private:
|
|||||||
private:
|
private:
|
||||||
QScopedPointer<QSettings> m_settings;
|
QScopedPointer<QSettings> m_settings;
|
||||||
};
|
};
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,7 +1,3 @@
|
|||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
|
|
||||||
#pragma ide diagnostic ignored "readability-convert-member-functions-to-static"
|
|
||||||
|
|
||||||
#include "FluTools.h"
|
#include "FluTools.h"
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
@ -248,5 +244,3 @@ bool FluTools::isWindows10OrGreater() {
|
|||||||
QRect FluTools::desktopAvailableGeometry(QQuickWindow *window) {
|
QRect FluTools::desktopAvailableGeometry(QQuickWindow *window) {
|
||||||
return window->screen()->availableGeometry();
|
return window->screen()->availableGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,5 +1,3 @@
|
|||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -94,6 +92,4 @@ SINGLETON(FluTools)
|
|||||||
Q_INVOKABLE bool isWindows10OrGreater();
|
Q_INVOKABLE bool isWindows10OrGreater();
|
||||||
|
|
||||||
Q_INVOKABLE QRect desktopAvailableGeometry(QQuickWindow *window);
|
Q_INVOKABLE QRect desktopAvailableGeometry(QQuickWindow *window);
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,7 +1,3 @@
|
|||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
|
|
||||||
#pragma ide diagnostic ignored "google-default-arguments"
|
|
||||||
|
|
||||||
#include "FluTreeModel.h"
|
#include "FluTreeModel.h"
|
||||||
|
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
@ -276,5 +272,3 @@ void FluTreeModel::allCollapse() {
|
|||||||
_rows = _root->_children;
|
_rows = _root->_children;
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
@ -1,6 +1,3 @@
|
|||||||
#pragma clang diagnostic push
|
|
||||||
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
|
|
||||||
#pragma ide diagnostic ignored "google-default-arguments"
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@ -22,10 +19,10 @@ Q_OBJECT
|
|||||||
public:
|
public:
|
||||||
explicit FluTreeNode(QObject *parent = nullptr);
|
explicit FluTreeNode(QObject *parent = nullptr);
|
||||||
|
|
||||||
Q_INVOKABLE [[nodiscard]] int depth() const { return _depth; };
|
Q_INVOKABLE int depth() const { return _depth; };
|
||||||
Q_INVOKABLE [[nodiscard]] bool isExpanded() const { return _isExpanded; };
|
Q_INVOKABLE bool isExpanded() const { return _isExpanded; };
|
||||||
Q_INVOKABLE [[nodiscard]] QVariantMap data() const { return _data; };
|
Q_INVOKABLE QVariantMap data() const { return _data; };
|
||||||
Q_INVOKABLE [[nodiscard]] bool hasChildren() const { return !_children.isEmpty(); };
|
Q_INVOKABLE bool hasChildren() const { return !_children.isEmpty(); };
|
||||||
Q_INVOKABLE bool hasNextNodeByIndex(int index) {
|
Q_INVOKABLE bool hasNextNodeByIndex(int index) {
|
||||||
FluTreeNode *p = this;
|
FluTreeNode *p = this;
|
||||||
for (int i = 0; i <= _depth - index - 1; i++) {
|
for (int i = 0; i <= _depth - index - 1; i++) {
|
||||||
@ -37,7 +34,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Q_INVOKABLE [[nodiscard]] bool checked() const {
|
Q_INVOKABLE bool checked() const {
|
||||||
if (!hasChildren()) {
|
if (!hasChildren()) {
|
||||||
return _checked;
|
return _checked;
|
||||||
}
|
}
|
||||||
@ -63,7 +60,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
[[nodiscard]] bool isShown() const {
|
bool isShown() const {
|
||||||
auto p = _parent;
|
auto p = _parent;
|
||||||
while (p) {
|
while (p) {
|
||||||
if (!p->_isExpanded) {
|
if (!p->_isExpanded) {
|
||||||
@ -99,17 +96,17 @@ public:
|
|||||||
|
|
||||||
explicit FluTreeModel(QObject *parent = nullptr);
|
explicit FluTreeModel(QObject *parent = nullptr);
|
||||||
|
|
||||||
[[nodiscard]] int rowCount(const QModelIndex &parent = {}) const override;
|
int rowCount(const QModelIndex &parent = {}) const override;
|
||||||
|
|
||||||
[[nodiscard]] int columnCount(const QModelIndex &parent = {}) const override;
|
int columnCount(const QModelIndex &parent = {}) const override;
|
||||||
|
|
||||||
[[nodiscard]] QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
[[nodiscard]] QHash<int, QByteArray> roleNames() const override;
|
QHash<int, QByteArray> roleNames() const override;
|
||||||
|
|
||||||
[[nodiscard]] QModelIndex parent(const QModelIndex &child) const override;
|
QModelIndex parent(const QModelIndex &child) const override;
|
||||||
|
|
||||||
[[nodiscard]] QModelIndex index(int row, int column, const QModelIndex &parent = {}) const override;
|
QModelIndex index(int row, int column, const QModelIndex &parent = {}) const override;
|
||||||
|
|
||||||
Q_INVOKABLE void removeRows(int row, int count);
|
Q_INVOKABLE void removeRows(int row, int count);
|
||||||
|
|
||||||
@ -144,5 +141,3 @@ private:
|
|||||||
QList<FluTreeNode *> _dataSource;
|
QList<FluTreeNode *> _dataSource;
|
||||||
FluTreeNode *_root = nullptr;
|
FluTreeNode *_root = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma clang diagnostic pop
|
|
Loading…
Reference in New Issue
Block a user