mirror of
https://github.com/jaredtao/TaoQuick.git
synced 2025-01-31 21:22:58 +08:00
for path
This commit is contained in:
parent
44af220075
commit
d1baadc1d3
@ -8,8 +8,6 @@ Item {
|
||||
height: 900
|
||||
Component.onCompleted: {
|
||||
appInfo.splashShow = false;
|
||||
trans.loadFolder(appPath + "/Trans")
|
||||
componentsMgr.loadFolder(contentsPath)
|
||||
}
|
||||
Splash {
|
||||
id: splash
|
||||
|
@ -63,6 +63,7 @@ void ComponentsMgr::beforeUiReady(QQmlContext* ctx)
|
||||
|
||||
void ComponentsMgr::afterUiReady()
|
||||
{
|
||||
loadFolder(contentsPath);
|
||||
}
|
||||
|
||||
const QJsonArray& ComponentsMgr::comps() const
|
||||
|
@ -1,5 +1,11 @@
|
||||
#include "TaoFramework.h"
|
||||
#include <QQmlContext>
|
||||
TaoFramework *TaoFramework::instance()
|
||||
{
|
||||
static TaoFramework framework;
|
||||
return &framework;
|
||||
}
|
||||
|
||||
TaoFramework::~TaoFramework()
|
||||
{
|
||||
uninit();
|
||||
|
@ -6,13 +6,9 @@ class QQmlContext;
|
||||
class QQuickView;
|
||||
class TaoFramework {
|
||||
public:
|
||||
static TaoFramework* instance()
|
||||
{
|
||||
static TaoFramework framework;
|
||||
return &framework;
|
||||
}
|
||||
~TaoFramework();
|
||||
static TaoFramework* instance();
|
||||
|
||||
~TaoFramework();
|
||||
public:
|
||||
//初始化
|
||||
void init();
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <QDir>
|
||||
#include <QQmlContext>
|
||||
#include <QtConcurrent>
|
||||
#include <QCoreApplication>
|
||||
const static auto cEnglisthStr = QStringLiteral("English");
|
||||
const static auto cChineseStr = QStringLiteral("简体中文");
|
||||
Trans::Trans(QObject* parent)
|
||||
@ -18,13 +19,16 @@ void Trans::beforeUiReady(QQmlContext* ctx)
|
||||
ctx->setContextProperty("trans", this);
|
||||
}
|
||||
|
||||
void Trans::afterUiReady() {}
|
||||
void Trans::afterUiReady()
|
||||
{
|
||||
loadFolder(qApp->applicationDirPath() + "/Trans");
|
||||
}
|
||||
|
||||
void Trans::loadFolder(const QString& folder)
|
||||
{
|
||||
QDir dir(folder);
|
||||
auto infos = dir.entryInfoList({ "language_*.json" }, QDir::Files);
|
||||
QStringList paths;
|
||||
// QStringList paths;
|
||||
QString lang;
|
||||
for (auto info : infos) {
|
||||
// paths.append(info.absoluteFilePath());
|
||||
|
@ -22,8 +22,8 @@ int main(int argc, char** argv)
|
||||
{
|
||||
prepareApp();
|
||||
QGuiApplication app(argc, argv);
|
||||
qWarning() << "appPath" << app.applicationDirPath();
|
||||
Logger::initLog();
|
||||
qWarning() << "appPath" << app.applicationDirPath();
|
||||
|
||||
TaoView view;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user