24#include "AstUtil/JsonValue.hpp"
26#include <QApplication>
27#include <QAbstractItemModel>
40AST_UIUTIL_CAPI
void aAddQueued(std::function<
void()> func, Qt::ConnectionType type);
45template<
typename Func>
47 const auto type = Qt::QueuedConnection;
48#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
50 QMetaObject::invokeMethod(qApp, std::forward<Func>(func), type);
58template<
typename Func>
59inline void addBlockingQueued(Func &&func) {
60 const auto type = Qt::BlockingQueuedConnection;
61#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
63 QMetaObject::invokeMethod(qApp, std::forward<Func>(func), type);
66 aAddQueued(std::forward<Func>(func), type);
void addQueued(Func &&func)
添加一个排队执行的回调函数
定义 UiUtil.hpp:46
void aAddQueued(std::function< void()> func, Qt::ConnectionType type)
添加一个排队执行的回调函数
定义 UiUtil.cpp:82
QModelIndex modelIndexFromItemPath(QAbstractItemModel *model, const JsonValue &itemPath)
通过 ItemPath 获取 QModelIndex
定义 UiUtil.cpp:153